/* ============================================================
   Too Many Coins - Complete Stylesheet
   Mobile-first dark game UI with gold/amber accent colors
   ============================================================ */

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2236;
    --bg-card: #151d2e;
    --bg-card-hover: #1c2640;
    --bg-input: #0d1321;
    --border-color: #2a3550;
    --border-light: #374361;
    --text-primary: #e8eaf0;
    --text-secondary: #9ca3b8;
    --text-muted: #6b7394;
    --accent-gold: #f0b429;
    --accent-gold-light: #fcd34d;
    --accent-gold-dark: #b8860b;
    --accent-blue: #3b82f6;
    --accent-blue-light: #60a5fa;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --accent-purple: #a855f7;
    --accent-orange: #f97316;
    --accent-cyan: #06b6d4;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.6);
    --shadow-glow: 0 0 20px rgba(240,180,41,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --transition: 0.2s ease;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --bottom-nav-height: 0px;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
}

a { color: var(--accent-blue-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==================== LAYOUT ==================== */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

#main-content {
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 1.25rem 1rem calc(1.25rem + var(--bottom-nav-height));
}

.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.2s ease; }

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

/* ==================== TOP BAR ==================== */
#top-bar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.top-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    height: 52px;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 1.3rem;
    color: var(--accent-gold);
    filter: drop-shadow(0 0 6px rgba(240,180,41,0.4));
}

.logo-text {
    font-size: 1rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.desktop-nav {
    display: flex;
    gap: 0.25rem;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.desktop-nav::-webkit-scrollbar { display: none; }

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    min-height: 44px;
    display: flex;
    align-items: center;
}

.nav-btn:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.nav-btn.active { color: var(--accent-gold); background: rgba(240,180,41,0.1); }

#user-area { flex-shrink: 0; }

.wiki-top-link {
    flex-shrink: 0;
    min-height: 36px;
}

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

.user-global-stars {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent-gold);
    font-weight: 600;
}

.user-handle {
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-handle:hover { color: var(--accent-gold); }

/* ==================== MOBILE BOTTOM NAV ==================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 200;
    padding-bottom: var(--safe-bottom);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.5);
}

.bottom-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.5rem 0.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-btn.active {
    color: var(--accent-gold);
}

.bottom-nav-btn:active {
    transform: scale(0.92);
}

.bottom-nav-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.bottom-nav-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ==================== PLAYER HUD ==================== */
#player-hud {
    background: linear-gradient(180deg, var(--bg-tertiary), var(--bg-secondary));
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.hud-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    gap: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.hud-inner::-webkit-scrollbar { display: none; }

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    flex-shrink: 0;
}

.hud-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}

.hud-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hud-coins .hud-value { color: var(--accent-gold); }
.hud-stars .hud-value { color: var(--accent-blue-light); }
.hud-sigils .hud-value { color: var(--accent-purple); }
.hud-rate .hud-value { color: var(--accent-cyan); }
.hud-global .hud-value { color: var(--accent-gold-light); }
.activity-active { color: var(--accent-green) !important; }
.activity-idle { color: var(--accent-orange) !important; }

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--font-main);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    padding: 0.6rem 1.1rem;
    font-size: 0.85rem;
    white-space: nowrap;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
    color: #000;
    box-shadow: 0 2px 8px rgba(240,180,41,0.25);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
    box-shadow: 0 4px 16px rgba(240,180,41,0.35);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-red), #dc2626);
    color: #fff;
}
.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #f87171, var(--accent-red));
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.btn-outline:hover:not(:disabled) {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(240,180,41,0.05);
}

.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.78rem; min-height: 36px; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-full { width: 100%; }

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 1rem;
}

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

.input-field, select.input-field {
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 16px; /* Prevents iOS zoom on focus */
    transition: var(--transition);
    min-height: 44px;
    -webkit-appearance: none;
    appearance: none;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(240,180,41,0.15);
}

.input-sm { max-width: 120px; }

.form-error {
    color: var(--accent-red);
    font-size: 0.8rem;
    margin: 0.5rem 0;
    min-height: 1.2em;
}

/* ==================== AUTH ==================== */
.auth-container {
    max-width: 420px;
    margin: 2rem auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.auth-tab {
    flex: 1;
    padding: 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
}

.auth-tab.active {
    background: rgba(240,180,41,0.1);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.auth-form h2 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    color: var(--text-primary);
}

/* ==================== HERO ==================== */
.hero-section {
    text-align: center;
    padding: 2.5rem 0.5rem 2rem;
}

.hero-section h1 {
    font-size: 2.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold), var(--accent-gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 1.5rem;
    line-height: 1.7;
}

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

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: var(--transition);
}

.info-card:hover {
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-glow);
}

.info-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    color: var(--accent-gold);
}

.info-card p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== SCREEN TITLES ==================== */
.screen-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.screen-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

/* ==================== SEASONS GRID ==================== */
.seasons-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.season-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.season-card:hover {
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-glow);
}

.season-card.my-season {
    border-color: var(--accent-gold);
    box-shadow: 0 0 12px rgba(240,180,41,0.1);
}

.season-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.season-id {
    font-weight: 700;
    font-size: 1rem;
}

.season-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.season-stat {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.season-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-active { background: rgba(34,197,94,0.15); color: var(--accent-green); }
.badge-idle { background: rgba(249,115,22,0.15); color: var(--accent-orange); }
.badge-offline { background: rgba(107,115,148,0.15); color: var(--text-muted); }
.badge-blackout { background: rgba(249,115,22,0.15); color: var(--accent-orange); }
.badge-expired { background: rgba(107,115,148,0.15); color: var(--text-muted); }
.badge-scheduled { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.badge-warning { background: rgba(249,115,22,0.2); color: var(--accent-orange); }
.badge-lockin { background: rgba(168,85,247,0.15); color: var(--accent-purple); }
.badge-ended { background: rgba(6,182,212,0.15); color: var(--accent-cyan); }
.badge-owned { background: rgba(34,197,94,0.15); color: var(--accent-green); }
.badge-staff { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.badge-first { background: rgba(255,215,0,0.2); color: #ffd700; }
.badge-second { background: rgba(192,192,192,0.2); color: #c0c0c0; }
.badge-third { background: rgba(205,127,50,0.2); color: #cd7f32; }
.badge-lg { font-size: 0.8rem; padding: 0.3rem 0.8rem; }
.badge-open { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.badge-accepted { background: rgba(34,197,94,0.15); color: var(--accent-green); }
.badge-declined { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.badge-canceled { background: rgba(107,115,148,0.15); color: var(--text-muted); }

/* ==================== SEASON DETAIL ==================== */
.season-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.season-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
}

.season-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.season-timer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.timer-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.timer-value {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.season-economy-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.economy-stat {
    display: flex;
    flex-direction: column;
}

.econ-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.econ-value {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
}

/* ==================== ACTION PANELS ==================== */
.action-panels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.action-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.action-panel h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--accent-gold);
}

.panel-info {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.panel-warning {
    font-size: 0.78rem;
    color: var(--accent-orange);
    background: rgba(249,115,22,0.08);
    border: 1px solid rgba(249,115,22,0.2);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.75rem;
}

.panel-lockin {
    border-color: rgba(239,68,68,0.3);
    background: linear-gradient(135deg, var(--bg-card), rgba(239,68,68,0.03));
}

.action-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.action-row .input-field { flex: 1; }

.quick-buy-row {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.join-panel {
    background: var(--bg-card);
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-glow);
}

.join-panel h3 {
    font-size: 1.1rem;
    color: var(--accent-gold);
    margin-bottom: 0.6rem;
}

.join-panel p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

/* ==================== SIGILS ==================== */
.sigil-display {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.sigil-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    min-width: 48px;
    background: var(--bg-tertiary);
}

.sigil-tier {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
}

.sigil-count {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
}

.sigil-rate {
    font-size: 0.58rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.sigil-vault-section {
    margin-top: 0.9rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(42,53,80,0.8);
}

.sigil-vault-section h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-gold-light);
    margin-bottom: 0.25rem;
}

.tier-1 .sigil-tier, .tier-1 .sigil-count { color: #a8a8a8; }
.tier-2 .sigil-tier, .tier-2 .sigil-count { color: #4ade80; }
.tier-3 .sigil-tier, .tier-3 .sigil-count { color: #60a5fa; }
.tier-4 .sigil-tier, .tier-4 .sigil-count { color: #c084fc; }
.tier-5 .sigil-tier, .tier-5 .sigil-count { color: #fbbf24; }

.tier-1 { border-color: rgba(168,168,168,0.3); }
.tier-2 { border-color: rgba(74,222,128,0.3); }
.tier-3 { border-color: rgba(96,165,250,0.3); }
.tier-4 { border-color: rgba(192,132,252,0.3); }
.tier-5 { border-color: rgba(251,191,36,0.3); box-shadow: 0 0 8px rgba(251,191,36,0.1); }

/* ==================== VAULT ==================== */
.vault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.4rem;
}

.vault-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.6rem 0.4rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    text-align: center;
}

.vault-tier {
    font-size: 0.7rem;
    font-weight: 700;
}

.vault-remaining {
    font-size: 0.6rem;
    color: var(--text-muted);
}

.vault-cost {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-blue-light);
}

.leaderboard-tabs {
    display: inline-flex;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.leaderboard-tab {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: var(--transition);
}

.leaderboard-tab:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.leaderboard-tab.active {
    border-color: var(--accent-gold);
    color: var(--accent-gold-light);
    box-shadow: 0 0 0 1px rgba(240, 180, 41, 0.25) inset;
}

/* ==================== LEADERBOARD ==================== */
.season-leaderboard {
    margin-top: 1.5rem;
}

.season-leaderboard h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.leaderboard-table thead {
    background: var(--bg-tertiary);
}

.leaderboard-table th {
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(42,53,80,0.5);
    font-size: 0.82rem;
}

.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tr:hover { background: var(--bg-card-hover); }

.my-row {
    background: rgba(240,180,41,0.05) !important;
    border-left: 3px solid var(--accent-gold);
}

.top-three td { font-weight: 600; }

.rank-cell {
    font-family: var(--font-mono);
    font-weight: 700;
    width: 50px;
}

.stars-cell {
    font-family: var(--font-mono);
    font-weight: 600;
}

.player-link {
    cursor: pointer;
    color: var(--accent-blue-light);
    transition: var(--transition);
}

.player-link:hover { color: var(--accent-gold); }

/* ==================== SHOP ==================== */
.shop-tabs {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.shop-tab {
    padding: 0.4rem 0.7rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-height: 36px;
}

.shop-tab:hover { border-color: var(--accent-gold); color: var(--text-primary); }
.shop-tab.active { background: rgba(240,180,41,0.1); border-color: var(--accent-gold); color: var(--accent-gold); }

.shop-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.shop-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: var(--transition);
}

.shop-item:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.shop-item.owned {
    border-color: rgba(34,197,94,0.3);
    background: linear-gradient(135deg, var(--bg-card), rgba(34,197,94,0.03));
}

.shop-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.4rem;
}

.shop-item-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.shop-item-category {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.shop-item-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    line-height: 1.5;
}

.shop-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shop-item-price {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent-gold);
    font-size: 0.85rem;
}

.shop-item-login {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ==================== CHAT ==================== */
.chat-tabs {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

.chat-tab {
    padding: 0.4rem 0.7rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-height: 36px;
}

.chat-tab.active { background: rgba(240,180,41,0.1); border-color: var(--accent-gold); color: var(--accent-gold); }

.chat-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    -webkit-overflow-scrolling: touch;
}

.chat-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.chat-msg {
    display: flex;
    gap: 0.4rem;
    align-items: baseline;
    padding: 0.25rem 0;
    font-size: 0.82rem;
    flex-wrap: wrap;
}

.chat-msg-mine { background: rgba(240,180,41,0.03); border-radius: var(--radius-sm); padding: 0.3rem 0.5rem; }
.chat-msg-admin { background: rgba(239,68,68,0.05); border-radius: var(--radius-sm); padding: 0.3rem 0.5rem; }

.chat-handle {
    font-weight: 700;
    color: var(--accent-blue-light);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.78rem;
}

.chat-handle:hover { color: var(--accent-gold); }
.admin-handle { color: var(--accent-red) !important; }

.chat-text {
    color: var(--text-primary);
    word-break: break-word;
    flex: 1;
    min-width: 0;
}

.chat-time {
    font-size: 0.6rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: auto;
}

.chat-input-area {
    display: flex;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.chat-input-area input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 16px;
    min-height: 44px;
}

.chat-input-area input:focus {
    outline: none;
    border-color: var(--accent-gold);
}

/* ==================== TRADE ==================== */
.trade-form-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin: 1.25rem 0;
}

.trade-form-container h3 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    color: var(--accent-gold);
}

.trade-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.trade-side h4 {
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.trade-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-gold);
    transform: rotate(90deg);
}

.my-trades-section {
    margin-top: 1.5rem;
}

.my-trades-section h3 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

.trades-list, .trade-item {
    margin-bottom: 0.6rem;
}

.trade-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
}

.trade-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.trade-with {
    font-weight: 600;
    font-size: 0.85rem;
}

.trade-item-body {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.trade-label {
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.trade-fee {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.trade-item-actions {
    display: flex;
    gap: 0.3rem;
    justify-content: flex-end;
}

/* ==================== PROFILE ==================== */
.profile-card {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.profile-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
}

.profile-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.profile-stat {
    display: flex;
    flex-direction: column;
}

.profile-stats-season {
    margin-bottom: 0.6rem;
}

.profile-inventory {
    margin-bottom: 1rem;
}

.profile-inventory h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.profile-sigil-display {
    margin-top: 0.4rem;
}

.profile-actions {
    margin-bottom: 1rem;
}

.profile-badges {
    margin-bottom: 1.25rem;
}

.profile-badges h3 {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.badges-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.profile-badge {
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.profile-history {
    margin-top: 1.25rem;
}

.profile-history h3 {
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 1rem;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.idle-modal-box {
    border-color: var(--accent-orange);
}

.drop-modal-box {
    border-color: var(--accent-purple);
    animation: dropPulse 0.5s ease;
}

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

.modal-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.modal-box h2 {
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
}

.modal-box p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
}

/* ==================== TOAST ==================== */
#toast-container {
    position: fixed;
    bottom: calc(1rem + var(--bottom-nav-height));
    right: 1rem;
    left: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    pointer-events: none;
    align-items: flex-end;
}

.toast {
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: auto;
    max-width: 100%;
    word-break: break-word;
}

.toast-show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { background: var(--accent-green); color: #000; border-left: 4px solid #16a34a; }
.toast-error { background: var(--accent-red); color: #fff; }
.toast-info { background: var(--accent-blue); color: #fff; }
.toast-warning { background: var(--accent-orange); color: #000; }

/* ==================== EMPTY/ERROR STATES ==================== */
.empty-state, .error-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.empty-text {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
    padding: 0.75rem;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ==================== BOOSTS ==================== */
.panel-boosts h3 {
    color: var(--accent-blue-light);
}

.boost-catalog-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.75rem 0;
}

.boost-catalog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.boost-catalog-grid.boost-catalog-collapsed {
    display: none;
}

.boost-catalog-grid h4 {
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.boost-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.boost-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.boost-card.boost-locked {
    opacity: 0.55;
}

.boost-card.tier-1 { border-left: 3px solid #9ca3af; }
.boost-card.tier-2 { border-left: 3px solid #22c55e; }
.boost-card.tier-3 { border-left: 3px solid #3b82f6; }
.boost-card.tier-4 { border-left: 3px solid #a855f7; }
.boost-card.tier-5 { border-left: 3px solid #f59e0b; }

.boost-card-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.boost-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.boost-inline-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.boost-icon {
    font-size: 1.1rem;
}

.boost-name {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.boost-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.boost-desc-inline {
    margin-left: auto;
    text-align: right;
    line-height: 1.2;
    white-space: nowrap;
}

.boost-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    font-size: 0.78rem;
}

.boost-modifier {
    color: var(--accent-green);
    font-weight: 700;
    background: rgba(34, 197, 94, 0.1);
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
}

.boost-duration {
    color: var(--accent-blue-light);
    font-weight: 600;
    white-space: nowrap;
}

.boost-cost-inline {
    color: var(--text-muted);
    white-space: nowrap;
}

.boost-scope {
    font-weight: 600;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    font-size: 0.72rem;
}

.scope-self {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
}

.scope-global {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.boost-cost {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.boost-have {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.boost-have-inline {
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
}

/* Active Boosts Display */
.active-boosts-summary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(34, 197, 94, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.6rem;
}

.boost-total-mod {
    color: var(--accent-green);
    font-size: 0.9rem;
}

.ab-section {
    margin-bottom: 0.6rem;
}

.ab-section h4 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.active-boost-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    font-size: 0.82rem;
    flex-wrap: wrap;
}

.active-boost-item.self {
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid #3b82f6;
}

.active-boost-item.global {
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid #f59e0b;
}

.ab-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
}

.ab-mod {
    color: var(--accent-green);
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.ab-time {
    color: var(--accent-blue-light);
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.ab-by {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-style: italic;
}

/* Boost active indicator in HUD */
.boost-active {
    color: var(--accent-green) !important;
    animation: boostPulse 2s ease-in-out infinite;
}

@keyframes boostPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.hud-boosts .hud-label {
    color: var(--accent-blue-light);
}

/* ==================== SIGIL DROPS ==================== */
.panel-drops h3 {
    color: var(--accent-gold);
}

.drop-stats {
    display: flex;
    gap: 1rem;
    margin: 0.4rem 0;
    font-size: 0.82rem;
    flex-wrap: wrap;
}

.drop-stat {
    color: var(--text-secondary);
}

.recent-drops-list {
    max-height: 180px;
    overflow-y: auto;
    margin: 0.6rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    -webkit-overflow-scrolling: touch;
}

.drop-entry {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    background: var(--bg-tertiary);
    font-size: 0.82rem;
    border-left: 3px solid var(--border-color);
    flex-wrap: wrap;
}

.drop-entry.tier-1 { border-left-color: #9ca3af; }
.drop-entry.tier-2 { border-left-color: #22c55e; }
.drop-entry.tier-3 { border-left-color: #3b82f6; }
.drop-entry.tier-4 { border-left-color: #a855f7; }
.drop-entry.tier-5 { border-left-color: #f59e0b; }

.drop-tier {
    font-weight: 700;
    min-width: 80px;
}

.drop-source {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.drop-tick {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-family: var(--font-mono);
    margin-left: auto;
}

.drop-odds-table {
    margin-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.6rem;
}

.drop-odds-table h4 {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.mini-table {
    width: 100%;
    font-size: 0.78rem;
    border-collapse: collapse;
}

.mini-table td {
    padding: 0.25rem 0.4rem;
    border-bottom: 1px solid rgba(42, 53, 80, 0.5);
    color: var(--text-secondary);
}

.mini-table td:first-child {
    font-weight: 600;
    color: var(--text-primary);
    width: 40%;
}

.tier-1-text { color: #9ca3af !important; }
.tier-2-text { color: #22c55e !important; }
.tier-3-text { color: #3b82f6 !important; }
.tier-4-text { color: #a855f7 !important; }
.tier-5-text { color: #f59e0b !important; }

/* ==================== RESPONSIVE: TABLET ==================== */
@media (min-width: 600px) {
    .home-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .seasons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .action-panels {
        grid-template-columns: repeat(2, 1fr);
    }
    .season-economy-bar {
        grid-template-columns: repeat(4, 1fr);
    }
    .season-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
    .season-timer {
        align-items: flex-end;
    }
    .trade-form {
        grid-template-columns: 1fr auto 1fr;
    }
    .trade-arrow {
        transform: none;
        font-size: 2rem;
        padding-top: 2rem;
    }
    .hero-section h1 {
        font-size: 2.8rem;
    }
}

/* ==================== RESPONSIVE: DESKTOP ==================== */
@media (min-width: 900px) {
    :root {
        --bottom-nav-height: 0px;
    }

    .mobile-bottom-nav {
        display: none !important;
    }

    .desktop-nav {
        display: flex !important;
    }

    #main-content {
        padding: 2rem 1.5rem 4rem;
    }

    .home-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .seasons-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .hero-section {
        padding: 4rem 1rem 3rem;
    }

    .hero-section h1 {
        font-size: 3rem;
    }

    .chat-messages {
        height: 500px;
    }

    .screen-title {
        font-size: 1.8rem;
    }

    .top-bar-inner {
        height: 60px;
        padding: 0 1.5rem;
        gap: 1.5rem;
    }

    .hud-inner {
        gap: 1.5rem;
        padding: 0.6rem 1.5rem;
    }

    .hud-item {
        min-width: 80px;
    }

    .hud-value {
        font-size: 1rem;
    }

    .auth-container {
        padding: 2rem;
    }

    .profile-card {
        padding: 2rem;
    }

    .modal-box {
        padding: 2.5rem;
        max-width: 420px;
    }

    #toast-container {
        left: auto;
        right: 1.5rem;
        bottom: 1.5rem;
    }

    .toast {
        max-width: 400px;
    }
}

/* ==================== RESPONSIVE: MOBILE ==================== */
@media (max-width: 899px) {
    :root {
        --bottom-nav-height: calc(52px + var(--safe-bottom));
    }

    .mobile-bottom-nav {
        display: flex;
    }

    .desktop-nav {
        display: none !important;
    }

    .top-bar-inner {
        height: 48px;
        padding: 0 0.75rem;
    }

    .logo-text {
        font-size: 0.9rem;
    }

    /* Profile table responsive */
    .profile-history .leaderboard-table {
        font-size: 0.72rem;
    }

    .profile-history .leaderboard-table th,
    .profile-history .leaderboard-table td {
        padding: 0.4rem 0.5rem;
    }
}

/* ==================== RESPONSIVE: SMALL MOBILE ==================== */
@media (max-width: 380px) {
    html {
        font-size: 13px;
    }

    .hud-item {
        min-width: 50px;
    }

    .hud-value {
        font-size: 0.8rem;
    }

    .hud-label {
        font-size: 0.55rem;
    }

    .vault-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    }

    .hero-section h1 {
        font-size: 1.8rem;
    }

    .bottom-nav-icon {
        font-size: 1rem;
    }

    .bottom-nav-label {
        font-size: 0.55rem;
    }
}

/* ==================== LANDSCAPE MOBILE ==================== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 1rem 0.5rem;
    }

    .hero-section h1 {
        font-size: 1.5rem;
    }

    .chat-messages {
        height: 250px;
    }

    .modal-box {
        padding: 1.25rem;
    }

    .modal-icon {
        font-size: 1.5rem;
        margin-bottom: 0.4rem;
    }
}

/* ==================== PRINT ==================== */
@media print {
    .mobile-bottom-nav,
    #top-bar,
    #player-hud,
    #toast-container,
    .modal-overlay {
        display: none !important;
    }
}
