@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-title: 'Outfit', sans-serif;
    
    /* Harmonious Cyberpunk Dark Palette */
    --bg-primary: #0a0e1a;
    --bg-secondary: rgba(16, 24, 48, 0.6);
    --bg-glass: rgba(26, 36, 68, 0.45);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(0, 242, 254, 0.5);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Accents & Gradients */
    --accent-cyan: #00f2fe;
    --accent-blue: #4facfe;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --accent-gold: #fbbf24;
    
    --gradient-primary: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-rose: linear-gradient(135deg, #f43f5e 0%, #fda4af 100%);
    --gradient-success: linear-gradient(135deg, #059669 0%, #34d399 100%);
    --shadow-glow: 0 8px 32px 0 rgba(0, 242, 254, 0.15);
    --shadow-card: 0 8px 24px 0 rgba(0, 0, 0, 0.3);
}

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

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(79, 172, 254, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 242, 254, 0.05) 0%, transparent 40%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 4rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Glassmorphism Container */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(0, 242, 254, 0.2);
    box-shadow: var(--shadow-glow);
}

.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

/* Header & Navigation */
header {
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-cyan);
}

.nav-links .btn-logout {
    border: 1px solid var(--accent-rose);
    color: var(--accent-rose);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-links .btn-logout:hover {
    background: var(--accent-rose);
    color: white;
}

/* User display in nav */
.user-display {
    color: var(--accent-cyan);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Admin Dropdown Navigation */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
    margin: 0;
    outline: none;
}

.nav-dropdown-btn:hover {
    background: rgba(255, 215, 0, 0.1);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(10, 14, 26, 0.98);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    min-width: 200px;
    padding: 0.5rem 0;
    list-style: none;
    z-index: 200;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    gap: 0;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu li a {
    display: block;
    padding: 0.6rem 1.2rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease, background 0.2s ease;
    border-radius: 0;
}

.nav-dropdown-menu li a:hover,
.nav-dropdown-menu li a.active {
    color: var(--accent-gold);
    background: rgba(255, 215, 0, 0.05);
}

/* Close dropdown when clicking outside */
.nav-dropdown-menu li:first-child a { border-radius: 12px 12px 0 0; }
.nav-dropdown-menu li:last-child a  { border-radius: 0 0 12px 12px; }

@media (max-width: 900px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgb(10, 14, 26);
        backdrop-filter: blur(12px);
        padding: 1rem 2rem 1.5rem;
        border-bottom: 1px solid var(--border-glass);
        gap: 0.75rem;
        z-index: 99;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    .nav-links.open {
        display: flex;
    }
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 0.5rem;
        z-index: 101;
    }
    .hamburger span {
        display: block;
        width: 24px;
        height: 2px;
        background: var(--text-secondary);
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .hamburger.open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .hamburger.open span:nth-child(2) {
        opacity: 0;
    }
    .hamburger.open span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}
@media (min-width: 901px) {
    .hamburger {
        display: none;
    }
}

/* Primary Layout Container */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Button UI */
.btn-primary {
    background: var(--gradient-primary);
    color: #050b14;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 700;
    font-family: var(--font-title);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 242, 254, 0.3);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
}

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

/* Form Styling */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}

/* Dashboard UI Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive equal 2-column grid (used on admin pages, etc.) */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .two-col-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}


.stats-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(16, 24, 48, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-family: var(--font-title);
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Matches & Tipping Interface */
.match-card {
    background: rgba(20, 30, 58, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    /* NOTE: overflow must NOT be hidden here - it clips number input spinner arrows */
    overflow: visible;
    transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.match-card:hover {
    border-color: rgba(0, 242, 254, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 242, 254, 0.08);
}

.match-header {
    background: rgba(10, 14, 26, 0.4);
    padding: 0.6rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    border-radius: 12px 12px 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 0.4rem;
    overflow: hidden;
}

.match-body {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .match-body {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

.team-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 35%;
    min-width: 0; /* allow flex children to shrink below their natural size */
}

.team-display.home {
    justify-content: flex-end;
}

.team-display.away {
    justify-content: flex-start;
}

@media (max-width: 768px) {
    .team-display {
        width: 100%;
        justify-content: center !important;
    }
}

.team-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.team-name {
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

@media (max-width: 768px) {
    .team-name {
        max-width: 120px;
        font-size: 1rem;
    }
}

.match-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 30%;
}

@media (max-width: 768px) {
    .match-center {
        width: 100%;
    }
}

.score-actual {
    font-family: var(--font-title);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.2em;
    padding-left: 0.2em;
}

.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.live {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid var(--accent-rose);
    animation: pulse 1.5s infinite;
}

.status-badge.finished {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.status-badge.scheduled {
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 242, 254, 0.2);
}

/* Tip Inputs Form */
.tip-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.tip-input {
    width: 72px;  /* wider to accommodate native spinner arrows without clipping */
    min-width: 72px;
    height: 42px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 6px;
    /* Balanced padding: left for number, right for spinner area */
    padding: 0.4rem 1.8rem 0.4rem 0.4rem;
    box-sizing: border-box;
    overflow: visible;
}

/* Force show number spin-button arrows (overrides Pico CSS reset) */
.tip-input[type="number"]::-webkit-inner-spin-button,
.tip-input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: inner-spin-button !important;
    display: block !important;
    opacity: 1 !important;
    cursor: pointer;
    height: 42px;
}
.tip-input[type="number"] {
    -moz-appearance: number-input !important;
}

.tip-divider {
    color: var(--text-secondary);
    font-weight: 700;
}

.tip-saved {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--accent-emerald);
    color: var(--accent-emerald);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.tip-points-tag {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.tip-points-tag.points-4 {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
    border: 1px solid var(--accent-emerald);
}

.tip-points-tag.points-3 {
    background: rgba(79, 172, 254, 0.2);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

.tip-points-tag.points-2 {
    background: rgba(251, 191, 36, 0.2);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
}

.tip-points-tag.points-1 {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.tip-points-tag.points-0 {
    background: rgba(244, 63, 94, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.match-footer {
    background: rgba(16, 24, 48, 0.25);
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.match-footer span {
    color: var(--text-secondary);
}

.match-footer strong {
    color: var(--text-primary);
}

/* Leaderboard Table */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.leaderboard-table th, .leaderboard-table td {
    padding: 1rem 1.25rem;
    text-align: left;
}

.leaderboard-table th {
    font-family: var(--font-title);
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-glass);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.leaderboard-table tr {
    border-bottom: 1px solid var(--border-glass);
    transition: background 0.2s ease;
}

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

.leaderboard-table tr.me {
    background: rgba(0, 242, 254, 0.05);
    border-left: 3px solid var(--accent-cyan);
}

.leaderboard-table tr.rank-1 .rank-badge {
    background: var(--gradient-gold);
    color: #050b14;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.leaderboard-table tr.rank-2 .rank-badge {
    background: #cbd5e1;
    color: #050b14;
}

.leaderboard-table tr.rank-3 .rank-badge {
    background: #b45309;
    color: white;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.user-name-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-ai {
    background: var(--gradient-primary);
    color: #050b14;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Prediction Details Page */
.ai-summary-header {
    border-left: 4px solid var(--accent-cyan);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.factors-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* AI predictions main content grid also needs mobile breakpoint */
.ai-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .factors-grid {
        grid-template-columns: 1fr;
    }
    .ai-content-grid {
        grid-template-columns: 1fr;
    }
}

.factor-item {
    background: rgba(10, 14, 26, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.factor-impact-tag {
    font-weight: 800;
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
    align-self: flex-start;
    flex-shrink: 0;
}

.factor-impact-tag.pos-2, .factor-impact-tag.pos-1 {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.factor-impact-tag.neg-2, .factor-impact-tag.neg-1 {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
}

.factor-impact-tag.neutral {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

/* Animations */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Form Container Layout */
.auth-container {
    max-width: 480px;
    margin: 4rem auto;
}

.alert-error {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid var(--accent-rose);
    color: var(--accent-rose);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Premium Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 254, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 242, 254, 0.4);
}

/* Decorative Background Glows */
.bg-glow-circle {
    position: fixed;
    width: 45vw;
    height: 45vw;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.07;
    pointer-events: none;
    animation: floatGlow 20s ease-in-out infinite alternate;
}

.circle-1 {
    top: -10vw;
    left: -10vw;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
}

.circle-2 {
    bottom: -15vw;
    right: -10vw;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
    animation-delay: -5s;
}

.circle-3 {
    top: 50vh;
    left: 45vw;
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, var(--accent-rose) 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(6%, 6%) scale(1.1);
    }
}

/* Real-Time Live Score Update Flash Glow */
@keyframes score-flash-update {
    0% {
        color: var(--accent-cyan) !important;
        text-shadow: 0 0 15px var(--accent-cyan);
        transform: scale(1.15);
    }
    100% {
        color: var(--text-primary) !important;
        text-shadow: none;
        transform: scale(1.0);
    }
}
.score-update-flash {
    display: inline-block;
    animation: score-flash-update 1.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Page Entrance Animation */
main {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Match card stagger entrance */
.match-card {
    animation: fadeInUp 0.4s ease-out both;
}
.match-card:nth-child(1) { animation-delay: 0.05s; }
.match-card:nth-child(2) { animation-delay: 0.1s; }
.match-card:nth-child(3) { animation-delay: 0.15s; }
.match-card:nth-child(4) { animation-delay: 0.2s; }
.match-card:nth-child(5) { animation-delay: 0.25s; }

/* HTMX Loading Indicator */
.htmx-request .btn-primary {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}
.htmx-request .btn-primary::after {
    content: "⏳";
    margin-left: 0.4rem;
}

/* Subtle success pulse on tip save */
.tip-saved {
    animation: tipSavedPulse 0.6s ease-out;
}

@keyframes tipSavedPulse {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Footer */
.app-footer {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-glass);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    word-break: break-word;
}

.app-footer a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.2s ease;
}

.app-footer a:hover {
    color: var(--accent-blue);
}

/* Responsive padding adjustments */
@media (max-width: 768px) {
    body {
        padding-bottom: 2rem;
    }
    main {
        padding: 0 1rem;
        margin: 1.5rem auto;
    }
    .glass-panel {
        padding: 1.25rem;
    }
    .glass-card {
        padding: 1.25rem;
    }
    nav {
        padding: 0.75rem 1rem;
    }
    .app-footer {
        padding: 1.25rem 1rem;
    }
    .stats-card-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .match-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .tip-input-wrapper {
        justify-content: center;
    }
    /* Leaderboard: compact padding on mobile */
    .leaderboard-table th, .leaderboard-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    /* Team names: ensure they don't overflow cards */
    .team-name {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    /* Rank badge: reduce size slightly */
    .rank-badge {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
}

/* Extra-small screens: stack dashboard match cards differently */
@media (max-width: 480px) {
    .stats-card-container {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .match-body {
        flex-direction: column;
        gap: 0.5rem;
    }
    .team-display.home,
    .team-display.away {
        flex-direction: row;
        justify-content: center;
        min-width: 0;
    }
    .match-center {
        order: -1;
    }
    .leaderboard-table th:nth-child(3),
    .leaderboard-table td:nth-child(3) {
        display: none; /* hide total tips count on xs */
    }
}

/* Enhanced Auth Pages */
.auth-container h2 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-container .glass-panel {
    border: 1px solid rgba(0, 242, 254, 0.15);
    box-shadow: 0 8px 40px rgba(0, 242, 254, 0.1);
}

/* Stat card hover micro-interaction */
.stat-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

/* Smooth link transitions */
a {
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* Alert success variant */
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--accent-emerald);
    color: var(--accent-emerald);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Countdown timer badge glow on last minute */
.countdown-urgent {
    animation: urgentPulse 0.8s ease-in-out infinite;
}

@keyframes urgentPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
    50% { box-shadow: 0 0 8px 2px rgba(244, 63, 94, 0.4); }
}
