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

body {
    font-family: 'Segoe UI', 'Yu Gothic', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #2d3748;
    font-size: 2em;
    margin-bottom: 10px;
}

header p {
    color: #718096;
    font-size: 1.1em;
}

.btn-back {
    display: inline-block;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    border: 2px solid #667eea;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #667eea;
    color: white;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* スタート画面 */
.start-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.start-container h2 {
    color: #2d3748;
    font-size: 1.8em;
    margin-bottom: 30px;
}

.rules {
    background: rgba(102, 126, 234, 0.1);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: left;
}

.rules p {
    color: #4a5568;
    font-size: 1.1em;
    line-height: 2;
    margin-bottom: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

/* クイズ画面 */
.quiz-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1em;
}

.progress-bar {
    background: rgba(102, 126, 234, 0.2);
    height: 12px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
}

.quiz-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.question-number {
    color: #667eea;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
}

.question-text {
    color: #2d3748;
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border-left: 5px solid #667eea;
    letter-spacing: 0.05em;
    line-height: 1.6;
}

.answer-area {
    margin-bottom: 20px;
}

#answer-input {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

#answer-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-submit, .btn-skip {
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.btn-submit {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.btn-skip {
    background: rgba(160, 174, 192, 0.2);
    color: #4a5568;
}

.btn-skip:hover {
    background: rgba(160, 174, 192, 0.3);
}

.hint-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.btn-hint {
    padding: 10px 25px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #f6ad55;
    background: rgba(246, 173, 85, 0.1);
    color: #dd6b20;
    transition: all 0.3s ease;
}

.btn-hint:hover {
    background: rgba(246, 173, 85, 0.2);
}

.btn-hint:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-hint.used {
    background: rgba(160, 174, 192, 0.2);
    color: #a0aec0;
    border-color: #a0aec0;
}

.result-message {
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: 600;
    text-align: center;
    display: none;
}

.result-message.correct {
    background: rgba(72, 187, 120, 0.1);
    color: #38a169;
    border: 2px solid #48bb78;
    display: block;
}

.result-message.incorrect {
    background: rgba(245, 101, 101, 0.1);
    color: #e53e3e;
    border: 2px solid #f56565;
    display: block;
}

.hint-area {
    margin-top: 15px;
    padding: 15px;
    background: rgba(66, 153, 225, 0.1);
    border-radius: 8px;
    color: #2c5282;
    display: none;
}

.hint-area.visible {
    display: block;
}

/* 結果画面 */
.result-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 50px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.result-container h2 {
    color: #2d3748;
    font-size: 2.5em;
    margin-bottom: 30px;
}

.final-score {
    margin-bottom: 30px;
}

.score-label {
    color: #718096;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.score-value {
    color: #2d3748;
    font-size: 4em;
    font-weight: 700;
    margin-bottom: 10px;
}

.score-percentage {
    color: #667eea;
    font-size: 2em;
    font-weight: 600;
}

.score-rank {
    font-size: 3em;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.1);
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background: rgba(160, 174, 192, 0.2);
    color: #4a5568;
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: 2px solid #a0aec0;
}

.btn-secondary:hover {
    background: #a0aec0;
    color: white;
}

/* レスポンシブ */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.5em;
    }

    .question-text {
        font-size: 1.4em;
        padding: 20px;
    }

    .quiz-content {
        padding: 25px;
    }

    .result-container {
        padding: 30px;
    }

    .score-value {
        font-size: 3em;
    }
}
