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

/* =============================================
   Bird Of Stars — Apple iOS Light
   ============================================= */
:root {
    --bg: #F2F2F7;
    --card: #FFFFFF;
    --card-hover: #FAFAFA;
    --glass: rgba(242, 242, 247, 0.82);
    --pill-bg: rgba(255, 255, 255, 0.92);

    --text: #000000;
    --text2: #8E8E93;
    --text3: #C7C7CC;

    --accent: #007AFF;
    --accent10: rgba(0,122,255,0.1);
    --gold: #FF9500;
    --green: #34C759;
    --red: #FF3B30;
    --purple: #AF52DE;

    --sep: rgba(60,60,67,0.08);
    --sep2: rgba(60,60,67,0.15);

    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-xl: 30px;
    --r-pill: 28px;

    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08), 0 12px 40px rgba(0,0,0,0.06);
    --shadow-pill: 0 4px 24px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
}

body.dark-theme {
    --bg: #000000;
    --card: #1C1C1E;
    --card-hover: #2C2C2E;
    --glass: rgba(0, 0, 0, 0.82);
    --pill-bg: rgba(28, 28, 30, 0.92);
    --text: #FFFFFF;
    --text2: rgba(235,235,245,0.6);
    --text3: rgba(235,235,245,0.3);
    --sep: rgba(84,84,88,0.65);
    --sep2: rgba(84,84,88,0.35);
}

/* Switch */
.ios-switch { position: relative; display: flex; align-items: center; width: 51px; height: 31px; border-radius: 31px; background-color: #E9E9EA; transition: background-color 0.3s; cursor: pointer; flex-shrink: 0; padding: 2px; }
body.dark-theme .ios-switch { background-color: #39393D; }
.ios-switch.checked { background-color: #34C759 !important; }
.ios-slider-thumb { width: 27px; height: 27px; background: white; border-radius: 50%; box-shadow: 0 3px 8px rgba(0,0,0,0.15), 0 1px 1px rgba(0,0,0,0.16); transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.6, 1); }
.ios-switch.checked .ios-slider-thumb { transform: translateX(20px); }

/* Reset */
*{box-sizing:border-box;margin:0;padding:0;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
html,body{width:100%;height:100%;overflow:hidden;font-family:'Inter',-apple-system,BlinkMacSystemFont,system-ui,sans-serif;color:var(--text);background:var(--bg);user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-font-smoothing:antialiased;transition:background 0.3s, color 0.3s;}

/* ===== ANIMATIONS ===== */
@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}
.shake { animation: shakeError 0.4s ease-in-out; }

@keyframes popSuccess {
    0% { transform: scale(1); color: var(--gold); }
    50% { transform: scale(1.3); color: #34C759; }
    100% { transform: scale(1); color: inherit; }
}
.pop-success { animation: popSuccess 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ===== SCREENS ===== */
.app-screen{position:fixed;inset:0;opacity:0;pointer-events:none;transition:opacity .35s ease,transform .35s ease;transform:scale(.97);z-index:1}
.app-screen.active{opacity:1;pointer-events:auto;transform:scale(1);z-index:10}
.hidden{display:none!important}

/* ===== SPLASH ===== */
#splash-screen{display:flex;justify-content:center;align-items:center;background:linear-gradient(180deg,#E8F4FD 0%,#FFF8E7 50%,#F2F2F7 100%)}
.splash-content{display:flex;flex-direction:column;align-items:center;gap:10px;padding:0 40px}

.splash-icon-wrap{position:relative;margin-bottom:12px}
.splash-icon{width:110px;height:110px;border-radius:26px;background:linear-gradient(135deg,#FFD60A,#FF9F0A);display:flex;justify-content:center;align-items:center;box-shadow:0 8px 32px rgba(255,159,10,.22);animation:iconBob 3s ease-in-out infinite}
.splash-icon svg{width:64px;height:64px}
.hero-icon-wrap{position:relative}
.hero-icon,.ref-hero-icon{width:88px;height:88px;border-radius:22px;background:linear-gradient(135deg,#FFD60A,#FF9F0A);display:flex;justify-content:center;align-items:center;box-shadow:0 6px 24px rgba(255,159,10,.2);animation:iconBob 3s ease-in-out infinite}
.hero-icon svg,.ref-hero-icon svg{width:52px;height:52px}
@keyframes iconBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}

.splash-title{font-size:34px;font-weight:800;letter-spacing:-.8px;text-align:center;color:#000!important}
.splash-subtitle{font-size:16px;color:var(--text2);text-align:center;margin-bottom:24px}

/* ===== BUTTONS ===== */
.btn-primary{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;max-width:300px;padding:15px 28px;border:none;border-radius:var(--r-md);background:var(--accent);color:#fff;font-family:inherit;font-size:17px;font-weight:600;cursor:pointer;box-shadow:0 4px 16px rgba(0,122,255,.28);outline:none;transition:all .15s}
.btn-primary:active{transform:scale(.96);opacity:.85}
.btn-secondary{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;max-width:300px;padding:15px 28px;border:none;border-radius:var(--r-md);background:var(--bg);color:var(--text);font-family:inherit;font-size:17px;font-weight:600;cursor:pointer;outline:none;transition:all .15s}
.btn-secondary:active{transform:scale(.96);background:var(--sep2)}
.btn-play{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:14px;border:none;border-radius:var(--r-md);background:var(--accent);color:#fff;font-family:inherit;font-size:17px;font-weight:700;cursor:pointer;box-shadow:0 4px 16px rgba(0,122,255,.28);outline:none;margin-top:8px;transition:all .15s}
.btn-play:active{transform:scale(.97);opacity:.85}
.btn-svg{width:18px;height:18px;flex-shrink:0}

/* ===== GAME ===== */
#game-screen{background:#000}
#game-container{position:relative;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background:#000}
canvas{image-rendering:pixelated;image-rendering:crisp-edges;width:100%;height:100%;object-fit:cover}
#ui-layer{position:absolute;inset:0;pointer-events:none;display:flex;flex-direction:column;align-items:center}
#score-display{font-family:'Inter',sans-serif;font-size:56px;font-weight:800;margin-top:15vh;color:#fff;text-shadow:0 2px 12px rgba(0,0,0,.4);z-index:10;transition:transform .1s;letter-spacing:-2px}
#score-display.bump{transform:scale(1.15)}
.screen{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;pointer-events:auto;z-index:20}
#start-screen{background:transparent}
.game-start-hint{display:flex;flex-direction:column;align-items:center;gap:8px;animation:hintPulse 2s ease-in-out infinite}
.hint-hand{width:40px;height:40px;filter:drop-shadow(0 2px 6px rgba(0,0,0,.3))}
.game-start-hint p{font-size:14px;font-weight:500;color:rgba(255,255,255,.9);text-shadow:0 1px 6px rgba(0,0,0,.4)}
@keyframes hintPulse{0%,100%{opacity:1;transform:translateY(0)}50%{opacity:.5;transform:translateY(-5px)}}

/* Game Over */
#game-over-screen{background:rgba(0,0,0,.5);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px)}
.gameover-card{width:calc(100% - 48px);max-width:340px;background:var(--card);border-radius:var(--r-xl);padding:28px 24px;display:flex;flex-direction:column;align-items:center;gap:16px;box-shadow:var(--shadow-lg);animation:cardPop .4s cubic-bezier(.34,1.56,.64,1)}
@keyframes cardPop{0%{transform:scale(.8) translateY(20px);opacity:0}100%{transform:scale(1) translateY(0);opacity:1}}
.gameover-icon{width:56px;height:56px}
.gameover-icon svg{width:100%;height:100%}
.gameover-card h2{font-size:24px;font-weight:700}
.gameover-scores{width:100%;background:var(--bg);border-radius:var(--r-md);padding:14px 18px}
.score-row{display:flex;justify-content:space-between;align-items:center;padding:8px 0}
.score-label{font-size:16px;font-weight:500;color:var(--text2)}
.score-value{font-size:22px;font-weight:700}
.score-value.best{color:var(--gold)}
.score-divider{height:1px;background:var(--sep)}
.gameover-actions{display:flex;flex-direction:column;gap:10px;width:100%;align-items:center}

/* ===== MENU ===== */
#menu-screen{background:var(--bg);display:flex;flex-direction:column}
.tab-content{display:none;flex-direction:column;height:100%}
.tab-content.active{display:flex}
.page-scroll{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding-bottom:110px;scrollbar-width:none}
.page-scroll::-webkit-scrollbar{display:none}
.page-header{position:sticky;top:0;z-index:50;padding:calc(var(--safe-t) + 10px) 20px 12px;background:var(--glass);backdrop-filter:saturate(180%) blur(20px);-webkit-backdrop-filter:saturate(180%) blur(20px);border-bottom:.5px solid var(--sep)}
.page-header h1{font-size:34px;font-weight:800;letter-spacing:-.5px}
.page-body{padding:16px 20px;display:flex;flex-direction:column;gap:20px}

/* Hero Card */
.hero-card{background:var(--card);border-radius:var(--r-xl);padding:28px 20px;display:flex;flex-direction:column;align-items:center;gap:8px;box-shadow:var(--shadow-sm);text-align:center}
.hero-card h2{font-size:22px;font-weight:700}
.hero-card p{font-size:14px;color:var(--text2);margin-bottom:4px}
.hero-stats{display:flex;align-items:center;width:100%;padding:12px 0;margin:4px 0}
.hero-stat{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px}
.hero-stat-val{font-size:24px;font-weight:800}
.hero-stat-lbl{font-size:12px;color:var(--text3);font-weight:500}
.hero-stat-sep{width:1px;height:30px;background:var(--sep2)}

/* Section */
.section-title{display:flex;align-items:center;gap:6px;font-size:18px;font-weight:700;letter-spacing:-.2px;color:var(--text)}
.section-icon{width:18px;height:18px;color:var(--text2)}

/* Leaderboard */
.leaderboard-preview{background:var(--card);border-radius:var(--r-lg);overflow:hidden;box-shadow:var(--shadow-sm)}
.lb-preview-item{display:flex;align-items:center;padding:13px 16px;gap:12px;border-bottom:.5px solid var(--sep)}
.lb-preview-item:last-child{border-bottom:none}
.lb-preview-item.is-you{background:var(--accent10)}
.lb-pos{font-size:15px;font-weight:700;color:var(--text2);width:28px;text-align:center}
.lb-pos.gold{color:#FF9500}
.lb-pos.silver{color:#8E8E93}
.lb-pos.bronze{color:#AF6E28}
.lb-avatar{width:36px;height:36px;border-radius:50%;background:var(--bg);display:flex;justify-content:center;align-items:center}
.lb-avatar svg{width:22px;height:22px}
.lb-info{flex:1;min-width:0}
.lb-info-name{font-size:16px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lb-info-sub{font-size:12px;color:var(--text3)}
.lb-score{font-size:17px;font-weight:700;color:var(--accent)}
.lb-empty{padding:24px;text-align:center;color:var(--text3);font-size:14px}

/* Achievements */
.achievements-list{background:var(--card);border-radius:var(--r-lg);overflow:hidden;box-shadow:var(--shadow-sm)}
.ach-item{display:flex;align-items:center;padding:14px 16px;gap:12px;border-bottom:.5px solid var(--sep);transition:opacity .2s}
.ach-item:last-child{border-bottom:none}
.ach-item[data-locked="true"]{opacity:.35}
.ach-item[data-locked="false"]{opacity:1}
.ach-icon-wrap{width:40px;height:40px;flex-shrink:0;display:flex;justify-content:center;align-items:center}
.ach-svg{width:32px;height:32px}
.ach-info{flex:1;min-width:0}
.ach-name{font-size:15px;font-weight:600}
.ach-desc{font-size:13px;color:var(--text3);margin-top:1px}
.ach-check{width:22px;height:22px;opacity:0;transition:opacity .3s}
.ach-check svg{width:100%;height:100%}
.ach-item[data-locked="false"] .ach-check{opacity:1}

/* Profile */
.profile-card{display:flex;flex-direction:column;align-items:center;padding:28px 20px;background:var(--card);border-radius:var(--r-xl);box-shadow:var(--shadow-sm);gap:4px}
.profile-avatar{width:76px;height:76px;border-radius:50%;background:linear-gradient(135deg,#007AFF,#5856D6);display:flex;justify-content:center;align-items:center;margin-bottom:8px;overflow:hidden;box-shadow:0 4px 16px rgba(0,122,255,.2)}
.profile-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.avatar-placeholder{width:40px;height:40px}
.profile-name{font-size:22px;font-weight:700}
.profile-username{font-size:15px;color:var(--text2)}
.profile-badge{display:flex;align-items:center;gap:4px;padding:5px 14px;background:#FFF3E0;border-radius:20px;margin-top:6px}
.badge-text{font-size:13px;font-weight:600;color:var(--gold)}

.stats-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.stat-card{background:var(--card);border-radius:var(--r-md);padding:14px 6px;text-align:center;box-shadow:var(--shadow-sm);display:flex;flex-direction:column;align-items:center;gap:4px}
.stat-card.blue-card{background:var(--accent); color:#fff;}
.stat-card-icon{width:24px;height:24px}
.stat-card-icon svg{width:100%;height:100%}
.stat-card-val{font-size:22px;font-weight:800}
.stat-card-lbl{font-size:11px;color:var(--text3)}

.history-list{background:var(--card);border-radius:var(--r-lg);overflow:hidden;box-shadow:var(--shadow-sm)}
.history-item{display:flex;align-items:center;padding:13px 16px;gap:12px;border-bottom:.5px solid var(--sep)}
.history-item:last-child{border-bottom:none}
.history-rank{font-size:13px;font-weight:600;color:var(--text3);width:28px;text-align:center}
.history-score-val{font-size:17px;font-weight:700;flex:1}
.history-date{font-size:13px;color:var(--text3)}
.history-empty{display:flex;flex-direction:column;align-items:center;padding:32px;gap:12px}
.history-empty svg{width:48px;height:48px}
.history-empty p{font-size:14px;color:var(--text3)}

/* Referrals */
.ref-hero{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px}
.ref-hero h2{font-size:24px;font-weight:800}
.ref-hero-sub{font-size:15px;color:var(--accent);font-weight:500}
.ref-hero-icon-wrap{position:relative}

.ref-link-section{display:flex;flex-direction:column;gap:8px}
.ref-link-label{font-size:13px;color:var(--text2);font-weight:500;padding-left:4px}
.ref-link-box{display:flex;align-items:center;background:var(--card);border-radius:var(--r-md);padding:14px 14px;gap:10px;box-shadow:var(--shadow-sm)}
.ref-link-text{flex:1;font-size:14px;color:var(--text);font-weight:500;word-break:break-all;line-height:1.4}
.ref-copy-btn, .ref-share-btn {
    width: 38px; height: 38px; border-radius: 12px; border: none; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: transform 0.15s, background 0.15s; flex-shrink: 0;
}
.ref-copy-btn { background: var(--bg); color: var(--text2); }
.ref-copy-btn svg { width: 18px; height: 18px; }
.ref-copy-btn:active { background: var(--sep2); transform: scale(0.95); }

.ref-share-btn { background: #1C1C1E; color: #FFF; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.ref-share-btn svg { width: 18px; height: 18px; }
.ref-share-btn:active { transform: scale(0.95); }

.ref-balance-card{background:var(--card);border-radius:var(--r-xl);padding:28px;text-align:center;box-shadow:var(--shadow-sm)}
.ref-balance-val{font-size:52px;font-weight:800;letter-spacing:-2px}
.ref-balance-lbl{font-size:15px;color:var(--text2);margin-top:2px}

.ref-invite-btn{max-width:100%;padding:16px;border-radius:var(--r-lg)}
.ref-list{background:var(--card);border-radius:var(--r-lg);overflow:hidden;box-shadow:var(--shadow-sm)}
.ref-list-item{display:flex;align-items:center;padding:13px 16px;gap:12px;border-bottom:.5px solid var(--sep)}
.ref-list-item:last-child{border-bottom:none}
.ref-item-avatar{width:36px;height:36px;border-radius:50%;background:#F2F2F7;display:flex;justify-content:center;align-items:center}
.ref-item-avatar svg{width:20px;height:20px;color:#8E8E93}
.ref-item-name{flex:1;font-size:16px;font-weight:500}
.ref-item-date{font-size:13px;color:var(--text3)}
.ref-list-empty{display:flex;flex-direction:column;align-items:center;padding:32px;gap:12px}
.ref-list-empty svg{width:48px;height:48px}
.ref-list-empty p{font-size:14px;color:var(--text3);text-align:center}

/* ==============================================
   FLOATING PILL TAB BAR — Apple style
   ============================================== */
#tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 20px calc(var(--safe-b) + 12px);
    z-index: 1000;
    pointer-events: none;
}

.tab-bar-pill {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    max-width: 380px;
    height: 64px;
    background: var(--pill-bg);
    backdrop-filter: saturate(200%) blur(24px);
    -webkit-backdrop-filter: saturate(200%) blur(24px);
    border-radius: 32px;
    box-shadow: var(--shadow-pill);
    border: .5px solid rgba(0,0,0,.06);
    pointer-events: auto;
    padding: 0 6px;
}

.tab-bar-indicator {
    position: absolute;
    top: 6px;
    left: 6px;
    width: calc(25% - 3px);
    height: calc(100% - 12px);
    background: var(--accent10);
    border-radius: 26px;
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    z-index: 0;
}

.tab-btn {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    transition: all .2s;
}
.tab-btn:active { opacity: .5; }

.tab-icon {
    width: 22px;
    height: 22px;
    color: var(--text3);
    transition: color .25s;
}

.tab-label {
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    color: var(--text3);
    transition: color .25s;
}

.tab-btn.active .tab-icon { color: var(--accent); stroke-width: 2.5; }
.tab-btn.active .tab-label { color: var(--accent); font-weight: 700; }

/* Toast */
.toast{position:fixed;top:calc(var(--safe-t) + 16px);left:50%;transform:translateX(-50%) translateY(-100px);background:var(--card);color:var(--text);padding:12px 24px;border-radius:var(--r-md);font-size:15px;font-weight:500;box-shadow:var(--shadow-lg);z-index:9999;transition:transform .4s cubic-bezier(.34,1.56,.64,1);pointer-events:none}
.toast.visible{transform:translateX(-50%) translateY(0)}

/* Responsive */
@media(max-width:360px){
    .splash-title{font-size:28px}
    .stats-row{grid-template-columns:repeat(2,1fr)}
    .tab-bar-pill{height:58px}
}
@media(min-width:768px){
    .page-body{max-width:600px;margin:0 auto}
}

/* ===== NEW ELEMENTS ===== */
.play-top-bar {
    position: sticky; top: 0; z-index: 50;
    display: flex; justify-content: space-between; align-items: center;
    padding: calc(var(--safe-t) + 16px) 20px 12px;
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: .5px solid var(--sep);
}
.top-bar-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 15px; font-weight: 700; color: var(--text);
    background: var(--card); padding: 8px 12px; border-radius: var(--r-md);
    box-shadow: var(--shadow-sm); cursor: pointer;
}
.top-bar-item svg { width: 18px; height: 18px; }
.top-bar-item.gold { color: var(--gold); }

.modes-grid { display: flex; flex-direction: column; gap: 14px; }

.mode-card {
    position: relative;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--sep);
    border-radius: var(--r-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mode-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.mode-card:active {
    transform: scale(0.97);
}

/* Background Icons */
.mode-bg-svg {
    position: absolute;
    right: -15px;
    bottom: -15px;
    width: 90px;
    height: 90px;
    opacity: 0.05;
    pointer-events: none;
    transition: all 0.3s;
}

.mode-card:hover .mode-bg-svg {
    transform: scale(1.15) rotate(-10deg);
    opacity: 0.12;
}

/* Free Mode */
.mode-card.free-mode {
    border: 1.5px solid rgba(0, 122, 255, 0.15);
    background: linear-gradient(180deg, var(--card) 0%, rgba(0, 122, 255, 0.02) 100%);
}

.mode-card.free-mode .mode-bg-svg {
    color: var(--accent);
}

.mode-card.free-mode:hover {
    border-color: rgba(0, 122, 255, 0.4);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.08);
}

/* Premium Mode */
.mode-card.premium-mode {
    border: 1.5px solid rgba(255, 149, 0, 0.2);
    background: linear-gradient(180deg, var(--card) 0%, rgba(255, 149, 0, 0.03) 100%);
}

.mode-card.premium-mode .mode-bg-svg {
    color: var(--gold);
}

.mode-card.premium-mode:hover {
    border-color: rgba(255, 149, 0, 0.5);
    box-shadow: 0 8px 24px rgba(255, 149, 0, 0.12);
}

/* Ultra Mode */
.mode-card.ultra-mode {
    background: linear-gradient(135deg, #1C0A35 0%, #3D1263 50%, #6E1A8B 100%);
    border: 1.5px solid rgba(110, 26, 139, 0.3);
    box-shadow: 0 6px 20px rgba(110, 26, 139, 0.25);
}

.mode-card.ultra-mode .mode-bg-svg {
    color: #FF007F;
    opacity: 0.15;
}

.mode-card.ultra-mode:hover .mode-bg-svg {
    opacity: 0.28;
}

.mode-card.ultra-mode:hover {
    border-color: rgba(255, 0, 127, 0.5);
    box-shadow: 0 12px 30px rgba(110, 26, 139, 0.4);
}

.mode-card.ultra-mode .mode-title {
    color: #FFF;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.mode-card.ultra-mode .mode-sub {
    color: rgba(255, 255, 255, 0.7);
}

/* Mode Icon Badges */
.mode-icon {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    align-self: flex-start;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.mode-icon.free {
    background: rgba(0, 122, 255, 0.12);
    color: var(--accent);
}

.mode-icon.cost {
    background: rgba(255, 149, 0, 0.15);
    color: var(--gold);
}

.mode-card.ultra-mode .mode-icon.cost {
    background: rgba(255, 255, 255, 0.2);
    color: #FFF;
}

.mode-title { font-size: 17px; font-weight: 700; }
.mode-sub { font-size: 13px; color: var(--text2); }

/* How To Play Banner */
.how-to-play-banner {
    background: linear-gradient(135deg, #0A84FF 0%, #5E5CE6 100%);
    border-radius: var(--r-md);
    padding: 16px 20px;
    margin-top: 16px;
    color: #FFF;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(10, 132, 255, 0.25);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.how-to-play-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(10, 132, 255, 0.35);
}

.how-to-play-banner:active {
    transform: scale(0.98);
}

.htp-banner-title {
    font-weight: 700;
    font-size: 16px;
}

.htp-banner-sub {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 2px;
}

.htp-banner-arrow {
    background: rgba(255, 255, 255, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s;
}

.how-to-play-banner:hover .htp-banner-arrow {
    transform: translateX(4px);
}

/* Shop Card Styling */
.shop-card {
    background: var(--card);
    border: 1px solid var(--sep);
    border-radius: var(--r-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.shop-icon-container {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(0, 122, 255, 0.1);
    color: var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    box-shadow: inset 0 0 8px rgba(0, 122, 255, 0.1);
}

.shop-shield-svg {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 2px 4px rgba(0, 122, 255, 0.2));
}

.shop-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shop-title {
    font-size: 16px;
    font-weight: 700;
}

.shop-desc {
    font-size: 12px;
    color: var(--text2);
    line-height: 1.3;
}

.shop-stats-container {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.shop-stat-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
}

.shop-stat-badge.balance {
    background: rgba(255, 149, 0, 0.1);
    color: var(--gold);
}

.shop-stat-badge.owned {
    background: rgba(0, 122, 255, 0.1);
    color: var(--accent);
}

.btn-buy {
    background: var(--gold);
    color: #FFF;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 149, 0, 0.2);
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-buy:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(255, 149, 0, 0.3);
}

.btn-buy:active {
    transform: scale(0.96);
}

.toggle-shield {
    position: relative; display: inline-block; width: 44px; height: 24px;
}
.toggle-shield input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc; transition: .4s; border-radius: 24px;
}
.slider:before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

.profile-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.btn-action {
    background: var(--card); border: none; padding: 16px; border-radius: var(--r-md);
    font-size: 16px; font-weight: 600; color: var(--text); box-shadow: var(--shadow-sm);
    cursor: pointer; text-align: left; display: flex; align-items: center; gap: 10px;
}
.btn-action:active { background: var(--sep); }

.profile-season-reward { font-size: 14px; color: var(--text2); margin-top: 6px; font-weight: 500; }
.gold-text { color: var(--gold); font-weight: 700; }

.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000;
    display: flex; justify-content: center; align-items: flex-end;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-card {
    background: var(--bg); width: 100%; height: 85vh;
    border-radius: 24px 24px 0 0; display: flex; flex-direction: column;
    transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
.modal-overlay.active .modal-card { transform: translateY(0); }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px; border-bottom: 1px solid var(--sep); background: var(--card); border-radius: 24px 24px 0 0;
}
.modal-header h3 { font-size: 20px; font-weight: 800; }
.modal-close {
    background: var(--sep); border: none; width: 30px; height: 30px; border-radius: 15px;
    display: flex; justify-content: center; align-items: center; font-size: 20px; color: var(--text2); cursor: pointer;
}
.modal-body { flex: 1; overflow-y: auto; padding: 20px; padding-bottom: calc(var(--safe-b) + 20px); }

/* Upgraded Season Timer */
.season-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.05) 0%, rgba(94, 92, 230, 0.05) 100%);
    border: 1px solid var(--sep);
    border-radius: var(--r-md);
    margin-top: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.season-timer #season-end-time {
    color: var(--accent);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.play-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: calc(var(--safe-t) + 30px) 16px 16px;
    z-index: 40;
    pointer-events: none;
}
.play-top-bar > * { pointer-events: auto; }

/* ==============================================
   LEADERBOARD PODIUM AND LIST STYLING
   ============================================== */
.leaderboard-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    margin: 24px 0 28px;
    padding: 14px 10px;
    background: var(--card);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--sep);
}

.podium-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 4px;
    border-radius: var(--r-md);
    background: transparent;
    transition: transform 0.2s;
    position: relative;
    max-width: 105px;
    height: 160px;
}

.podium-item.empty {
    visibility: hidden;
}

.podium-item.first {
    padding-top: 16px;
    z-index: 10;
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.08) 0%, transparent 100%);
    border: 1px solid rgba(255, 215, 0, 0.25);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.08);
    height: 180px;
}

.podium-item.second {
    background: linear-gradient(180deg, rgba(142, 142, 147, 0.05) 0%, transparent 100%);
    border: 1px solid rgba(142, 142, 147, 0.15);
}

.podium-item.third {
    background: linear-gradient(180deg, rgba(175, 110, 40, 0.05) 0%, transparent 100%);
    border: 1px solid rgba(175, 110, 40, 0.15);
}

.podium-item.second { order: 1; }
.podium-item.first { order: 2; }
.podium-item.third { order: 3; }

.podium-avatar-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.podium-crown {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 22px;
    animation: crownGlow 2s ease-in-out infinite alternate;
}

@keyframes crownGlow {
    0% { transform: translateX(-50%) scale(1) rotate(-5deg); }
    100% { transform: translateX(-50%) scale(1.15) rotate(5deg); }
}

.podium-avatar-circle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--sep);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.podium-item.first .podium-avatar-circle {
    width: 70px;
    height: 70px;
    border-color: #FFD700;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.3);
}

.podium-item.second .podium-avatar-circle {
    border-color: #C0C0C0;
    box-shadow: 0 0 12px rgba(192, 192, 192, 0.2);
}

.podium-item.third .podium-avatar-circle {
    border-color: #CD7F32;
    box-shadow: 0 0 12px rgba(205, 127, 50, 0.2);
}

.podium-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.podium-avatar-svg {
    width: 30px;
    height: 30px;
    color: var(--text3);
}
.podium-avatar-svg.is-you-color {
    color: var(--accent);
}

.podium-rank-badge {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text);
    color: var(--card);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1.5px solid var(--card);
}

.podium-item.first .podium-rank-badge { background: #FFD700; color: #000; }
.podium-item.second .podium-rank-badge { background: #C0C0C0; color: #000; }
.podium-item.third .podium-rank-badge { background: #CD7F32; color: #FFF; }

.podium-name {
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.podium-score {
    font-size: 15px;
    font-weight: 800;
    color: var(--accent);
    margin-top: 2px;
}

.podium-prize-badge {
    margin-top: 6px;
    padding: 3px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 3px;
    max-width: none;
    white-space: nowrap;
}

.podium-prize-badge.gram {
    background: rgba(0, 152, 234, 0.1);
    color: #0098EA;
    border: 0.5px solid rgba(0, 152, 234, 0.2);
}

.podium-prize-badge.general {
    background: rgba(255, 149, 0, 0.1);
    color: var(--gold);
    border: 0.5px solid rgba(255, 149, 0, 0.2);
}

.ton-mini-logo {
    width: 11px;
    height: 11px;
    object-fit: contain;
}

.leaderboard-list-container {
    background: var(--card);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--sep);
    margin-top: 12px;
}

.lb-preview-item.list-item {
    transition: background-color 0.2s;
}

.lb-preview-item.list-item:hover {
    background-color: var(--card-hover);
}

.lb-list-prize-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

.lb-list-prize-badge.gram {
    background: rgba(0, 152, 234, 0.08);
    color: #0098EA;
}

.lb-list-prize-badge.general {
    background: rgba(255, 149, 0, 0.08);
    color: var(--gold);
}

.ton-mini-logo-inline {
    width: 11px;
    height: 11px;
    object-fit: contain;
}

/* Premium Skin Card Equip Accent */
.skin-card.equipped {
    border: 1.5px solid var(--gold) !important;
    background: linear-gradient(180deg, var(--card) 0%, rgba(255,149,0,0.04) 100%) !important;
}
.skin-preview-container {
    background: radial-gradient(circle, rgba(0,122,255,0.08) 0%, transparent 70%);
    transition: transform 0.2s;
}
.skin-card:hover .skin-preview-container {
    transform: scale(1.12);
}
