/* =================================================================
   クイズゲーム専用スタイル
   ================================================================= */

.quiz-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

/* ヘッダー */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.quiz-progress {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.penalty-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.quiz-timer {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* スコアボード */
.scoreboard {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.score-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 6px;
}

.score-rank {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 2rem;
    text-align: center;
    color: var(--primary-color);
}

.score-name {
    flex: 1;
    font-weight: 500;
}

.score-points {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--success-color);
}

/* 問題表示 */
.question-display {
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.question-text {
    font-size: 1.4rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    text-align: center;
}

.question-meta {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 早押しボタン */
.buzzer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
}

.buzzer-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.buzzer-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.buzzer-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.buzzer-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.buzzer-btn.locked {
    background: #e74c3c;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(231, 76, 60, 0.8);
    }
}

.buzzer-icon {
    font-size: 3rem;
}

.buzzer-status {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
    min-height: 1.5rem;
    text-align: center;
}

/* 回答セクション */
.answer-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.answer-input {
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-color);
}

.answer-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.answer-buttons {
    display: flex;
    gap: 1rem;
}

.answer-buttons button {
    flex: 1;
    padding: 1rem;
    font-size: 1rem;
}

/* みんはや形式の回答セクション */
.answer-progress {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.char-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.char-option-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 2rem 1rem;
    font-size: 2rem;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.char-option-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: var(--primary-hover);
}

.char-option-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ゲーム結果 */
.game-results {
    text-align: center;
    padding: 2rem;
}

.game-results h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.final-ranking {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.ranking-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.ranking-item.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    font-size: 1.2rem;
}

.ranking-item.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.ranking-item.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #e6a85c 100%);
}

.ranking-position {
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 3rem;
    text-align: center;
}

.ranking-name {
    flex: 1;
    font-weight: 600;
}

.ranking-score {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .quiz-container {
        padding: 1rem;
    }

    .question-text {
        font-size: 1.2rem;
    }

    .buzzer-btn {
        width: 150px;
        height: 150px;
        font-size: 1.2rem;
    }

    .buzzer-icon {
        font-size: 2rem;
    }

    .final-ranking {
        gap: 0.75rem;
    }

    .ranking-item {
        padding: 1rem;
    }
}

/* =================================================================
   カウントダウンオーバーレイ
   ================================================================= */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-in;
}

.countdown-number {
    font-size: 8rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    animation: countdownPulse 1s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* =================================================================
   タイマーバー
   ================================================================= */
.timer-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.timer-bar {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    transition: width 0.05s linear, background 0.3s ease;
    border-radius: 4px;
}

.timer-bar.warning {
    background: linear-gradient(90deg, #ff9800, #ffc107);
}

.timer-bar.danger {
    background: linear-gradient(90deg, #f44336, #ff5722);
}

/* =================================================================
   みんはや答え入力
   ================================================================= */
.answer-progress {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    min-height: 2.5rem;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    border: 2px solid var(--primary-color);
}

.char-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.char-option-btn {
    font-size: 2rem;
    font-weight: bold;
    padding: 2rem;
    border: 2px solid var(--primary-color);
    background: var(--card-bg);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.char-option-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    background: var(--primary-color);
    color: white;
}

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

/* =================================================================
   正解表示
   ================================================================= */
.correct-answer-display {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    text-align: center;
    animation: slideDown 0.5s ease-out;
}

.correct-answer-label {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
}

.correct-answer-text {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
}

.correct-answer-explanation {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    text-align: left;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
