/* =====================================================================
   CORE DESIGN SYSTEM & UTILITIES (VANILLA CSS - WORLD CUP 2026 THEME)
   ===================================================================== */
:root {
    --bg-dark: #050505; /* Solid dark background inspired by 5.html */
    --card-bg: rgba(10, 8, 22, 0.95); /* High opacity glassmorphism for maximum readability */
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #f3f4f6;
    --text-muted: #a3a7cc;
    
    /* World Cup 2026 Official Colors (from 5.html) */
    --green-light: #00b140;
    --green-dark: #005530;
    --red-light: #e3001b;
    --red-dark: #7a0010;
    --blue-light: #70a3f0;
    --blue-dark: #0047bb;
    
    /* Game UI Theme Elements */
    --primary: #00f589;            /* Neon Green */
    --primary-glow: rgba(0, 245, 137, 0.35);
    --secondary: #ff007f;          /* Neon Pink */
    --secondary-glow: rgba(255, 0, 127, 0.35);
    --accent-gold: #ffd700;        /* Trophy Gold */
    --accent-gold-glow: rgba(255, 215, 0, 0.4);
    --accent-red: #ff5e57;
    --accent-red-glow: rgba(255, 94, 87, 0.4);
    --accent-green-glow: rgba(11, 232, 129, 0.4);
    
    /* Fonts */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-sporty: 'Kanit', var(--font-sans);
}

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

html, body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background-attachment: fixed;
    padding: 20px 12px; /* Space on top/bottom for scroll on mobile */
}

/* Faint Stadium Pitch Grid overlay (very subtle) */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at center, rgba(255, 255, 255, 0.005) 1.5px, transparent 1.5px),
        linear-gradient(rgba(255, 255, 255, 0.003) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.003) 1px, transparent 1px);
    background-size: 80px 80px, 40px 40px, 40px 40px;
    z-index: -1;
    pointer-events: none;
}

/* Concentric Corner Brand Shapes - Solid Curves (Inspired by 5.html) */
.shape {
    position: fixed; /* Fixed to viewport corners */
    width: 160px; 
    height: 160px;
    border-radius: 48px;
    transform: rotate(45deg);
    pointer-events: none;
    z-index: -2;
    opacity: 0.9;  /* Fully visible and solid style */
}

.top-left {
    top: -80px; 
    left: -80px;
    background: var(--green-light);
    box-shadow: 
        0 0 0 50px var(--green-dark),
        0 0 0 100px var(--red-light),
        0 0 0 150px var(--red-dark),
        0 0 0 200px var(--blue-light),
        0 0 0 250px var(--blue-dark);
}

.bottom-right {
    bottom: -80px; 
    right: -80px;
    background: var(--green-light);
    box-shadow: 
        0 0 0 50px var(--green-dark),
        0 0 0 100px var(--red-light),
        0 0 0 150px var(--red-dark),
        0 0 0 200px var(--blue-light),
        0 0 0 250px var(--blue-dark);
}

.top-right {
    top: -80px; 
    right: -80px;
    background: var(--blue-light);
    box-shadow: 
        0 0 0 50px var(--blue-dark),
        0 0 0 100px var(--red-dark),
        0 0 0 150px var(--red-light),
        0 0 0 200px var(--green-dark),
        0 0 0 250px var(--green-light);
}

.bottom-left {
    bottom: -80px; 
    left: -80px;
    background: var(--blue-light);
    box-shadow: 
        0 0 0 50px var(--blue-dark),
        0 0 0 100px var(--red-dark),
        0 0 0 150px var(--red-light),
        0 0 0 200px var(--green-dark),
        0 0 0 250px var(--green-light);
}

/* Watermark "26" Background (Inspired by 2.html) */
.bg-text-26 {
    position: fixed; /* Fixed to viewport corners */
    top: 5%;
    right: 8%;
    font-family: var(--font-sporty);
    font-size: 22rem;
    font-weight: 900;
    font-style: italic;
    color: rgba(255, 255, 255, 0.012);
    z-index: -1;
    pointer-events: none;
    letter-spacing: -12px;
    user-select: none;
}

/* Container - Smart Centering & Scrolling */
.container {
    width: 100%;
    max-width: 480px; /* Slightly narrower to fit smaller screens better */
    margin: auto; /* Vertically and horizontally centers container, allows scrolling if taller than viewport */
    display: flex;
    flex-direction: column;
    z-index: 10;
}

/* GLOBAL SPORTS SCOREBOARD HEADER (Game Name Large) */
.game-logo-header {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeInLogo 0.6s ease-out;
}

.game-logo-title {
    font-family: var(--font-sporty);
    font-size: min(3.1rem, 8.5vw);
    font-weight: 800;
    font-style: italic;
    letter-spacing: -0.02em;
    color: #ffffff;
    text-transform: uppercase;
    line-height: 1.1;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
}

.game-logo-title span {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-logo-subtitle {
    font-family: var(--font-sporty);
    font-size: 1.1rem;
    font-weight: 600;
    font-style: italic;
    color: var(--secondary);
    letter-spacing: 0.3em;
    margin-top: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(255, 0, 127, 0.35);
}

@keyframes fadeInLogo {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* CARDS & ANIMATIONS */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: 24px 20px; /* Reduced to fit smaller viewports and mobile */
    box-shadow: 0 35px 90px rgba(0, 0, 0, 0.9), 
                inset 0 1px 2px rgba(255, 255, 255, 0.05);
    text-align: center;
    display: none;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.card.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0) 100%);
    margin: 20px 0;
}

.game-instructions {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Stats Overview */
.stats-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.4);
    min-height: 96px; /* Balance heights */
}

.stat-label {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-sporty);
    font-size: 1.35rem; /* Prevent overflow issues */
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.stat-subvalue {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 3px;
    text-transform: none;
    text-shadow: none;
}

/* BUTTON SYSTEM */
.btn {
    font-family: var(--font-sporty);
    text-transform: uppercase;
    border: none;
    border-radius: 18px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #00e676 100%);
    color: #050b1a;
    padding: 16px 32px;
    box-shadow: 0 8px 24px var(--primary-glow),
                inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 245, 137, 0.5);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    padding: 16px 32px;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-large {
    width: 100%;
    font-size: 1.2rem;
    padding: 18px;
    letter-spacing: 0.05em;
}

/* GAME SCREEN STYLES */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.streak-container, .timer-text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.streak-container .label, .timer-text-container .label {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-bottom: 3px;
}

.streak-container .value, .timer-text-container .value {
    font-family: var(--font-sporty);
    font-size: 1.35rem;
    font-weight: 800;
}

.streak-container .value {
    color: var(--accent-gold);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.35);
}

.timer-text-container .value {
    color: var(--text-main);
}

.timer-text-container .value.highlight {
    color: var(--accent-red);
    text-shadow: 0 0 15px rgba(255, 0, 127, 0.45);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

/* Timer Progress Bar with Soccer Ball */
.timer-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 999px;
    margin-bottom: 20px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
    border-radius: 999px;
    position: relative;
    transition: width 0.05s linear, background 0.3s ease;
}

.timer-ball {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
    line-height: 1;
    z-index: 10;
    pointer-events: none;
    animation: rollBall 1.5s infinite linear;
}

@keyframes rollBall {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(-360deg); }
}

/* Player Cromo Card Display */
.player-card {
    position: relative;
    width: 100%;
    max-width: min(420px, 42vh);
    aspect-ratio: 1 / 1;
    margin: 0 auto 20px auto;
    border-radius: 26px;
    padding: 8px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #b8860b 30%, #e5c158 50%, #8b6508 70%, var(--accent-gold) 100%);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6),
                0 0 30px rgba(255, 215, 0, 0.15);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15), box-shadow 0.4s ease;
}

.player-card::after {
    content: '';
    position: absolute;
    top: -150%;
    left: -150%;
    width: 300%;
    height: 300%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 35%,
        rgba(255, 255, 255, 0.15) 45%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.15) 55%,
        rgba(255, 255, 255, 0) 65%
    );
    transform: rotate(-45deg);
    transition: transform 0.8s ease;
    pointer-events: none;
    z-index: 4;
}

.player-card:hover {
    transform: scale(1.02) rotate(1deg);
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.75),
                0 0 35px rgba(255, 215, 0, 0.3);
}

.player-card:hover::after {
    transform: rotate(-45deg) translate(25%, 25%);
}

.player-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background-color: #0b091c;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

#player-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
    z-index: 2;
}

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

/* Loading Spinner */
.spinner {
    width: 45px;
    height: 45px;
    border: 3.5px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Feedback Overlay */
.feedback-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.feedback-overlay span {
    font-family: var(--font-sporty);
    font-style: italic;
    font-size: 2.1rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feedback-overlay.show {
    opacity: 1;
}

.feedback-overlay.show span {
    transform: scale(1);
}

.feedback-overlay.correct {
    background: rgba(0, 245, 137, 0.8);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.3);
}

.feedback-overlay.incorrect {
    background: rgba(255, 0, 127, 0.8);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.3);
}

/* Option Buttons Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 440px) {
    .options-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }
}

.btn-option {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #ffffff;
    padding: 16px 20px;
    font-family: var(--font-sporty);
    font-size: 1.1rem;
    font-weight: 600;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 48%, rgba(255,255,255,0.007) 50%, transparent 52%);
    background-size: 10px 10px;
    pointer-events: none;
}

.btn-option:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(0, 245, 137, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 245, 137, 0.15);
}

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

.btn-option:disabled {
    cursor: default;
    opacity: 0.6;
}

/* Option States after clicking */
.btn-option.correct-choice {
    background: linear-gradient(135deg, #00d66c 0%, var(--primary) 100%) !important;
    border-color: var(--primary) !important;
    color: #050b1a !important;
    font-weight: 800;
    box-shadow: 0 0 25px var(--accent-green-glow),
                inset 0 1px 1px rgba(255,255,255,0.2) !important;
    transform: scale(1.03);
    z-index: 5;
}

.btn-option.incorrect-choice {
    background: linear-gradient(135deg, #e60067 0%, var(--secondary) 100%) !important;
    border-color: var(--secondary) !important;
    color: #ffffff !important;
    box-shadow: 0 0 25px var(--accent-red-glow) !important;
    opacity: 0.45;
}

/* Shake animation for card */
.shake {
    animation: shakeAnim 0.4s ease-in-out;
}

@keyframes shakeAnim {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* Green success flash glow */
.success-glow {
    animation: successGlowAnim 0.5s ease-out;
}

@keyframes successGlowAnim {
    0% { box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9); }
    50% { box-shadow: 0 0 45px rgba(0, 245, 137, 0.25), 0 30px 80px rgba(0, 0, 0, 0.9); }
    100% { box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9); }
}

/* END SCREEN STYLES */
.section-title {
    font-family: var(--font-sporty);
    font-style: italic;
    font-size: 2.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.end-message {
    font-size: 1.15rem;
    color: var(--text-muted);
}

.final-stats {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 35px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
}

.final-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
    color: var(--text-muted);
}

.final-stat-row strong {
    font-family: var(--font-sporty);
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

#final-score {
    color: var(--accent-gold);
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 480px) {
    .button-group {
        flex-direction: row;
    }
    .button-group .btn {
        flex: 1;
    }
}

/* =====================================================================
   LEADERBOARD SCREEN & PROFILE BADGE STYLES
   ===================================================================== */
.profile-header {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.user-badge.small {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.user-icon {
    font-size: 1rem;
}

.user-name {
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary-glow);
}

.game-player-badge {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 4px;
}

.percentile-message {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 10px;
    text-shadow: 0 0 10px var(--primary-glow);
}

.leaderboard-table-container {
    max-height: 280px;
    overflow-y: auto;
    margin: 20px 0;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.4);
}

/* Custom Scrollbar for Leaderboard */
.leaderboard-table-container::-webkit-scrollbar {
    width: 6px;
}
.leaderboard-table-container::-webkit-scrollbar-track {
    background: transparent;
}
.leaderboard-table-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
}
.leaderboard-table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.leaderboard-table th, .leaderboard-table td {
    padding: 12px 14px;
    font-size: 0.9rem;
}

.leaderboard-table th {
    font-family: var(--font-sporty);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    background: #0d0a1b;
    z-index: 2;
}

.leaderboard-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: background 0.2s ease;
}

.leaderboard-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.leaderboard-table tr.current-player-row {
    background: rgba(0, 245, 137, 0.08) !important;
    border-left: 3px solid var(--primary);
}

.leaderboard-table tr.current-player-row td {
    color: var(--primary);
    font-weight: 700;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.8rem;
}

.rank-1 {
    background: var(--accent-gold);
    color: #050b1a;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.45);
}

.rank-2 {
    background: #d1d5db;
    color: #050b1a;
    box-shadow: 0 0 8px rgba(209, 213, 219, 0.35);
}

.rank-3 {
    background: #cd7f32;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(205, 127, 50, 0.35);
}

/* =====================================================================
   RESPONSIVE HEIGHT AND WIDTH MEDIA QUERIES (Mobile, Tablet, Desktop)
   ===================================================================== */

/* Tablets (Scale down shapes and adjust layout) */
@media (min-width: 481px) and (max-width: 768px) {
    .shape {
        width: 120px;
        height: 120px;
        border-radius: 36px;
    }
    .top-left {
        top: -60px;
        left: -60px;
        box-shadow: 
            0 0 0 35px var(--green-dark),
            0 0 0 70px var(--red-light),
            0 0 0 105px var(--red-dark),
            0 0 0 140px var(--blue-light),
            0 0 0 175px var(--blue-dark);
    }
    .bottom-right {
        bottom: -60px;
        right: -60px;
        box-shadow: 
            0 0 0 35px var(--green-dark),
            0 0 0 70px var(--red-light),
            0 0 0 105px var(--red-dark),
            0 0 0 140px var(--blue-light),
            0 0 0 175px var(--blue-dark);
    }
    .top-right {
        top: -60px;
        right: -60px;
        box-shadow: 
            0 0 0 35px var(--blue-dark),
            0 0 0 70px var(--red-dark),
            0 0 0 105px var(--red-light),
            0 0 0 140px var(--green-dark),
            0 0 0 175px var(--green-light);
    }
    .bottom-left {
        bottom: -60px;
        left: -60px;
        box-shadow: 
            0 0 0 35px var(--blue-dark),
            0 0 0 70px var(--red-dark),
            0 0 0 105px var(--red-light),
            0 0 0 140px var(--green-dark),
            0 0 0 175px var(--green-light);
    }
    .bg-text-26 {
        font-size: 15rem;
        letter-spacing: -9px;
    }
}

/* Mobile Devices (Portrait) */
@media (max-width: 480px) {
    body {
        padding: 10px 8px;
    }
    .container {
        padding: 4px;
    }
    .game-logo-header {
        margin-bottom: 10px;
    }
    .game-logo-title {
        font-size: 2rem;
    }
    .game-logo-title span {
        display: block; /* Force brand word to next line for neat centering */
        margin-top: 2px;
    }
    .game-logo-subtitle {
        font-size: 0.82rem;
        letter-spacing: 0.22em;
    }
    .card {
        padding: 16px 12px;
        border-radius: 24px;
    }
    .game-instructions {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 15px;
    }
    .stats-overview {
        margin-bottom: 18px;
        gap: 8px;
    }
    .stat-box {
        padding: 8px;
        border-radius: 14px;
        min-height: 76px;
    }
    .stat-value {
        font-size: 1.15rem;
    }
    .stat-subvalue {
        font-size: 0.72rem;
    }
    .btn-option {
        padding: 10px 8px;
        font-size: 0.92rem;
        min-height: 44px;
        border-radius: 12px;
    }
    .player-card {
        border-radius: 18px;
        padding: 5px;
        margin-bottom: 12px;
        max-width: min(280px, 32vh); /* Prevents overflow and tall crops on mobile */
    }
    .player-image-wrapper {
        border-radius: 13px;
    }
    .timer-bar-container {
        margin-bottom: 12px;
    }
    .options-grid {
        gap: 8px;
    }
    .button-group {
        gap: 8px;
    }
    
    /* Responsive Mobile Corners */
    .shape {
        width: 80px;
        height: 80px;
        border-radius: 24px;
    }
    .top-left {
        top: -40px;
        left: -40px;
        box-shadow: 
            0 0 0 25px var(--green-dark),
            0 0 0 50px var(--red-light),
            0 0 0 75px var(--red-dark),
            0 0 0 100px var(--blue-light),
            0 0 0 125px var(--blue-dark);
    }
    .bottom-right {
        bottom: -40px;
        right: -40px;
        box-shadow: 
            0 0 0 25px var(--green-dark),
            0 0 0 50px var(--red-light),
            0 0 0 75px var(--red-dark),
            0 0 0 100px var(--blue-light),
            0 0 0 125px var(--blue-dark);
    }
    .top-right {
        top: -40px;
        right: -40px;
        box-shadow: 
            0 0 0 25px var(--blue-dark),
            0 0 0 50px var(--red-dark),
            0 0 0 75px var(--red-light),
            0 0 0 100px var(--green-dark),
            0 0 0 125px var(--green-light);
    }
    .bottom-left {
        bottom: -40px;
        left: -40px;
        box-shadow: 
            0 0 0 25px var(--blue-dark),
            0 0 0 50px var(--red-dark),
            0 0 0 75px var(--red-light),
            0 0 0 100px var(--green-dark),
            0 0 0 125px var(--green-light);
    }
    .bg-text-26 {
        font-size: 8rem;
        letter-spacing: -5px;
        top: 10%;
        right: 3%;
    }
}

/* Short Viewport Heights (Laptops, mobile landscape, split screens) */
@media (max-height: 750px) {
    body {
        padding: 8px 6px;
    }
    .game-logo-header {
        margin-bottom: 6px;
    }
    .game-logo-title {
        font-size: 1.8rem;
    }
    .game-logo-subtitle {
        font-size: 0.8rem;
        letter-spacing: 0.18em;
    }
    .card {
        padding: 14px 12px;
        border-radius: 20px;
    }
    .divider {
        margin: 10px 0;
    }
    .game-instructions {
        margin-bottom: 12px;
        font-size: 0.9rem;
    }
    .stats-overview {
        margin-bottom: 12px;
    }
    .timer-bar-container {
        margin-bottom: 10px;
        height: 8px;
    }
    .player-card {
        margin-bottom: 10px;
        padding: 4px;
        max-width: min(300px, 30vh);
    }
    .btn-option {
        padding: 8px 8px;
        font-size: 0.9rem;
        min-height: 38px;
        border-radius: 12px;
    }
    .stat-box {
        padding: 6px;
        min-height: 64px;
    }
    .stat-value {
        font-size: 1.1rem;
    }
}

/* Extreme Landscape Heights */
@media (max-height: 520px) {
    .game-logo-header {
        display: none; /* Hide brand header to fit card on screen */
    }
    .player-card {
        max-width: min(200px, 24vh);
        margin-bottom: 8px;
    }
    .options-grid {
        grid-template-columns: 1fr 1fr !important; /* Force 2 columns to fit landscape width */
        gap: 6px;
    }
    .btn-option {
        min-height: 36px;
        padding: 4px 6px;
        font-size: 0.82rem;
    }
    .card {
        padding: 8px 10px;
    }
}
