/* ===== 1Candle Trader — Complete Design System v2 ===== */
/* Mobile-first, matching 1candletrader.com pixel-for-pixel */

:root {
    --bg-dark: #0F172A;
    --bg-secondary: #1E293B;
    --electric-blue: #00f2ff;
    --radiant-amber: #ffcc00;
    --purple-accent: #8A4FFF;
    --spring-easing: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ===== RESETS & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }

.game-shell {
    background: var(--bg-dark);
    min-height: 100vh;
    min-height: 100dvh;
    color: #F1F5F9;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Full-screen game wrapper */
.game-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    overflow: hidden;
    touch-action: none;
}

/* ===== MESH BACKGROUND ===== */
.mesh-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at 30% 20%, rgba(59,130,246,0.06) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(139,92,246,0.04) 0%, transparent 60%),
                radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    pointer-events: none;
    transition: background-color 1s ease;
}

/* ===== SPRING FEEDBACK ===== */
.btn-spring {
    transition: transform 0.2s var(--spring-easing), box-shadow 0.2s ease, filter 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.btn-spring:active { transform: scale(0.96); }
.btn-press {
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn-press:active { transform: scale(0.95); }

/* ===== GLASSMORPHISM ===== */
.glass-panel {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border-radius: 1.5rem;
}
.glass {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ===== 3D CARD ===== */
.card-3d {
    transition: transform 0.1s ease-out, border-color 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* ===== GLOW EFFECTS ===== */
.glow-blue:hover { border-color: var(--electric-blue) !important; box-shadow: 0 0 30px rgba(0, 242, 255, 0.15); }
.glow-amber:hover { border-color: var(--radiant-amber) !important; box-shadow: 0 0 30px rgba(255, 204, 0, 0.15); }
.glow-mint:hover { border-color: #10b981 !important; box-shadow: 0 0 30px rgba(16, 185, 129, 0.15); }
.glow-purple:hover { border-color: var(--purple-accent) !important; box-shadow: 0 0 30px rgba(138, 79, 255, 0.15); }

/* ===== SHIMMER ===== */
.shimmer { position: relative; overflow: hidden; }
.shimmer::after {
    content: "";
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.03), transparent);
    transform: rotate(45deg);
    animation: shimmer-anim 4s linear infinite;
}
@keyframes shimmer-anim {
    0%   { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* ===== ANIMATIONS ===== */
@keyframes float {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}
.animate-float { animation: float 6s ease-in-out infinite; }

@property --num {
    syntax: "<integer>";
    initial-value: 0;
    inherits: false;
}
.counter-anim { transition: --num 1s ease-out; counter-reset: num var(--num); }
.counter-anim::before { content: "$" counter(num); }

@keyframes popIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; pointer-events: none; } }
@keyframes slideInRight { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.pop-anim { animation: popIn 0.5s var(--spring-easing); }

/* ===== SECTION LABEL ===== */
.label-h3 {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* ===== CHART ===== */
.chart-watermark {
    font-size: 0.65rem; font-weight: 800;
    color: rgba(255,255,255,0.08);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
}

/* ===== GAME HEADER ===== */
.game-header {
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
    flex-shrink: 0;
    z-index: 20;
    position: relative;
}
@media (min-width: 768px) {
    .game-header { height: 3.5rem; padding: 0 1rem; }
}

/* ===== TAB BAR ===== */
.tab-bar {
    display: flex;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(30,41,59,0.5);
    border-bottom: 1px solid rgba(30,41,59,1);
    flex-shrink: 0;
}
.tab-bar button {
    flex: 1;
    padding: 0.5rem;
    color: #64748b;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 700;
    font-size: 0.75rem;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.tab-bar button:hover { background: rgba(30,41,59,0.3); }
.tab-bar button.active {
    color: #60a5fa;
    border-bottom-color: #3b82f6;
    background: rgba(30,41,59,0.8);
}

/* ===== FLOATING PILL FOOTER (Quick Learning / Fast Mode) ===== */
.pill-footer {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 24rem;
    z-index: 50;
    pointer-events: none;
    transition: all 0.5s ease;
}
.pill-footer-inner {
    pointer-events: auto;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    ring: 1px solid rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.5);
    padding: 0 0.25rem;
    border-radius: 9999px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 0.125rem;
    width: 100%;
    justify-content: space-between;
    transition: all 0.2s ease;
}
.pill-footer-inner:hover { background: rgba(30, 41, 59, 1); }

/* Pill drag indicator */
.pill-drag {
    display: flex;
    justify-content: center;
    padding-bottom: 0.375rem;
    cursor: grab;
    user-select: none;
    touch-action: none;
    pointer-events: auto;
}
.pill-drag-bar {
    width: 2rem;
    height: 3px;
    border-radius: 9999px;
    background: #475569;
    transition: all 0.2s;
}

/* ===== FULL-WIDTH FOOTER (Practice/Challenge) ===== */
.wide-footer {
    padding: 1rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    background: linear-gradient(to top, #0f172a, rgba(15,23,42,0.9), transparent);
    flex-shrink: 0;
    z-index: 30;
    display: flex;
    gap: 0.75rem;
    transition: transform 0.3s ease;
}

/* ===== PATTERN FOOTER ===== */
.pattern-footer {
    padding: 0.75rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    background: linear-gradient(to top, #0f172a, rgba(15,23,42,0.9), transparent);
    flex-shrink: 0;
    z-index: 30;
    display: flex;
    gap: 0.5rem;
}

/* ===== TRADE BUTTONS (Pill style for QL footer) ===== */
.btn-sell-pill {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
    font-weight: 700;
    padding: 0.625rem 0.5rem;
    border-radius: 9999px 0 0 9999px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}
.btn-sell-pill:hover { background: #ef4444; color: white; }
.btn-sell-pill:active { transform: scale(0.95); }

.btn-buy-pill {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
    color: #22c55e;
    font-weight: 700;
    padding: 0.625rem 0.5rem;
    border-radius: 0 9999px 9999px 0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}
.btn-buy-pill:hover { background: #22c55e; color: white; }
.btn-buy-pill:active { transform: scale(0.95); }

/* ===== TRADE BUTTONS (Full-width for Practice/Challenge) ===== */
.btn-short-wide {
    flex: 1;
    height: 2.5rem;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
    font-weight: 700;
    font-size: 0.75rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 8px 20px rgba(239,68,68,0.1);
    -webkit-tap-highlight-color: transparent;
}
.btn-short-wide:active { background: #ef4444; color: white; }
.btn-short-wide:hover { background: rgba(239,68,68,0.2); }

.btn-long-wide {
    flex: 1;
    height: 2.5rem;
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
    color: #22c55e;
    font-weight: 700;
    font-size: 0.75rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 8px 20px rgba(34,197,94,0.1);
    -webkit-tap-highlight-color: transparent;
}
.btn-long-wide:active { background: #22c55e; color: white; }
.btn-long-wide:hover { background: rgba(34,197,94,0.2); }

/* ===== CONFIRM BUTTON ===== */
.btn-confirm {
    background: var(--purple-accent);
    color: white;
    font-weight: 700;
    padding: 0.625rem 0.75rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    box-shadow: 0 8px 20px rgba(138,79,255,0.4);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}
.btn-confirm:hover { background: #7c3aed; }
.btn-confirm:active { transform: scale(0.95); }

/* ===== NEXT CHART BUTTON ===== */
.btn-next-chart {
    background: white;
    color: #0f172a;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    border: 4px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.15s;
    font-size: 0.875rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    -webkit-tap-highlight-color: transparent;
}
.btn-next-chart:hover { transform: scale(1.05); }
.btn-next-chart:active { transform: scale(0.97); }

/* Quick Trade Floating */
.btn-quick-buy {
    background: #059669; color: white; font-weight: 700;
    padding: 0.75rem 1.5rem; border-radius: 0.75rem;
    border: 1px solid rgba(52,211,153,0.3); cursor: pointer;
    transition: all 0.2s; box-shadow: 0 8px 20px rgba(5,150,105,0.4);
    display: flex; align-items: center; gap: 0.5rem;
    -webkit-tap-highlight-color: transparent;
}
.btn-quick-buy:hover { background: #10b981; }
.btn-quick-buy:active { transform: scale(0.95); }

.btn-quick-sell {
    background: #dc2626; color: white; font-weight: 700;
    padding: 0.75rem 1.5rem; border-radius: 0.75rem;
    border: 1px solid rgba(248,113,113,0.3); cursor: pointer;
    transition: all 0.2s; box-shadow: 0 8px 20px rgba(220,38,38,0.4);
    display: flex; align-items: center; gap: 0.5rem;
    -webkit-tap-highlight-color: transparent;
}
.btn-quick-sell:hover { background: #ef4444; }
.btn-quick-sell:active { transform: scale(0.95); }

/* ===== RR BUTTONS ===== */
.rrb {
    min-width: 36px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.rrb:hover { color: white; background: rgba(255,255,255,0.05); }
.rrb:active { transform: scale(0.95); filter: brightness(0.9); }
.rrb[data-active="true"] { background: var(--purple-accent); color: white; }

/* ===== RESULT BLAST ===== */
.blast-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; z-index: 50;
}

/* ===== ACHIEVEMENT TOAST ===== */
.achievement-toast {
    position: fixed; top: 1rem; right: 1rem;
    background: rgba(15,23,42,0.9);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(245,158,11,0.4); border-radius: 1rem;
    padding: 1rem 1.5rem; z-index: 100;
    animation: slideInRight 0.5s var(--spring-easing), fadeOut 0.5s ease-in 3s forwards;
    display: flex; align-items: center; gap: 0.75rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    max-width: calc(100vw - 2rem);
}

/* ===== LEADERBOARD ===== */
.lb-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    transition: background 0.15s;
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(255,255,255,0.04);
}
.lb-row:hover { background: rgba(30, 41, 59, 0.6); }

/* ===== XP BAR ===== */
.xp-bar-container { background: rgba(30,41,59,0.6); border-radius: 1rem; height: 0.5rem; overflow: hidden; }
.xp-bar-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, var(--purple-accent)); border-radius: 1rem; transition: width 0.5s ease-out; }

/* ===== PAIR CHIP ===== */
.pair-chip {
    padding: 0.375rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0.5rem;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.15s;
    font-family: 'JetBrains Mono', monospace;
    -webkit-tap-highlight-color: transparent;
}
.pair-chip.active { border-color: #f59e0b; color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.pair-chip:hover:not(.active) { border-color: rgba(255,255,255,0.15); color: #e2e8f0; }

/* ===== STAT MINI ===== */
.stat-mini {
    display: flex; align-items: center; gap: 0.375rem;
    padding: 0.375rem 0.75rem; background: rgba(30,41,59,0.5);
    border-radius: 0.5rem; border: 1px solid rgba(51,65,85,0.5);
    backdrop-filter: blur(8px);
}

/* ===== SCROLLBAR ===== */
.scroll-styled::-webkit-scrollbar { width: 6px; }
.scroll-styled::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
.scroll-styled::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.scroll-hide::-webkit-scrollbar { display: none; }
.scroll-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== HERO CTA ===== */
.hero-cta {
    border-radius: 1.5rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0e1f4d 0%, #0b1738 55%, #080f28 100%);
    border: 1px solid rgba(59,130,246,0.2);
    box-shadow: 0 8px 40px rgba(14,31,77,0.65), inset 0 1px 0 rgba(99,160,255,0.07);
}
.hero-cta-glow {
    position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse 65% 55% at 5% 0%, rgba(59,130,246,0.2) 0%, transparent 65%);
}

/* ===== PATTERN BUTTONS ===== */
.pattern-btn {
    flex: 1;
    height: 3rem;
    font-weight: 700;
    font-size: 0.7rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    letter-spacing: 0.05em;
    -webkit-tap-highlight-color: transparent;
}
.pattern-btn:active { transform: scale(0.96); }

/* ===== SETUP MODAL (Quick Learning / Challenge pre-game) ===== */
.setup-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}
.setup-modal {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1.5rem;
    width: 100%; max-width: 480px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    animation: slideUp 0.3s var(--spring-easing);
}
.setup-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.5rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.setup-modal-body { padding: 1.25rem 1.5rem 1.5rem; }
.setup-section-label {
    font-size: 0.65rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.15em;
    color: #94a3b8; margin-bottom: 0.75rem;
}
.setup-select {
    width: 100%; padding: 0.75rem 1rem;
    background: #0f172a; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.75rem; color: white; font-weight: 600;
    font-size: 0.875rem; font-family: inherit;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.75rem center;
    cursor: pointer; outline: none;
}
.setup-select:focus { border-color: #3b82f6; }

/* Timeframe grid buttons */
.tf-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.tf-btn {
    padding: 0.625rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.75rem; background: #0f172a;
    color: #94a3b8; font-weight: 700; font-size: 0.8rem;
    cursor: pointer; transition: all 0.15s; text-align: center;
    font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.tf-btn:hover { border-color: rgba(255,255,255,0.2); color: white; }
.tf-btn.active {
    background: #3b82f6; color: white;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

/* Pattern filter pills */
.filter-pills { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.filter-pill {
    padding: 0.375rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9999px; background: transparent;
    color: #94a3b8; font-weight: 700; font-size: 0.75rem;
    cursor: pointer; transition: all 0.15s;
    font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.filter-pill:hover { border-color: rgba(255,255,255,0.2); color: white; }
.filter-pill.active {
    background: #3b82f6; color: white;
    border-color: #3b82f6;
}

/* Start button */
.btn-start-game {
    width: 100%; padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white; font-weight: 800; font-size: 0.9rem;
    border: none; border-radius: 0.75rem;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 8px 24px rgba(37,99,235,0.4);
    display: flex; align-items: center; justify-content: center; gap: 0.75rem;
    -webkit-tap-highlight-color: transparent; font-family: inherit;
    letter-spacing: 0.05em;
}
.btn-start-game:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(37,99,235,0.5); }
.btn-start-game:active { transform: scale(0.98); }

.setup-hint {
    font-size: 0.7rem; color: #64748b; margin-top: 0.5rem;
    display: flex; align-items: flex-start; gap: 0.375rem;
}

/* ===== CHALLENGE PACK CARDS ===== */
.pack-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (max-width: 500px) { .pack-grid { grid-template-columns: 1fr; } }

.pack-card {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1.25rem; padding: 1.25rem 1.5rem;
    cursor: pointer; transition: all 0.2s;
    display: flex; flex-direction: column; justify-content: space-between;
    min-height: 160px;
    -webkit-tap-highlight-color: transparent;
}
.pack-card:hover { border-color: rgba(255,255,255,0.2); background: #263248; transform: translateY(-2px); }
.pack-card.selected {
    border-color: #8b5cf6; background: rgba(139,92,246,0.1);
    box-shadow: 0 0 30px rgba(139,92,246,0.15);
}
.pack-card-icon {
    width: 2.5rem; height: 2.5rem;
    border-radius: 0.75rem; display: flex;
    align-items: center; justify-content: center;
    font-size: 1.125rem; margin-bottom: 0.75rem;
}
.pack-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: auto; padding-top: 0.75rem;
}

/* ===== DESKTOP SPLIT-SCREEN LAYOUT ===== */
.chart-split {
    display: flex; flex-direction: column;
    flex: 1; position: relative; overflow: hidden;
}
@media (min-width: 768px) {
    .chart-split {
        flex-direction: row;
    }
    .chart-split .chart-pane {
        flex: 1; position: relative; overflow: hidden;
        border-right: 1px solid rgba(30,41,59,0.8);
    }
    .chart-split .chart-pane:last-child { border-right: none; }
    .chart-split .chart-pane .chart-watermark { display: block !important; }
    /* Hide tab bar on desktop when split */
    .split-active .tab-bar { display: none; }
    .split-active .chart-split .chart-pane { display: block !important; }
}

/* ===== SIMULATION OVERLAY ===== */
.sim-overlay {
    position: absolute; top: 0.75rem; right: 0.75rem;
    background: rgba(15,23,42,0.9);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1rem; padding: 1rem 1.25rem;
    z-index: 35; min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    animation: fadeIn 0.3s ease;
}
.sim-progress-track {
    width: 100%; height: 4px;
    background: #334155; border-radius: 9999px;
    overflow: hidden; margin: 0.5rem 0;
}
.sim-progress-bar {
    height: 100%; background: #3b82f6;
    border-radius: 9999px;
    transition: width 0.3s ease;
}
.btn-skip {
    display: flex; align-items: center; justify-content: center;
    gap: 0.5rem; padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.5rem; color: white;
    font-weight: 700; font-size: 0.75rem;
    cursor: pointer; transition: all 0.15s;
    width: 100%; margin-top: 0.5rem;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.btn-skip:hover { background: rgba(255,255,255,0.1); }

/* ===== SETTINGS MODAL ===== */
.settings-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}
.settings-modal {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1.25rem;
    width: 100%; max-width: 320px;
    padding: 1.25rem; box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: slideUp 0.3s var(--spring-easing);
}

/* ===== UTILITIES ===== */
.pb-safe { padding-bottom: max(2rem, env(safe-area-inset-bottom)); }
a.no-underline, a.no-underline:hover { text-decoration: none; }

/* Prevent text select on game */
.no-select { user-select: none; -webkit-user-select: none; }

/* ===== RESPONSIVE FINE-TUNING ===== */

/* Extra small phones (320-374px) */
@media (max-width: 374px) {
    .game-header { padding: 0 0.5rem; }
    .pill-footer { width: 98%; bottom: 0.5rem; }
    .pattern-btn { font-size: 0.6rem; height: 2.5rem; gap: 0.25rem; }
    .label-h3 { font-size: 0.55rem; }
}

/* Small phones (375-413px) */
@media (min-width: 375px) and (max-width: 413px) {
    .pill-footer { width: 95%; }
}

/* Large phones (414px+) */
@media (min-width: 414px) {
    .pill-footer { max-width: 26rem; }
    .pattern-btn { height: 3rem; font-size: 0.75rem; }
}

/* Tablets+ */
@media (min-width: 768px) {
    .game-header { height: 3.5rem; padding: 0 1rem; }
    .pill-footer { max-width: 28rem; }
    .pattern-btn { height: 3.25rem; }
}

/* Fix for notch phones */
@supports (padding: env(safe-area-inset-bottom)) {
    .pill-footer { bottom: max(1rem, env(safe-area-inset-bottom)); }
    .wide-footer { padding-bottom: max(2rem, env(safe-area-inset-bottom)); }
    .pattern-footer { padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }
}
