* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#story-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 600px;
}

#story-content {
    margin-bottom: 30px;
}

#story-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 20px;
}

#choices-container {
    margin-bottom: 30px;
}

#choices-container h3 {
    font-size: 1.2rem;
    color: #667eea;
    margin-bottom: 15px;
}

#choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.choice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.choice-btn:active {
    transform: translateY(0);
}

.choice-btn strong {
    font-weight: bold;
    margin-right: 4px;
}

#setup-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 600px;
    margin: 0 auto;
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.setup-item {
    display: flex;
    flex-direction: column;
}

.setup-item label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #667eea;
}

.setup-item select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.summary-box {
    background: #f8f9ff;
    border: 1px solid #e0e7ff;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.summary-box h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.summary-box h4 {
    color: #764ba2;
    margin: 15px 0 10px 0;
}

.summary-box ul {
    margin-left: 20px;
}

.summary-box li {
    margin: 5px 0;
}

#progress-bar {
    background: #f0f0f0;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#progress {
    font-weight: bold;
    color: #667eea;
    z-index: 2;
}

#progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.3s ease;
    z-index: 1;
}

.controls {
    text-align: center;
    margin-top: 30px;
}

.controls button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    margin: 0 10px;
    transition: background-color 0.3s;
}

.controls button:hover {
    background: #5a6fd8;
}

@media (max-width: 600px) {
    .setup-grid {
        grid-template-columns: 1fr;
    }
}

.choice-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
    width: 100%;
    min-height: 60px;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    #story-container {
        padding: 20px;
    }
    
    #story-text p {
        font-size: 1rem;
    }
    
    .choice-btn {
        font-size: 0.9rem;
        padding: 12px 15px;
        min-height: 50px;
    }
    
    .choice-number {
        font-size: 1rem;
    }
}

#controls {
    text-align: center;
}

#controls button {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    margin: 0 10px;
    transition: background-color 0.3s;
}

#controls button:hover {
    background: #5a6fd8;
}

#loading {
    text-align: center;
    padding: 20px;
}

#loading p {
    font-size: 1.2rem;
    color: #667eea;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    #story-container {
        padding: 20px;
    }
    
    .choice-btn {
        font-size: 0.9rem;
        padding: 12px 15px;
    }
}