:root {
    --primary: #FFD700; /* Gold */
    --secondary: #1E90FF; /* Dodger Blue */
    --accent: #FF69B4; /* Hot Pink */
    --bg-dark: #000080; /* Navy Blue */
    --bg-card: #FFFFFF;
    --text-main: #333;
    --text-light: #F1F2F6;
    --shadow-color: rgba(0, 0, 0, 0.3);
    
    --font-heading: 'Fredoka', sans-serif;
    --font-body: 'Nunito', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, #000080 0%, #191970 100%); /* Navy to Midnight Blue */
    min-height: 100vh;
    color: var(--text-main);
    overflow-x: hidden;
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.app-container {
    max-width: 900px; /* Wider for jeopardy board */
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.main-header {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 20px;
}

.game-title {
    font-family: var(--font-heading);
    font-size: 3.8rem;
    color: var(--primary); /* Gold */
    text-shadow: 4px 4px 0px rgba(0,0,0,0.4);
    letter-spacing: 2px;
    margin-bottom: 5px;
    transform: rotate(-3deg);
    display: inline-block;
}

.game-title .highlight {
    color: white; /* White for "Challenge" */
    text-shadow: 4px 4px 0px #666;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 600;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 30px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.15); /* Slightly transparent white */
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 25px;
    border-radius: 50px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform 0.2s;
}

.stat-item:hover {
    transform: scale(1.03);
}

.stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    opacity: 0.8;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary); /* Gold for values */
}

/* Main Content Area */
.game-content {
    flex: 1;
    position: relative;
}

.section {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 15px 35px var(--shadow-color), 0 5px 15px rgba(0,0,0,0.1);
    width: 100%;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 1;
    transform: translateY(0);
}

.section.hidden {
    display: none !important;
    opacity: 0;
    transform: translateY(20px);
}

.section-title {
    font-family: var(--font-heading);
    text-align: center;
    color: var(--bg-dark);
    margin-bottom: 25px;
    font-size: 2rem;
}

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

/* Jeopardy Board */
.jeopardy-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 categories */
    gap: 10px;
    margin-top: 20px;
}

.jeopardy-category-header {
    background: var(--secondary); /* Dodger Blue */
    color: white;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    padding: 15px 5px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 80px; /* Ensure headers have some height */
    display: flex;
    align-items: center;
    justify-content: center;
}

.jeopardy-question-cell {
    background: #e0e0e0; /* Light grey for empty/used cells */
    border-radius: 8px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--bg-dark);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease-in-out;
}

.jeopardy-question-cell.used {
    background: #6c757d; /* Darker grey for used */
    color: #ced4da;
    opacity: 0.7;
    pointer-events: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.jeopardy-question-cell.empty {
    background: #f8f9fa; /* Even lighter for truly empty slots */
    color: #adb5bd;
    font-size: 0.8rem;
}

.jeopardy-value-btn {
    width: 100%;
    height: 100%;
    background: var(--secondary); /* Dodger Blue */
    color: var(--primary); /* Gold text on blue */
    border: none;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 0 #1461a2; /* Darker blue shadow */
    position: relative;
    top: 0;
}

.jeopardy-value-btn:hover {
    background: #1c86e0;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #1461a2;
}

.jeopardy-value-btn:active {
    top: 4px;
    box-shadow: 0 0 0 #1461a2;
    transform: translateY(0);
}

/* Question Section */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.category-badge {
    background: var(--accent); /* Hot Pink */
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.question-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--secondary); /* Dodger Blue */
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.question-card {
    text-align: center;
    margin-bottom: 30px;
    background: #f8f9fa; /* Lighter background for question text */
    padding: 30px;
    border-radius: 16px;
    border-left: 5px solid var(--primary); /* Gold accent */
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.question-card h2 {
    font-size: 1.8rem;
    line-height: 1.4;
    color: var(--bg-dark);
    font-weight: 700;
}

/* Styles for embedded images and links in questions */
.question-card h2 img,
.question-card h2 .question-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 2px solid rgba(0,0,0,0.1);
    margin: 15px auto;
    display: block;
}

.question-card h2 a {
    color: var(--secondary);
    text-decoration: underline;
    font-weight: 700;
    transition: color 0.2s;
}

.question-card h2 a:hover {
    color: var(--primary);
}

/* Answer Section */
.answer-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.button-group .btn {
    flex: 1;
    max-width: 200px;
}

.input-wrapper {
    position: relative;
}

#answer-input {
    width: 100%;
    padding: 18px 25px;
    font-size: 1.2rem;
    border: 3px solid #ced4da;
    border-radius: 16px;
    background: #f8f9fa;
    font-family: var(--font-body);
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
    color: var(--text-main);
}

#answer-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.2); /* Gold glow */
}

/* Custom 3D Buttons */
.btn {
    position: relative;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    outline: none;
    width: 100%;
    height: 60px;
}

.btn-xl {
    height: 70px;
}

.btn-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary); /* Gold */
    color: var(--bg-dark); /* Navy text */
    font-family: var(--font-heading);
    font-size: 1.4rem;
    border-radius: 16px;
    z-index: 2;
    transform: translateY(-6px);
    transition: transform 0.1s cubic-bezier(0.3, 0.7, 0.4, 1);
}

.btn-secondary .btn-text {
    background: var(--secondary); /* Dodger Blue */
    color: white;
}

.btn-pass .btn-text {
    background: #9ca3af; /* Gray */
    color: #000000; /* Black text */
}

.btn-shadow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #b8860b; /* Darker Gold shadow */
    border-radius: 16px;
    z-index: 1;
}

.btn-secondary .btn-shadow {
    background: #1461a2; /* Darker Dodger Blue */
}

.btn-pass .btn-shadow {
    background: #6b7280; /* Darker Gray */
}

.btn:hover .btn-text {
    transform: translateY(-8px);
}

.btn:active .btn-text {
    transform: translateY(-2px);
}

.btn:disabled {
    cursor: not-allowed;
    filter: brightness(0.7);
}

.btn:disabled .btn-text {
    transform: translateY(-2px);
}

/* Loading State */
#loading {
    text-align: center;
    padding: 40px 0;
}

.loading-animation {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.dot {
    width: 15px;
    height: 15px;
    background: var(--accent); /* Hot Pink */
    border-radius: 50%;
    animation: bounce 0.5s alternate infinite cubic-bezier(0.19, 0.57, 0.3, 0.98);
}

.dot:nth-child(2) { animation-delay: 0.1s; }
.dot:nth-child(3) { animation-delay: 0.2s; }

.loading-text {
    font-weight: 700;
    color: #a4b0be;
}

/* Result Card */
.result-header {
    margin-bottom: 20px;
}

#result-icon {
    font-size: 5rem;
    margin-bottom: 10px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.correct #result-icon::before {
    content: '💰'; /* Money Bag emoji */
    display: block;
}

.incorrect #result-icon::before {
    content: '❌'; /* Cross Mark emoji */
    display: block;
}

#result-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
}

.correct #result-title { color: var(--secondary); } /* Dodger Blue */
.incorrect #result-title { color: var(--primary); } /* Gold (for losing money) */

#result-feedback {
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 25px;
    color: #57606f;
}

.correct-answer-box {
    background: #f1f2f6;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 30px;
    text-align: left;
}

.correct-answer-box .label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #a4b0be;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.correct-answer-box .value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--bg-dark);
}

.final-score {
    background: var(--bg-dark); /* Navy background */
    color: white;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 30px;
    text-align: center;
    border: 3px solid var(--primary); /* Gold border */
}

.final-score .label {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

.final-score .value {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary); /* Gold */
    text-shadow: 2px 2px 0px rgba(0,0,0,0.2);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-15px); }
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }
    .game-title { font-size: 2.8rem; }
    .stats-bar { gap: 15px; }
    .stat-item { padding: 8px 15px; }
    .stat-value { font-size: 1.4rem; }
    .section { padding: 20px; }
    .section-title { font-size: 1.6rem; }
    .jeopardy-board { gap: 5px; }
    .jeopardy-category-header { font-size: 0.9rem; padding: 10px 5px; min-height: 60px; }
    .jeopardy-value-btn { font-size: 1.2rem; min-height: 60px; }
    .question-card h2 { font-size: 1.4rem; }
    .btn-xl { height: 60px; }
    .btn-text { font-size: 1.2rem; }
    .result-title { font-size: 2rem; }
    .final-score .value { font-size: 2.5rem; }
}

@media (max-width: 480px) {
    .game-title { font-size: 2.2rem; }
    .subtitle { font-size: 1rem; }
    .stats-bar { flex-direction: column; gap: 10px; }
}
/* Add to src/static/style.css */

.round-value {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    margin: 10px 0 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s backwards;
}

.round-value.win {
    color: #2ED573; /* Green */
}

.round-value.loss {
    color: #a4b0be; /* Grey */
    font-size: 2.5rem;
    opacity: 0.8;
}

/* Image Question Styles */
.media-container {
    margin-bottom: 20px;
    text-align: center;
}

.question-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 2px solid rgba(0,0,0,0.1);
}

.clue-text {
    margin-top: 15px;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--bg-dark);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 15px 35px var(--shadow-color);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--bg-dark);
    margin-bottom: 20px;
}

.summary-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 25px;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.summary-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.summary-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #a4b0be;
    font-weight: 700;
}

.summary-history {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.history-item {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.history-item.correct {
    background-color: #2ED573;
    color: white;
}

.history-item.incorrect {
    background-color: #FF4757;
    color: white;
}

/* Leaderboard Section */
.leaderboard-section {
    margin: 15px 0 25px 0;
    padding-top: 15px;
    border-top: 2px solid #e8e8e8;
}

.leaderboard-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--bg-dark);
    margin-bottom: 20px;
    text-align: center;
}

.leaderboard-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
}

.leaderboard-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.leaderboard-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #a4b0be;
    font-weight: 700;
}

.leaderboard-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.user-rank {
    margin-top: 5px;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #a4b0be;
    font-weight: 700;
    text-align: center;
}

/* Countdown Banner */
.countdown-container {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 15px;
    padding: 20px 0;
}

.countdown-label {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 2px;
    line-height: 1;
}

.countdown-timer {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
