/* ═══════════════════════════════════════════════════════════════════════
   Sky Soarer – Full Stylesheet  (enhanced edition)
   Source file – Use style.min.css in production
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    --primary:       #f1c40f;
    --secondary:     #e67e22;
    --accent:        #e74c3c;
    --bg:            #3498db;
    --text:          #ecf0f1;
    --overlay-bg:    rgba(0,0,0,.85);
    --font:          'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --golden:        #f1c40f;
    --flame:         #e67e22;
    --royal:         #3498db;
    --wise:          #95a5a6;
    --radius:        12px;
    --success:       #2ecc71;
    --zen:           #9b59b6;

    /* Legacy aliases kept for backward compat */
    --primary-color:   var(--primary);
    --secondary-color: var(--secondary);
    --accent-color:    var(--accent);
    --bg-color:        var(--bg);
    --text-color:      var(--text);
    --overlay-bg-old:  var(--overlay-bg);
    --font-family:     var(--font);
    --golden-dove:     var(--golden);
    --flame-phoenix:   var(--flame);
    --royal-peacock:   var(--royal);
    --wise-owl:        var(--wise);
    --border-radius:   var(--radius);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    font-family: var(--font);
    background-color: #1a1a2e;
    color: var(--text);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

/* ── Top Ad Bar ── */
#ad-top-bar {
    width: 100%;
    min-height: 50px;
    background: #0d0d1a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-bottom: 1px solid #2a2a4a;
    overflow: hidden;
}
.ad-label {
    font-size: .65rem;
    color: #444;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ── Game Wrapper (canvas + sidebars) ── */
#game-wrapper {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    flex: 1;
    overflow: hidden;
}

/* ── Sidebar Ads ── */
.ad-sidebar {
    width: 0;
    background: #0d0d1a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    transition: width .3s;
}
@media (min-width: 860px) {
    .ad-sidebar { width: 160px; }
}
.ad-placeholder-sidebar {
    color: #333;
    font-size: .7rem;
    text-align: center;
    letter-spacing: 1px;
    padding: 8px;
}
.ad-placeholder-rect {
    width: 300px;
    height: 150px;
    background: rgba(255,255,255,.06);
    border: 1px dashed #444;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: .8rem;
    text-align: center;
    padding: 8px;
}
.ad-game-over-slot {
    margin: 8px 0;
    display: flex;
    justify-content: center;
}

/* ── Main Game Container ── */
#game-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 100%;
    background-color: var(--bg);
    box-shadow: 0 0 30px rgba(0,0,0,.6);
    overflow: hidden;
    contain: layout style;
    flex-shrink: 0;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 100%);
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#ui-layer div, #ui-layer button {
    pointer-events: auto;
}

.overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    opacity: 1;
    transition: opacity .3s ease;
    text-align: center;
    padding: 10px 14px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}
.overlay::-webkit-scrollbar { width: 4px; }
.overlay::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.hidden {
    display: none !important;
}

.game-title {
    font-size: 2.4rem;
    background: linear-gradient(90deg, #f1c40f, #e67e22, #f1c40f, #ffe07a, #e67e22);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: .4rem;
    text-shadow: none;
    letter-spacing: 4px;
    flex-shrink: 0;
    animation: shimmerTitle 3.5s linear infinite;
}
@keyframes shimmerTitle {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}
}

/* ── Section Label ── */
.section-label {
    font-size: .7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: .65;
    margin: 6px 0 5px;
    align-self: flex-start;
    padding-left: 2px;
}

.character-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .5rem;
    width: 100%;
    margin: 0 auto 6px;
}

.character {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: var(--radius);
    background: rgba(255,255,255,.07);
    border: 2px solid transparent;
    transition: border-color .2s, background .2s, transform .15s;
}
.character:hover  { background: rgba(255,255,255,.12); transform: translateY(-1px); }
.character.active { background: rgba(255,255,255,.18); }

/* Per-type active border colours */
.character.active[data-type="golden"] { border-color: #f1c40f; box-shadow: 0 0 10px rgba(241,196,15,.35); }
.character.active[data-type="flame"]  { border-color: #ff6a00; box-shadow: 0 0 10px rgba(255,106,0,.35); }
.character.active[data-type="royal"]  { border-color: #00bcd4; box-shadow: 0 0 10px rgba(0,188,212,.35); }
.character.active[data-type="wise"]   { border-color: #90a4ae; box-shadow: 0 0 10px rgba(144,164,174,.35); }

.char-preview {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    margin-bottom: 5px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border: 3px solid transparent;
    transition: transform .2s, box-shadow .2s;
}
.character:hover .char-preview  { transform: scale(1.1); }
.character.active .char-preview { transform: scale(1.08); }

.char-preview.golden {
    background: radial-gradient(circle at 38% 35%, #ffe566, #f1c40f 55%, #c9900a);
    border-color: #fff8;
    box-shadow: 0 0 12px rgba(241,196,15,.65), 0 0 24px rgba(241,196,15,.25);
}
.char-preview.golden::after  { content: '🕊️'; }

.char-preview.flame {
    background: radial-gradient(circle at 38% 35%, #ffcc00, #ff6a00 50%, #c0390a);
    border-color: rgba(255,180,50,.5);
    box-shadow: 0 0 12px rgba(255,100,0,.7), 0 0 24px rgba(255,100,0,.3);
}
.char-preview.flame::after   { content: '🦅'; }

.char-preview.royal {
    background: radial-gradient(circle at 38% 35%, #80deea, #0288d1 50%, #01579b);
    border-color: rgba(100,230,255,.45);
    box-shadow: 0 0 12px rgba(0,200,255,.65), 0 0 24px rgba(0,200,255,.25);
}
.char-preview.royal::after   { content: '🦚'; }

.char-preview.wise {
    background: radial-gradient(circle at 38% 35%, #eceff1, #90a4ae 50%, #546e7a);
    border-color: rgba(200,220,230,.4);
    box-shadow: 0 0 12px rgba(150,180,200,.55), 0 0 20px rgba(150,180,200,.2);
}
.char-preview.wise::after    { content: '🦉'; }
.character span  { font-size: .7rem; font-weight: bold; display: block; }
.character small { font-size: .6rem; opacity: .6; }

.main-btn {
    padding: .7rem 2.4rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    background-color: var(--secondary);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,.3);
    margin: 6px 0 8px;
    flex-shrink: 0;
    transition: transform .15s, box-shadow .15s;
}
.main-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.pulse-btn {
    animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%,100% { box-shadow: 0 0 10px rgba(230,126,34,.4); }
    50%      { box-shadow: 0 0 24px rgba(230,126,34,.85); }
}
.text-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    margin: 4px 0;
    cursor: pointer;
    opacity: .8;
    transition: opacity .15s;
}
.text-btn:hover { opacity: 1; }
.small-btn { font-size: .8rem !important; padding: 4px 8px; }

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    padding: 8px 12px 4px;
    display: flex;
    flex-direction: column;
    z-index: 5;
    pointer-events: none;
}
#hud button { pointer-events: auto; }

/* Timer bar */
#timer-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,.15);
    border-radius: 3px;
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}
#timer-bar {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #f1c40f, #e74c3c);
    border-radius: 3px;
    width: 100%;
    transition: width .5s linear;
    transform-origin: left;
}
#timer-text {
    position: absolute;
    right: 4px;
    top: -1px;
    font-size: .65rem;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

.hud-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}
.hud-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 2px;
}

.hud-left, .hud-right {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hud-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hud-right { align-items: flex-end; }

/* Lives */
.lives-display { display: flex; gap: 2px; align-items: center; }
.life-icon { font-size: .9rem; }

/* Coins */
.coins-display {
    background: rgba(0,0,0,.25);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: .8rem;
    font-weight: bold;
    color: #f1c40f;
}

/* Mode badge */
.mode-badge {
    font-size: .6rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,.15);
    color: #fff;
    margin-top: 2px;
}

.score-container {
    background: rgba(0,0,0,.3);
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.1);
}
.score-label {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: .7;
}
#score {
    font-size: 2rem;
    font-weight: bold;
    display: block;
    line-height: 1;
}

.combo-container {
    animation: pulse-combo 0.5s ease-out;
    background: linear-gradient(135deg, #f1c40f, #e67e22);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 10px;
}

@keyframes pulse-combo {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

.level-indicator {
    font-size: .85rem;
    font-weight: bold;
    color: var(--primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ── Zen Level Progress Bar ────────────────────────────────────────────── */
#zen-progress-container {
    width: 100%;
    margin-bottom: 3px;
}
.zen-prog-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .65rem;
    font-weight: bold;
    letter-spacing: .8px;
    color: rgba(255,255,255,.85);
    margin-bottom: 2px;
    padding: 0 1px;
}
.zen-ad-badge {
    background: rgba(155,89,182,.35);
    border: 1px solid rgba(195,155,211,.3);
    border-radius: 8px;
    padding: 1px 8px;
    color: #c39bd3;
    font-size: .62rem;
    letter-spacing: .5px;
}
#zen-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,.12);
    border-radius: 3px;
    overflow: hidden;
}
#zen-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6a0572, #9b59b6, #c39bd3);
    border-radius: 3px;
    transition: width .22s ease;
    box-shadow: 0 0 6px rgba(155,89,182,.7);
}

.stats-mini {
    font-size: .7rem;
    opacity: .7;
}

.icon-btn {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.12);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin: 3px;
    backdrop-filter: blur(10px);
}
.icon-btn:active { transform: scale(.92); }

.achievements-unlocked {
    margin: 1rem 0;
    max-height: 100px;
    overflow-y: auto;
}

.achievement-item {
    background: rgba(241, 196, 15, 0.2);
    padding: 5px 10px;
    margin: 5px 0;
    border-radius: 5px;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.settings-panel {
    background: rgba(0,0,0,.3);
    padding: 1rem 1.2rem;
    border-radius: 18px;
    margin: 6px 0;
    max-width: 400px;
    width: 95%;
}

.setting-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: .7rem 0;
    padding: .4rem 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.setting-group label {
    font-size: 1rem;
    font-weight: 500;
}

.toggle-btn {
    width: 50px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    border: 2px solid rgba(255,255,255,0.3);
}

.toggle-btn.active {
    background: var(--secondary-color);
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: left 0.3s ease;
}

.toggle-btn.active .toggle-slider {
    left: 24px;
}

.difficulty-select {
    display: flex;
    gap: 0.5rem;
}

.diff-btn {
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    background: transparent;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.diff-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    margin: 6px 0;
    width: 100%;
}

.stat-card {
    background: rgba(0,0,0,.28);
    padding: .7rem .4rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255,255,255,.08);
}
.stat-label {
    display: block;
    font-size: .6rem;
    opacity: .65;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: .25rem;
}
.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary);
}

.leaderboard {
    margin: 6px 0;
    width: 100%;
    background: rgba(0,0,0,.28);
    padding: .8rem 1rem;
    border-radius: 14px;
    max-height: 180px;
    overflow-y: auto;
}
.leaderboard h3 { color: var(--primary); margin-bottom: .5rem; font-size: 1rem; }
.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    padding: .3rem 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
    font-size: .82rem;
}

@media (max-width: 480px) {
    .game-title  { font-size: 1.9rem; }
    .main-btn    { font-size: 1rem; padding: .6rem 1.8rem; }
    .icon-btn    { width: 34px; height: 34px; font-size: 1rem; }
    .stats-grid  { grid-template-columns: repeat(2, 1fr); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
.overlay { animation: fadeIn .25s ease; }

/* ═══════════════════════════════════════════════════════
   TAB NAVIGATION
   ═══════════════════════════════════════════════════════ */
.tab-nav {
    display: flex;
    gap: .4rem;
    margin: 4px 0 6px;
    background: rgba(0,0,0,.25);
    border-radius: 20px;
    padding: 3px;
    width: 100%;
    max-width: 320px;
}
.tab-btn {
    flex: 1;
    padding: .35rem .5rem;
    border-radius: 16px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,.6);
    font-size: .75rem;
    font-weight: bold;
    cursor: pointer;
    transition: background .2s, color .2s;
    letter-spacing: .5px;
}
.tab-btn.active {
    background: var(--secondary);
    color: #fff;
}
.tab-content { display: none; width: 100%; }
.tab-content.active { display: flex; flex-direction: column; align-items: center; }

/* ═══════════════════════════════════════════════════════
   GAME MODE CARDS
   ═══════════════════════════════════════════════════════ */
.mode-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .4rem;
    width: 100%;
    margin: 0 0 6px;
}
.mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    border-radius: 10px;
    background: rgba(255,255,255,.07);
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.mode-card.active {
    border-color: #f1c40f;
    background: rgba(241,196,15,.15);
}
.mode-icon  { font-size: 1.4rem; line-height: 1; }
.mode-name  { font-size: .65rem; font-weight: bold; margin: 3px 0 1px; }
.mode-card small { font-size: .55rem; opacity: .6; line-height: 1.2; text-align: center; }

/* Mode badge colours */
.mode-badge.mode-classic    { background: rgba(52,152,219,.3); }
.mode-badge.mode-timeattack { background: rgba(241,196,15,.3); color: #f1c40f; }
.mode-badge.mode-survival   { background: rgba(231,76,60,.3);  color: #e74c3c; }
.mode-badge.mode-zen        { background: rgba(155,89,182,.3); color: #9b59b6; }

/* ═══════════════════════════════════════════════════════
   PLAYER NAME INPUT
   ═══════════════════════════════════════════════════════ */
.name-input-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: rgba(0,0,0,.25);
    border-radius: 20px;
    padding: 5px 12px;
    width: 100%;
    max-width: 320px;
    margin: 4px 0 6px;
}
.name-input-row label { font-size: .8rem; opacity: .7; white-space: nowrap; }
#player-name-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: .9rem;
    outline: none;
    min-width: 0;
}
#player-name-input::placeholder { opacity: .4; }

/* ═══════════════════════════════════════════════════════
   SCORE BAR ROW + PLAY FOOTER BADGES
   ═══════════════════════════════════════════════════════ */
/* Play Tab — Stats Footer Badges */
.play-footer-badges {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 360px;
    background: rgba(0,0,0,.28);
    border-radius: 14px;
    padding: .5rem .4rem;
    margin: .5rem 0 .2rem;
    gap: .2rem;
}
.pf-badge {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex: 1;
    justify-content: center;
}
.pf-icon { font-size: 1rem; line-height: 1; }
.pf-badge > div { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.pf-val  { font-size: .9rem; font-weight: 700; color: var(--primary); }
.pf-lbl  { font-size: .54rem; opacity: .55; text-transform: uppercase; letter-spacing: .4px; }

/* Global LB offline / personal records notice */
.lb-offline-notice {
    font-size: .72rem;
    color: rgba(255,255,255,.38);
    text-align: center;
    padding: .3rem 0 .45rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    margin-bottom: .3rem;
}

.score-bar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 320px;
    font-size: .85rem;
    opacity: .85;
}

/* ═══════════════════════════════════════════════════════
   GLOBAL LEADERBOARD (tab)
   ═══════════════════════════════════════════════════════ */
.mode-filter-row {
    display: flex;
    gap: .3rem;
    margin: 4px 0 6px;
    width: 100%;
}
.mode-filter-btn {
    flex: 1;
    padding: .3rem .2rem;
    border: 1px solid rgba(255,255,255,.2);
    background: transparent;
    color: rgba(255,255,255,.6);
    border-radius: 8px;
    cursor: pointer;
    font-size: .7rem;
    font-weight: bold;
    transition: all .2s;
}
.mode-filter-btn.active {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
}
.global-lb-container {
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0,0,0,.28);
    border-radius: 12px;
    padding: .6rem;
}
.lb-loading  { color: rgba(255,255,255,.4); font-size: .85rem; padding: 1rem; text-align: center; }
.lb-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .3rem .2rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    font-size: .78rem;
}
.lb-rank  { width: 24px; color: var(--primary); font-weight: bold; }
.lb-name  { flex: 1; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-weight: bold; color: var(--primary); }
.lb-flag  { margin-left: 4px; }
.lb-rank.gold   { color: #ffd700; }
.lb-rank.silver { color: #c0c0c0; }
.lb-rank.bronze { color: #cd7f32; }
.global-summary {
    display: flex;
    justify-content: space-between;
    width: 100%;
    background: rgba(0,0,0,.2);
    border-radius: 10px;
    padding: .5rem .8rem;
    font-size: .78rem;
    margin-top: 6px;
    gap: .5rem;
}

/* Personal Stats Grid */
.personal-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .35rem;
    width: 100%;
    margin-bottom: .5rem;
}
.ps-card {
    background: rgba(0,0,0,.28);
    border-radius: 10px;
    padding: .5rem .3rem .4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
}
.ps-icon  { font-size: 1.1rem; }
.ps-val   { font-size: 1.1rem; font-weight: bold; color: var(--primary); line-height: 1; }
.ps-label { font-size: .55rem; opacity: .6; text-transform: uppercase; letter-spacing: .4px; }

/* Mode Stats Rows */
.mode-stats-rows { width: 100%; margin-bottom: .4rem; }
.mode-stat-row {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .22rem .1rem;
    font-size: .78rem;
}
.ms-icon  { width: 18px; text-align: center; flex-shrink: 0; }
.ms-name  { width: 68px; flex-shrink: 0; }
.ms-bar-wrap {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,.1);
    border-radius: 3px;
    overflow: hidden;
}
.ms-bar   { height: 100%; background: var(--secondary); border-radius: 3px; width: 0; transition: width .6s ease; }
.ms-count { font-size: .72rem; color: var(--primary); width: 22px; text-align: right; flex-shrink: 0; }
.your-location-card {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: rgba(52,152,219,.18);
    border: 1px solid rgba(52,152,219,.4);
    border-radius: 10px;
    padding: .5rem .8rem;
    font-size: .82rem;
    margin-bottom: .5rem;
    animation: fadeIn .4s ease;
}
.your-location-card span:first-child { font-size: 1.3rem; }

.traffic-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.refresh-btn {
    background: rgba(255,255,255,.1);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: .9rem;
    padding: .2rem .5rem;
    cursor: pointer;
    transition: background .2s;
}
.refresh-btn:hover { background: rgba(255,255,255,.2); }
.refresh-btn.spinning { animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.traffic-last-updated {
    font-size: .6rem;
    opacity: .4;
    text-align: right;
    margin-top: 3px;
}

.countries-container {
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0,0,0,.28);
    border-radius: 12px;
    padding: .5rem;
}
.country-entry {
    display: flex;
    align-items: center;
    padding: .3rem .3rem;
    border-bottom: 1px solid rgba(255,255,255,.05);
    font-size: .78rem;
    gap: .4rem;
}
.country-entry.is-you { background: rgba(52,152,219,.15); border-radius: 6px; }
.country-flag  { font-size: 1rem; width: 24px; text-align: center; flex-shrink: 0; }
.country-name  { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-bar-wrap {
    width: 55px;
    height: 5px;
    background: rgba(255,255,255,.12);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}
.country-bar   { height: 100%; background: var(--secondary); border-radius: 3px; transition: width .6s ease; }
.country-pct   { font-size: .66rem; color: rgba(255,255,255,.45); width: 30px; text-align: right; flex-shrink: 0; }
.country-visits { font-size: .7rem; color: var(--primary); width: 28px; text-align: right; flex-shrink: 0; }

.visit-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .4rem;
    width: 100%;
    margin-top: 4px;
}
.vs-card {
    background: rgba(0,0,0,.28);
    border-radius: 10px;
    padding: .6rem .4rem;
    text-align: center;
    position: relative;
}
.vs-label { display: block; font-size: .6rem; opacity: .6; text-transform: uppercase; letter-spacing: .5px; margin-bottom: .2rem; }
.vs-val   { display: block; font-size: 1.4rem; font-weight: bold; color: var(--primary); }
.vs-trend {
    display: block;
    font-size: .62rem;
    margin-top: .1rem;
    letter-spacing: .3px;
}
.vs-trend.up   { color: #2ecc71; }
.vs-trend.down { color: #e74c3c; }
.vs-trend.flat { color: rgba(255,255,255,.4); }

/* ═══════════════════════════════════════════════════════
   DAILY MISSION
   ═══════════════════════════════════════════════════════ */
.daily-mission-card {
    background: rgba(0,0,0,.3);
    border-radius: 18px;
    padding: 1.5rem;
    width: 90%;
    max-width: 320px;
    margin: .5rem 0 1rem;
    border: 1px solid rgba(255,255,255,.1);
}
.dm-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.dm-desc { font-size: 1rem; font-weight: bold; margin-bottom: .8rem; }
.dm-progress-wrap {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,.12);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: .4rem;
}
.dm-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 4px;
    transition: width .4s ease;
}
.dm-progress-text { font-size: .85rem; opacity: .7; }
.dm-reward {
    margin-top: .8rem;
    color: var(--primary);
    font-weight: bold;
    font-size: 1rem;
    animation: fadeIn .5s ease;
}

/* ═══════════════════════════════════════════════════════
   GAME OVER ENHANCEMENTS
   ═══════════════════════════════════════════════════════ */
.final-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .4rem;
    width: 100%;
    margin: .5rem 0;
}
.fs-card {
    background: rgba(0,0,0,.28);
    border-radius: 10px;
    padding: .5rem .3rem;
    text-align: center;
}
.fs-label { display: block; font-size: .6rem; opacity: .6; text-transform: uppercase; letter-spacing: .5px; }
.fs-val   { display: block; font-size: 1.2rem; font-weight: bold; color: var(--primary); }

.rank-banner {
    background: linear-gradient(135deg, rgba(241,196,15,.25), rgba(230,126,34,.25));
    border: 1px solid rgba(241,196,15,.4);
    border-radius: 10px;
    padding: .5rem 1rem;
    font-size: .85rem;
    margin: .4rem 0;
    width: 100%;
}

.continue-container {
    background: rgba(231,76,60,.15);
    border: 1px solid rgba(231,76,60,.4);
    border-radius: 12px;
    padding: .6rem 1rem;
    margin: .4rem 0;
    width: 100%;
    text-align: center;
}
.continue-label { font-size: .78rem; opacity: .8; margin-bottom: .5rem; }
.continue-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: .5rem 1.2rem;
    cursor: pointer;
    font-size: .85rem;
    font-weight: bold;
    transition: opacity .2s;
}
.continue-btn:hover { opacity: .85; }

.end-btn-row {
    display: flex;
    gap: .5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: .3rem;
}

/* ═══════════════════════════════════════════════════════
   PAUSE SCREEN
   ═══════════════════════════════════════════════════════ */
#pause-screen h2 { margin-top: 2rem; }
.pause-stats {
    display: flex;
    gap: 1.5rem;
    background: rgba(0,0,0,.25);
    border-radius: 12px;
    padding: .5rem 1rem;
    font-size: .9rem;
    margin: .8rem 0;
}

/* ═══════════════════════════════════════════════════════
   LEVEL-UP NOTIFICATION
   ═══════════════════════════════════════════════════════ */
.level-up-notif {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: #fff;
    font-size: 1.4rem;
    font-weight: bold;
    padding: .6rem 1.8rem;
    border-radius: 30px;
    z-index: 20;
    pointer-events: none;
    animation: levelUpAnim 1.6s ease forwards;
    white-space: nowrap;
}
@keyframes levelUpAnim {
    0%   { opacity: 0; transform: translateX(-50%) scale(.6); }
    15%  { opacity: 1; transform: translateX(-50%) scale(1.1); }
    70%  { opacity: 1; transform: translateX(-50%) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(.9); }
}

/* ═══════════════════════════════════════════════════════
   ACHIEVEMENTS
   ═══════════════════════════════════════════════════════ */
.achievements-unlocked {
    margin: .3rem 0;
    max-height: 80px;
    overflow-y: auto;
    width: 100%;
}
.achievement-item {
    background: rgba(241,196,15,.18);
    padding: 3px 10px;
    margin: 3px 0;
    border-radius: 6px;
    color: var(--primary);
    font-size: .82rem;
}

/* ═══════════════════════════════════════════════════════
   COMBO
   ═══════════════════════════════════════════════════════ */
.combo-container {
    animation: pulse-combo .5s ease-out;
    background: linear-gradient(135deg, #f1c40f, #e67e22);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    font-size: 1rem;
    margin-top: 4px;
}
@keyframes pulse-combo {
    0%   { transform: scale(.5); opacity: 0; }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════
   DEFAULT AD BANNERS (shown when AdSense is inactive)
   Hidden automatically by JS when AdSense is active.
   ═══════════════════════════════════════════════════════ */
.default-ad-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: linear-gradient(135deg, #1a1240 0%, #2d1b69 100%);
    border: 1px solid rgba(155,89,182,.45);
    border-radius: 8px;
    color: #ecf0f1;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    overflow: hidden;
    position: relative;
}
.default-ad-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(155,89,182,.5);
    border-color: #9b59b6;
}
/* ── TOP BANNER (728×90 / 320×50) ── */
.default-ad-top {
    width: 100%;
    height: 50px;
    gap: 8px;
    padding: 0 14px;
    border-radius: 0;
    border-width: 0 0 1px 0;
}
.default-ad-top .dab-bird    { font-size: 1.4rem; flex-shrink: 0; }
.default-ad-top .dab-text    { font-size: .7rem; color: #bdc3c7; flex: 1; line-height: 1.4; }
.default-ad-top .dab-text strong { color: #f1c40f; }
.default-ad-top .dab-cta-btn {
    background: #9b59b6;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .7rem;
    white-space: nowrap;
    flex-shrink: 0;
}
/* ── SIDEBAR (160×600) ── */
.default-ad-sidebar {
    width: 150px;
    min-height: 200px;
    flex-direction: column;
    gap: 8px;
    padding: 16px 8px;
    text-align: center;
    border-radius: 6px;
}
.dab-sidebar-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dab-bird-big   { font-size: 2rem; }
.dab-title      { font-size: .9rem; font-weight: 700; color: #f1c40f; }
.dab-subtitle   { font-size: .7rem; color: #bdc3c7; }
.dab-price-big  { font-size: 1.5rem; font-weight: 700; color: #2ecc71; margin: 4px 0; }
.dab-cta-sidebar {
    background: #9b59b6;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .72rem;
    margin-top: 4px;
}
/* ── RECTANGLE 300×250 (game over, zen) ── */
.default-ad-rect {
    width: 300px;
    height: 200px;
    flex-direction: column;
    gap: 7px;
    text-align: center;
    padding: 16px;
    border-radius: 8px;
}
.dab-rect-bird  { font-size: 2.2rem; }
.dab-rect-title { font-size: 1rem; font-weight: 700; color: #f1c40f; }
.dab-rect-sub   { font-size: .75rem; color: #bdc3c7; line-height: 1.4; }
.dab-rect-price { font-size: 1.5rem; font-weight: 700; color: #2ecc71; margin: 3px 0; }
.dab-rect-cta {
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
    color: #fff;
    padding: 7px 18px;
    border-radius: 20px;
    font-size: .78rem;
    margin-top: 2px;
}
/* ── MINI BANNER 320×50 (zen slot 3) ── */
.default-ad-mini {
    width: 300px;
    height: 48px;
    gap: 8px;
    padding: 0 10px;
    border-radius: 6px;
}
.default-ad-mini .dab-text   { font-size: .68rem; color: #bdc3c7; flex: 1; }
.default-ad-mini .dab-text strong { color: #f1c40f; }
.default-ad-mini .dab-cta-btn {
    background: #9b59b6;
    color: #fff;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: .65rem;
    white-space: nowrap;
    flex-shrink: 0;
}
/* ── FOOTER SALE LINK ── */
.footer-sale-row {
    padding: 4px 8px 2px;
    text-align: center;
    border-top: 1px solid rgba(155,89,182,.2);
    margin-top: 3px;
}
.footer-sale-link {
    color: #7d6a9a;
    text-decoration: none;
    font-size: .6rem;
    letter-spacing: .3px;
}
.footer-sale-link:hover { color: #f1c40f; text-decoration: underline; }

/* ═══════════════════════════════════════════════════════
   ZEN MODE AD BREAK OVERLAY
   Pauses game. Blocking (pointer-events:auto). 5-s ring.
   Auto-resumes after countdown. Skip button activates at 0.
   ═══════════════════════════════════════════════════════ */
.zen-ad-overlay {
    background: rgba(10, 3, 22, 0.96);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    z-index: 200;
    overflow-y: auto;
    padding: 14px 10px 16px;
    pointer-events: auto;  /* blocks canvas taps — game is paused */
}

.zen-ad-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}
.zen-ad-flower { font-size: 1.5rem; }
.zen-ad-title  {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #c39bd3;
}

/* Countdown ring */
.zen-ad-countdown-wrap {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}
.zen-ad-ring {
    width: 60px;
    height: 60px;
    transform: rotate(-90deg);
}
.zen-ad-ring-track {
    fill: none;
    stroke: rgba(155,89,182,.25);
    stroke-width: 4;
}
.zen-ad-ring-fill {
    fill: none;
    stroke: #9b59b6;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 113.1 113.1;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset .85s linear, stroke .4s;
}
.zen-ad-timer-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #c39bd3;
}
.zen-ad-status {
    font-size: .68rem;
    color: rgba(255,255,255,.45);
    margin: 0 0 4px;
    letter-spacing: .4px;
}

/* Skip / Continue button */
.zen-ad-skip-btn {
    background: linear-gradient(135deg, #6a0572, #9b59b6);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: .55rem 1.6rem;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: opacity .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 14px rgba(155,89,182,.45);
}
.zen-ad-skip-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
}
.zen-ad-skip-btn:not(:disabled):hover {
    opacity: .9;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(155,89,182,.65);
}
.zen-ad-skip-btn:not(:disabled):active { transform: translateY(1px); }
