/* Quindle - Kid-friendly geography game styles */

body {
    background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 25%, #81d4fa 75%, #4fc3f7 100%);
    min-height: 100vh;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e3a8a;
}

.container {
    max-width: 900px;
}

/* Geography-themed card styling */
.card {
    border: 2px solid #0d9488;
    border-radius: 14px;
    background: linear-gradient(145deg, #f0fdfa 0%, #ecfdf5 100%);
    box-shadow: 0 6px 12px rgba(13, 148, 136, 0.2);
    margin-bottom: 1rem;
}

/* Mode selection cards */
.mode-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.3);
    border-color: #0d9488;
}

.mode-card .display-4 {
    transition: all 0.3s ease;
}

.mode-card:hover .display-4 {
    transform: scale(1.1);
}

.mode-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mode-card .btn {
    margin-top: auto;
    white-space: nowrap;
}

.game-card {
    border: 3px solid #0d9488;
    background: linear-gradient(145deg, #ffffff 0%, #f0fdfa 100%);
    box-shadow: 0 8px 16px rgba(13, 148, 136, 0.25);
}

.card-header {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    color: #ffffff;
    border-bottom: 2px solid #0f766e;
    font-weight: 700;
    border-radius: 11px 11px 0 0 !important;
}

/* Geography-themed stat cards */
.card.bg-primary {
    background: linear-gradient(135deg, #4a7c59 0%, #5d8f6b 100%) !important;
    border: 2px solid #3e6b4a;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(74, 124, 89, 0.3);
}

.card.bg-info {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
    border: 2px solid #1d4ed8;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.card.bg-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border: 2px solid #047857;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

/* ---- BUTTON STYLES (no uppercase) ---- */
.btn {
    border-radius: 10px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    border: 2px solid;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    border-color: #1d4ed8;
    color: #ffffff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    border-color: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    color: #ffffff;
}

.btn-success {
    background: linear-gradient(135deg, #4a7c59 0%, #5d8f6b 100%);
    border-color: #3e6b4a;
    color: #ffffff;
}

.btn-success:hover {
    background: linear-gradient(135deg, #3e6b4a 0%, #4a7c59 100%);
    border-color: #2d5237;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    color: #ffffff;
}

.btn-warning {
    background: linear-gradient(135deg, #d4af37 0%, #f0d882 100%);
    border-color: #b8941f;
    color: #1e3a8a;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #b8941f 0%, #d4af37 100%);
    border-color: #9d7f1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    color: #1e3a8a;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    border-color: #b91c1c;
    color: #ffffff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    border-color: #991b1b;
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-secondary {
    background: linear-gradient(135deg, #8a8680 0%, #a8a199 100%);
    border-color: #6f6c65;
    color: #ffffff;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #6f6c65 0%, #8a8680 100%);
    border-color: #5a5751;
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-outline-secondary {
    border-color: #6f6c65;
    color: #6f6c65;
}

.btn-outline-secondary:hover {
    background: #6f6c65;
    color: #fff;
}

/* ---- THE BIG NEXT COUNTRY BUTTON ---- */
.btn-next-country {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border: 3px solid #047857;
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 900;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45);
    animation: pulse-glow 1.8s ease-in-out infinite;
    letter-spacing: 0;
}

.btn-next-country:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    border-color: #065f46;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(5, 150, 105, 0.55);
    color: #ffffff;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45); }
    50% { box-shadow: 0 6px 32px rgba(5, 150, 105, 0.75), 0 0 0 6px rgba(5, 150, 105, 0.15); }
}

/* ---- END QUIZ BUTTON (subtle) ---- */
.btn-end-quiz {
    font-size: 0.78rem;
    color: #9ca3af;
    border-color: #d1d5db;
    background: transparent;
    padding: 4px 12px;
    box-shadow: none;
}

.btn-end-quiz:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #6b7280;
    transform: none;
}

/* ---- AGE GROUP SELECTOR ---- */
.age-selector-label {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f766e;
}

.age-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.1rem 0.5rem;
    border-radius: 14px;
    border: 3px solid #d1d5db;
    background: linear-gradient(145deg, #f8fafc, #f1f5f9);
    cursor: pointer;
    transition: all 0.25s ease;
    gap: 4px;
    font-family: 'Nunito', sans-serif;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.age-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.age-btn-young {
    border-color: #10b981;
}

.age-btn-young:hover, .age-btn-young.selected {
    background: linear-gradient(145deg, #d1fae5, #a7f3d0);
    border-color: #059669;
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.3);
}

.age-btn-older {
    border-color: #3b82f6;
}

.age-btn-older:hover, .age-btn-older.selected {
    background: linear-gradient(145deg, #dbeafe, #bfdbfe);
    border-color: #2563eb;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
}

.age-emoji {
    font-size: 2rem;
    line-height: 1;
}

.age-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e3a8a;
}

.age-range {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}

.age-selected-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #059669;
}

/* ---- ROUND PROGRESS BAR ---- */
#round-progress-wrap {
    background: rgba(255,255,255,0.6);
    border-radius: 10px;
    padding: 8px 12px;
    border: 1px solid #d1fae5;
}

#round-progress-label {
    color: #0f766e;
}

.progress {
    background-color: #d1fae5;
}

/* ---- FORM CONTROLS ---- */
.form-control {
    border: 2px solid #0d9488;
    border-radius: 10px;
    background-color: #faf8f3;
    color: #1e3a8a;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
}

.form-control:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 0.3rem rgba(14, 165, 233, 0.25);
    background-color: #ffffff;
    outline: none;
}

/* ---- ALERTS / RESULT DISPLAY ---- */
.alert {
    border-radius: 12px;
    border: 2px solid;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-family: 'Nunito', sans-serif;
}

.alert-info {
    background: linear-gradient(135deg, #e8f4fd 0%, #d4edda 100%);
    border-color: #4a7c59;
    color: #1e3a8a;
}

.alert-success {
    background: linear-gradient(135deg, #d4f4dd 0%, #c3e6cb 100%);
    border-color: #4a7c59;
    color: #1e5a28;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f1c0c7 100%);
    border-color: #b91c1c;
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #d4af37;
    color: #92400e;
}

/* ---- CELEBRATION ANIMATION ---- */
.celebrating .game-card {
    animation: celebrate-card 0.6s ease-in-out;
}

@keyframes celebrate-card {
    0%   { transform: scale(1); }
    25%  { transform: scale(1.02) rotate(-0.5deg); }
    50%  { transform: scale(1.03) rotate(0.5deg); }
    75%  { transform: scale(1.01) rotate(-0.3deg); }
    100% { transform: scale(1); }
}

/* Confetti dots */
.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 9998;
    animation: confetti-fall 2.5s ease-in forwards;
}

@keyframes confetti-fall {
    0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ---- CLUE CARDS ---- */
.clue-card {
    border: 2px solid #0d9488;
    border-radius: 12px;
    background: linear-gradient(145deg, #f0fdfa, #ecfdf5);
    padding: 0.9rem 1rem;
    margin-bottom: 0.65rem;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.12);
    animation: clue-pop 0.35s ease-out;
}

@keyframes clue-pop {
    0%  { transform: scale(0.95); opacity: 0; }
    100%{ transform: scale(1);    opacity: 1; }
}

.clue-card h6 {
    color: #0f766e;
    font-weight: 800;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.clue-card p {
    color: #1e3a8a;
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

/* ---- LEADERBOARD ---- */
.leaderboard-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #faf8f3 0%, #f0ede2 100%);
    border: 2px solid #0d9488;
    border-radius: 10px;
    box-shadow: 0 3px 6px rgba(13, 148, 136, 0.15);
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg, #d4af37 0%, #f0d882 100%);
    border-color: #b8941f;
    color: #1e3a8a;
    box-shadow: 0 4px 8px rgba(212, 175, 55, 0.3);
}

.leaderboard-rank {
    font-weight: 800;
    color: #0f766e;
}

/* ---- LOADING OVERLAY ---- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* ---- MISC ---- */
.text-warning {
    color: #f59e0b !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.display-4 {
    color: #333333;
    font-weight: 700;
}

.text-muted {
    color: #6c757d !important;
}

.stat-card {
    min-height: auto;
}

.stat-card .card-body {
    padding: 0.75rem 0.5rem;
}

.stat-card h6 {
    font-size: 0.75rem;
    font-weight: 700;
}

.stat-card h5 {
    font-size: 1.1rem;
    font-weight: 800;
}

/* ---- MOBILE RESPONSIVE ---- */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .card-body {
        padding: 1rem;
    }

    .stat-card .card-body {
        padding: 0.5rem 0.25rem;
    }

    .stat-card h6 {
        font-size: 0.65rem;
    }

    .stat-card h5 {
        font-size: 1rem;
    }

    .stat-card .fas {
        font-size: 0.75rem;
    }

    .display-4 {
        font-size: 2rem;
    }

    .btn-lg {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }

    .btn-next-country {
        font-size: 1.2rem;
        padding: 0.85rem 1rem;
    }

    .age-emoji {
        font-size: 1.6rem;
    }

    .age-title {
        font-size: 0.85rem;
    }
}
