  *, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
  :root {
    --bg: #080b11;
    --bg-2: #0d1320;
    --bg-3: #141c30;
    --pnl: rgba(20, 28, 48, 0.65);
    --pnl-bd: rgba(255, 179, 0, 0.18);
    --gld: #FFB300;
    --gld-2: #FFD86B;
    --red: #E63946;
    --blu: #1D9BF0;
    --grn: #27ae60;
    --txt: #E8ECF4;
    --dim: #8A93A8;
    --shadow-gold: 0 0 24px rgba(255, 179, 0, 0.35);
    --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.5);
  }
  html, body {
    background: var(--bg);
    color: var(--txt);
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
  }
  body {
    background:
      radial-gradient(ellipse at 20% 0%, rgba(255, 179, 0, 0.08) 0%, transparent 45%),
      radial-gradient(ellipse at 80% 100%, rgba(29, 155, 240, 0.07) 0%, transparent 45%),
      var(--bg);
    background-attachment: fixed;
    padding: 14px;
    display: flex;
    justify-content: center;
  }
  body::before {
    content: '';
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image:
      linear-gradient(rgba(255,179,0,0.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,179,0,0.025) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  }

  .rotate-notice {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    padding: 28px;
    text-align: center;
    color: var(--txt);
    background:
      radial-gradient(ellipse at 50% 18%, rgba(255,179,0,0.18), transparent 46%),
      linear-gradient(180deg, rgba(8,11,17,0.96), rgba(13,19,32,0.98));
  }
  .rotate-phone {
    width: 86px;
    height: 86px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 42px;
    color: var(--gld-2);
    border: 2px solid rgba(255,179,0,0.55);
    box-shadow: 0 0 28px rgba(255,179,0,0.25), inset 0 0 18px rgba(255,179,0,0.12);
    animation: rotateHint 1.4s ease-in-out infinite;
  }
  .rotate-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--gld-2);
  }
  .rotate-sub {
    max-width: 280px;
    font-size: 14px;
    color: var(--dim);
    line-height: 1.5;
  }
  @keyframes rotateHint {
    0%, 100% { transform: rotate(-8deg) scale(1); }
    50% { transform: rotate(82deg) scale(1.06); }
  }

  .app {
    width: 100%;
    max-width: 760px;
    position: relative;
    z-index: 1;
  }

  /* ========== HEADER ========== */
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: var(--pnl);
    border: 1px solid var(--pnl-bd);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
    position: relative;
  }
  .brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 900; font-size: 16px;
    background: linear-gradient(135deg, var(--gld), #fff, var(--gld));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.3px;
    /* Big tap target for debug trigger */
    padding: 6px 10px 6px 4px;
    border-radius: 12px;
    cursor: pointer;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
  }
  .brand .badge {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,179,0,0.25), rgba(255,179,0,0.05));
    border: 1px solid rgba(255,179,0,0.4);
    display: grid; place-items: center;
    font-size: 18px;
    -webkit-text-fill-color: initial;
    box-shadow: 0 0 12px rgba(255,179,0,0.25);
    transition: transform 0.1s, opacity 0.1s;
    flex-shrink: 0;
  }
  .top-actions { display: flex; gap: 6px; }
  .icon-btn {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--txt);
    display: grid; place-items: center;
    cursor: pointer;
    font-size: 14px;
    transition: 0.15s;
    font-family: inherit;
  }
  .icon-btn:hover { background: rgba(255,179,0,0.12); border-color: rgba(255,179,0,0.4); }
  .icon-btn:active { transform: scale(0.93); }
  .icon-btn.danger { color: var(--red); }
  .icon-btn.danger:hover { background: rgba(230,57,70,0.15); border-color: rgba(230,57,70,0.5); }

  /* ========== STATS GRID ========== */
  .stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }
  .stat {
    background: var(--pnl);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 10px 12px;
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
  }
  .stat::before {
    content: ''; position: absolute; top:0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent, var(--gld)), transparent);
    opacity: 0.6;
  }
  .stat .lbl { font-size: 10px; color: var(--dim); font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; }
  .stat .val {
    font-size: 22px; font-weight: 900; line-height: 1; margin-top: 4px;
    color: var(--accent, var(--txt));
    font-feature-settings: 'tnum';
    text-shadow: 0 0 12px color-mix(in srgb, var(--accent, var(--gld)) 35%, transparent);
  }
  .stat.gold { --accent: var(--gld); }
  .stat.gold .gold-val {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 58px;
  }
  .gold-mark {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 50%;
    background:
      radial-gradient(circle at 34% 26%, #fff7b8 0 14%, transparent 15%),
      linear-gradient(145deg, #ffe58a 0%, #ffb300 48%, #d98400 100%);
    box-shadow:
      inset 0 -2px 0 rgba(117, 63, 0, 0.32),
      inset 0 2px 0 rgba(255,255,255,0.52),
      0 0 14px rgba(255, 179, 0, 0.55);
    font-size: 14px;
    line-height: 1;
    -webkit-text-fill-color: initial;
    filter: none;
    transform: translateY(-1px);
  }
  .gold-mark::after {
    content: '';
    position: absolute;
    inset: 4px 6px auto auto;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.82);
  }
  .stat.gold .val {
    font-size: 26px;
    background: linear-gradient(135deg, var(--gld-2), var(--gld));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 12px rgba(255,179,0,0.55));
  }
  .stat.gold::after {
    content: '';
    position: absolute; inset: 0; pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 18px rgba(255,179,0,0.18);
  }
  .stat.lives { --accent: var(--red); }
  .stat.score { --accent: var(--blu); }
  .stat.time { --accent: var(--grn); }
  .lives-hearts {
    display: inline-flex; gap: 2px; font-size: 14px; line-height: 1;
    margin-top: 2px;
  }
  .lives-hearts .h-on { filter: drop-shadow(0 0 6px rgba(230,57,70,0.7)); }
  .lives-hearts .h-off { opacity: 0.25; filter: grayscale(1); }
  .stat.lives.critical .val { animation: critPulse 0.8s ease-in-out infinite; }
  @keyframes critPulse { 50% { color: #FF6B7A; text-shadow: 0 0 22px rgba(230,57,70,0.9); } }

  /* ========== PROGRESS BARS ========== */
  .pbars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
  .pbar {
    background: var(--pnl);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 8px 12px;
    backdrop-filter: blur(8px);
    display: flex; align-items: center; gap: 10px;
  }
  .pbar .pi { font-size: 16px; }
  .pbar .pname { font-size: 11px; color: var(--dim); font-weight: 600; min-width: 56px; }
  .pbar .ptrack {
    flex: 1; height: 8px; background: rgba(255,255,255,0.05);
    border-radius: 999px; overflow: hidden; position: relative;
    border: 1px solid rgba(255,255,255,0.04);
  }
  .pbar .pfill {
    position: absolute; top:0; bottom:0; left: 0;
    border-radius: 999px;
    transition: width 0.2s linear;
    background: linear-gradient(90deg, var(--c1, var(--gld)), var(--c2, var(--gld-2)));
    box-shadow: 0 0 12px color-mix(in srgb, var(--c2, var(--gld)) 60%, transparent);
  }
  .pbar.distance { --c1: #1D9BF0; --c2: #27ae60; }
  .pbar.time { --c1: #27ae60; --c2: #FFB300; }
  .pbar.time.danger { --c1: #FFB300; --c2: #E63946; animation: pulseDanger 0.6s ease-in-out infinite; }
  @keyframes pulseDanger { 50% { filter: brightness(1.4); } }
  .pbar .pval { font-size: 11px; color: var(--txt); font-weight: 700; min-width: 38px; text-align: left; font-feature-settings: 'tnum'; }

  /* ========== POWERUPS ========== */
  .pu-row { display: flex; gap: 8px; flex-wrap: wrap; min-height: 38px; margin-bottom: 12px; align-items: center; }
  .pu {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 800;
    padding: 7px 14px; border-radius: 999px;
    background: rgba(255,179,0,0.15); color: var(--gld);
    border: 1.5px solid rgba(255,179,0,0.55);
    box-shadow: 0 0 14px rgba(255,179,0,0.25), inset 0 0 8px rgba(255,179,0,0.08);
    animation: puPop 0.3s cubic-bezier(.34,1.56,.64,1);
  }
  .pu .pu-ic { font-size: 16px; line-height: 1; }
  .pu .pu-tm {
    font-size: 11px; opacity: 0.85; padding: 1px 6px;
    background: rgba(0,0,0,0.25); border-radius: 999px;
    margin-inline-start: 2px; font-feature-settings: 'tnum';
  }
  @keyframes puPop { from { transform: scale(0); } to { transform: scale(1); } }
  .pu.shield { background: rgba(29,155,240,0.16); color: #8FCBFF; border-color: rgba(29,155,240,0.6); box-shadow: 0 0 14px rgba(29,155,240,0.3), inset 0 0 8px rgba(29,155,240,0.1); }
  .pu.magnet { background: rgba(155,81,224,0.16); color: #D4B0FF; border-color: rgba(155,81,224,0.6); box-shadow: 0 0 14px rgba(155,81,224,0.3), inset 0 0 8px rgba(155,81,224,0.1); }
  .pu.x2 { background: rgba(230,57,70,0.16); color: #FF9CA5; border-color: rgba(230,57,70,0.6); box-shadow: 0 0 14px rgba(230,57,70,0.3), inset 0 0 8px rgba(230,57,70,0.1); }
  .pu.life { background: rgba(39,174,96,0.16); color: #7EEBA9; border-color: rgba(39,174,96,0.6); box-shadow: 0 0 14px rgba(39,174,96,0.3), inset 0 0 8px rgba(39,174,96,0.1); }
  .pu.boost { background: rgba(255,107,53,0.16); color: #FFB58F; border-color: rgba(255,107,53,0.6); box-shadow: 0 0 14px rgba(255,107,53,0.3), inset 0 0 8px rgba(255,107,53,0.1); }
  .pu.djump { background: rgba(255,216,107,0.16); color: var(--gld-2); border-color: rgba(255,216,107,0.6); box-shadow: 0 0 14px rgba(255,216,107,0.3), inset 0 0 8px rgba(255,216,107,0.1); }
  .pu-empty { font-size: 12px; color: var(--dim); padding: 0 4px; opacity: 0.7; }

  /* ========== CANVAS ========== */
  .stage {
    position: relative;
    background: var(--bg-2);
    border: 1px solid var(--pnl-bd);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-card), 0 0 0 1px rgba(255,179,0,0.04) inset;
    touch-action: none;       /* stop browser intercepting touch for scroll/zoom */
    -webkit-touch-callout: none;
  }
  .stage::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.4);
  }
  canvas#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 680 / 340;
    background: #B5D4F4;
    touch-action: none;       /* critical: no browser gesture handling on canvas */
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
    will-change: contents;    /* hint GPU compositing layer */
  }

  /* ========== OVERLAY SCREENS ========== */
  .scr {
    position: absolute; inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    /* `safe center` keeps content centered but never clips the top when it
       overflows, so tall end boards (with the world-score panel) stay fully
       scrollable on short mobile screens. */
    justify-content: safe center;
    text-align: center;
    padding: 20px;
    z-index: 5;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(180deg, rgba(8,11,17,0.7), rgba(8,11,17,0.92));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 1;
    animation: scrIn 0.35s cubic-bezier(.4,0,.2,1);
  }
  .scr.on { display: flex; }
  @keyframes scrIn { from { transform: scale(0.96); } to { transform: scale(1); } }
  .scr .ico {
    font-size: 56px; margin-bottom: 8px;
    filter: drop-shadow(0 0 16px rgba(255,179,0,0.5));
    animation: float 3s ease-in-out infinite;
  }
  @keyframes float { 50% { transform: translateY(-6px); } }
  .scr .h {
    font-size: 28px; font-weight: 900;
    background: linear-gradient(135deg, var(--gld), #fff, var(--gld));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
  }
  .scr .sub { font-size: 13px; color: var(--dim); margin-bottom: 18px; max-width: 380px; line-height: 1.6; }
  .scr .keys { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; justify-content: center; }
  .scr .keys kbd {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--txt); padding: 4px 10px; border-radius: 7px;
    font-size: 12px; font-family: inherit; font-weight: 700;
  }

  .cta {
    padding: 12px 28px;
    font-size: 15px; font-weight: 900;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    color: #1a1000;
    background: linear-gradient(135deg, var(--gld-2), var(--gld));
    box-shadow: var(--shadow-gold), 0 4px 16px rgba(0,0,0,0.4);
    transition: 0.15s;
    letter-spacing: 0.3px;
  }
  .cta:hover { transform: translateY(-2px); box-shadow: 0 0 32px rgba(255,179,0,0.5), 0 6px 20px rgba(0,0,0,0.4); }
  .cta:active { transform: translateY(0) scale(0.97); }
  .cta.ghost {
    background: transparent;
    color: var(--txt);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: none;
  }
  .cta.ghost:hover { border-color: var(--gld); color: var(--gld); }

  .guide-screen {
    justify-content: flex-start;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }
  .guide-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: min(100%, 760px);
    margin: 0 auto;
    text-align: start;
  }
  .guide-head .ico {
    width: 54px;
    height: 54px;
    margin: 0;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255,216,107,0.26), rgba(111,230,160,0.14));
    border: 1px solid rgba(255,216,107,0.45);
    font-size: 32px;
  }
  .guide-head .h { margin-bottom: 2px; }
  .guide-head .sub { margin: 0; max-width: 560px; }
  .guide-title-copy { min-width: 0; }
  .guide-grid {
    width: min(100%, 760px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .guide-card {
    min-height: 158px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.09);
    text-align: start;
    overflow: hidden;
    position: relative;
  }
  .guide-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,216,107,0.12), transparent 58%);
  }
  .guide-card h3 {
    position: relative;
    margin: 9px 0 4px;
    font-size: 14px;
    color: var(--txt);
  }
  .guide-card p {
    position: relative;
    margin: 0;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--dim);
  }
  .guide-scene {
    height: 58px;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(80,150,210,0.26), rgba(240,194,108,0.18));
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
  }
  .guide-scene::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 8px;
    height: 3px;
    background: rgba(255,216,107,0.38);
  }
  .mini-runner {
    position: absolute;
    left: 18px;
    bottom: 13px;
    width: 18px;
    height: 24px;
    border-radius: 10px 10px 7px 7px;
    background: #1D9BF0;
    box-shadow: inset 0 8px 0 #FFD86B;
    animation: guideRun 1.2s ease-in-out infinite;
    z-index: 2;
  }
  .mini-runner::before {
    content: '';
    position: absolute;
    left: 4px;
    top: -9px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f6c28b;
  }
  .mini-obstacle {
    position: absolute;
    right: 24px;
    bottom: 11px;
    width: 20px;
    height: 22px;
    border-radius: 5px;
    background: #E63946;
    animation: guideObstacle 1.2s linear infinite;
  }
  .mini-jump-arc {
    position: absolute;
    left: 18px;
    bottom: 10px;
    width: 62px;
    height: 36px;
    border-top: 2px dashed rgba(255,255,255,0.55);
    border-radius: 50% 50% 0 0;
  }
  @keyframes guideRun {
    0%,100% { transform: translate(0, 0); }
    45% { transform: translate(38px, -24px); }
    70% { transform: translate(58px, 0); }
  }
  @keyframes guideObstacle {
    from { transform: translateX(22px); }
    to { transform: translateX(-86px); }
  }
  .mini-coin {
    position: absolute;
    top: 20px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffe58a, #ffb300);
    box-shadow: 0 0 10px rgba(255,179,0,0.55);
    animation: coinFloat 1.1s ease-in-out infinite;
  }
  .mini-coin.c1 { left: 54px; animation-delay: 0s; }
  .mini-coin.c2 { left: 82px; animation-delay: .15s; }
  .mini-coin.c3 { left: 110px; animation-delay: .3s; }
  @keyframes coinFloat { 50% { transform: translateY(-9px) scale(1.08); } }
  .score-pop,
  .hearts-pop,
  .shop-demo,
  .map-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
  .score-pop span {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255,216,107,0.16);
    color: #FFD86B;
    font-weight: 900;
    font-size: 12px;
    animation: popPulse 1.4s ease-in-out infinite;
  }
  .score-pop span:nth-child(2) { animation-delay: .2s; }
  .score-pop span:nth-child(3) { animation-delay: .4s; }
  .hearts-pop span {
    color: #FF8993;
    font-size: 24px;
    animation: heartBeat 1.2s ease-in-out infinite;
  }
  .hearts-pop b {
    color: #6FE6A0;
    font-size: 17px;
    animation: popPulse 1.2s ease-in-out infinite;
  }
  .shop-demo span {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.12);
    font-size: 20px;
    animation: shopLift 1.5s ease-in-out infinite;
  }
  .shop-demo span:nth-child(2) { animation-delay: .18s; }
  .shop-demo span:nth-child(3) { animation-delay: .36s; }
  .map-demo .city-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-block;
    background: #FFD86B;
    box-shadow: 0 0 18px rgba(255,216,107,0.55);
  }
  .map-demo .city-dot.done { background: #6FE6A0; }
  .map-demo .city-dot.next { animation: mapUnlockPulse 1.35s ease-in-out infinite; }
  .map-demo .route-line {
    width: 62px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #6FE6A0, #FFD86B);
    animation: routeGlow 1.35s ease-in-out infinite;
  }
  @keyframes popPulse { 50% { transform: translateY(-6px) scale(1.08); } }
  @keyframes heartBeat { 50% { transform: scale(1.18); } }
  @keyframes shopLift { 50% { transform: translateY(-7px); } }
  @keyframes mapUnlockPulse { 50% { transform: scale(1.16); box-shadow: 0 0 28px rgba(255,216,107,0.82); } }
  @keyframes routeGlow { 50% { filter: brightness(1.4); } }
  .guide-actions {
    width: min(100%, 760px);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .guide-top-actions {
    width: auto;
    margin: 0;
    justify-content: flex-end;
    align-items: center;
    justify-self: end;
    align-self: start;
    flex-wrap: nowrap;
  }
  .guide-top-actions .map-back-game {
    position: static;
    min-width: 132px;
    min-height: 44px;
    padding: 9px 16px;
    z-index: auto;
    width: auto;
  }
  .guide-top-actions #guideCloseBtn {
    min-height: 44px;
    padding: 9px 22px;
    margin: 0;
  }

  .end-stats {
    display: flex; gap: 16px; margin: 10px 0 18px;
    padding: 14px 22px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
  }
  .end-stats .es { text-align: center; }
  .end-stats .es-l { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.4px; }
  .end-stats .es-v { font-size: 22px; font-weight: 900; color: var(--gld); margin-top: 2px; font-feature-settings: 'tnum'; }
  .lifetime-stats {
    margin-top: 8px;
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.06);
  }
  .lifetime-stats .es-l { font-size: 11px; }
  .lifetime-stats .es-v { font-size: 16px; color: var(--dim); }
  .world-record {
    width: min(100%, 440px);
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid rgba(255,179,0,0.24);
    border-radius: 12px;
    background: rgba(20,28,48,0.62);
    box-shadow: inset 0 0 18px rgba(255,179,0,0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  }
  .world-record.celebrate20 {
    border-color: rgba(255,216,107,0.8);
    box-shadow: var(--shadow-gold), inset 0 0 22px rgba(255,179,0,0.12);
    animation: wrPulse 0.65s ease-out 2;
  }
  .world-record.celebrate100 {
    border-color: rgba(39,174,96,0.65);
    box-shadow: 0 0 24px rgba(39,174,96,0.22), inset 0 0 18px rgba(39,174,96,0.10);
  }
  .world-record.climb {
    border-color: rgba(29,155,240,0.45);
    box-shadow: 0 0 18px rgba(29,155,240,0.16), inset 0 0 18px rgba(29,155,240,0.08);
  }
  .world-record.finish {
    border-color: rgba(255,179,0,0.56);
    box-shadow: 0 0 22px rgba(255,179,0,0.18), inset 0 0 20px rgba(255,179,0,0.09);
  }
  .world-record .wr-light {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #1f2435;
    background: linear-gradient(135deg, #fff3a8, #ffb300 72%, #ff8a00);
    border: 1px solid rgba(255,255,255,0.42);
    box-shadow: 0 0 18px rgba(255,179,0,0.42), inset 0 1px 6px rgba(255,255,255,0.42);
    font-size: 11px;
    font-weight: 1000;
    z-index: 1;
  }
  .world-record .wr-burst {
    position: absolute;
    left: 50%;
    top: 22px;
    width: 1px;
    height: 1px;
    pointer-events: none;
    z-index: 2;
  }
  .world-record .wr-burst i {
    position: absolute;
    width: 6px;
    height: 10px;
    border-radius: 2px;
    opacity: 0;
    animation: wrConfetti 1.15s ease-out var(--d) forwards;
  }
  .world-record .wr-title {
    font-size: 12px;
    font-weight: 900;
    color: var(--gld-2);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    padding-right: 44px;
  }
  .world-record .wr-best {
    color: var(--txt);
    font-size: 13px;
    font-weight: 800;
    min-height: 20px;
  }
  .world-record .wr-rank-card {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.045);
    text-align: start;
  }
  .world-record .wr-rank-card[hidden] { display: none; }
  .world-record .wr-rank-card.top20 {
    background: linear-gradient(135deg, rgba(255,216,107,0.18), rgba(39,174,96,0.10));
    border-color: rgba(255,216,107,0.52);
  }
  .world-record .wr-rank-card.top100 {
    background: linear-gradient(135deg, rgba(39,174,96,0.14), rgba(29,155,240,0.08));
    border-color: rgba(39,174,96,0.40);
  }
  .world-record .wr-rank-card.climb {
    background: linear-gradient(135deg, rgba(29,155,240,0.13), rgba(255,255,255,0.04));
    border-color: rgba(29,155,240,0.36);
  }
  .world-record .wr-rank-card.finish {
    background: linear-gradient(135deg, rgba(255,179,0,0.15), rgba(255,255,255,0.04));
    border-color: rgba(255,179,0,0.38);
  }
  .world-record .wr-rank-label {
    color: var(--gld-2);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.2;
  }
  .world-record .wr-rank-copy {
    color: var(--txt);
    font-size: 12px;
    line-height: 1.35;
    margin-top: 4px;
  }
  .world-record .wr-top {
    list-style: none;
    display: grid;
    gap: 4px;
    max-height: 148px;
    overflow: auto;
    margin: 8px 0 0;
    padding: 0;
    text-align: start;
  }
  .world-record .wr-top li {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    background: rgba(255,255,255,0.035);
    color: var(--dim);
    font-size: 11px;
  }
  .world-record .wr-top li.me {
    border-color: rgba(255,179,0,0.42);
    background: rgba(255,179,0,0.10);
    color: var(--txt);
  }
  .world-record .wr-top li.empty {
    color: var(--dim);
    background: rgba(255,255,255,0.025);
    border-style: dashed;
  }
  .world-record .wr-top .rank { color: var(--gld-2); font-weight: 900; }
  .world-record .wr-top .name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .world-record .wr-top .score { color: var(--txt); font-weight: 900; }
  .world-record .wr-status {
    color: var(--dim);
    font-size: 11px;
    line-height: 1.4;
    margin-top: 6px;
  }
  .world-record .wr-status.ok { color: #7EEBA9; }
  .world-record .wr-status.warn { color: #FFD86B; }
  .wr-email-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
  }
  .wr-email-row[hidden] { display: none; }
  .wr-email-row input {
    min-width: 0;
    flex: 1;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--txt);
    background: rgba(255,255,255,0.06);
    font: inherit;
    font-size: 13px;
    outline: none;
  }
  .wr-email-row input:focus {
    border-color: rgba(255,179,0,0.72);
    box-shadow: 0 0 0 3px rgba(255,179,0,0.12);
  }
  .wr-email-row .cta {
    padding: 9px 14px;
    font-size: 12px;
    border-radius: 10px;
    white-space: nowrap;
  }
  @keyframes wrPulse {
    50% { transform: translateY(-2px) scale(1.012); }
  }
  @keyframes wrConfetti {
    0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.8); }
    12% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--x), 138px) rotate(var(--r)) scale(1); }
  }

  /* Level select cards */
  #mapScr {
    padding: 14px 12px;
    overflow-y: auto;
    justify-content: flex-start;
    gap: 4px;
  }
  #mapScr .ico { font-size: 32px; margin-bottom: 0; animation: none; }
  #mapScr .h { font-size: 22px; margin-bottom: 2px; }
  #mapScr .sub { font-size: 11px; margin-bottom: 10px; }
  .map-back-game {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 148px;
    min-height: 48px;
    z-index: 7600;
    border: 2px solid rgba(255,179,0,0.78);
    background: rgba(8,11,17,0.94);
    color: var(--gld-2);
    font: 900 14px Cairo, sans-serif;
    padding: 11px 18px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 26px rgba(0,0,0,0.52), 0 0 18px rgba(255,179,0,0.22);
  }
  .map-back-game:hover, .map-back-game:active {
    background: rgba(255,179,0,0.20);
    color: #fff;
  }
  .lvl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 720px;
    padding: 4px;
  }
  @media (max-width: 480px) {
    .lvl-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    #mapScr { padding: 10px 8px 74px; }
    #mapScr .ico { font-size: 24px; }
    #mapScr .h { font-size: 18px; }
    .map-back-game {
      left: max(12px, env(safe-area-inset-left));
      right: max(12px, env(safe-area-inset-right));
      width: auto;
      min-height: 54px;
      font-size: 15px;
    }
  }
  .lvl-card {
    width: auto;
    background: linear-gradient(160deg, rgba(40,55,90,0.85), rgba(20,28,48,0.95));
    border: 2px solid rgba(255,179,0,0.35);
    border-radius: 16px;
    padding: 14px 10px;
    color: var(--txt);
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4), inset 0 0 12px rgba(255,179,0,0.06);
  }
  .lvl-card:not(:disabled):hover, .lvl-card:not(:disabled):active {
    transform: translateY(-3px);
    border-color: var(--gld);
    background: linear-gradient(160deg, rgba(60,80,130,0.95), rgba(30,40,70,0.98));
    box-shadow: 0 10px 28px rgba(0,0,0,0.6), 0 0 24px rgba(255,179,0,0.4);
  }
  .lvl-card:disabled { opacity: 0.45; cursor: not-allowed; }
  .lvl-card .lvl-flag { font-size: 34px; margin-bottom: 4px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); }
  .lvl-card .lvl-name {
    font-size: 15px; font-weight: 900; line-height: 1.2;
    background: linear-gradient(135deg, var(--gld-2), var(--gld));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    margin-bottom: 3px;
  }
  .lvl-card .lvl-desc { font-size: 10px; color: var(--dim); margin-bottom: 8px; line-height: 1.3; }
  .lvl-card .lvl-st {
    display: inline-block; font-size: 11px; font-weight: 800;
    padding: 4px 12px; border-radius: 999px;
    background: rgba(255,179,0,0.22); color: var(--gld-2);
    border: 1px solid rgba(255,179,0,0.6);
  }
  .lvl-card.locked .lvl-st { background: rgba(255,255,255,0.06); color: var(--dim); border-color: rgba(255,255,255,0.1); }
  .lvl-card.completed::after {
    content: '✓'; position: absolute; top: 6px; left: 6px;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--grn); color: #fff; font-weight: 900; font-size: 13px;
    display: grid; place-items: center;
    box-shadow: 0 0 12px rgba(39,174,96,0.5);
  }

  /* ── Beach Passport stamps ── */
  .lvl-card .lvl-stamps { display: flex; justify-content: center; gap: 5px; margin-bottom: 7px; }
  .lvl-card .lvl-stamps .stamp { font-size: 15px; line-height: 1; filter: grayscale(1); opacity: 0.28; transition: 0.2s; cursor: pointer; }
  .lvl-card .lvl-stamps .stamp.earned { filter: none; opacity: 1; transform: scale(1.08); text-shadow: 0 0 7px rgba(255,200,80,0.65); }
  .lvl-card .lvl-stamps .stamp:hover, .lvl-card .lvl-stamps .stamp:focus { outline: none; transform: scale(1.28); }

  /* ── Layer 5: journey thread — story line pulling toward the next city ── */
  .lvl-card .lvl-journey {
    margin-top: 8px; padding-top: 7px;
    border-top: 1px dashed rgba(255,200,80,0.22);
    font-size: 9.5px; font-style: italic; line-height: 1.35;
    color: rgba(190,205,228,0.72);
  }

  /* Shared stamp-info tooltip (body-level so it escapes the card's overflow:hidden) */
  .stamp-tip {
    position: fixed; transform: translate(-50%, -100%);
    z-index: 9999; pointer-events: none;
    max-width: 180px; text-align: center; white-space: normal;
    background: rgba(14,19,34,0.97); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 1.3;
    padding: 6px 9px; border-radius: 9px;
    border: 1px solid rgba(255,200,80,0.55);
    box-shadow: 0 5px 16px rgba(0,0,0,0.55);
    opacity: 0; transition: opacity 0.12s ease;
  }
  .stamp-tip.show { opacity: 1; }
  .stamp-tip::after {
    content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: rgba(14,19,34,0.97);
  }

  /* ── Soft gating: keep locked cards readable, dim via inner elements ── */
  .lvl-card.locked:disabled { opacity: 0.82; cursor: default; }

  /* 🌫 Foggy — next 1–2 cities: silhouette + teaser */
  .lvl-card.foggy {
    border-color: rgba(150,170,200,0.3);
    background: linear-gradient(160deg, rgba(48,58,78,0.88), rgba(24,30,44,0.96));
  }
  .lvl-card.foggy::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(205,220,235,0.20), rgba(205,220,235,0.04));
  }
  .lvl-card.foggy .fog-silhouette { filter: brightness(0) blur(1.4px); opacity: 0.5; }
  .lvl-card .lvl-fog { font-size: 13px; font-weight: 800; color: #aebfd2; margin: 2px 0 4px; line-height: 1.2; }

  /* ❓ Mystery — far cities: question mark + tiny clue */
  .lvl-card.mystery {
    border-color: rgba(255,255,255,0.12);
    background: linear-gradient(160deg, rgba(34,40,55,0.92), rgba(17,21,31,0.97));
  }
  .lvl-card.mystery .lvl-flag { opacity: 0.55; }
  .lvl-card.mystery .lvl-name { -webkit-text-fill-color: #8b97ad; color: #8b97ad; background: none; }
  .lvl-card.mystery-beach:not(:disabled) {
    border-color: rgba(245,197,66,0.5);
    background: linear-gradient(160deg, rgba(16,91,112,0.92), rgba(25,42,64,0.96));
    box-shadow: 0 0 22px rgba(245,197,66,0.18), inset 0 0 20px rgba(255,255,255,0.06);
  }
  .lvl-card.mystery-beach:not(:disabled) .lvl-flag { opacity: 1; }
  .lvl-card.mystery-beach:not(:disabled) .lvl-name {
    -webkit-text-fill-color: #F5C542;
    color: #F5C542;
  }

  /* ── 3-second reveal cinematic: fog clears, flag flips, card glows ── */
  .lvl-card.revealing { animation: lvlRevealFlip 0.9s ease-out, lvlRevealGlow 1.4s ease-in-out 2; z-index: 2; }
  .lvl-card.revealing::before {
    content: ''; position: absolute; inset: 0; z-index: 5; pointer-events: none;
    background: radial-gradient(circle at 50% 40%, rgba(225,238,248,0.95), rgba(180,200,222,0.85));
    animation: lvlRevealFog 2.8s ease-out forwards;
  }
  @keyframes lvlRevealFog { 0% { opacity: 1; } 65% { opacity: 1; } 100% { opacity: 0; } }
  @keyframes lvlRevealFlip {
    0%   { transform: perspective(600px) rotateY(90deg) scale(0.7); opacity: 0; }
    60%  { transform: perspective(600px) rotateY(0deg) scale(1.06); opacity: 1; }
    100% { transform: perspective(600px) rotateY(0deg) scale(1); }
  }
  @keyframes lvlRevealGlow {
    0%, 100% { box-shadow: 0 4px 14px rgba(0,0,0,0.4), inset 0 0 12px rgba(255,179,0,0.06); }
    50%      { box-shadow: 0 0 32px rgba(255,200,80,0.85), inset 0 0 16px rgba(255,200,80,0.3); }
  }
  @media (prefers-reduced-motion: reduce) {
    .lvl-card.revealing { animation: none; }
    .lvl-card.revealing::before { animation: lvlRevealFog 0.6s ease-out forwards; }
  }
  .scr.win {
    background: linear-gradient(180deg, rgba(8,40,15,0.82), rgba(8,11,17,0.95));
    justify-content: flex-start;
    gap: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
  }
  .scr.win .h { background: linear-gradient(135deg, #6FE6A0, #fff, #6FE6A0); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
  .scr.win .ico {
    font-size: 38px;
    margin-bottom: 0;
  }
  .scr.win .h {
    font-size: 25px;
    margin-bottom: 0;
  }
  .scr.win .sub {
    margin-bottom: 2px;
    line-height: 1.35;
  }
  .scr.win .end-stats {
    margin: 4px 0;
    padding: 10px 18px;
  }
  .scr.win .lifetime-stats {
    margin-top: 0;
  }
  .scr.win .world-record {
    margin: 6px 0 4px;
    flex: 0 1 auto;
    max-height: min(58vh, 360px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .win-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .scr.win .win-actions .cta {
    padding: 10px 24px;
  }
  .scr.win .win-actions .share-result {
    background: linear-gradient(135deg, #1F9E62, #6FE6A0);
    color: #062414;
  }
  .worldcup-victory {
    width: min(100%, 520px);
    padding: 14px 18px 16px;
    border: 2px solid rgba(255,255,255,0.82);
    border-radius: 8px;
    background:
      linear-gradient(90deg, rgba(206,17,38,0.94) 0 8px, transparent 8px calc(100% - 8px), rgba(108,199,213,0.94) calc(100% - 8px)),
      linear-gradient(180deg, #111b22, #071015);
    box-shadow: 0 12px 28px rgba(0,0,0,0.38), inset 0 0 0 1px rgba(255,255,255,0.08);
    color: #fff;
    text-align: center;
  }
  .worldcup-victory[hidden], .shared-result-overlay[hidden] { display: none; }
  .wc-cup { font-size: 34px; line-height: 1; }
  .wc-victory-title {
    margin-top: 4px;
    color: #FFD86B;
    font-size: 20px;
    font-weight: 1000;
    letter-spacing: 0;
  }
  .wc-final-score {
    display: grid;
    grid-template-columns: minmax(72px, 1fr) auto minmax(72px, 1fr);
    align-items: center;
    gap: 12px;
    margin-top: 10px;
  }
  .wc-team { display: grid; justify-items: center; gap: 3px; min-width: 0; }
  .wc-team strong { font-size: 12px; letter-spacing: 0; }
  .wc-flag { font-size: 30px; line-height: 1; }
  .wc-score {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 34px;
    font-weight: 1000;
    font-feature-settings: 'tnum';
  }
  .wc-score span { color: #FFD86B; font-size: 24px; }
  .wc-result-foot, .shared-game-score {
    margin-top: 10px;
    color: #BFD2DD;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
  }
  .shared-result-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2,8,12,0.92);
  }
  .shared-result-card { position: relative; padding: 22px 22px 20px; }
  .shared-result-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
  }
  .shared-play-link { display: inline-flex; margin-top: 16px; text-decoration: none; }
  @media (min-width: 820px) and (min-height: 560px) {
    .scr.win {
      display: none;
      grid-template-columns: minmax(260px, 420px) minmax(320px, 440px);
      grid-template-areas:
        "icon record"
        "title record"
        "sub record"
        "runstats record"
        "lifestats record"
        "actions record";
      align-content: center;
      justify-content: center;
      column-gap: 24px;
      row-gap: 8px;
    }
    .scr.win.on { display: grid; }
    .scr.win .ico { grid-area: icon; justify-self: center; }
    .scr.win .h { grid-area: title; justify-self: center; }
    .scr.win .sub { grid-area: sub; justify-self: center; }
    .scr.win > .end-stats:not(.lifetime-stats) { grid-area: runstats; justify-self: center; }
    .scr.win > .lifetime-stats { grid-area: lifestats; justify-self: center; }
    .scr.win > .world-record {
      grid-area: record;
      align-self: center;
      justify-self: stretch;
      width: min(100%, 440px);
      max-height: min(520px, calc(100% - 12px));
      overflow-y: auto;
      margin: 0;
    }
    .scr.win > .win-actions { grid-area: actions; justify-self: center; }
    .scr.win .world-record .wr-top {
      max-height: 230px;
    }
  }
  .scr.lose {
    background: linear-gradient(180deg, rgba(60,8,12,0.82), rgba(8,11,17,0.95));
    justify-content: flex-start;
    gap: 8px;
  }
  .scr.lose .h { background: linear-gradient(135deg, #FF8993, #fff, #FF8993); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
  .scr.lose > .cta:not(.map-cta) {
    order: 3;
    margin: 2px 0 4px;
  }
  .scr.lose > .map-cta { order: 4; }
  .scr.lose > .end-stats:not(.lifetime-stats) { order: 5; }
  .scr.lose > .lifetime-stats { order: 6; }
  .scr.victory-cinema {
    overflow: hidden;
    background:
      radial-gradient(ellipse at 50% 26%, rgba(255,216,107,0.16), transparent 42%),
      linear-gradient(180deg, rgba(20,28,48,0.88), rgba(8,11,17,0.96));
  }
  .victory-cinema::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      linear-gradient(rgba(255,179,0,0.035) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,179,0,0.026) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: linear-gradient(180deg, transparent, #000 22%, #000 82%, transparent);
    pointer-events: none;
  }
  .victory-cinema .cinema-scene {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }
  .victory-cinema .cinema-route {
    position: absolute;
    left: 50%;
    bottom: -10%;
    width: 66%;
    height: 46%;
    transform: translateX(-50%);
    background:
      linear-gradient(90deg, transparent 0 7%, rgba(255,216,107,0.35) 7% 8.5%, transparent 8.5% 91.5%, rgba(255,216,107,0.35) 91.5% 93%, transparent 93%),
      linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,179,0,0.10));
    clip-path: polygon(19% 0, 81% 0, 100% 100%, 0 100%);
    border-top: 1px solid rgba(255,216,107,0.42);
  }
  .victory-cinema .cinema-rail {
    position: absolute;
    bottom: 21%;
    width: 22%;
    height: 4px;
    background: rgba(255,216,107,0.45);
    box-shadow: 0 0 14px rgba(255,179,0,0.22);
  }
  .victory-cinema .rail-left { left: 5%; transform: rotate(-8deg); }
  .victory-cinema .rail-right { right: 5%; transform: rotate(8deg); }
  .victory-cinema .finish-arch {
    position: absolute;
    left: 50%;
    bottom: 24%;
    width: min(30vw, 148px);
    height: min(31vw, 132px);
    transform: translateX(-50%);
    border: 4px solid rgba(255,216,107,0.78);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    box-shadow: var(--shadow-gold), inset 0 0 18px rgba(255,179,0,0.14);
  }
  .victory-cinema .finish-arch::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -16px;
    width: 72%;
    height: 20px;
    transform: translateX(-50%);
    border-radius: 6px;
    background:
      repeating-linear-gradient(90deg, #fff 0 12px, #111827 12px 24px);
    border: 2px solid rgba(255,216,107,0.78);
    box-shadow: 0 6px 18px rgba(0,0,0,0.32);
  }
  .victory-cinema .finish-arch span {
    position: absolute;
    left: 50%;
    top: 21%;
    width: 42%;
    height: 5px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: var(--grn);
    box-shadow: 0 0 18px rgba(39,174,96,0.52);
  }
  .victory-cinema .runner-finish {
    position: absolute;
    left: 17%;
    bottom: 24%;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gld-2), var(--gld));
    border: 1px solid rgba(255,255,255,0.42);
    box-shadow: var(--shadow-gold), 0 8px 20px rgba(0,0,0,0.42);
    animation: finishRun 2.35s cubic-bezier(.2,.8,.2,1) forwards;
  }
  .victory-cinema .runner-finish span {
    position: absolute;
    left: 50%;
    top: 9px;
    width: 8px;
    height: 18px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: #1a1000;
  }
  .victory-cinema .runner-finish span::before,
  .victory-cinema .runner-finish span::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 4px;
    height: 12px;
    border-radius: 999px;
    background: #1a1000;
    transform-origin: top center;
  }
  .victory-cinema .runner-finish span::before { transform: translateX(-50%) rotate(30deg); }
  .victory-cinema .runner-finish span::after { transform: translateX(-50%) rotate(-30deg); }
  .victory-cinema .runner-finish::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 4px;
    width: 8px;
    height: 8px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #1a1000;
  }
  .victory-cinema .crowd {
    position: absolute;
    bottom: 15%;
    display: flex;
    gap: 7px;
  }
  .victory-cinema .crowd-left { left: 7%; }
  .victory-cinema .crowd-right { right: 7%; }
  .victory-cinema .crowd b {
    position: relative;
    width: 12px;
    height: 30px;
    border-radius: 999px 999px 4px 4px;
    background: rgba(232,236,244,0.72);
    box-shadow: 0 0 10px rgba(255,255,255,0.12);
    animation: clapBounce 0.46s ease-in-out infinite alternate;
  }
  .victory-cinema .crowd b::before {
    content: '';
    position: absolute;
    left: 2px;
    top: -8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,216,107,0.88);
  }
  .victory-cinema .crowd b:nth-child(2n) {
    height: 25px;
    animation-delay: 0.14s;
    background: rgba(39,174,96,0.72);
  }
  .victory-cinema .crowd b:nth-child(3n) { animation-delay: 0.24s; }
  .victory-cinema .clap-lines {
    position: absolute;
    bottom: 28%;
    width: 42px;
    height: 26px;
    opacity: 0.78;
    animation: clapGlow 0.56s ease-in-out infinite alternate;
  }
  .victory-cinema .line-left { left: 12%; }
  .victory-cinema .line-right { right: 12%; }
  .victory-cinema .clap-lines::before,
  .victory-cinema .clap-lines::after {
    content: '';
    position: absolute;
    left: 0;
    width: 34px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255,216,107,0.8);
    box-shadow: 0 0 10px rgba(255,179,0,0.32);
  }
  .victory-cinema .clap-lines::before { top: 5px; transform: rotate(-18deg); }
  .victory-cinema .clap-lines::after { top: 17px; transform: rotate(15deg); }
  .victory-cinema .line-right::before { transform: rotate(18deg); }
  .victory-cinema .line-right::after { transform: rotate(-15deg); }
  .victory-cinema .ico,
  .victory-cinema .h,
  .victory-cinema .sub {
    position: relative;
    z-index: 1;
    text-shadow: 0 4px 18px rgba(0,0,0,0.4);
  }
  @keyframes finishRun {
    0% { transform: translateX(0) scale(0.96); }
    72% { transform: translateX(31vw) scale(1.05); }
    100% { transform: translateX(38vw) scale(1.08); }
  }
  @keyframes clapBounce {
    from { transform: translateY(0); }
    to { transform: translateY(-7px); }
  }
  @keyframes clapGlow {
    from { opacity: 0.35; transform: translateY(2px); }
    to { opacity: 0.95; transform: translateY(-2px); }
  }

  /* ========== TOUCH CONTROLS — Thumb Zone Glass UI ========== */
  .controls {
    display: none;
    gap: 10px;
    margin-top: 10px;
    padding: 0 2px;
    align-items: stretch;
  }
  .controls .ctrl {
    flex: 1;
    height: 66px;
    min-height: 56px;
    border: none;
    border-radius: 18px;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    transition: transform 0.08s, box-shadow 0.12s;
  }
  /* Glass highlight top edge */
  .controls .ctrl::before {
    content: '';
    position: absolute;
    top: 0; left: 12%; right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  }
  .controls .ctrl:active { transform: scale(0.90); }
  .controls .ctrl .ctrl-ico {
    width: 24px; height: 24px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
    pointer-events: none;
  }
  .controls .ctrl .ctrl-lbl {
    font-size: 11px; font-weight: 700;
    opacity: 0.82; letter-spacing: 0.3px;
    pointer-events: none;
  }

  /* Duck — blue glass */
  .ctrl-duck {
    background: linear-gradient(160deg, rgba(21,101,192,0.60), rgba(13,71,161,0.78));
    box-shadow: 0 4px 14px rgba(21,101,192,0.28),
                inset 0 1px 0 rgba(255,255,255,0.06);
  }
  .ctrl-duck:active {
    background: linear-gradient(160deg, rgba(21,101,192,0.90), rgba(13,71,161,0.95));
    box-shadow: 0 2px 18px rgba(21,101,192,0.50),
                inset 0 0 14px rgba(100,180,255,0.12);
  }
  .ctrl-duck .ctrl-ico { color: #90CAF9; }

  /* Speed — fire glass */
  .ctrl-speed {
    background: linear-gradient(160deg, rgba(230,81,0,0.60), rgba(191,54,12,0.78));
    box-shadow: 0 4px 14px rgba(255,107,53,0.28),
                inset 0 1px 0 rgba(255,255,255,0.06);
  }
  .ctrl-speed:active {
    background: linear-gradient(160deg, rgba(255,107,53,0.95), rgba(230,81,0,0.98));
    box-shadow: 0 2px 20px rgba(255,107,53,0.55),
                inset 0 0 16px rgba(255,200,100,0.15);
  }
  .ctrl-speed .ctrl-ico { color: #FFD54F; }

  /* Jump — green glass (biggest) */
  .ctrl-jump {
    flex: 1.6;
    background: linear-gradient(160deg, rgba(27,94,32,0.60), rgba(46,125,50,0.78));
    box-shadow: 0 4px 16px rgba(67,160,71,0.28),
                inset 0 1px 0 rgba(255,255,255,0.06);
  }
  .ctrl-jump:active {
    background: linear-gradient(160deg, rgba(56,142,60,0.95), rgba(27,94,32,0.98));
    box-shadow: 0 2px 22px rgba(76,175,80,0.50),
                inset 0 0 16px rgba(150,255,150,0.12);
  }
  .ctrl-jump .ctrl-ico {
    color: #A5D6A7;
    width: 28px; height: 28px;
  }

  @media (hover: none) and (pointer: coarse) { .controls { display: flex; } }
  @media (max-width: 640px) { .controls { display: flex; } }

  .skb-lane-controls {
    position: absolute;
    inset: auto 14px 16px 14px;
    z-index: 14;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
  }
  .skb-lane-btn {
    width: min(137px, 23vw);
    height: 53px;
    border-radius: 18px;
    border: 1px solid rgba(255, 216, 61, 0.72);
    background: radial-gradient(circle at 35% 25%, rgba(255,255,255,0.28), rgba(255,216,61,0.78) 38%, rgba(196,118,12,0.92));
    color: #1a1304;
    font: 900 29px/1 'Cairo', sans-serif;
    box-shadow: 0 8px 24px rgba(0,0,0,0.42), 0 0 22px rgba(255,216,61,0.32);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
    position: relative;
  }
  .skb-lane-btn:active {
    transform: scale(0.92);
    box-shadow: 0 4px 18px rgba(0,0,0,0.48), 0 0 28px rgba(255,216,61,0.55);
  }
  .skb-lane-controls.show-hint .skb-lane-btn {
    animation: skbButtonPulse 0.75s ease-in-out infinite alternate;
  }
  .skb-lane-controls.show-hint .skb-lane-btn::after {
    position: absolute;
    top: -34px;
    font-size: 34px;
    line-height: 1;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.55));
    animation: skbPointerBounce 0.55s ease-in-out infinite alternate;
  }
  .skb-lane-controls.show-hint .skb-lane-btn.left::after {
    content: '👇';
    left: 22%;
  }
  .skb-lane-controls.show-hint .skb-lane-btn.right::after {
    content: '👇';
    right: 22%;
  }
  @keyframes skbButtonPulse {
    from { transform: scale(1); box-shadow: 0 8px 24px rgba(0,0,0,0.42), 0 0 22px rgba(255,216,61,0.32); }
    to { transform: scale(1.05); box-shadow: 0 10px 30px rgba(0,0,0,0.46), 0 0 34px rgba(255,216,61,0.62); }
  }
  @keyframes skbPointerBounce {
    from { transform: translateY(-4px); opacity: 0.72; }
    to { transform: translateY(5px); opacity: 1; }
  }
  @media (min-width: 761px) and (hover: hover) and (pointer: fine) {
    .skb-lane-controls { display: none; }
  }
  @media (max-width: 520px) and (pointer: coarse) {
    .skb-lane-controls {
      inset: auto 10px 12px 10px;
    }
    .skb-lane-btn {
      width: min(82px, 18vw);
      height: 40px;
      border-radius: 14px;
      font-size: 23px;
    }
    .skb-lane-controls.show-hint .skb-lane-btn::after {
      top: -28px;
      font-size: 28px;
    }
  }

  .bal-float-controls {
    position: absolute;
    left: 12px;
    bottom: 18px;
    z-index: 14;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
  }
  .bal-float-btn {
    width: min(74px, 16vw);
    height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(135, 206, 250, 0.74);
    background: radial-gradient(circle at 35% 25%, rgba(255,255,255,0.30), rgba(103,198,255,0.78) 42%, rgba(32,96,170,0.92));
    color: #061421;
    font: 900 25px/1 'Cairo', sans-serif;
    box-shadow: 0 8px 24px rgba(0,0,0,0.42), 0 0 22px rgba(95,190,255,0.32);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
  }
  .bal-float-btn.down {
    background: radial-gradient(circle at 35% 25%, rgba(255,255,255,0.28), rgba(255,190,88,0.80) 42%, rgba(183,92,18,0.94));
    border-color: rgba(255, 205, 118, 0.78);
  }
  .bal-float-btn:active {
    transform: scale(0.92);
    box-shadow: 0 4px 18px rgba(0,0,0,0.48), 0 0 28px rgba(95,190,255,0.55);
  }
  @media (min-width: 761px) and (hover: hover) and (pointer: fine) {
    .bal-float-controls { display: none; }
  }
  @media (max-width: 520px) and (pointer: coarse) {
    .bal-float-controls {
      left: 8px;
      bottom: 12px;
      gap: 7px;
    }
    .bal-float-btn {
      width: min(58px, 15vw);
      height: 42px;
      border-radius: 14px;
      font-size: 22px;
    }
  }

  .kite-float-controls {
    position: absolute;
    right: 14px;
    bottom: 34px;
    z-index: 14;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
  }
  .kite-float-btn {
    width: min(116px, 22vw);
    height: 66px;
    border-radius: 24px;
    border: 1px solid rgba(255, 216, 61, 0.78);
    background: radial-gradient(circle at 35% 25%, rgba(255,255,255,0.28), rgba(255,216,61,0.80) 42%, rgba(191,106,18,0.94));
    color: #171004;
    font: 900 36px/1 'Cairo', sans-serif;
    box-shadow: 0 8px 24px rgba(0,0,0,0.42), 0 0 22px rgba(255,216,61,0.34);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
  }
  .kite-float-btn.down {
    background: radial-gradient(circle at 35% 25%, rgba(255,255,255,0.24), rgba(120,205,255,0.80) 42%, rgba(31,93,170,0.94));
    border-color: rgba(135, 206, 250, 0.78);
  }
  .kite-float-btn:active {
    transform: scale(0.92);
    box-shadow: 0 4px 18px rgba(0,0,0,0.48), 0 0 28px rgba(255,216,61,0.55);
  }
  @media (min-width: 901px) and (hover: hover) and (pointer: fine) {
    .kite-float-controls { display: none; }
  }
  @media (max-width: 520px) and (pointer: coarse) {
    .kite-float-controls {
      right: 10px;
      bottom: 24px;
      gap: 9px;
    }
    .kite-float-btn {
      width: min(78px, 17vw);
      height: 44px;
      border-radius: 16px;
      font-size: 25px;
    }
  }

  /* ========== HINT ========== */
  .hint {
    text-align: center;
    font-size: 12px;
    color: var(--dim);
    margin-top: 10px;
  }
  .hint kbd {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 2px 8px; border-radius: 6px;
    font-size: 11px; font-family: inherit; color: var(--txt);
  }

  /* ========== SHOP MODAL ========== */
  .modal-bg {
    position: fixed; inset: 0;
    background: rgba(8,11,17,0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center; justify-content: center;
    z-index: 100;
    padding: 16px;
    animation: modalIn 0.25s ease;
  }
  .modal-bg.show { display: flex; }
  @keyframes modalIn { from { backdrop-filter: blur(0); } to { backdrop-filter: blur(10px); } }
  .modal {
    background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
    border: 1px solid var(--pnl-bd);
    border-radius: 20px;
    padding: 22px;
    width: 100%; max-width: 520px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-card), 0 0 60px rgba(255,179,0,0.1);
    animation: modalPop 0.3s cubic-bezier(.34,1.56,.64,1);
  }
  @keyframes modalPop { from { transform: scale(0.9); } to { transform: scale(1); } }
  .modal-hdr {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; margin-bottom: 18px;
  }
  .modal-hdr h2 {
    font-size: 22px; font-weight: 900;
    background: linear-gradient(135deg, var(--gld), #fff, var(--gld));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
  }
  .modal-hdr .desc { font-size: 12px; color: var(--dim); line-height: 1.5; }
  .gold-pill {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(255,179,0,0.12);
    border: 1px solid rgba(255,179,0,0.5);
    color: var(--gld); font-weight: 900;
    padding: 6px 12px; border-radius: 999px;
    font-size: 14px; font-feature-settings: 'tnum';
    box-shadow: 0 0 16px rgba(255,179,0,0.2);
  }
  .shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .shop-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    transition: 0.15s;
    position: relative;
    overflow: hidden;
  }
  .shop-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--card-c, var(--gld)), transparent 60%);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
  }
  .shop-card:hover:not(.disabled) {
    transform: translateY(-3px);
    border-color: var(--card-c, var(--gld));
    box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 20px color-mix(in srgb, var(--card-c, var(--gld)) 25%, transparent);
  }
  .shop-card:hover:not(.disabled)::before { opacity: 0.08; }
  .shop-card.disabled { opacity: 0.4; cursor: not-allowed; }
  .shop-card .ic { font-size: 24px; margin-bottom: 6px; }
  .shop-card .name { font-weight: 900; font-size: 14px; color: var(--txt); margin-bottom: 4px; }
  .shop-card .d { font-size: 11px; color: var(--dim); line-height: 1.5; min-height: 32px; margin-bottom: 8px; }
  .shop-card .cost {
    display: inline-flex; align-items: center; gap: 4px;
    font-weight: 900; font-size: 13px;
    color: var(--gld);
    background: rgba(255,179,0,0.1);
    padding: 3px 9px; border-radius: 999px;
    border: 1px solid rgba(255,179,0,0.3);
    font-feature-settings: 'tnum';
  }
  .shop-card.shield  { --card-c: #1D9BF0; }
  .shop-card.magnet  { --card-c: #9B51E0; }
  .shop-card.x2      { --card-c: #E63946; }
  .shop-card.life    { --card-c: #27ae60; }
  .shop-card.djump   { --card-c: #FFD86B; }
  .shop-card.boost   { --card-c: #FF6B35; }

  .modal-foot { margin-top: 16px; display: flex; justify-content: flex-end; gap: 8px; }

  /* ========== RESPONSIVE ========== */
  @media (max-width: 640px) {
    body { padding: 6px; }
    .topbar { padding: 7px 10px; border-radius: 12px; margin-bottom: 8px; }
    .brand { font-size: 13px; }
    .brand .badge { width: 26px; height: 26px; font-size: 14px; }
    .icon-btn { width: 32px; height: 32px; font-size: 13px; }
    .stats { grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 8px; }
    .stat { padding: 6px 8px; border-radius: 10px; }
    .stat .val { font-size: 18px; }
    .stat.gold .val { font-size: 20px; }
    .stat .lbl { font-size: 9px; }
    .pbars { margin-bottom: 8px; gap: 6px; }
    .pbar { padding: 5px 9px; border-radius: 10px; }
    .pbar .pname { display: none; }
    .pbar .pi { font-size: 13px; }
    .pbar .pval { font-size: 10px; min-width: 32px; }
    .pu-row { min-height: 30px; gap: 6px; margin-bottom: 8px; }
    .pu { font-size: 11px; padding: 5px 10px; }
    .pu .pu-ic { font-size: 13px; }
    .scr .ico { font-size: 44px; }
    .scr .h { font-size: 22px; }
    .scr .sub { font-size: 12px; }
    .shop-grid { grid-template-columns: 1fr; }
    .modal { padding: 18px; border-radius: 18px; }
    .hint { display: none; }
    .controls { gap: 8px; margin-top: 8px; }
    .controls .ctrl { height: 72px; min-height: 64px; border-radius: 20px; }
    .controls .ctrl .ctrl-ico { width: 28px; height: 28px; }
    .controls .ctrl .ctrl-lbl { font-size: 13px; }
    .controls .ctrl-jump .ctrl-ico { width: 32px; height: 32px; }
  }

  /* ========== FULLSCREEN (default on all sizes) ========== */
  .app.fs {
    position: fixed;
    left: 0; right: 0; top: 0;
    /* --real-vh is set by JS to window.visualViewport.height — the actual visible pixels.
       100dvh is the modern fallback; 100vh is the last resort (wrong on Android Chrome with toolbar). */
    height: var(--real-vh, 100dvh);
    max-width: none;
    width: 100%;
    padding: 8px;
    /* Respect notch / nav-bar safe areas */
    padding-top:    max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    padding-left:   max(8px, env(safe-area-inset-left));
    padding-right:  max(8px, env(safe-area-inset-right));
    display: flex; flex-direction: column;
    gap: 6px;
    background: var(--bg);
    z-index: 50;
    overflow: hidden;
    box-sizing: border-box;
  }
  .app.fs .topbar { margin-bottom: 0; }
  .app.fs .stats { margin-bottom: 0; }
  .app.fs .pbars { margin-bottom: 0; }
  .app.fs .pu-row { margin-bottom: 0; min-height: 0; }
  .app.fs .pu-row:empty { display: none; }
  .app.fs .stage { flex: 1; min-height: 0; display: flex; }
  .app.fs canvas#gameCanvas {
    width: 100%; height: 100%;
    aspect-ratio: auto;
    display: block;
  }
  .app.fs .hint { display: none; }
  body.fs-on {
    display: block;
    padding: 0;
    overflow: hidden;
    position: fixed;        /* kills Android overscroll bounce */
    width: 100%;
    height: 100%;
  }

  .app.fs.mobile-run-layout {
    padding: max(4px, env(safe-area-inset-top)) max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    gap: 0;
  }
  .app.fs.mobile-run-layout .topbar,
  .app.fs.mobile-run-layout .stats,
  .app.fs.mobile-run-layout .pbars,
  .app.fs.mobile-run-layout .pu-row,
  .app.fs.mobile-run-layout > .controls {
    display: none !important;
  }
  .app.fs.mobile-run-layout .stage {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    width: 100%;
  }
  .app.fs.mobile-run-layout canvas#gameCanvas {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }
  .app.fs.mobile-run-layout .play-fab {
    display: flex !important;
    z-index: 18;
  }
  /* Bigger, emphasized shop button for easy access on touch UI */
  .app.fs.mobile-run-layout .play-fab #shopFab {
    width: 58px; height: 58px;
    font-size: 28px;
    border-color: rgba(255, 179, 0, 0.85);
    box-shadow: 0 6px 18px rgba(0,0,0,0.5), 0 0 22px rgba(255,179,0,0.5);
  }
  /* Show the in-stage HUD (timer + hearts) during the run */
  .app.fs.mobile-run-layout .run-hud {
    display: flex !important;
    position: fixed;
    top: 5px;
    transform: translateX(-50%) scale(0.7);
    transform-origin: top center;
  }

  @media (max-width: 900px) and (orientation: portrait) and (pointer: coarse) {
    .rotate-notice { display: flex; }
    .app.fs { filter: blur(4px); pointer-events: none; }
  }

  @media (orientation: landscape) and (max-height: 900px) and (pointer: coarse) {
    .app.fs {
      padding: max(4px, env(safe-area-inset-top)) max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
      gap: 0;
      height: 100dvh !important;
      top: 0 !important;
    }
    .app.fs .topbar,
    .app.fs .stats,
    .app.fs .pbars,
    .app.fs .pu-row,
    .app.fs > .controls {
      display: none !important;
    }
    .app.fs .stage {
      flex: 1 1 auto;
      min-height: 0;
      height: 100%;
      width: 100%;
      border-radius: 10px;
      border-color: rgba(255,179,0,0.22);
    }
    .app.fs canvas#gameCanvas {
      width: 100%;
      height: 100%;
      aspect-ratio: auto;
    }
    .app.fs.mobile-run-layout {
      height: 100dvh !important;
      top: 0 !important;
    }
    .app.fs.mobile-run-layout .stage {
      border-radius: 10px;
      border-color: rgba(255,179,0,0.22);
    }
    .app.fs.mobile-run-layout .play-fab {
      top: 20px;
      right: 30px;
    }
    .app.fs.mobile-run-layout .play-fab.menu-open {
      right: 40px;
    }
    .app.fs.mobile-run-layout .play-fab .fab {
      width: 46px;
      height: 46px;
      border-radius: 13px;
      background: rgba(8,11,17,0.72);
    }
    .app.fs.mobile-run-layout .play-fab #shopFab {
      width: 60px;
      height: 60px;
      font-size: 28px;
    }
    .app.fs.mobile-run-layout .run-hud {
      top: 5px;
    }
    .app.fs #mapScr {
      padding: 10px 10px 74px;
    }
    .app.fs .mobile-guide-entry {
      display: inline-flex;
      top: max(8px, env(safe-area-inset-top));
      left: max(8px, env(safe-area-inset-left));
      min-height: 42px;
      padding: 0 11px;
      font-size: 12px;
    }
    .app.fs #mapScr .ico,
    .app.fs #mapScr .sub {
      display: none;
    }
    .app.fs #mapScr .h {
      font-size: 18px;
      margin-bottom: 6px;
    }
    .app.fs #mapScr .lvl-grid {
      max-width: none;
      grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
      gap: 7px;
    }
    .app.fs #mapScr .lvl-card {
      padding: 8px 7px;
      border-radius: 10px;
    }
    .app.fs.mobile-run-layout #mapScr {
      padding: 10px 10px 74px;
    }
    .app.fs.mobile-run-layout #mapScr .ico,
    .app.fs.mobile-run-layout #mapScr .sub {
      display: none;
    }
    .app.fs.mobile-run-layout #mapScr .h {
      font-size: 18px;
      margin-bottom: 6px;
    }
    .app.fs.mobile-run-layout #mapScr .lvl-grid {
      max-width: none;
      grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
      gap: 7px;
    }
    .app.fs.mobile-run-layout #mapScr .lvl-card {
      padding: 8px 7px;
      border-radius: 10px;
    }
  }
  /* ========== AD OVERLAY ========== */
  #adOverlay {
    position: fixed; inset: 0; z-index: 600;
    display: none; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(8,11,17,0.96);
    backdrop-filter: blur(12px);
  }
  #adOverlay.show { display: flex; }
  .ad-box {
    background: linear-gradient(160deg,#0d1320,#141c30);
    border: 1px solid rgba(255,179,0,0.2);
    border-radius: 20px; padding: 18px 20px 16px;
    text-align: center; min-width: 320px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
  }
  #adSenseWrap { display: none; }
  /* AdSense interstitial renders as Google-managed full-screen overlay */
  .ad-sub { font-size: 12px; color: var(--dim); }
  .ad-bar-wrap { width: 100%; height: 5px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; }
  .ad-bar { height: 100%; background: linear-gradient(90deg,var(--gld),var(--gld-2)); border-radius: 999px; width: 0%; transition: width 0.1s linear; }
  #adSkipBtn {
    display: none; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18); color: var(--txt);
    font-family: inherit; font-size: 13px; font-weight: 700;
    padding: 6px 22px; border-radius: 999px; cursor: pointer; transition: background 0.2s;
  }
  #adSkipBtn:hover { background: rgba(255,255,255,0.18); }
  #debugPanel {
    position: fixed; inset: 0; z-index: 500;
    display: none; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  }
  #debugPanel.open { display: flex; }
  #debugInner {
    background: linear-gradient(160deg, #0a0e1c, #111827);
    border: 1px solid rgba(255,179,0,0.35);
    border-radius: 20px; padding: 24px 22px;
    width: min(420px, 92vw);
    max-height: calc(var(--real-vh, 100dvh) - 28px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-shadow: 0 0 60px rgba(255,100,0,0.25), 0 20px 60px rgba(0,0,0,0.7);
    position: relative;
  }
  #debugInner h3 {
    font-size: 18px; font-weight: 900; margin-bottom: 4px;
    background: linear-gradient(135deg, #FF6B35, #FFB300, #FF6B35);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    display: flex; align-items: center; gap: 8px;
  }
  #debugInner .dbg-sub { font-size: 11px; color: var(--dim); margin-bottom: 18px; }
  #debugClose {
    position: absolute; top: 14px; left: 14px;
    width: 30px; height: 30px; border-radius: 8px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: var(--txt); cursor: pointer; font-size: 14px;
    display: grid; place-items: center; font-family: inherit;
    transition: 0.15s;
  }
  #debugClose:hover { background: rgba(230,57,70,0.2); border-color: rgba(230,57,70,0.5); color: var(--red); }
  .dbg-section { margin-bottom: 16px; }
  .dbg-label { font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
  .dbg-btns { display: flex; gap: 6px; flex-wrap: wrap; }
  .dbg-btn {
    padding: 7px 14px; border-radius: 9px; border: none; cursor: pointer;
    font-family: inherit; font-size: 13px; font-weight: 800;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: var(--txt); transition: 0.15s;
  }
  .dbg-btn:hover { background: rgba(255,179,0,0.15); border-color: rgba(255,179,0,0.5); color: var(--gld); }
  .dbg-btn.active { background: rgba(255,179,0,0.25); border-color: var(--gld); color: var(--gld); }
  .dbg-btn.dur-btn.active { background: rgba(255,107,53,0.25); border-color: #FF6B35; color: #FF6B35; }
  .dbg-btn.road-start-btn.active,
  .dbg-btn.alex-start-btn.active { background: rgba(78,201,176,0.22); border-color: #4EC9B0; color: #8FF5DC; }
  .dbg-btn.red:hover { background: rgba(230,57,70,0.2); border-color: var(--red); color: var(--red); }
  .dbg-input-row { display: flex; gap: 6px; margin-bottom: 8px; }
  .dbg-input {
    min-width: 0; flex: 1; padding: 7px 10px; border-radius: 9px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: var(--txt); font-family: inherit; font-size: 13px; font-weight: 800;
  }
  .dbg-input:focus { outline: none; border-color: rgba(255,179,0,0.55); box-shadow: 0 0 0 2px rgba(255,179,0,0.12); }
  .dbg-toggle {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-radius: 10px;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 8px; cursor: pointer; transition: 0.15s;
  }
  .dbg-toggle:hover { background: rgba(255,179,0,0.06); border-color: rgba(255,179,0,0.2); }
  .dbg-toggle .tgl-label { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
  .dbg-toggle .tgl-desc { font-size: 10px; color: var(--dim); margin-top: 2px; }
  .tgl-pill {
    width: 40px; height: 22px; border-radius: 999px;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
    position: relative; transition: 0.2s; flex-shrink: 0;
  }
  .tgl-pill::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; opacity: 0.4; transition: 0.2s; }
  .tgl-pill.on { background: rgba(39,174,96,0.4); border-color: var(--grn); }
  .tgl-pill.on::after { left: 21px; opacity: 1; background: var(--grn); }
  .dbg-divider { height: 1px; background: rgba(255,255,255,0.07); margin: 14px 0; }
  #debugPanel .dbg-hint { font-size: 10px; color: var(--dim); text-align: center; margin-top: 6px; opacity: 0.6; }


  /* ========== IN-STAGE FAB MENU (Pause + Map + Guide + Shop) ========== */
  .play-fab {
    position: fixed;
    top: 20px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    z-index: 18;
    pointer-events: auto;
  }
  .play-fab.menu-open {
    right: 40px;
  }
  .fab-menu-actions {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }
  .play-fab.menu-open .fab-menu-actions { display: flex; }
  .play-fab .fab {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(13, 19, 32, 0.78);
    border: 1.5px solid rgba(255, 179, 0, 0.45);
    color: var(--gld-2);
    font-size: 20px; line-height: 1;
    display: grid; place-items: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.45), 0 0 14px rgba(255,179,0,0.22);
    transition: transform .15s, border-color .15s, box-shadow .15s;
    font-family: inherit;
    padding: 0;
    position: relative;
  }
  .play-fab .fab:hover { transform: translateY(-2px); border-color: var(--gld); box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 22px rgba(255,179,0,0.45); }
  .play-fab .fab:active { transform: scale(.93); }
  .play-fab .fab.menu {
    color: #fff;
    border-color: rgba(255,255,255,0.35);
    background: rgba(8,11,17,0.82);
    font-size: 22px;
  }
  .play-fab.menu-open .fab.menu {
    color: var(--gld-2);
    border-color: rgba(255,179,0,0.78);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 22px rgba(255,179,0,0.45);
  }
  .play-fab .fab.pause {
    color: #8FCBFF;
    border-color: rgba(29,155,240,0.5);
    box-shadow: 0 4px 14px rgba(0,0,0,0.45), 0 0 14px rgba(29,155,240,0.22);
  }
  .play-fab .fab.pause:hover { border-color: #1D9BF0; box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 22px rgba(29,155,240,0.45); }
  .play-fab .help-dot {
    position: absolute;
    top: -6px; left: -6px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gld-2), var(--gld));
    color: #1a1000;
    font-weight: 900;
    font-size: 12px;
    display: grid; place-items: center;
    border: 2px solid var(--bg-2);
    cursor: help;
    box-shadow: 0 2px 8px rgba(255,179,0,0.5);
    transition: transform .15s;
    padding: 0;
    font-family: inherit;
  }
  .play-fab .help-dot:hover { transform: scale(1.12); }
  .fab-shop-wrap { position: relative; }
  .shop-tip {
    position: absolute;
    top: 0; right: 54px;
    background: rgba(13, 19, 32, 0.96);
    border: 1px solid rgba(255, 179, 0, 0.55);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--txt);
    width: 230px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 18px rgba(255,179,0,0.18);
    display: none;
    z-index: 6;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: right;
    animation: tipIn .2s ease;
  }
  .shop-tip.show { display: block; }
  @keyframes tipIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
  .shop-tip h4 {
    font-size: 13px; font-weight: 900; margin-bottom: 8px;
    color: var(--gld);
    display: flex; align-items: center; gap: 6px;
  }
  .shop-tip ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
  .shop-tip li { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--txt); }
  .shop-tip li .ti { width: 16px; text-align: center; }
  .shop-tip .foot { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 10.5px; color: var(--dim); }
  @media (max-width: 640px) {
    .play-fab { top: 8px; right: 8px; gap: 6px; }
    .fab-menu-actions { gap: 6px; }
    .play-fab .fab { width: 40px; height: 40px; font-size: 18px; }
    .play-fab .help-dot { width: 18px; height: 18px; font-size: 11px; }
    .shop-tip { width: 200px; font-size: 11.5px; }
  }

  /* ===== In-stage run HUD: timer + lives (mobile/tablet during the run) ===== */
  .run-hud {
    display: none;            /* shown only via .mobile-run-layout below */
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 16;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(13, 19, 32, 0.78);
    border: 1.5px solid rgba(255, 179, 0, 0.45);
    box-shadow: 0 4px 14px rgba(0,0,0,0.45), 0 0 14px rgba(255,179,0,0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* Tappable so it doubles as the debug-unlock zone during mobile play
       (tap 5×). It sits clear of the canvas, so this won't trigger jumps. */
    pointer-events: auto;
  }
  .run-hud-time {
    display: flex; align-items: center; gap: 5px;
    font-weight: 900; font-size: 20px; color: var(--gld-2);
    font-variant-numeric: tabular-nums;
  }
  .run-hud-time .rh-ic { font-size: 16px; }
  .run-hud-stat {
    display: flex; align-items: center; gap: 4px;
    font-weight: 900; font-size: 16px;
    font-variant-numeric: tabular-nums;
  }
  .run-hud-stat .rh-ic { font-size: 13px; }
  .run-hud-stat.score { color: var(--gld-2); }
  .run-hud-stat.gold  {
    color: #FFD86B;
    gap: 6px;
  }
  .run-hud-stat.gold .gold-mark {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
    font-size: 12px;
  }
  /* Thin divider between HUD chips */
  .run-hud-stat::before {
    content: ''; width: 1px; height: 16px;
    margin-right: 4px;
    background: rgba(255,255,255,0.18);
  }
  .run-hud-hearts {
    display: flex; align-items: center; gap: 3px;
    font-size: 20px; line-height: 1; color: var(--red);
  }
  .run-hud-hearts .h-on  { filter: drop-shadow(0 0 6px rgba(230,57,70,0.7)); }
  .run-hud-hearts .h-off { opacity: 0.25; filter: grayscale(1); }
  .run-hud.danger { border-color: rgba(230,57,70,0.7); box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 18px rgba(230,57,70,0.5); }
  .run-hud.danger .run-hud-time { color: #FF6B6B; }
  .run-hud.critical { animation: critPulse 0.8s ease-in-out infinite; }

  .stage-info {
    position: absolute;
    left: 50%;
    bottom: max(10px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 18;
    display: none;
    align-items: center;
    gap: 7px;
    max-width: calc(100% - 18px);
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(13, 19, 32, 0.82);
    border: 1px solid rgba(255,179,0,0.34);
    box-shadow: 0 4px 14px rgba(0,0,0,0.42), 0 0 12px rgba(255,179,0,0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: none;
  }
  .stage-info span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
    color: var(--txt);
    font-size: 12px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .stage-info b { font-style: normal; font-size: 12px; line-height: 1; }
  .stage-info .stage-gold { color: #FFD86B; }
  .stage-info .stage-gold .gold-mark {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    font-size: 11px;
  }
  .stage-info i { font-style: normal; overflow: hidden; text-overflow: ellipsis; }

  .stage:has(> #startScr.on) .stage-info,
  .stage:has(> #mapScr.on) .stage-info { display: flex; }
  @media (max-width: 720px), (pointer: coarse) {
    .stage-info {
      top: max(8px, env(safe-area-inset-top));
      bottom: auto;
      font-size: 11px;
    }
  }

/* ── Language switcher ─────────────────────────────────────── */
#langSwitcher {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
  z-index: 8000;
  background: rgba(0,0,0,0.45);
  border-radius: 999px;
  padding: 3px 6px;
}
.lang-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 999px;
  transition: all .15s;
  letter-spacing: 0.02em;
  line-height: 1.6;
}
.lang-btn:hover { color: #fff; background: rgba(255,255,255,0.12); }
.lang-btn.active { color: #FFB300; background: rgba(255,179,0,0.18); }

/* ── Language switcher ─────────────────────────────── */
#brLangSwitcher{position:fixed;top:14px;right:12px;display:flex;gap:4px;z-index:8500;background:rgba(0,0,0,0.5);border-radius:999px;padding:4px 7px;backdrop-filter:blur(4px);}
.br-lang-btn{background:transparent;border:none;color:rgba(255,255,255,0.5);font-size:13px;font-weight:700;font-family:inherit;cursor:pointer;padding:3px 9px;border-radius:999px;line-height:1.7;transition:color .15s,background .15s;}
.br-lang-btn:hover{color:#fff;background:rgba(255,255,255,0.12);}
.br-lang-btn.active{color:#FFB300;background:rgba(255,179,0,0.2);}
body.game-playing #langSwitcher,
body.game-playing #brLangSwitcher { display: none !important; }
/* Mobile / tablet: keep the language icons pinned to the top-right corner, enlarged for easy tapping */
@media (max-width: 900px), (pointer: coarse) {
  #brLangSwitcher{top:calc(env(safe-area-inset-top) + 8px);right:8px;gap:5px;padding:5px 9px;}
  .br-lang-btn{font-size:16px;padding:6px 12px;}
}

/* Primary map button in topbar — pill with icon + label */
  .icon-btn.map-btn-primary {
    width: auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0 14px 0 12px;
    gap: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255,179,0,0.22), rgba(255,179,0,0.08));
    border: 1.5px solid rgba(255,179,0,0.55);
    color: #FFD86B;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 10px rgba(255,179,0,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
    position: relative;
    touch-action: manipulation;
  }
  .icon-btn.map-btn-primary:hover {
    background: linear-gradient(135deg, rgba(255,179,0,0.32), rgba(255,179,0,0.14));
    border-color: #FFB300;
    box-shadow: 0 4px 16px rgba(255,179,0,0.30), inset 0 1px 0 rgba(255,255,255,0.10);
    transform: translateY(-1px);
  }
  .icon-btn.map-btn-primary:active { transform: scale(0.96); }
  .icon-btn.map-btn-primary .map-ico {
    font-size: 18px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
  }
  .icon-btn.map-btn-primary .map-lbl {
    font-family: inherit;
    white-space: nowrap;
  }
  /* Subtle pulse to draw the eye */
  .icon-btn.map-btn-primary::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 14px;
    border: 1.5px solid rgba(255,179,0,0.45);
    opacity: 0;
    animation: mapPulse 2.6s ease-out infinite;
    pointer-events: none;
  }
  @keyframes mapPulse {
    0%   { opacity: 0.85; transform: scale(0.96); }
    70%  { opacity: 0;    transform: scale(1.12); }
    100% { opacity: 0;    transform: scale(1.18); }
  }

  /* In-stage Map FAB — quick access while playing */
  .play-fab .fab.map {
    color: #FFD86B;
    border-color: rgba(255,179,0,0.55);
    background: linear-gradient(135deg, rgba(255,179,0,0.22), rgba(255,140,0,0.08));
    box-shadow: 0 4px 14px rgba(0,0,0,0.45), 0 0 14px rgba(255,179,0,0.28);
  }
  .play-fab .fab.map:hover {
    border-color: #FFB300;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 22px rgba(255,179,0,0.50);
  }
  .icon-btn.guide-btn-primary,
  .play-fab .fab.guide {
    color: #6FE6A0;
    border-color: rgba(111,230,160,0.55);
    background: linear-gradient(135deg, rgba(111,230,160,0.18), rgba(29,155,240,0.10));
    font-weight: 900;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35), 0 0 14px rgba(111,230,160,0.20);
  }
  .icon-btn.guide-btn-primary {
    width: auto;
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0 12px;
    gap: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }
  .guide-lbl {
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
  }
  .play-fab .fab.guide {
    width: auto;
    min-width: 62px;
    padding: 0 10px;
    gap: 5px;
  }
  .play-fab .fab.guide .guide-ico {
    width: 18px;
    height: 18px;
    font-size: 12px;
  }
  .guide-fab-lbl {
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
  }
  .mobile-guide-entry {
    display: none;
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    z-index: 24;
    min-height: 44px;
    padding: 0 13px;
    gap: 7px;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    border: 1.5px solid rgba(111,230,160,0.68);
    background: rgba(8,11,17,0.82);
    color: #6FE6A0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 6px 18px rgba(0,0,0,0.48), 0 0 18px rgba(111,230,160,0.25);
    touch-action: manipulation;
  }
  .mobile-guide-entry .guide-ico {
    width: 20px;
    height: 20px;
    font-size: 13px;
  }
  .stage:has(> #guideScr.on) .mobile-guide-entry,
  .stage:has(> #pauseScr.on) .mobile-guide-entry,
  .app.mobile-run-layout .mobile-guide-entry {
    display: none !important;
  }
  .icon-btn.guide-btn-primary:hover,
  .play-fab .fab.guide:hover {
    border-color: #6FE6A0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 22px rgba(111,230,160,0.42);
  }
  .guide-ico {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid currentColor;
    line-height: 1;
  }

  /* Game-over map CTA spacing */
  .scr.lose .map-cta { margin-top: 4px; }

  /* ── MOBILE: huge, undeniable map button ───────────────────── */
  @media (max-width: 720px) {
    .topbar { gap: 6px; padding: 8px 10px; }
    .brand {
      font-size: 13px;
      padding: 4px 6px 4px 2px;
      min-width: 0;
      flex: 0 1 auto;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .brand .badge { width: 30px; height: 30px; font-size: 16px; }
    .top-actions { gap: 4px; flex-shrink: 0; }
    .icon-btn.map-btn-primary {
      min-width: 52px;
      min-height: 40px;
      padding: 0 12px 0 10px;
      font-size: 13.5px;
      border-radius: 12px;
    }
    .icon-btn.map-btn-primary .map-ico { font-size: 17px; }
    .icon-btn.map-btn-primary .map-lbl { font-size: 13px; }
    .icon-btn:not(.map-btn-primary) {
      width: 36px; height: 36px;
      font-size: 14px;
    }
    .icon-btn.guide-btn-primary {
      width: auto;
      min-width: 100px;
      height: 40px;
      padding: 0 10px;
      font-size: 15px;
      border-radius: 12px;
      order: 0;
    }
    .icon-btn.guide-btn-primary .guide-lbl {
      display: inline;
      font-size: 12px;
    }
    .mobile-guide-entry {
      display: inline-flex;
    }
    .play-fab .fab.guide {
      min-width: 58px;
      height: 40px;
      font-size: 12px;
    }
    #startScr {
      justify-content: flex-start;
      padding-top: max(14px, env(safe-area-inset-top));
      padding-bottom: max(78px, env(safe-area-inset-bottom));
    }
    #startScr .ico { font-size: 36px; margin-bottom: 3px; }
    #startScr .h { font-size: 20px; margin-bottom: 3px; }
    #startScr .sub { font-size: 11px; margin-bottom: 8px; line-height: 1.35; }
    #startScr .keys { margin-bottom: 8px; gap: 5px; }
    #startScr .cta { margin-top: 0; transform: translateY(-6px); }
    .guide-screen {
      padding: max(30px, calc(env(safe-area-inset-top) + 20px)) 10px max(76px, env(safe-area-inset-bottom));
      gap: 8px;
    }
    .guide-head {
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 8px;
      align-items: start;
    }
    .guide-head .ico {
      width: 42px;
      height: 42px;
      font-size: 24px;
      border-radius: 12px;
    }
    .guide-head .h { font-size: 19px; }
    .guide-head .sub { font-size: 11px; line-height: 1.3; }
    .guide-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 7px;
    }
    .guide-card {
      min-height: 132px;
      padding: 8px;
    }
    .guide-scene { height: 44px; }
    .guide-card h3 { font-size: 12.5px; margin: 6px 0 2px; }
    .guide-card p { font-size: 10.5px; line-height: 1.3; }
    .guide-actions .cta {
      min-height: 42px;
      padding: 9px 18px;
      font-size: 13px;
    }
    .guide-top-actions {
      position: static;
      width: auto;
      padding: 0;
      background: none;
      gap: 5px;
      align-self: start;
    }
    .guide-top-actions .map-back-game,
    .guide-top-actions #guideCloseBtn {
      flex: 0 0 auto;
      min-width: 0;
      min-height: 40px;
      padding: 8px 12px;
      font-size: 12px;
    }
    .guide-top-actions .map-back-game { min-width: 96px; }
    .scr.lose {
      padding-top: max(10px, env(safe-area-inset-top));
      padding-bottom: max(18px, env(safe-area-inset-bottom));
    }
    .scr.lose .ico {
      font-size: 34px;
      margin-bottom: 0;
    }
    .scr.lose .h {
      font-size: 22px;
      margin-bottom: 0;
    }
    .scr.lose > .cta:not(.map-cta) {
      width: min(100%, 320px);
      min-height: 52px;
      padding: 12px 18px;
      font-size: 16px;
      margin: 0 0 2px;
    }
    .scr.lose .map-cta {
      width: min(100%, 280px);
      min-height: 44px;
      padding: 10px 16px;
      margin-top: 0;
    }
    .scr.lose .end-stats {
      width: min(100%, 360px);
      margin: 4px 0;
      padding: 10px 12px;
      gap: 8px;
      justify-content: center;
      flex-wrap: wrap;
    }
    .scr.lose .end-stats .es-v { font-size: 18px; }
    .scr.lose .lifetime-stats .es-v { font-size: 14px; }
    #debugPanel {
      align-items: flex-start;
      padding: max(10px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
      overflow: hidden;
    }
    #debugInner {
      width: min(520px, 100%);
      max-height: calc(var(--real-vh, 100dvh) - max(20px, env(safe-area-inset-top)) - max(20px, env(safe-area-inset-bottom)));
      padding: 18px 14px;
      border-radius: 16px;
    }
    #debugClose {
      position: sticky;
      top: 0;
      z-index: 2;
      margin-inline-start: auto;
      margin-bottom: 4px;
    }
  }

  @media (max-width: 420px) {
    .brand { font-size: 0; }
    .brand .badge { font-size: 16px; }
    .brand .badge + span { display: none; }
    .icon-btn.guide-btn-primary {
      min-width: 92px;
      padding: 0 8px;
    }
    .icon-btn.guide-btn-primary .guide-lbl { font-size: 11.5px; }
  }

  @media (max-width: 380px) {
    .icon-btn.map-btn-primary { min-width: 44px; padding: 0 10px; }
    /* Fullscreen button hidden on tiny screens — map button gets priority */
    #fsBtn { display: none; }
  }

  /* Map screen: bigger finger-friendly cards */
  @media (max-width: 720px) {
    #mapScr .lvl-grid { gap: 8px; }
    .lvl-card { min-height: 96px; }
  }

/* Last updated: 2026-05-24 — adaptive difficulty UI + checkpoint button */
.difficulty-picker {
  background: rgba(20,28,48,0.78);
  border: 1px solid rgba(255,179,0,0.22);
  border-radius: 14px;
  padding: 10px;
  margin: 8px auto 10px;
  max-width: 520px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}
.diff-title {
  font-size: 12px;
  font-weight: 900;
  color: var(--gld-2);
  margin-bottom: 8px;
}
.diff-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.diff-btn {
  border: 1px solid rgba(255,179,0,0.25);
  background: rgba(255,255,255,0.05);
  color: var(--txt);
  border-radius: 12px;
  padding: 8px 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.diff-btn.active {
  background: linear-gradient(135deg, rgba(255,179,0,0.32), rgba(255,216,107,0.16));
  border-color: rgba(255,216,107,0.72);
  color: #fff8dd;
  box-shadow: 0 0 16px rgba(255,179,0,0.22);
}
.diff-hint {
  margin-top: 7px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--dim);
}
.lvl-card .lvl-diff {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(29,155,240,0.12);
  border: 1px solid rgba(29,155,240,0.22);
  color: #9fd8ff;
  font-size: 9px;
  font-weight: 900;
}
.checkpoint-cta {
  margin-top: 8px;
  background: linear-gradient(135deg, rgba(39,174,96,0.92), rgba(29,155,240,0.85));
  border-color: rgba(126,235,169,0.5);
}
.run-sand-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 72px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 10001;
  min-width: min(92vw, 520px);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  background: rgba(40, 0, 12, 0.92);
  color: #ffe3e7;
  border: 1px solid rgba(255, 120, 140, 0.55);
  border-radius: 999px;
  padding: 10px 16px;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55), 0 0 24px rgba(230,57,70,0.28);
  transition: opacity .18s ease, transform .18s ease;
}
.run-sand-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.review-prompt {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(5, 12, 20, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.review-prompt[hidden] { display: none; }
.review-prompt.show {
  opacity: 1;
  pointer-events: auto;
}
.review-card {
  width: min(92vw, 420px);
  border-radius: 8px;
  border: 1px solid rgba(255,216,107,0.45);
  background: linear-gradient(160deg, rgba(10,20,32,0.96), rgba(25,35,35,0.96));
  color: #f8fafc;
  box-shadow: 0 18px 54px rgba(0,0,0,0.62);
  padding: 18px;
  text-align: center;
  font-family: 'Cairo', sans-serif;
}
.review-stars {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 8px;
  color: #ffd86b;
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 0 14px rgba(255,216,107,0.35);
}
.review-title {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
  margin-bottom: 8px;
}
.review-body {
  margin: 0 auto;
  max-width: 34ch;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
}
.review-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.review-actions button {
  border-radius: 8px;
  min-height: 44px;
  border: 1px solid rgba(255,255,255,0.16);
  padding: 10px 14px;
  font-family: 'Cairo', sans-serif;
  font-weight: 900;
  cursor: pointer;
}
.review-later {
  background: rgba(255,255,255,0.08);
  color: #e5e7eb;
}
.review-go {
  background: linear-gradient(135deg, #ffd86b, #27ae60);
  color: #102015;
  box-shadow: 0 10px 24px rgba(39,174,96,0.28);
}
@media (max-width: 720px) {
  .review-prompt {
    align-items: flex-start;
    padding-top: max(16px, calc(env(safe-area-inset-top) + 12px));
  }
  .review-card {
    width: min(94vw, 390px);
    padding: 14px;
  }
  .review-title { font-size: 17px; }
  .review-body { font-size: 12.5px; line-height: 1.35; }
  .review-actions { gap: 8px; margin-top: 12px; }
  .review-actions button { min-height: 42px; padding: 8px 11px; font-size: 12.5px; }
}
