/* ============================================================
   BrainBrawl — Game Page Styles
   ============================================================ */

/* --- Score Strip --- */
.score-strip {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border-color);
}
.score-strip::-webkit-scrollbar { display: none; }

.score-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: border-color 0.3s;
}
.score-chip.me {
    border-color: var(--accent-pink);
    background: rgba(247,37,133,0.08);
}
.score-chip.eliminated {
    opacity: 0.4;
    text-decoration: line-through;
}

.sc-avatar {
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}

.sc-info { min-width: 0; }
.sc-name { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60px; }
.sc-score { font-size: 12px; font-weight: 800; color: var(--accent-yellow); }
.sc-streak { font-size: 11px; flex-shrink: 0; }

/* --- Turn Banner --- */
.turn-banner {
    text-align: center;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}
.turn-text { font-size: 16px; font-weight: 700; }
.turn-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* --- Game Area --- */
.game-area {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

/* --- Question View --- */
.question-view {
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.question-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.question-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.q-category, .q-difficulty, .q-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.question-text {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* --- Timer Bar --- */
.timer-bar-container {
    position: relative;
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    margin-bottom: 16px;
    overflow: hidden;
}
.timer-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    border-radius: 4px;
    transition: width linear;
}
.timer-bar.timer-urgent {
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-pink)) !important;
    animation: timerPulse 0.5s ease-in-out infinite;
}
@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.timer-text {
    position: absolute;
    right: 8px;
    top: -18px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* --- Multiple Choice --- */
.choices-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: auto;
}

.choice-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-primary);
    text-align: left;
    font-size: 15px;
    font-family: inherit;
}
.choice-btn:hover { border-color: var(--accent-blue); background: var(--bg-hover); }
.choice-btn:active { transform: scale(0.98); }

.choice-letter {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.choice-text { flex: 1; font-weight: 500; }

/* --- True/False --- */
.tf-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: auto;
}
.btn-tf {
    padding: 24px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.btn-true {
    background: rgba(6,214,160,0.1);
    color: var(--accent-green);
    border-color: rgba(6,214,160,0.3);
}
.btn-true:hover { border-color: var(--accent-green); background: rgba(6,214,160,0.2); }
.btn-false {
    background: rgba(247,37,133,0.1);
    color: var(--accent-pink);
    border-color: rgba(247,37,133,0.3);
}
.btn-false:hover { border-color: var(--accent-pink); background: rgba(247,37,133,0.2); }

/* --- Type Answer --- */
.type-answer {
    display: flex;
    gap: 10px;
    margin-top: auto;
}
.type-answer input {
    flex: 1;
    padding: 14px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 18px;
    font-family: inherit;
    outline: none;
}
.type-answer input:focus { border-color: var(--accent-blue); }
.type-answer button { flex-shrink: 0; padding: 14px 24px; }

/* --- Results View --- */
.results-view {
    padding: 16px;
}

.result-card {
    text-align: center;
    padding: 20px;
    margin-bottom: 16px;
}
.result-icon { font-size: 48px; margin-bottom: 8px; }
.result-icon.correct { animation: bounceIn 0.4s ease-out; }
.result-icon.wrong { animation: shakeX 0.4s ease-out; }

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.result-text {
    font-size: 24px; font-weight: 800; margin-bottom: 4px;
}
.result-answer {
    font-size: 16px; color: var(--accent-cyan); font-weight: 600; margin-bottom: 4px;
}
.result-note {
    font-size: 13px; color: var(--text-secondary); margin-bottom: 8px;
    line-height: 1.4;
}
.result-points {
    font-size: 20px; font-weight: 800;
}
.result-points.correct { color: var(--accent-green); }
.result-points.wrong { color: var(--text-muted); }

.round-results {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 16px;
}
.rr-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.rr-row:last-child { border-bottom: none; }
.rr-name { flex: 1; font-weight: 600; }
.rr-time { color: var(--text-muted); font-size: 12px; }
.rr-points { font-weight: 700; min-width: 50px; text-align: right; }
.rr-points.correct { color: var(--accent-green); }

/* --- Game Over --- */
.gameover-view {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

.gameover-card {
    width: 100%;
    text-align: center;
}

.gameover-title {
    font-size: 32px;
    font-weight: 800;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}
.gameover-winner {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.gameover-stats {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.final-scoreboard {
    margin-bottom: 20px;
}
.final-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
}
.final-row.me {
    border-color: var(--accent-pink);
    background: rgba(247,37,133,0.08);
}
.final-rank { font-size: 20px; width: 32px; text-align: center; }
.final-name { flex: 1; font-weight: 600; text-align: left; }
.final-correct { font-size: 12px; color: var(--text-muted); }
.final-score { font-weight: 800; color: var(--accent-yellow); font-size: 16px; min-width: 50px; text-align: right; }

/* --- Waiting View --- */
.waiting-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}
.waiting-spinner {
    width: 40px; height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.waiting-view p { font-size: 14px; color: var(--text-secondary); }

/* --- Board View (Classic Mode) --- */
.board-view {
    position: relative;
}
.board-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 50vh;
    scrollbar-width: none;
}
.board-scroll::-webkit-scrollbar { display: none; }

.board-container {
    position: relative;
    width: 100%;
    padding: 0 10px;
}
.bridges-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}
.bridge-line {
    stroke: rgba(255,255,255,0.1);
    stroke-width: 3;
    stroke-dasharray: 8 4;
}

.island {
    position: absolute;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}
.island-lg { font-size: 10px; }
.isle-icon { font-size: 16px; }
.isle-label { font-size: 8px; text-transform: uppercase; letter-spacing: 1px; }

.isle-player {
    position: absolute;
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    font-size: 9px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    z-index: 2;
}

.dice-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(247,37,133,0.4);
    z-index: 10;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s;
}
.dice-btn:hover { transform: scale(1.1); }
.dice-btn:active { transform: scale(0.95); }

/* --- Notifications --- */
.game-notification {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    z-index: 100;
    transition: top 0.3s ease-out;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}
.game-notification.info {
    background: var(--accent-blue);
    color: #fff;
}
.game-notification.error {
    background: var(--accent-pink);
    color: #fff;
}
.game-notification.show {
    top: 60px;
}
