    :root {
      --display: 'Baloo 2', system-ui, sans-serif;
      --body: 'Fredoka', system-ui, sans-serif;

      /* ── Surfaces — "Ice Blue" theme, lightened & more saturated blue ── */
      --bg-0: #0C2A52;
      /* app base — deep blue (was near-black navy) */
      --bg-1: #123A6C;
      /* screen gradient base */
      --surface: #1C4378;
      /* cards / panels */
      --surface-2: #265390;
      /* elevated cards */
      --surface-3: #3163A4;
      /* hover / pressed */
      --glass: rgba(130, 190, 255, .14);
      --glass-strong: rgba(9, 34, 64, .58);
      --border: rgba(135, 195, 255, .20);
      --border-strong: rgba(135, 195, 255, .36);

      /* ── Text ── */
      --ink: #EEF4FF;
      --ink-muted: #AAC6EC;
      --ink-subtle: #88A6CE;
      --on-accent: #06182E;
      /* dark text on bright accents */

      /* ── Brand / accent ── */
      --violet: #38BDF8;
      /* Light Blue (Sky-400) */
      --violet-d: #0284C7;
      /* Sky-700 */
      --cyan: #38E1F0;
      --cyan-d: #16B9CC;
      --gold: #FFC83D;
      --gold-d: #E8A92B;
      --gold-shadow: #9A6E13;
      --green: #46D67E;
      --green-d: #21B25C;
      --red: #FF6B6B;
      --red-d: #E8475A;
      --blue: #0EA5E9;
      /* Sky-500 */
      --blue-d: #0284C7;
      --purple: #38BDF8;
      --purple-d: #0284C7;
      --pink: #FB5A86;

      /* legacy aliases — repointed to the blue theme */
      --panel: #1C4378;
      --panel-soft: #123A6C;

      /* ── Elevation ── */
      --shadow: 0 18px 48px rgba(0, 12, 30, .50);
      --shadow-sm: 0 8px 22px rgba(0, 12, 30, .40);
      --glow-violet: 0 0 24px rgba(56, 189, 248, .45);
      --glow-cyan: 0 0 22px rgba(56, 225, 240, .40);

      /* ── Motion ── */
      --ease-bounce: cubic-bezier(0.34, 1.1, 0.64, 1);
      --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
      --ease-spring: cubic-bezier(0.34, 1.18, 0.64, 1);
      --dur-fast: 140ms;
      --dur: 220ms;

      /* ── Radii ── */
      --radius-sm: 12px;
      --radius-md: 18px;
      --radius-lg: 24px;
    }

    *,
    *::before,
    *::after {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    /* ── Hide scrollbars everywhere (screens are sized to fit) ──
       The Reports tab is the one exception: it keeps a visible scrollbar so its
       transaction history can scroll. */
    * {
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    *::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
    }

    #tab-reports {
      scrollbar-width: thin;
      scrollbar-color: rgba(38, 86, 150, .35) transparent;
      -ms-overflow-style: auto;
    }

    #tab-reports::-webkit-scrollbar {
      width: 9px;
      height: 9px;
      display: block;
    }

    #tab-reports::-webkit-scrollbar-thumb {
      background: rgba(38, 86, 150, .35);
      border-radius: 8px;
    }

    #tab-reports::-webkit-scrollbar-track {
      background: transparent;
    }

    html,
    body {
      height: 100%;
      overflow: hidden;
    }

    body {
      font-family: var(--body);
      color: var(--ink);
      background:
        radial-gradient(120% 80% at 50% -10%, rgba(56, 189, 248, .22) 0%, transparent 55%),
        var(--bg-0);
      -webkit-tap-highlight-color: transparent;
      user-select: none;
      -webkit-user-select: none;
      touch-action: manipulation;
    }

    button {
      font-family: var(--display);
      cursor: pointer;
      border: none;
      background: none;
    }

    input {
      font-family: var(--body);
    }

    /* ── SCREENS ── */
    .screen {
      display: none;
      height: 100vh;
      width: 100%;
      flex-direction: column;
      position: relative;
    }

    .screen.active {
      display: flex;
    }

    /* ── AUTH SCREENS ── */
    :root { --auth-c0: #0C2A52; --auth-c1: #154488; --auth-c2: #1E5AA6; }
    #auth-screen {
      background: linear-gradient(165deg, var(--auth-c0) 0%, var(--auth-c1) 55%, var(--auth-c2) 100%);
      align-items: center;
      justify-content: center;
      padding: 24px;
      overflow: hidden;
    }

    #auth-screen::before {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      background: radial-gradient(circle at 50% 12%, rgba(255, 255, 255, .22) 0%, transparent 45%);
    }

    #auth-screen>* {
      position: relative;
      z-index: 1;
    }

    @keyframes setupBounce {

      0%,
      100% {
        transform: translateY(0) rotate(-3deg);
      }

      50% {
        transform: translateY(-8px) rotate(3deg);
      }
    }

    .auth-logo {
      font-size: 56px;
      margin-bottom: 8px;
      text-align: center;
      filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .15));
      animation: setupBounce 2.5s ease-in-out infinite;
    }

    .auth-logo-img {
      width: 240px;
      max-width: 80vw;
      height: auto;
      display: block;
      margin: 0 auto;
      filter: drop-shadow(0 4px 18px rgba(0,0,0,.35));
    }

    .auth-credits {
      font-family: var(--display);
      font-weight: 900;
      font-size: 15px;
      color: #fff;
      text-align: center;
      line-height: 1.5;
      max-width: 300px;
      text-shadow: 0 2px 14px rgba(6, 24, 50, .45);
      letter-spacing: .01em;
    }

    @keyframes goodJobPop {
      0%   { transform: translate(-50%, -50%) scale(.5); opacity: 0; }
      55%  { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
      75%  { transform: translate(-50%, -50%) scale(.97); }
      100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    }

    .goodjob-overlay {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(.5);
      z-index: 12000;
      pointer-events: none;
      animation: goodJobPop .45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
      text-align: center;
    }

    .goodjob-box {
      background: linear-gradient(135deg, #0ea5e9, #0284c7);
      border: 3px solid #FFC83D;
      border-radius: 24px;
      padding: 22px 38px;
      box-shadow: 0 0 40px rgba(14,165,233,.55), 0 8px 32px rgba(0,0,0,.45);
    }

    .goodjob-title {
      font-family: var(--display);
      font-size: 38px;
      font-weight: 900;
      color: #FFC83D;
      letter-spacing: -.5px;
      text-shadow: 0 2px 12px rgba(0,0,0,.35);
    }

    .goodjob-sub {
      font-family: var(--display);
      font-size: 22px;
      font-weight: 700;
      color: #fff;
      margin-top: 6px;
    }

    /* Bigger, more prominent +stat floats shown immediately on purchase */
    .float-big {
      font-size: 54px !important;
      font-weight: 900 !important;
      font-family: var(--display) !important;
      letter-spacing: -1px !important;
      text-shadow: 0 4px 0 rgba(0,0,0,.35), 0 0 32px rgba(34,197,94,.95), 0 0 60px rgba(34,197,94,.5) !important;
      animation: floatBigPop 2.2s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
      pointer-events: none !important;
    }
    @keyframes floatBigPop {
      0%   { opacity:0; transform: scale(0.4) translateY(0); }
      12%  { opacity:1; transform: scale(1.35) translateY(-8px); }
      22%  { transform: scale(0.95) translateY(-16px); }
      35%  { transform: scale(1.08) translateY(-26px); opacity: 1; }
      80%  { transform: scale(1.0)  translateY(-70px); opacity: 1; }
      100% { transform: scale(0.9)  translateY(-110px); opacity: 0; }
    }

    /* Discount choice menu — appears before minigame launches */
    @keyframes discountMenuIn {
      0%   { opacity: 0; transform: translateY(18px) scale(.92); }
      100% { opacity: 1; transform: translateY(0) scale(1); }
    }
    .discount-menu-overlay {
      position: fixed; top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(0,0,0,.58); backdrop-filter: blur(4px);
      z-index: 11500; display: flex; align-items: center; justify-content: center;
    }
    .discount-menu-box {
      background: linear-gradient(145deg, #0f3460, #0a2240);
      border: 2.5px solid rgba(255,200,61,.65);
      border-radius: 26px; padding: 30px 28px 26px;
      box-shadow: 0 0 60px rgba(14,165,233,.35), 0 14px 48px rgba(0,0,0,.65);
      text-align: center; max-width: 310px; width: 86%;
      animation: discountMenuIn .3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }
    .discount-menu-icon { font-size: 42px; margin-bottom: 6px; }
    .discount-menu-title {
      font-family: var(--display); font-size: 24px; font-weight: 900; color: #FFC83D;
      margin-bottom: 8px;
    }
    .discount-menu-sub {
      font-family: var(--display); font-size: 14px; color: rgba(255,255,255,.82);
      margin-bottom: 22px; line-height: 1.5;
    }
    .discount-menu-btns { display: flex; flex-direction: column; gap: 10px; }
    .discount-play-btn {
      background: linear-gradient(145deg, #22c55e, #16a34a);
      color: #fff; font-family: var(--display); font-weight: 900; font-size: 17px;
      padding: 14px 20px; border-radius: 18px; border: 2px solid rgba(255,255,255,.35);
      box-shadow: 0 5px 0 #0f7a2a, 0 8px 24px rgba(34,197,94,.45);
      cursor: pointer; transition: transform .12s, box-shadow .12s; width: 100%;
    }
    .discount-play-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #0f7a2a; }
    .discount-skip-btn {
      background: rgba(255,255,255,.08);
      color: rgba(255,255,255,.65); font-family: var(--display); font-weight: 700; font-size: 14px;
      padding: 10px 18px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.18);
      cursor: pointer; transition: opacity .15s; width: 100%;
    }
    .discount-skip-btn:active { opacity: .6; }

    .auth-title {
      font-size: 38px;
      font-weight: 900;
      color: #fff;
      letter-spacing: -.5px;
      text-align: center;
      font-family: var(--display);
      text-shadow: 0 2px 14px rgba(6, 24, 50, .45);
    }

    .auth-subtitle {
      font-size: 15px;
      color: rgba(231, 240, 255, .9);
      margin-top: 6px;
      font-weight: 700;
      text-align: center;
    }

    .auth-card {
      width: 100%;
      max-width: 380px;
      margin-top: 24px;
      background: rgba(18, 48, 88, .52);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-radius: var(--radius-lg);
      padding: 24px 22px;
      border: 1px solid var(--border-strong);
      box-shadow: 0 24px 60px rgba(0, 12, 32, .45);
    }

    .auth-btn-group {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .auth-main-btn {
      width: 100%;
      padding: 16px;
      border: none;
      border-radius: var(--radius-md);
      font-size: 17px;
      font-weight: 900;
      cursor: pointer;
      transition: transform .15s var(--ease-bounce), box-shadow .15s;
      font-family: var(--display);
    }

    .auth-main-btn:active {
      transform: scale(.97);
    }

    .auth-btn-signin {
      background: linear-gradient(135deg, #FFC83D, #E8A92B);
      color: #243042;
      box-shadow: 0 5px 0 #c08820, 0 8px 20px rgba(0, 0, 0, .15);
    }

    .auth-btn-signup {
      background: rgba(255, 255, 255, .92);
      color: #3E9E4E;
      box-shadow: 0 5px 0 rgba(255, 255, 255, .4), 0 8px 20px rgba(0, 0, 0, .12);
    }

    .auth-btn-guest {
      background: rgba(255, 255, 255, .14);
      color: #fff;
      border: 2px solid rgba(255, 255, 255, .45) !important;
      box-shadow: none;
      font-size: 15px;
      padding: 13px;
    }

    .auth-divider {
      text-align: center;
      color: rgba(231, 240, 255, .85);
      font-size: 12px;
      font-weight: 700;
      margin: 4px 0;
      letter-spacing: .05em;
    }

    /* The class-code route is the one schools use, so it leads the stack. */
    .auth-btn-join {
      background: linear-gradient(135deg, #46D67E, #2FA65E);
      color: #06210f;
      box-shadow: 0 5px 0 #1f7a44, 0 8px 20px rgba(0, 0, 0, .15);
    }

    #signin-screen,
    #signup-screen,
    #join-screen,
    #pick-screen,
    #pic-screen,
    #prek-pet-screen {
      background: linear-gradient(165deg, var(--auth-c0) 0%, var(--auth-c1) 55%, var(--auth-c2) 100%);
      align-items: center;
      justify-content: flex-start;
      padding: 20px;
      padding-top: max(40px, 8vh);
      overflow-y: auto;
    }

    .auth-form-note {
      font-size: 13px;
      line-height: 1.5;
      color: rgba(231, 240, 255, .85);
      text-align: center;
      margin: -8px 0 18px;
    }

    /* A 6-letter code, spaced out so a child can check it against the card. */
    .code-input {
      text-transform: uppercase;
      letter-spacing: 10px;
      text-align: center;
      font-size: 26px !important;
      font-weight: 900;
      font-family: var(--display);
    }

    /* Tappable first names — no typing anywhere in the pre-K route. */
    .name-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
      gap: 10px;
      margin-bottom: 14px;
    }

    .name-card {
      padding: 18px 12px;
      border-radius: var(--radius-md);
      border: 2px solid rgba(255, 255, 255, .35);
      background: rgba(255, 255, 255, .12);
      color: #fff;
      font-family: var(--display);
      font-weight: 800;
      font-size: 19px;
      cursor: pointer;
      min-height: 66px;
    }

    .name-card:active { transform: scale(.96); }
    .name-card.sel { background: rgba(70, 214, 126, .3); border-color: #46D67E; }

    /* Picture password: three slots that fill as the child taps the icons. */
    .pic-slots {
      display: flex;
      justify-content: center;
      gap: 12px;
      margin-bottom: 18px;
    }

    .pic-slot {
      width: 58px;
      height: 58px;
      border-radius: var(--radius-md);
      border: 2px dashed rgba(255, 255, 255, .45);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 30px;
      background: rgba(255, 255, 255, .08);
    }

    .pic-slot.filled { border-style: solid; border-color: #46D67E; background: rgba(70, 214, 126, .18); }

    .pic-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
    }

    .pic-icon {
      aspect-ratio: 1;
      font-size: 34px;
      border-radius: var(--radius-md);
      border: 2px solid rgba(255, 255, 255, .3);
      background: rgba(255, 255, 255, .12);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .pic-icon:active { transform: scale(.93); }

    #pic-screen.wrong .pic-slots { animation: picShake .4s; }

    @keyframes picShake {
      0%, 100% { transform: translateX(0); }
      25% { transform: translateX(-9px); }
      75% { transform: translateX(9px); }
    }

    #signin-screen::before,
    #signup-screen::before {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      background: radial-gradient(circle at 50% 10%, rgba(255, 255, 255, .18) 0%, transparent 45%);
    }

    #signin-screen>*,
    #signup-screen>* {
      position: relative;
      z-index: 1;
    }

    .auth-form-card {
      width: 100%;
      max-width: 380px;
      background: rgba(18, 24, 46, .5);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-radius: var(--radius-lg);
      padding: 22px 20px;
      border: 1px solid var(--border-strong);
      box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
    }

    .auth-form-title {
      font-size: 24px;
      font-weight: 900;
      color: white;
      margin-bottom: 18px;
      text-align: center;
      font-family: var(--display);
      text-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    }

    .auth-input-label {
      font-size: 12px;
      font-weight: 800;
      color: rgba(231, 240, 255, .95);
      letter-spacing: .08em;
      text-transform: uppercase;
      display: block;
      margin-bottom: 7px;
    }

    .auth-input {
      width: 100%;
      background: rgba(255, 255, 255, .95);
      border: 2px solid transparent;
      border-radius: var(--radius-md);
      padding: 13px 15px;
      font-size: 15px;
      font-weight: 700;
      color: #243042;
      outline: none;
      margin-bottom: 16px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
      font-family: var(--body);
    }

    .auth-input:focus {
      border-color: #FFC83D;
      box-shadow: 0 0 0 3px rgba(255, 200, 61, .4);
    }

    .auth-input::placeholder {
      color: #9AA8C4;
      font-weight: 600;
    }

    .auth-error {
      color: #fff;
      background: rgba(220, 38, 38, .75);
      border-radius: 8px;
      padding: 6px 10px;
      font-size: 12px;
      font-weight: 700;
      margin-top: -10px;
      margin-bottom: 10px;
      display: none;
    }

    .auth-submit-btn {
      width: 100%;
      background: linear-gradient(135deg, #FFC83D, #E8A92B);
      color: #243042;
      border: none;
      border-radius: var(--radius-md);
      padding: 15px;
      font-size: 16px;
      font-weight: 900;
      box-shadow: 0 5px 0 #c08820, 0 8px 24px rgba(0, 0, 0, .15);
      cursor: pointer;
      transition: transform .15s, box-shadow .15s;
      font-family: var(--display);
    }

    .auth-submit-btn:active {
      transform: translateY(3px);
      box-shadow: 0 2px 0 #c08820;
    }

    .auth-back-btn {
      background: transparent;
      border: 2px solid rgba(255, 255, 255, .5);
      color: white;
      border-radius: var(--radius-md);
      padding: 10px 18px;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      margin-bottom: 16px;
      font-family: var(--display);
      display: inline-block;
    }

    .pet-select-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
      margin-bottom: 24px;
    }

    .pet-select-btn {
      background: rgba(255, 255, 255, .2);
      border: 2px solid rgba(255, 255, 255, .35);
      border-radius: var(--radius-md);
      padding: 14px 6px;
      transition: all .25s var(--ease-bounce);
      text-align: center;
    }

    .pet-select-btn.selected {
      background: rgba(255, 255, 255, .95);
      border: 3px solid #FFC83D;
      transform: scale(1.06);
      box-shadow: 0 6px 20px rgba(255, 200, 61, .45);
    }

    .pet-select-btn.selected .label {
      color: #243042;
    }

    #profile-avatar-grid .pet-select-btn,
    #signup-pet-grid .pet-select-btn {
      background: #f1f5f9;
      border: 2px solid #e2e8f0;
      border-radius: 12px;
      padding: 8px 4px;
      font-size: 24px;
      cursor: pointer;
      transition: all .18s ease;
      aspect-ratio: 1;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    #profile-avatar-grid .pet-select-btn.selected,
    #signup-pet-grid .pet-select-btn.selected {
      background: #fff8e1;
      border: 2px solid #FFC83D;
      transform: scale(1.1);
      box-shadow: 0 4px 12px rgba(255, 200, 61, .3);
    }

    .pet-select-btn .emoji {
      font-size: 30px;
      margin-bottom: 4px;
      display: block;
    }

    .pet-select-btn .label {
      font-size: 10px;
      font-weight: 800;
      color: rgba(255, 255, 255, .95);
    }

    /* ── GAME SCREEN ── */
    #game-screen {
      position: relative;
      width: 100vw;
      flex: 1;
      overflow: hidden;
    }

    canvas {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      display: block;
    }

    /* HUD */
    #hud {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      z-index: 20;
      padding: 10px 12px;
      padding-top: max(10px, env(safe-area-inset-top, 10px));
      display: flex;
      align-items: center;
      gap: 8px;
      background: linear-gradient(180deg, rgba(9, 30, 60, .58) 0%, rgba(9, 30, 60, .18) 70%, transparent 100%);
    }

    .coinbox {
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--ink);
      background: var(--glass-strong);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      padding: 7px 13px;
      border-radius: 20px;
      box-shadow: 0 4px 18px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 200, 61, .25) inset;
      font-family: var(--display);
      font-weight: 800;
      font-size: 18px;
      border: 1.5px solid rgba(255, 200, 61, .55);
    }

    .coinbox .c {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      font-size: 11px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 60%, var(--gold-d));
      box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15), 0 1px 3px rgba(0, 0, 0, .2);
    }

    .petbadge {
      display: flex;
      align-items: center;
      gap: 7px;
      color: #fff;
      background: rgba(13, 42, 78, 0.92);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      padding: 5px 11px 5px 5px;
      border-radius: 20px;
      border: 1px solid rgba(135, 195, 255, .20);
      box-shadow: 0 8px 32px rgba(0, 12, 32, .55), 0 2px 8px rgba(0, 12, 32, .35);
    }

    .petbadge .av {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      background: linear-gradient(135deg, #ffe0b2, #ffb74d);
      box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
      flex-shrink: 0;
      line-height: 1;
      overflow: hidden;
    }

    .petbadge .pn {
      font-family: var(--display);
      font-weight: 800;
      font-size: 14px;
      line-height: 1.1;
    }

    .petbadge .pn small {
      display: inline-block;
      font-family: var(--body);
      font-weight: 600;
      font-size: 10px;
      color: rgba(255, 255, 255, .75);
      background: rgba(0, 0, 0, .32);
      border-radius: 6px;
      padding: 1px 5px;
      margin-top: 2px;
    }

    .hud-spacer {
      flex: 1;
    }

    .iconbtn {
      width: 42px;
      height: 42px;
      border-radius: 50%;
      color: var(--ink);
      background: var(--glass-strong);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
      font-size: 19px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--border-strong);
      cursor: pointer;
      transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
    }

    .iconbtn:hover {
      border-color: var(--violet);
      box-shadow: var(--glow-violet);
    }

    .iconbtn:active {
      transform: scale(.88);
    }

    /* STATS — sits inside bottom container */
    #stats {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 5px;
      width: 100%;
      max-height: 100px;
      opacity: 1;
      transition: max-height .3s ease, opacity .3s ease, transform .3s ease;
    }

    #stats.hidden {
      max-height: 0;
      opacity: 0;
      pointer-events: none;
      transform: translateY(10px);
      overflow: hidden;
    }

    .stat {
      background: var(--glass-strong);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-radius: 12px;
      padding: 6px 6px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
      border: 1px solid var(--border);
    }

    .stat .lab {
      display: flex;
      align-items: center;
      gap: 3px;
      font-family: var(--display);
      font-weight: 700;
      font-size: 11.5px;
      color: var(--ink-muted);
      letter-spacing: 0.2px;
    }

    .stat .bar {
      margin-top: 5px;
      height: 8px;
      border-radius: 6px;
      background: rgba(255, 255, 255, .12);
      overflow: hidden;
      box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
    }

    .stat .fill {
      height: 100%;
      border-radius: 6px;
      transition: width .5s cubic-bezier(.3, 1, .4, 1);
    }

    .stat.health .fill {
      background: linear-gradient(90deg, #ff9999, #f44336);
      box-shadow: 0 0 6px rgba(244, 67, 54, .4);
    }

    .stat.hunger .fill {
      background: linear-gradient(90deg, #ffd76a, #ff9800);
      box-shadow: 0 0 6px rgba(255, 152, 0, .4);
    }

    .stat.happy .fill {
      background: linear-gradient(90deg, #86e09f, #43c46b);
      box-shadow: 0 0 6px rgba(67, 196, 107, .4);
    }

    .stat.clean .fill {
      background: linear-gradient(90deg, #86ccf5, #42a5f5);
      box-shadow: 0 0 6px rgba(66, 165, 245, .4);
    }

    .stat.rest .fill {
      background: linear-gradient(90deg, #c084fc, #9333ea);
      box-shadow: 0 0 6px rgba(147, 51, 234, .4);
    }

    .actbtn {
      background: linear-gradient(160deg, #ffe27a, var(--gold-d));
      color: #4a3408;
      font-family: var(--display);
      font-size: 14px;
      font-weight: 800;
      padding: 0 18px;
      height: 40px;
      border-radius: 20px;
      box-shadow: 0 4px 0 #b87d0e, 0 6px 16px rgba(0, 0, 0, .2);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      border: 2.5px solid rgba(255, 255, 255, .6);
      cursor: pointer;
      transition: transform .12s var(--ease-bounce), box-shadow .12s;
      pointer-events: auto;
      letter-spacing: 0.3px;
    }

    .actbtn:active {
      transform: translateY(3px);
      box-shadow: 0 1px 0 #b87d0e, 0 2px 8px rgba(0, 0, 0, .15);
    }

    /* BOTTOM CONTAINER */
    #bottom-container {
      position: absolute;
      bottom: calc(10px + env(safe-area-inset-bottom, 0px));
      left: 10px;
      right: 10px;
      z-index: 22;
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 10px;
      pointer-events: none;
    }

    #bottom-container>* {
      pointer-events: auto;
    }

    .nav-arrow-btn {
      width: 52px;
      height: 52px;
      border-radius: 50%;
      font-size: 20px;
      color: white;
      background: linear-gradient(145deg, #5fbde8, #3a96d0);
      box-shadow: 0 4px 0 #2274a5, 0 6px 16px rgba(0, 0, 0, .25);
      display: flex;
      align-items: center;
      justify-content: center;
      border: 2.5px solid rgba(255, 255, 255, .5);
      transition: transform .12s, box-shadow .12s;
      flex-shrink: 0;
      cursor: pointer;
    }

    .nav-arrow-btn:active {
      transform: translateY(3px);
      box-shadow: 0 1px 0 #2274a5, 0 2px 8px rgba(0, 0, 0, .2);
    }

    #stats-area {
      display: flex;
      flex-direction: column;
      align-items: center;
      flex: 1;
      min-width: 0;
    }

    .stats-toggle-btn {
      background: var(--glass-strong);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid var(--border-strong);
      color: var(--ink);
      font-family: var(--display);
      font-size: 12px;
      font-weight: 800;
      padding: 6px 12px;
      border-radius: 16px;
      margin-bottom: 6px;
      box-shadow: var(--shadow-sm);
      display: flex;
      align-items: center;
      gap: 4px;
      transition: transform .1s var(--ease-out), border-color var(--dur-fast) var(--ease-out);
      cursor: pointer;
    }

    .stats-toggle-btn:active {
      transform: scale(.95);
    }

    /* ENTER prompt — floats above the shop storefront */
    #enter-now {
      position: absolute;
      left: 50%;
      top: 26%;
      transform: translateX(-50%) scale(0);
      z-index: 21;
      background: linear-gradient(145deg, #6ed68a, var(--green-d));
      color: #fff;
      font-family: var(--display);
      font-weight: 900;
      font-size: 16px;
      padding: 12px 24px;
      border-radius: 24px;
      box-shadow: 0 5px 0 #2e7a3c, 0 8px 24px rgba(0, 0, 0, .28);
      border: 2.5px solid rgba(255, 255, 255, .45);
      display: flex;
      align-items: center;
      gap: 8px;
      transition: transform .3s cubic-bezier(.3, 1.4, .5, 1), top .3s ease;
      white-space: nowrap;
    }

    #game-screen.stats-hidden #enter-now {
      top: 22%;
    }

    #enter-now.show {
      transform: translateX(-50%) scale(1);
    }

    #enter-now:active {
      transform: translateX(-50%) translateY(4px) scale(.98);
      box-shadow: 0 1px 0 #2e7a3c, 0 4px 12px rgba(0, 0, 0, .2);
    }

    /* INSIDE-SHOP top bar */
    #inside-bar {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      z-index: 22;
      padding: 10px 12px;
      padding-top: max(10px, env(safe-area-inset-top, 10px));
      display: none;
      align-items: center;
      gap: 10px;
      background: none;
    }

    #inside-bar.show {
      display: flex;
    }

    .leavebtn {
      background: var(--glass-strong);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      color: var(--ink);
      font-family: var(--display);
      font-weight: 800;
      font-size: 14px;
      padding: 9px 16px;
      border-radius: 20px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
      display: flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      min-height: 42px;
      border: 2px solid rgba(255, 255, 255, .7);
      transition: transform .12s var(--ease-bounce);
    }

    .leavebtn:active {
      transform: scale(.92);
    }

    #inside-title {
      flex: 1;
      text-align: center;
      color: #fff;
      font-family: var(--display);
      font-weight: 800;
      font-size: 17px;
      text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
      letter-spacing: 0.2px;
    }

    /* ── STORE NAME BANNER ── drops in from the top on store entry */
    #store-banner {
      position: absolute;
      top: 60px;
      left: 50%;
      z-index: 24;
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 10px 22px;
      border-radius: 999px;
      background: linear-gradient(135deg, var(--gold), var(--gold-d));
      color: var(--on-accent);
      font-family: var(--display);
      font-weight: 800;
      font-size: 17px;
      letter-spacing: .2px;
      max-width: 82vw;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      box-shadow: 0 10px 26px rgba(0, 0, 0, .26);
      border: 2px solid rgba(255, 255, 255, .6);
      opacity: 0;
      pointer-events: none;
      transform: translateX(-50%) translateY(-26px) scale(.96);
      transition: transform .4s var(--ease-out), opacity .4s var(--ease-out);
    }

    #store-banner.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0) scale(1);
    }

    #store-banner .sb-ico {
      font-size: 19px;
      line-height: 1;
    }

    @media (prefers-reduced-motion: reduce) {
      #store-banner {
        transition: opacity .2s linear;
      }
    }

    /* ── DYNAMIC ISLAND ── */
    #dynamic-island {
      position: absolute;
      top: 68px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 35;
      background: rgba(13, 42, 78, 0.90);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid rgba(135, 195, 255, .16);
      border-radius: 30px;
      box-shadow: 0 12px 40px rgba(0, 12, 32, .55), 0 2px 8px rgba(0, 12, 32, .35);
      overflow: hidden;
      transition:
        border-radius .45s cubic-bezier(.32, 1, .32, 1),
        box-shadow .45s cubic-bezier(.32, 1, .32, 1);
      will-change: transform;
    }

    #dynamic-island.notif-show {
      border-radius: 22px;
      box-shadow: 0 16px 48px rgba(0, 12, 32, .62), 0 4px 16px rgba(0, 12, 32, .4);
    }

    /* Warning state — red gradient on the message area only; taskbar stays blue and full-width */
    #dynamic-island.warn-show {
      border-radius: 22px;
      /* no width / background / border override — island keeps its blue colour and natural width */
    }

    #dynamic-island.warn-show #di-notif {
      max-height: 140px;
      opacity: 1;
      padding: 16px 22px 18px;
      font-size: 20px;
      line-height: 1.25;
      font-weight: 900;
      color: #fff;
      letter-spacing: .01em;
      text-shadow: 0 1px 6px rgba(0, 0, 0, .45);
      white-space: normal;
      word-break: break-word;
      background: linear-gradient(135deg, #d81810, #9b0a06);
      border-radius: 0 0 20px 20px;
      box-shadow: 0 6px 30px rgba(230, 30, 30, .6);
      border-top: 1px solid rgba(255, 120, 120, .35);
    }

    #di-notif {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 0 18px;
      max-height: 0;
      overflow: hidden;
      opacity: 0;
      font-family: var(--body);
      font-weight: 600;
      font-size: 13px;
      color: rgba(238, 244, 255, .92);
      line-height: 1.4;
      white-space: normal;
      transition:
        max-height .42s cubic-bezier(.32, 1, .32, 1),
        opacity .28s ease,
        padding .42s cubic-bezier(.32, 1, .32, 1);
    }

    #dynamic-island.notif-show #di-notif {
      max-height: 80px;
      opacity: 1;
      padding: 10px 18px 14px;
    }

    #di-notif .cdog {
      font-size: 18px;
      flex-shrink: 0;
      opacity: .85;
    }

    @media (prefers-reduced-motion: reduce) {

      #dynamic-island,
      #di-notif {
        transition: none;
      }
    }

    .float {
      position: absolute;
      z-index: 50;
      font-family: var(--display);
      font-weight: 800;
      font-size: 22px;
      pointer-events: none;
      animation: floatup 1.1s ease-out forwards;
      text-shadow: 0 2px 4px rgba(0, 0, 0, .25);
    }

    @keyframes floatup {
      0% {
        opacity: 1;
        transform: translateY(0) scale(.8);
      }

      30% {
        transform: translateY(-14px) scale(1.1);
      }

      100% {
        opacity: 0;
        transform: translateY(-60px) scale(1);
      }
    }

    #wipe {
      position: absolute;
      inset: 0;
      z-index: 55;
      background: #1a2233;
      transform: scaleY(0);
      transform-origin: bottom;
      pointer-events: none;
    }

    #wipe.in {
      animation: wipein .28s forwards;
    }

    #wipe.out {
      animation: wipeout .28s forwards;
    }

    @keyframes wipein {
      from {
        transform: scaleY(0);
        transform-origin: bottom;
      }

      to {
        transform: scaleY(1);
        transform-origin: bottom;
      }
    }

    @keyframes wipeout {
      from {
        transform: scaleY(1);
        transform-origin: top;
      }

      to {
        transform: scaleY(0);
        transform-origin: top;
      }
    }

    /* MENU PANEL inside shop */
    #menu-panel {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 30;
      display: none;
      flex-direction: column;
      max-height: 64%;
      background: linear-gradient(180deg, rgba(255, 247, 236, .0), var(--panel-soft) 14%);
    }

    #menu-panel.show {
      display: flex;
    }

    .menu-list {
      padding: 14px 14px calc(env(safe-area-inset-bottom, 0) + 16px);
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 11px;
    }

    .menu-card {
      display: flex;
      align-items: center;
      gap: 12px;
      background: var(--surface);
      border-radius: 20px;
      padding: 11px;
      box-shadow: var(--shadow-sm);
      border: 3px solid transparent;
    }

    .menu-card .pic {
      width: 60px;
      height: 60px;
      border-radius: 15px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 34px;
      background: linear-gradient(135deg, rgba(56, 189, 248, .22), rgba(56, 225, 240, .14));
      box-shadow: inset 0 0 0 1px var(--border);
    }

    .menu-card .info {
      flex: 1;
      min-width: 0;
    }

    .menu-card .nm {
      font-family: var(--display);
      font-weight: 800;
      font-size: 15px;
      display: flex;
      align-items: center;
      gap: 7px;
      flex-wrap: wrap;
    }

    .tag {
      font-weight: 600;
      font-size: 11px;
      padding: 2px 8px;
      border-radius: 8px;
    }

    .tag.need {
      background: #ffe2e2;
      color: #d84545;
    }

    .tag.want {
      background: #e6e1ff;
      color: #6d5ad8;
    }

    .menu-card .ds {
      font-size: 12px;
      color: var(--ink-muted);
      margin-top: 2px;
    }

    .menu-card .fx {
      display: flex;
      gap: 6px;
      margin-top: 5px;
      flex-wrap: wrap;
    }

    .fxpill {
      font-family: var(--display);
      font-weight: 700;
      font-size: 10.5px;
      padding: 3px 7px;
      border-radius: 9px;
      background: rgba(56, 225, 240, .14);
      color: #8FECF6;
    }

    .menu-card .buy {
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 5px;
    }

    .price {
      font-family: var(--display);
      font-weight: 800;
      font-size: 14px;
      color: var(--gold);
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .price .c {
      width: 15px;
      height: 15px;
      border-radius: 50%;
      background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 60%, var(--gold-d));
    }

    .buybtn {
      background: linear-gradient(180deg, #7fe08f, var(--green-d));
      color: #fff;
      font-family: var(--display);
      font-weight: 800;
      font-size: 13px;
      padding: 9px 16px;
      border-radius: 14px;
      box-shadow: 0 4px 0 rgba(0, 0, 0, .12);
    }

    .buybtn:active {
      transform: translateY(2px);
      box-shadow: 0 2px 0 rgba(0, 0, 0, .12);
    }

    .menu-card.cant {
      opacity: .55;
      filter: grayscale(.4);
    }

    .menu-card.cant .buybtn {
      background: #c2c9d4;
      box-shadow: none;
    }

    .cant-note {
      font-size: 10px;
      color: #d84545;
      font-weight: 700;
      font-family: var(--display);
    }

    .menu-head {
      padding: 14px 16px 4px;
      display: flex;
      align-items: flex-end;
      gap: 10px;
    }

    .menu-head h3 {
      font-family: var(--display);
      font-weight: 800;
      font-size: 18px;
      color: var(--ink);
    }

    .menu-head .sub {
      font-size: 12px;
      color: var(--ink-subtle);
      font-weight: 500;
    }

    .menu-head .purse {
      margin-left: auto;
      color: var(--ink);
      background: var(--surface-2);
      border: 2px solid rgba(255, 200, 61, .5);
      border-radius: 14px;
      padding: 6px 12px;
      font-family: var(--display);
      font-weight: 800;
      font-size: 15px;
      display: flex;
      align-items: center;
      gap: 6px;
      box-shadow: var(--shadow-sm);
    }

    .menu-head .purse .c {
      width: 17px;
      height: 17px;
      border-radius: 50%;
      background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 60%, var(--gold-d));
    }

    .goal {
      margin: 6px 14px 0;
      background: linear-gradient(135deg, var(--surface-2), rgba(255, 200, 61, .06));
      border-radius: 18px;
      padding: 12px;
      box-shadow: var(--shadow-sm);
      border: 2px dashed rgba(255, 200, 61, .55);
    }

    .goal .gh {
      display: flex;
      align-items: center;
      gap: 9px;
      font-family: var(--display);
      font-weight: 800;
      font-size: 14px;
    }

    .goal .gh .gp {
      margin-left: auto;
      font-size: 13px;
      color: var(--gold);
    }

    .goal .gbar {
      margin-top: 8px;
      height: 13px;
      border-radius: 8px;
      background: rgba(255, 255, 255, .1);
      overflow: hidden;
    }

    .goal .gfill {
      height: 100%;
      border-radius: 8px;
      background: linear-gradient(90deg, #ffd96b, var(--gold-d));
      transition: width .5s;
    }

    .goal .gsub {
      font-size: 11px;
      color: var(--ink-subtle);
      margin-top: 6px;
      font-weight: 600;
    }

    .goal .savebtns {
      margin-top: 9px;
      display: flex;
      gap: 8px;
    }

    /* OVERLAYS (Job & Profile) */
    .overlay {
      position: absolute;
      inset: 0;
      z-index: 40;
      display: none;
      align-items: flex-end;
      background: rgba(10, 18, 30, .55);
      backdrop-filter: blur(3px);
    }

    .overlay.open {
      display: flex;
      animation: fade .25s;
    }

    @keyframes fade {
      from {
        opacity: 0
      }

      to {
        opacity: 1
      }
    }

    .sheet {
      width: 100%;
      max-height: 80%;
      background: var(--panel-soft);
      border-radius: 28px 28px 0 0;
      box-shadow: 0 -10px 40px rgba(0, 0, 0, .35);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      animation: slideup .35s cubic-bezier(.2, 1, .3, 1);
    }

    @keyframes slideup {
      from {
        transform: translateY(100%)
      }

      to {
        transform: translateY(0)
      }
    }

    .sheet-head {
      position: relative;
      padding: 18px;
      color: #fff;
      background: linear-gradient(135deg, #6fd07f, #3E9E4E);
    }

    .sheet-head h2 {
      font-family: var(--display);
      font-weight: 800;
      font-size: 22px;
    }

    .sheet-head p {
      font-weight: 500;
      font-size: 13px;
      opacity: .92;
      margin-top: 3px;
    }

    .sheet-head .closeb {
      position: absolute;
      top: 14px;
      right: 14px;
      width: 38px;
      height: 38px;
      border-radius: 50%;
      background: rgba(255, 255, 255, .25);
      color: #fff;
      font-size: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .job-body {
      padding: 20px;
      text-align: center;
    }

    /* TOP NAV BAR — lives inside #dynamic-island, no own positioning */
    .top-nav-bar {
      display: flex;
      gap: 4px;
      padding: 4px;
    }

    .top-nav-btn {
      border: none;
      background: transparent;
      padding: 6px 14px;
      border-radius: 20px;
      font-family: var(--display);
      font-size: 13px;
      font-weight: 700;
      color: var(--ink-muted);
      display: flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
    }

    .top-nav-btn:hover {
      color: var(--ink);
    }

    .top-nav-btn.active {
      background: linear-gradient(135deg, var(--violet), var(--violet-d));
      color: white;
      box-shadow: var(--glow-violet);
    }

    .top-nav-btn:active {
      transform: scale(0.95);
    }

    /* WORK / REPORTS / AI TABS — full screen above nav */
    #tab-work,
    #tab-reports,
    #tab-ai,
    #tab-leaderboard {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      padding-top: 120px;
      padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
      overflow-y: auto;
      background: var(--panel-soft);
      display: none;
      flex-direction: column;
    }

    #tab-work.tab-active,
    #tab-reports.tab-active,
    #tab-ai.tab-active,
    #tab-leaderboard.tab-active {
      display: flex;
    }

    /* Work tab: lift the scene canvas above the panel so the pet companion shows at
       the bottom. The canvas is transparent except for the pet, and click-through so
       the work UI stays interactive. */
    #game-screen.companion-mode #scene {
      z-index: 1;
      pointer-events: none;
    }

    .work-wrap {
      padding: 16px 16px 24px;
    }

    .work-balance-hero {
      background: linear-gradient(135deg, var(--green), var(--green-d));
      border-radius: 20px;
      padding: 20px;
      color: #fff;
      margin-bottom: 18px;
      box-shadow: var(--shadow);
    }

    .work-balance-hero .wb-label {
      font-size: 12px;
      opacity: .85;
      margin-bottom: 6px;
      font-weight: 600;
    }

    .work-balance-hero .wb-amount {
      font-size: 34px;
      font-weight: 800;
      letter-spacing: -.03em;
    }

    .work-balance-hero .wb-hint {
      font-size: 11px;
      opacity: .75;
      margin-top: 8px;
      line-height: 1.4;
    }

    .work-section-title {
      font-size: 14px;
      font-weight: 900;
      color: var(--ink);
      margin-bottom: 12px;
    }

    .work-job-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .work-job-card {
      display: flex;
      align-items: center;
      gap: 12px;
      background: var(--surface);
      border-radius: 18px;
      padding: 14px;
      box-shadow: var(--shadow-sm);
      border: 2px solid rgba(91, 190, 107, .2);
      transition: all .2s;
      text-align: left;
    }

    .work-job-card:active {
      transform: scale(.98);
    }

    .work-job-card:hover {
      border-color: var(--green);
      box-shadow: 0 4px 16px rgba(91, 190, 107, .2);
    }

    .work-job-card .wj-icon {
      font-size: 28px;
      flex-shrink: 0;
      width: 40px;
      text-align: center;
    }

    .work-job-card .wj-body {
      flex: 1;
      min-width: 0;
    }

    .work-job-card .wj-title {
      font-size: 15px;
      font-weight: 800;
      color: var(--ink);
      margin-bottom: 2px;
      font-family: var(--display);
    }

    .work-job-card .wj-desc {
      font-size: 12px;
      color: var(--ink-muted);
      line-height: 1.35;
      font-weight: 600;
    }

    .work-job-card .wj-pay {
      background: rgba(91, 190, 107, .15);
      color: var(--green-d);
      border-radius: 10px;
      padding: 5px 10px;
      font-size: 13px;
      font-weight: 800;
      font-family: var(--display);
      flex-shrink: 0;
    }

    .room-back-btn {
      background: rgba(91, 190, 107, .15);
      color: var(--green-d);
      border: none;
      border-radius: 12px;
      padding: 8px 14px;
      font-size: 13px;
      font-weight: 800;
      cursor: pointer;
      font-family: var(--display);
    }

    .edu-score-badge {
      background: linear-gradient(135deg, var(--green), var(--green-d));
      color: white;
      border-radius: 12px;
      padding: 5px 14px;
      font-size: 13px;
      font-weight: 800;
      font-family: var(--display);
    }

    .edu-streak {
      background: #FFF5EB;
      color: var(--red);
      border-radius: 12px;
      padding: 5px 12px;
      font-size: 13px;
      font-weight: 800;
      border: 2px solid rgba(255, 107, 107, .2);
      font-family: var(--display);
    }

    .edu-question-card {
      background: var(--surface);
      border-radius: 18px;
      padding: 18px;
      box-shadow: var(--shadow-sm);
      margin-bottom: 12px;
      border: 2px solid rgba(91, 190, 107, .3);
    }

    .edu-q-label {
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .08em;
      color: var(--ink-subtle);
      margin-bottom: 8px;
    }

    .edu-q-text {
      font-size: 16px;
      font-weight: 700;
      color: var(--ink);
      line-height: 1.4;
      margin-bottom: 14px;
    }

    .edu-q-passage {
      font-size: 13px;
      color: var(--ink-muted);
      background: var(--panel-soft);
      border-radius: 10px;
      padding: 10px 12px;
      margin-bottom: 12px;
      line-height: 1.55;
      border: 1px solid rgba(91, 190, 107, .2);
    }

    .edu-opts {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .edu-opt {
      padding: 12px 15px;
      border-radius: 13px;
      border: 2px solid rgba(91, 190, 107, .25);
      background: var(--surface);
      font-size: 14px;
      font-weight: 600;
      text-align: left;
      color: var(--ink);
      transition: all .18s;
      cursor: pointer;
    }

    .edu-opt.correct {
      background: #E8F5E9;
      border-color: #4CAF50;
      color: #1B5E20;
    }

    .edu-opt.wrong {
      background: #FFEBEE;
      border-color: #EF5350;
      color: #B71C1C;
    }

    .edu-opt:disabled {
      pointer-events: none;
    }

    .edu-feedback {
      margin-top: 10px;
      padding: 10px 14px;
      border-radius: 12px;
      font-size: 13px;
      font-weight: 600;
      display: none;
    }

    .edu-feedback.show {
      display: block;
    }

    .edu-feedback.ok {
      background: #E8F5E9;
      color: #2E7D32;
    }

    .edu-feedback.bad {
      background: #FFEBEE;
      color: #C62828;
    }

    .edu-next-btn {
      margin-top: 10px;
      width: 100%;
      background: linear-gradient(135deg, var(--green), var(--green-d));
      color: white;
      border: none;
      border-radius: 12px;
      padding: 13px;
      font-size: 14px;
      font-weight: 800;
      display: none;
      box-shadow: 0 4px 14px rgba(91, 190, 107, .3);
      cursor: pointer;
      font-family: var(--display);
    }

    .edu-next-btn.show {
      display: block;
    }

    /* TYPEABLE ANSWER (math) */
    .edu-input-row {
      display: flex;
      gap: 8px;
      align-items: stretch;
    }

    .edu-input {
      flex: 1;
      padding: 12px 15px;
      border-radius: 13px;
      border: 2px solid rgba(91, 190, 107, .35);
      background: var(--surface);
      font-size: 16px;
      font-weight: 700;
      color: var(--ink);
      font-family: var(--body);
      outline: none;
      transition: border-color .18s, box-shadow .18s;
    }

    .edu-input:focus {
      border-color: var(--green);
      box-shadow: 0 0 0 3px rgba(91, 190, 107, .18);
    }

    .edu-input.correct {
      background: #E8F5E9;
      border-color: #4CAF50;
      color: #1B5E20;
    }

    .edu-input.wrong {
      background: #FFEBEE;
      border-color: #EF5350;
      color: #B71C1C;
    }

    .edu-submit-btn {
      background: linear-gradient(135deg, var(--green), var(--green-d));
      color: white;
      border: none;
      border-radius: 13px;
      padding: 0 20px;
      font-size: 14px;
      font-weight: 800;
      cursor: pointer;
      font-family: var(--display);
      box-shadow: 0 4px 12px rgba(91, 190, 107, .28);
    }

    .edu-submit-btn:disabled {
      opacity: .5;
      cursor: default;
    }

    /* QUESTION TIMER */
    .edu-timer {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 14px;
    }

    .edu-timer-bar {
      flex: 1;
      height: 8px;
      border-radius: 6px;
      background: rgba(91, 190, 107, .15);
      overflow: hidden;
    }

    .edu-timer-fill {
      height: 100%;
      width: 100%;
      border-radius: 6px;
      background: linear-gradient(90deg, var(--green), var(--green-d));
      transform-origin: left center;
      transition: transform 1s linear, background .3s;
    }

    .edu-timer-fill.low {
      background: linear-gradient(90deg, #FFB347, var(--red));
    }

    .edu-timer-num {
      font-size: 13px;
      font-weight: 800;
      color: var(--ink-subtle);
      font-family: var(--display);
      min-width: 34px;
      text-align: right;
      font-variant-numeric: tabular-nums;
    }

    /* WORK SELECTOR */
    .ws-selector {
      display: flex;
      flex-direction: column;
      gap: 22px;
    }

    .ws-selector-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 4px;
    }

    .ws-selector-title {
      font-size: 20px;
      font-weight: 900;
      color: var(--ink);
      font-family: var(--display);
    }

    .ws-selector-sub {
      font-size: 12px;
      color: var(--ink-muted);
      font-weight: 600;
      margin-top: 2px;
    }

    .ws-section-label {
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .08em;
      color: var(--ink-subtle);
      margin-bottom: 10px;
    }

    .ws-chips {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .ws-chip {
      flex: 1;
      min-width: 80px;
      padding: 12px 10px;
      border-radius: 16px;
      border: 2px solid rgba(91, 190, 107, .2);
      background: var(--surface);
      font-family: var(--display);
      font-size: 13px;
      font-weight: 800;
      color: var(--ink-muted);
      cursor: pointer;
      text-align: center;
      transition: all .18s;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
    }

    .ws-chip .ws-chip-icon {
      font-size: 22px;
      line-height: 1;
    }

    .ws-chip:active {
      transform: scale(.96);
    }

    .ws-chip.selected {
      background: linear-gradient(135deg, var(--violet), var(--violet-d));
      border-color: var(--violet);
      color: #fff;
      box-shadow: var(--glow-violet);
    }

    .ws-confirm-btn {
      width: 100%;
      padding: 15px;
      border-radius: 16px;
      border: none;
      background: linear-gradient(135deg, var(--green), var(--green-d));
      color: #fff;
      font-family: var(--display);
      font-size: 15px;
      font-weight: 800;
      cursor: pointer;
      box-shadow: 0 4px 16px rgba(91, 190, 107, .3);
      transition: opacity .2s, transform .12s;
      opacity: .45;
      pointer-events: none;
    }

    .ws-confirm-btn.ready {
      opacity: 1;
      pointer-events: auto;
    }

    .ws-confirm-btn:active {
      transform: scale(.98);
    }

    .ws-reselect-btn {
      background: rgba(91, 190, 107, .12);
      color: var(--green-d);
      border: none;
      border-radius: 12px;
      padding: 7px 13px;
      font-size: 12px;
      font-weight: 800;
      cursor: pointer;
      font-family: var(--display);
      transition: background .15s;
      white-space: nowrap;
      flex-shrink: 0;
    }

    .ws-reselect-btn:active {
      background: rgba(91, 190, 107, .25);
    }

    .ws-badge-row {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 14px;
    }

    .ws-badge {
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 800;
      font-family: var(--display);
      text-transform: uppercase;
      letter-spacing: .04em;
    }

    .ws-badge.grade {
      background: rgba(124, 77, 255, .15);
      color: var(--violet-d, #5c35c9);
    }

    .ws-badge.subject {
      background: rgba(91, 190, 107, .15);
      color: var(--green-d);
    }



    /* REPORTS TAB */
    .reports-wrap {
      padding: 20px;
    }

    .reports-title {
      font-size: 16px;
      font-weight: 900;
      margin-bottom: 12px;
      color: var(--ink);
      font-family: var(--display);
    }

    .reports-summary {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-bottom: 16px;
    }

    .rs-card {
      background: var(--surface);
      border-radius: 16px;
      padding: 14px;
      box-shadow: var(--shadow-sm);
    }

    .rs-label {
      font-size: 12px;
      font-weight: 700;
      color: var(--ink-subtle);
      text-transform: uppercase;
      letter-spacing: .04em;
    }

    .rs-val {
      font-size: 22px;
      font-weight: 800;
      margin-top: 4px;
      letter-spacing: -.02em;
    }

    .rs-val.income {
      color: var(--green);
    }

    .rs-val.spend {
      color: #FF8A8A;
    }

    .rs-sub {
      font-size: 10px;
      color: #9aa3b0;
      margin-top: 6px;
      line-height: 1.3;
    }

    .reports-section-label {
      font-size: 12px;
      font-weight: 800;
      color: var(--ink-muted);
      text-transform: uppercase;
      letter-spacing: .06em;
      padding: 0 2px 8px;
    }

    .reports-empty {
      text-align: center;
      color: #9aa3b0;
      padding: 40px 0;
      font-size: 13px;
      line-height: 1.45;
    }

    .reports-empty .re-icon {
      font-size: 40px;
      margin-bottom: 8px;
    }

    .tx-row {
      display: flex;
      align-items: center;
      gap: 12px;
      background: var(--surface);
      border-radius: 14px;
      padding: 12px;
      margin-bottom: 8px;
      box-shadow: var(--shadow-sm);
    }

    .tx-icon-wrap {
      width: 38px;
      height: 38px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      flex-shrink: 0;
    }

    .tx-type {
      font-size: 13px;
      font-weight: 800;
      color: var(--ink);
    }

    .tx-date {
      font-size: 10px;
      color: #9aa3b0;
      font-weight: 600;
    }

    .tx-amount {
      font-size: 14px;
      font-weight: 800;
      flex-shrink: 0;
    }

    .tx-amount.income {
      color: var(--green);
    }

    .rpt-filter-btn {
      background: var(--surface-2);
      color: var(--ink-muted);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 6px 12px;
      font-size: 11px;
      font-weight: 800;
      cursor: pointer;
      font-family: var(--display);
      transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
    }

    .rpt-filter-btn.active {
      background: linear-gradient(135deg, var(--violet), var(--violet-d));
      color: white;
      border-color: transparent;
    }

    /* ═══ BADGES · STREAKS · CITY TOURS · CELEBRATIONS ═══ */
    #confetti-cv { position: fixed; inset: 0; z-index: 12000; pointer-events: none; }

    #mute-btn { background: var(--surface, #fff); border: 1px solid var(--border, #e2e8f0); border-radius: 12px; width: 38px; height: 38px; font-size: 17px; cursor: pointer; box-shadow: var(--shadow-sm, 0 2px 6px rgba(0,0,0,.08)); flex: none; }
    #mute-btn:active { transform: scale(.92); }
    /* Read-aloud toggle — matches the mute button, and lights up when armed so a
       teacher can tell across the room whether a child has speech on. */
    #read-btn { background: var(--surface, #fff); border: 1px solid var(--border, #e2e8f0); border-radius: 12px; width: 38px; height: 38px; font-size: 17px; cursor: pointer; box-shadow: var(--shadow-sm, 0 2px 6px rgba(0,0,0,.08)); flex: none; }
    #read-btn:active { transform: scale(.92); }
    body.read-aloud #read-btn { background: linear-gradient(135deg, #38BDF8, #0284c7); border-color: #0284c7; color: #fff; }

    /* ── Phase 4: audio-first pre-K layout ──
       Fewer words, bigger targets. Everything here is a size change only, so a
       class switching modes never loses access to a feature. */
    body.prek { font-size: 18px; }
    body.prek .edu-q-text { font-size: 26px; line-height: 1.35; }
    body.prek .edu-opt { font-size: 22px; padding: 20px 18px; min-height: 68px; }
    body.prek .talk-q { font-size: 20px; min-height: 64px; }
    body.prek .tab-btn, body.prek .ws-chip { font-size: 16px; }
    body.prek #read-btn, body.prek #mute-btn { width: 48px; height: 48px; font-size: 22px; }
    body.prek .reports-title, body.prek .work-balance-hero .wb-hint { font-size: 15px; }
    /* Speak buttons: the child's way back to a sentence they missed. */
    /* Teacher assignment strip above the quiz */
    .assign-banner { background: linear-gradient(135deg, rgba(70,214,126,.16), rgba(56,189,248,.12)); border: 1px solid var(--green, #46D67E); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
    .assign-banner .ab-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
    .assign-banner .ab-kicker { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
    .assign-banner .ab-count { font-family: var(--display); font-weight: 900; font-size: 15px; color: var(--green, #46D67E); }
    .assign-banner .ab-title { font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--ink); margin: 2px 0 8px; }
    .assign-banner .ab-bar { height: 8px; border-radius: 99px; background: rgba(8,24,52,.35); overflow: hidden; }
    .assign-banner .ab-fill { height: 100%; border-radius: 99px; background: var(--green, #46D67E); transition: width .3s ease-out; }
    body.prek .assign-banner .ab-title { font-size: 20px; }

    /* Standards mastery grid — students down, topics across */
    .mast-scroll { overflow-x: auto; }
    .mast-grid { border-collapse: separate; border-spacing: 3px; font-size: 12px; }
    .mast-grid th { font-weight: 700; color: var(--ink-muted); font-size: 11px; text-align: left; vertical-align: bottom; padding: 0 4px 4px; max-width: 86px; }
    .mast-grid th.mg-student { position: sticky; left: 0; background: var(--surface); z-index: 1; }
    .mast-grid td.mg-student { position: sticky; left: 0; background: var(--surface); font-weight: 800; white-space: nowrap; padding-right: 8px; z-index: 1; }
    .mast-cell { width: 46px; height: 30px; border-radius: 7px; text-align: center; font-weight: 800; color: #06210f; }
    .mast-cell.none { background: rgba(148,163,184,.22); color: var(--ink-muted); font-weight: 600; }
    .mast-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-muted); margin: 10px 0 0; }
    .mast-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 5px; vertical-align: -2px; }

    /* Live class view */
    .live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
    .live-card { background: var(--surface-2, rgba(255,255,255,.06)); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
    .live-card.on { border-color: var(--green, #46D67E); }
    .live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 99px; background: #94a3b8; margin-right: 6px; vertical-align: 1px; }
    .live-card.on .live-dot { background: var(--green, #46D67E); }
    .live-name { font-family: var(--display); font-weight: 800; font-size: 15px; }
    .live-meta { font-size: 12px; color: var(--ink-muted); margin-top: 3px; line-height: 1.5; }

    .speak-btn { background: var(--surface-2, #eef4ff); border: 2px solid var(--border-strong, #cbd5e1); border-radius: 12px; padding: 6px 12px; font-size: 16px; cursor: pointer; line-height: 1; }
    .speak-btn:active { transform: scale(.94); }
    body.prek .speak-btn { padding: 12px 18px; font-size: 22px; }
    #streak-chip { font-family: var(--display); font-weight: 800; font-size: 13px; background: linear-gradient(135deg, #ff9f43, #ff6b35); color: #fff; border-radius: 12px; padding: 8px 10px; box-shadow: 0 3px 10px rgba(255,107,53,.35); animation: streakPulse 2.4s ease-in-out infinite; flex: none; }
    @keyframes streakPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

    /* Badge unlock toast */
    #badge-toast { position: fixed; top: -170px; left: 50%; transform: translateX(-50%); z-index: 12500; display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #fef3c7, #fde68a); border: 3px solid #f59e0b; border-radius: 20px; padding: 14px 22px 14px 14px; box-shadow: 0 12px 40px rgba(245,158,11,.45); transition: top .55s cubic-bezier(.34,1.56,.64,1); max-width: min(92vw, 420px); }
    #badge-toast.show { top: 18px; }
    #badge-toast .bt-icon { font-size: 42px; animation: btSpin .8s cubic-bezier(.34,1.56,.64,1); }
    @keyframes btSpin { from { transform: scale(0) rotate(-180deg); } to { transform: scale(1) rotate(0); } }
    #badge-toast .bt-kicker { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: #b45309; font-family: var(--display); }
    #badge-toast .bt-name { font-family: var(--display); font-weight: 900; font-size: 18px; color: #78350f; line-height: 1.1; }
    #badge-toast .bt-desc { font-size: 12px; color: #92400e; }

    /* Badges overlay */
    #badges-overlay .sheet { max-height: 86vh; display: flex; flex-direction: column; }
    #badges-body { overflow-y: auto; padding: 14px; }
    .bacc-title { font-family: var(--display); font-weight: 800; font-size: 14px; color: var(--ink); margin: 2px 0 8px; }
    .bacc-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
    .bacc { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 24px; background: var(--surface); border: 2px solid var(--border); border-radius: 14px; padding: 8px 10px; cursor: pointer; min-width: 62px; transition: transform .15s; }
    .bacc span { font-size: 10px; font-weight: 800; color: var(--ink-muted); font-family: var(--display); }
    .bacc:not(:disabled):hover { transform: translateY(-2px); }
    .bacc.locked { opacity: .45; filter: grayscale(1); cursor: not-allowed; }
    .bacc.equipped { border-color: #f59e0b; background: rgba(255,200,61,.15); box-shadow: 0 0 0 3px rgba(255,200,61,.2); }
    .badge-cat { font-family: var(--display); font-weight: 900; font-size: 13px; letter-spacing: .5px; color: var(--ink-muted); text-transform: uppercase; margin: 14px 0 8px; }
    .badge-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .badge-card { background: var(--surface); border: 2px solid var(--border); border-radius: 16px; padding: 12px; text-align: center; position: relative; overflow: hidden; }
    .badge-card.earned { border-color: #f59e0b; background: linear-gradient(160deg, rgba(254,243,199,.9), rgba(253,230,138,.55)); box-shadow: 0 4px 14px rgba(245,158,11,.18); }
    .badge-card.earned .bc-icon { animation: bcFloat 3s ease-in-out infinite; }
    @keyframes bcFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
    .badge-card.locked .bc-icon { filter: grayscale(1); opacity: .5; }
    .bc-icon { font-size: 34px; line-height: 1.2; }
    .bc-name { font-family: var(--display); font-weight: 800; font-size: 13px; color: var(--ink); margin-top: 2px; }
    .badge-card.earned .bc-name { color: #78350f; }
    .bc-desc { font-size: 11px; color: var(--ink-muted); line-height: 1.35; margin-top: 2px; }
    .badge-card.earned .bc-desc { color: #92400e; }
    .bc-acc { display: block; font-weight: 700; color: #b45309; }
    .bc-date { font-size: 11px; font-weight: 800; color: #b45309; margin-top: 6px; }
    .bc-prog { height: 7px; background: var(--border); border-radius: 4px; margin-top: 8px; overflow: hidden; }
    .bc-prog-fill { height: 100%; background: linear-gradient(90deg, #38bdf8, #2563eb); border-radius: 4px; transition: width .4s; }
    .bc-prog-lab { font-size: 10px; font-weight: 800; color: var(--ink-muted); margin-top: 3px; }
    .badge-card.mini { padding: 8px; }
    .badge-card.mini .bc-icon { font-size: 26px; }
    .badge-card.mini .bc-name { font-size: 11px; }

    /* Player card (classmate badges) */
    #pc-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; padding: 14px; max-height: 46vh; overflow-y: auto; }

    /* Daily streak popup */
    #streak-overlay { position: fixed; inset: 0; z-index: 11500; display: none; align-items: center; justify-content: center; background: rgba(10,15,30,.55); backdrop-filter: blur(4px); }
    #streak-overlay.open { display: flex; }
    #streak-card { background: linear-gradient(160deg, #fff7ed, #ffedd5); border: 3px solid #fb923c; border-radius: 24px; padding: 28px 34px; text-align: center; max-width: 320px; animation: streakIn .5s cubic-bezier(.34,1.56,.64,1); box-shadow: 0 20px 60px rgba(251,146,60,.4); }
    @keyframes streakIn { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
    #streak-flame { font-size: 64px; animation: flameWob 1.2s ease-in-out infinite; }
    @keyframes flameWob { 0%, 100% { transform: rotate(-5deg) scale(1); } 50% { transform: rotate(5deg) scale(1.1); } }
    #streak-num-wrap { font-family: var(--display); font-weight: 900; font-size: 28px; color: #c2410c; }
    #streak-msg { font-size: 14px; color: #9a3412; margin: 6px 0 4px; }
    #streak-bonus { font-family: var(--display); font-weight: 900; font-size: 20px; color: #16a34a; margin-bottom: 14px; }

    /* City tour */
    #tour-overlay { position: fixed; inset: 0; z-index: 11000; display: none; background: #0b1c33; overflow: hidden; }
    #tour-overlay.show { display: block; }
    #tour-scene { position: absolute; inset: 0; }
    .tour-sky { position: absolute; inset: 0; transition: background 1s; }
    .tour-sun { position: absolute; top: 8%; right: 12%; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, #fff7cc 0%, #ffdf6b 45%, rgba(255,223,107,0) 72%); animation: sunGlow 4s ease-in-out infinite; }
    @keyframes sunGlow { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: 1; } }
    .tour-clouds i { position: absolute; background: rgba(255,255,255,.85); border-radius: 60px; box-shadow: 22px -8px 0 6px rgba(255,255,255,.75), -20px -4px 0 4px rgba(255,255,255,.7); }
    .tour-clouds i:nth-child(1) { width: 90px; height: 26px; top: 14%; animation: cloudDrift 34s linear infinite; }
    .tour-clouds i:nth-child(2) { width: 60px; height: 18px; top: 26%; animation: cloudDrift 26s linear infinite; animation-delay: -12s; }
    .tour-clouds i:nth-child(3) { width: 110px; height: 30px; top: 8%; animation: cloudDrift 44s linear infinite; animation-delay: -25s; }
    .tour-clouds i:nth-child(4) { width: 70px; height: 20px; top: 34%; animation: cloudDrift 30s linear infinite; animation-delay: -6s; }
    @keyframes cloudDrift { from { left: -140px; } to { left: 110%; } }
    #tour-svg { position: absolute; left: 0; right: 0; top: 0; bottom: 17vh; z-index: 2; }
    #tour-svg svg { width: 100%; height: 100%; display: block; }
    .tour-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 17vh; background: linear-gradient(180deg, #24355c, #101a30); }
    #tour-pet { position: absolute; left: 5%; bottom: 17.5vh; font-size: clamp(44px, 9vw, 64px); z-index: 3; filter: drop-shadow(0 8px 16px rgba(0,0,0,.35)); animation: petHop 2.2s ease-in-out infinite; }
    @keyframes petHop { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-14px) rotate(3deg); } }
    .tour-plane { position: absolute; top: 18%; left: -80px; font-size: 40px; z-index: 4; opacity: 0; }
    #tour-scene.enter .tour-plane { animation: planeCross 2.2s ease-in-out .1s 1; }
    @keyframes planeCross { 0% { left: -80px; opacity: 0; transform: rotate(8deg); } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: 110%; opacity: 0; transform: rotate(-4deg); } }
    #tour-scene.enter #tour-svg { animation: silRise .9s cubic-bezier(.22,1,.36,1); }
    @keyframes silRise { from { transform: translateY(60px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
    #tour-scene.enter #tour-pet { animation: emojiPop .7s cubic-bezier(.34,1.56,.64,1), petHop 2.2s ease-in-out .7s infinite; }
    @keyframes emojiPop { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1) rotate(0); } }
    /* gentle animations used inside landmark SVG scenes */
    @keyframes lmFlagWave { 0%,100% { transform: skewY(0deg); } 50% { transform: skewY(-6deg); } }
    @keyframes lmBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
    @keyframes lmShimmer { 0%,100% { opacity: .35; } 50% { opacity: .75; } }
    @keyframes lmSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
    @keyframes lmTwinkle { 0%,100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
    @keyframes lmSway { 0%,100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
    .lm-flag { animation: lmFlagWave 2.6s ease-in-out infinite; transform-origin: left center; transform-box: fill-box; }
    .lm-bob { animation: lmBob 3.2s ease-in-out infinite; }
    .lm-shimmer { animation: lmShimmer 3s ease-in-out infinite; }
    .lm-spin { animation: lmSpin 26s linear infinite; transform-origin: center; transform-box: fill-box; }
    .lm-twinkle { animation: lmTwinkle 2.2s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
    .lm-sway { animation: lmSway 3.4s ease-in-out infinite; transform-origin: bottom center; transform-box: fill-box; }
    #tour-ui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 18px; pointer-events: none; z-index: 5; }
    #tour-dots { display: flex; gap: 7px; margin-bottom: 10px; }
    #tour-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.3); transition: background .3s, transform .3s; }
    #tour-dots i.on { background: #ffd34d; transform: scale(1.25); }
    #tour-card, #tour-quiz { pointer-events: auto; width: min(480px, 94vw); background: rgba(255,255,255,.96); border-radius: 22px; padding: 18px 20px; box-shadow: 0 18px 50px rgba(0,0,0,.35); animation: cardUp .6s cubic-bezier(.22,1,.36,1); margin-bottom: 6px; }
    @keyframes cardUp { from { transform: translateY(70px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
    #tour-card-kicker { font-size: 11px; font-weight: 800; letter-spacing: .8px; color: #2563eb; font-family: var(--display); text-transform: uppercase; }
    #tour-card-title { font-family: var(--display); font-weight: 900; font-size: 22px; color: #0f172a; margin: 2px 0 6px; }
    #tour-card-fact { font-size: 14px; line-height: 1.55; color: #334155; margin-bottom: 14px; }
    .tour-card-head { display: flex; align-items: flex-start; gap: 8px; }
    .tour-card-head > div:first-child { flex: 1; min-width: 0; }
    .say-btn { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer; font-size: 22px; background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; box-shadow: 0 5px 14px rgba(249,115,22,.4); transition: transform .15s; }
    .say-btn:active { transform: scale(.9); }
    .say-btn.talking { animation: sayPulse 1s ease-in-out infinite; }
    @keyframes sayPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
    .tour-btn { font-family: var(--display); font-weight: 800; font-size: 15px; border: none; border-radius: 14px; padding: 12px 18px; background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; cursor: pointer; box-shadow: 0 6px 18px rgba(37,99,235,.35); transition: transform .15s; width: 100%; }
    .tour-btn:active { transform: scale(.96); }
    #tq-q { font-family: var(--display); font-weight: 800; font-size: 17px; color: #0f172a; margin-bottom: 12px; }
    #tq-opts { display: flex; flex-direction: column; gap: 8px; }
    .tq-opt { background: #f1f5f9; color: #0f172a; box-shadow: none; border: 2px solid #e2e8f0; }
    .tq-opt.right { background: #dcfce7; border-color: #22c55e; color: #14532d; }
    .tq-opt.wrong { background: #fee2e2; border-color: #ef4444; color: #7f1d1d; }
    #tq-fb { font-family: var(--display); font-weight: 800; font-size: 14px; text-align: center; margin-top: 10px; min-height: 20px; color: #334155; }
    #tour-skip { position: absolute; top: 16px; right: 16px; z-index: 6; background: rgba(15,23,42,.6); color: #fff; border: none; border-radius: 20px; padding: 8px 14px; font-weight: 800; font-family: var(--display); font-size: 12px; cursor: pointer; }

    /* ── FLIGHT DEPARTURE BOARD (kid-friendly airport picker) ── */
    #flights-list { display: flex; flex-direction: column; gap: 10px; }
    .fboard-section { font-family: var(--display); font-weight: 900; font-size: 15px; color: var(--ink); margin: 8px 2px 0; display: flex; align-items: center; gap: 6px; }
    .fboard-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 2px solid rgba(37,99,235,.18); border-radius: 18px; padding: 12px 14px; cursor: pointer; background: linear-gradient(135deg, #ffffff, #eef6ff); box-shadow: 0 4px 12px rgba(15,23,42,.08); transition: transform .15s, box-shadow .15s; font-family: inherit; }
    .fboard-row:not(:disabled):active { transform: scale(.97); }
    .fboard-row:disabled { opacity: .55; cursor: not-allowed; }
    .fb-flag { flex: 0 0 auto; font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
    .fb-main { flex: 1; min-width: 0; }
    .fb-city { font-family: var(--display); font-weight: 900; font-size: 17px; color: #0f172a; display: flex; align-items: baseline; gap: 6px; }
    .fb-code { font-size: 11px; font-weight: 800; color: #2563eb; background: rgba(37,99,235,.1); border-radius: 8px; padding: 1px 7px; }
    .fb-sights { font-size: 13px; color: #475569; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .fb-teaser { font-size: 11.5px; color: #64748b; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .fb-price { flex: 0 0 auto; font-family: var(--display); font-weight: 900; font-size: 15px; color: #16a34a; background: rgba(22,163,74,.1); border-radius: 12px; padding: 8px 10px; text-align: center; }
    .fb-price.fb-cant { color: #94a3b8; background: rgba(148,163,184,.12); }

    /* ── KID MONEY PICTURE CHART (Report tab) ── */
    .rchart { background: var(--surface, #fff); border: 2px solid rgba(37,99,235,.14); border-radius: 18px; padding: 14px; margin-bottom: 14px; }
    .rc-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; }
    .rc-emoji { flex: 0 0 30px; font-size: 20px; text-align: center; }
    .rc-label { flex: 0 0 84px; font-family: var(--display); font-weight: 800; font-size: 12.5px; color: var(--ink); }
    .rc-track { flex: 1; height: 22px; background: rgba(100,116,139,.12); border-radius: 11px; overflow: hidden; }
    .rc-fill { height: 100%; border-radius: 11px; min-width: 6px; transition: width .8s cubic-bezier(.22,1,.36,1); }
    .rc-val { flex: 0 0 auto; font-family: var(--display); font-weight: 900; font-size: 13px; color: var(--ink); min-width: 44px; text-align: right; }
    .rchart-sub { font-family: var(--display); font-weight: 800; font-size: 12px; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-muted); margin: 10px 2px 2px; }

    /* INTRO */
    #intro {
      position: absolute;
      inset: 0;
      z-index: 60;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      text-align: center;
      overflow-y: auto;
      background:
        radial-gradient(120% 70% at 50% 0%, rgba(56, 189, 248, .35) 0%, transparent 55%),
        linear-gradient(170deg, #070F1E 0%, #0B1C33 38%, #0E2340 72%, #15355B 100%);
    }

    #intro .intro-inner {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 36px 20px 30px;
      gap: 16px;
      max-width: 400px;
      width: 100%;
      margin: auto;
    }

    #intro .intro-logo {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
    }

    #intro h1 {
      font-family: var(--display);
      font-weight: 900;
      font-size: 46px;
      color: #fff;
      text-shadow: 0 4px 20px rgba(0, 0, 0, .4);
      letter-spacing: -1px;
    }

    #intro .tag {
      font-weight: 600;
      font-size: 13.5px;
      color: rgba(255, 255, 255, .65);
      letter-spacing: 0.5px;
    }

    #intro .bigdog {
      font-size: 88px;
      filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .35));
      animation: introBob 2.5s ease-in-out infinite;
    }

    @keyframes introBob {

      0%,
      100% {
        transform: translateY(0);
      }

      50% {
        transform: translateY(-8px);
      }
    }

    #intro .how-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      width: 100%;
    }

    #intro .how-tile {
      background: rgba(255, 255, 255, .1);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
      border: 1.5px solid rgba(255, 255, 255, .18);
      border-radius: 18px;
      padding: 14px 12px;
      text-align: left;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    #intro .how-tile .tile-icon {
      font-size: 26px;
      line-height: 1;
    }

    #intro .how-tile .tile-title {
      font-family: var(--display);
      font-weight: 800;
      font-size: 13px;
      color: #fff;
    }

    #intro .how-tile .tile-desc {
      font-size: 11.5px;
      font-weight: 500;
      color: rgba(255, 255, 255, .65);
      line-height: 1.45;
    }

    #intro .evo-hint {
      background: rgba(255, 200, 61, .15);
      border: 1.5px solid rgba(255, 200, 61, .35);
      border-radius: 16px;
      padding: 13px 16px;
      width: 100%;
      text-align: left;
    }

    #intro .evo-hint .eh-title {
      font-family: var(--display);
      font-weight: 800;
      font-size: 13px;
      color: var(--gold);
      margin-bottom: 6px;
    }

    #intro .evo-hint ul {
      list-style: none;
      font-size: 12px;
      color: rgba(255, 255, 255, .75);
      font-weight: 500;
      line-height: 1.7;
    }

    #intro .evo-hint li::before {
      content: '⭐ ';
    }

    #intro #play {
      width: 100%;
      background: linear-gradient(135deg, #ffe27a, var(--gold-d));
      color: #3a2800;
      font-family: var(--display);
      font-weight: 900;
      font-size: 18px;
      padding: 16px 44px;
      border-radius: 22px;
      box-shadow: 0 6px 0 #a06a10, 0 10px 24px rgba(0, 0, 0, .3);
      border: 2.5px solid rgba(255, 255, 255, .4);
      letter-spacing: 0.3px;
      transition: transform .15s var(--ease-bounce), box-shadow .15s;
    }

    #intro #play:active {
      transform: translateY(4px);
      box-shadow: 0 2px 0 #a06a10, 0 4px 12px rgba(0, 0, 0, .2);
    }

    #intro.hide {
      opacity: 0;
      pointer-events: none;
      transition: .5s;
    }

    /* ── DRIVE DESTINATIONS ── */
    .drive-body {
      padding: 16px 16px 20px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      overflow-y: auto;
      max-height: 70vh;
    }

    /* ── FLIGHTS picker rows ── */
    #flights-overlay { z-index: 9500; } /* above the city map modal (z 90) */
    #flights-list { display: flex; flex-direction: column; gap: 8px; }
    .flight-row {
      display: flex; align-items: center; justify-content: space-between; gap: 10px;
      width: 100%; text-align: left; cursor: pointer;
      padding: 12px 14px; border-radius: 14px;
      border: 1.5px solid rgba(37,99,235,.18);
      background: linear-gradient(160deg,#ffffff,#eef4fc);
      box-shadow: 0 3px 10px rgba(0,0,0,.07);
      font-family: inherit; transition: transform .08s, box-shadow .12s;
    }
    .flight-row:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37,99,235,.18); }
    .flight-row:active:not(:disabled) { transform: translateY(1px); }
    .flight-row:disabled { opacity: .5; cursor: not-allowed; }
    .flight-row .fr-dest { font-family: var(--display); font-weight: 800; font-size: 15px; color: #1e3a5f; }
    .flight-row .fr-code { font-size: 11px; font-weight: 700; color: #2563eb; background: rgba(37,99,235,.10); padding: 1px 6px; border-radius: 6px; margin-left: 4px; }
    .flight-row .fr-meta { font-size: 12px; color: #64748b; margin-top: 2px; }
    .flight-row .fr-price { font-family: var(--display); font-weight: 800; font-size: 15px; color: #047857; white-space: nowrap; }
    .flight-row .fr-price.fr-locked { color: #b45309; }



    /* ── PROGRESSION CARD ── */
    .prog-card {
      background: var(--surface-2); border: 1px solid var(--border);
      border-radius: 16px; padding: 16px; margin-bottom: 16px;
    }
    .prog-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
    .prog-lv {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      min-width: 68px; padding: 8px 10px; border-radius: 14px;
      background: linear-gradient(135deg, var(--violet), #0e7490); color: #fff;
    }
    .prog-lv-num { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; }
    .prog-lv-cap { font-size: 9px; font-weight: 800; letter-spacing: 1.2px; opacity: .85; margin-top: 2px; }
    .prog-stage { flex: 1; min-width: 0; }
    .prog-stage-name { font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--ink); }
    .prog-stage-blurb { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; }
    .prog-bar { height: 14px; border-radius: 99px; background: rgba(8, 24, 52, .45); overflow: hidden; }
    .prog-bar-fill {
      height: 100%; border-radius: 99px;
      background: linear-gradient(90deg, var(--green), var(--gold));
      transition: width .5s cubic-bezier(.2, .7, .3, 1);
    }
    .prog-bar-cap { font-size: 11.5px; color: var(--ink-muted); margin-top: 6px; text-align: center; }
    .prog-sub {
      font-family: var(--display); font-weight: 800; font-size: 13px;
      color: var(--ink-muted); letter-spacing: .4px;
      margin: 14px 0 6px; text-transform: uppercase;
    }
    .prog-m-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px; }
    .prog-m-name { flex: 1; color: var(--ink); font-weight: 600; }
    .prog-m-stars { color: var(--gold); letter-spacing: 1px; }
    .prog-m-cap { min-width: 56px; text-align: right; font-size: 11.5px; color: var(--ink-muted); }
    .prog-foot { display: flex; gap: 8px; margin-top: 14px; }
    .prog-chip {
      flex: 1; text-align: center; padding: 9px 6px; border-radius: 12px;
      background: var(--surface); border: 1px solid var(--border);
    }
    .prog-chip b { display: block; font-family: var(--display); font-size: 16px; color: var(--ink); }
    .prog-chip span { display: block; font-size: 10.5px; color: var(--ink-muted); margin-top: 1px; }

    /* ── TALK SHEET ── */
    #talk-body { padding: 16px; overflow-y: auto; }
    .talk-reply {
      background: var(--surface-2); border: 1px solid var(--border);
      border-radius: 18px; border-top-left-radius: 6px;
      padding: 16px 18px; margin-bottom: 16px;
      font-size: 16px; line-height: 1.5; color: var(--ink); min-height: 62px;
      display: flex; align-items: center;
    }
    .talk-reply.thinking { opacity: .55; font-style: italic; }
    .talk-qs { display: flex; flex-direction: column; gap: 10px; }
    .talk-q {
      display: flex; align-items: center; gap: 10px;
      width: 100%; text-align: left;
      padding: 14px 16px; min-height: 52px;
      border-radius: 14px; border: 2px solid var(--border-strong);
      background: var(--surface); color: var(--ink);
      font-family: var(--body); font-size: 15px; font-weight: 600;
      cursor: pointer;
    }
    .talk-q:active { transform: scale(.985); }
    .talk-q .tq-ico { font-size: 20px; flex: 0 0 auto; }

    /* ── TRAVEL MODAL (district picker) ── */
    #city-map-modal {
      position: fixed; inset: 0;
      background: rgba(16, 21, 31, 0.92); backdrop-filter: blur(8px);
      z-index: 90; display: flex; align-items: center; justify-content: center;
      opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
    }
    #city-map-modal.open { opacity: 1; pointer-events: auto; }
    .city-map-card {
      background: #f8fafb; width: 96%; max-width: 920px; height: 92%; max-height: 620px;
      border-radius: 20px; border: 3px solid var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.5);
      padding: 0; display: flex; flex-direction: row; position: relative; overflow: hidden;
    }
    .city-map-card h2 { font-family: var(--display); font-size: 18px; color: #0f172a; margin: 0; }
    .city-map-card p { font-size: 12px; color: #64748b; margin: 2px 0 0; }
    #city-map-close-btn {
      position: absolute; top: 10px; right: 10px;
      background: #ef4444; color: white; border: 3px solid var(--ink); border-radius: 50%;
      width: 32px; height: 32px; font-weight: 800; cursor: pointer; font-size: 14px;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 3px 0 var(--ink); transition: transform 0.1s; z-index: 10;
    }
    #city-map-close-btn:active { transform: translateY(3px); box-shadow: none; }
    .city-map-container {
      flex: 1; position: relative; overflow: hidden;
      background: #e8eff8;
    }
    .map-header {
      position: absolute; top: 12px; left: 16px; z-index: 8;
      background: rgba(255,255,255,0.92); padding: 8px 14px; border-radius: 12px;
      border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
    }
    .drive-map-pin {
      display: flex; flex-direction: column; align-items: center; cursor: pointer;
      transition: transform 0.15s;
    }
    .drive-map-pin:hover { transform: scale(1.12); }
    .drive-map-pin:active { transform: scale(0.95); }
    .dmp-bubble {
      width: 46px; height: 46px; border-radius: 50% 50% 50% 4px;
      background: #fff; border: 2.5px solid #1e3a8a;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 2px 6px rgba(0,0,0,.2);
      color: #1e3a8a;
    }
    .drive-map-pin.active .dmp-bubble { border-color: var(--green); background: #ecfdf5; color: #065f46; }
    .dmp-tag {
      margin-top: 2px; background: #1e293b; color: #fff;
      font-family: var(--display); font-size: 13px; font-weight: 800;
      padding: 2px 6px; border-radius: 6px;
      white-space: nowrap; text-align: center;
      box-shadow: 0 1px 3px rgba(0,0,0,.2);
    }
    .drive-map-pin.active .dmp-tag { background: var(--green); }
    #map-car { display: none; }
    #map-nodes { display: none; }
    .map-sidebar {
      width: 160px; background: #1e293b; display: flex; flex-direction: column; padding: 14px 10px;
      border-left: 2px solid #334155; gap: 10px; overflow-y: auto;
    }
    .map-sidebar-title { font-family: var(--display); font-size: 12px; color: #94a3b8; text-align: center; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
    .map-sidebar-item {
      background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,255,255,.1); border-radius: 12px;
      padding: 10px 6px; cursor: pointer; transition: background .2s, border-color .2s; text-align: center;
    }
    .map-sidebar-item:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); }
    .map-sidebar-item .si-icon { font-size: 22px; display: block; margin-bottom: 4px; }
    .map-sidebar-item .si-label { font-size: 10px; font-weight: 700; color: #e2e8f0; }
    @media (max-width: 640px) {
      .city-map-card { flex-direction: column; max-height: 88vh; }
      .map-sidebar { width: 100%; max-height: 120px; flex-direction: row; border-left: none; border-top: 2px solid #334155; }
      .map-sidebar-item { flex: 1; min-width: 80px; }
    }

    .dest-card {
      display: flex;
      align-items: center;
      gap: 14px;
      width: 100%;
      text-align: left;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 14px 16px;
      box-shadow: var(--shadow-sm);
      transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
      cursor: pointer;
    }

    .dest-card:hover {
      border-color: var(--violet);
      transform: translateY(-2px);
      box-shadow: var(--shadow-sm), var(--glow-violet);
    }

    .dest-card:active {
      transform: scale(.97);
    }

    .dest-card.current {
      border-color: var(--gold);
      background: var(--panel-soft);
    }

    .dest-card .demoji {
      font-size: 32px;
      width: 52px;
      height: 52px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 14px;
      background: linear-gradient(135deg, rgba(56, 189, 248, .22), rgba(56, 225, 240, .14));
    }

    .dest-card .dinfo {
      flex: 1;
      min-width: 0;
    }

    .dest-card .dname {
      font-family: var(--display);
      font-weight: 800;
      font-size: 17px;
      color: var(--ink);
    }

    .dest-card .dboost {
      font-size: 13px;
      font-weight: 600;
      color: var(--ink-muted);
      margin-top: 2px;
    }

    .dest-card .dgo {
      font-family: var(--display);
      font-weight: 800;
      font-size: 13px;
      color: #fff;
      background: linear-gradient(135deg, var(--blue), var(--blue-d));
      padding: 8px 14px;
      border-radius: 999px;
      flex-shrink: 0;
      min-height: 36px;
      display: flex;
      align-items: center;
    }

    .dest-card.current .dgo {
      background: #b9c2cf;
    }

    /* ── DRIVE ANIMATION OVERLAY ── */
    #drive-anim {
      position: absolute;
      inset: 0;
      z-index: 56;
      background: linear-gradient(180deg, #1a3a8f 0%, #2C5BC0 40%, #3F7DE0 70%, #6FB1ED 100%);
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }

    #drive-anim.show {
      display: flex;
    }

    #drive-road {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 40%;
      background: linear-gradient(180deg, #374151 0%, #1f2937 100%);
    }

    #drive-road::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 4px;
      background: #FFC83D;
    }

    #drive-road-line {
      position: absolute;
      bottom: 37%;
      left: 0;
      right: 0;
      height: 7px;
      overflow: hidden;
    }

    #drive-road-line::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 400%;
      height: 100%;
      background: repeating-linear-gradient(90deg, #fff 0px, #fff 70px, transparent 70px, transparent 110px);
      animation: roadDash 0.35s linear infinite;
    }

    @keyframes roadDash {
      to {
        transform: translateX(110px);
      }
    }

    /* Smoke particles */
    #drive-smoke-wrap {
      position: absolute;
      bottom: 40%;
      left: 0;
      will-change: transform;
      pointer-events: none;
      transform: translate3d(-220px,0,0);
    }

    @-webkit-keyframes smokeDrive {
      0% { -webkit-transform: translate3d(-220px,0,0); animation-timing-function: cubic-bezier(0.25,0.1,0.25,1); }
      35% { -webkit-transform: translate3d(calc(50vw - 120px),0,0); animation-timing-function: linear; }
      39% { -webkit-transform: translate3d(calc(50vw - 114px),0,0); }
      43% { -webkit-transform: translate3d(calc(50vw - 126px),0,0); }
      47% { -webkit-transform: translate3d(calc(50vw - 113px),0,0); }
      51% { -webkit-transform: translate3d(calc(50vw - 127px),0,0); }
      55% { -webkit-transform: translate3d(calc(50vw - 115px),0,0); }
      59% { -webkit-transform: translate3d(calc(50vw - 125px),0,0); }
      63% { -webkit-transform: translate3d(calc(50vw - 120px),0,0); animation-timing-function: cubic-bezier(0.6,0,1,0.4); }
      100% { -webkit-transform: translate3d(calc(100vw + 200px),0,0); }
    }
    @keyframes smokeDrive {
      0% { transform: translate3d(-220px,0,0); animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1); }
      35% { transform: translate3d(calc(50vw - 120px),0,0); animation-timing-function: linear; }
      39% { transform: translate3d(calc(50vw - 114px),0,0); }
      43% { transform: translate3d(calc(50vw - 126px),0,0); }
      47% { transform: translate3d(calc(50vw - 113px),0,0); }
      51% { transform: translate3d(calc(50vw - 127px),0,0); }
      55% { transform: translate3d(calc(50vw - 115px),0,0); }
      59% { transform: translate3d(calc(50vw - 125px),0,0); }
      63% { transform: translate3d(calc(50vw - 120px),0,0); animation-timing-function: cubic-bezier(0.6, 0, 1, 0.4); }
      100% { transform: translate3d(calc(100vw + 200px),0,0); }
    }

    .smoke-puff {
      position: absolute;
      border-radius: 50%;
      background: rgba(180, 180, 190, 0.7);
      -webkit-animation: puffUp 1.1s ease-out infinite;
      animation: puffUp 1.1s ease-out infinite;
    }

    .smoke-puff:nth-child(1) {
      width: 28px; height: 28px; left: -18px; bottom: 54px; animation-delay: 0s;
    }
    .smoke-puff:nth-child(2) {
      width: 20px; height: 20px; left: -30px; bottom: 66px; animation-delay: 0.25s;
    }
    .smoke-puff:nth-child(3) {
      width: 16px; height: 16px; left: -8px; bottom: 78px; animation-delay: 0.5s;
    }
    .smoke-puff:nth-child(4) {
      width: 22px; height: 22px; left: -38px; bottom: 80px; animation-delay: 0.75s;
    }

    @-webkit-keyframes puffUp {
      0% { -webkit-transform: translateY(0) scale(0.5); opacity: 0.8; }
      60% { opacity: 0.5; }
      100% { -webkit-transform: translateY(-50px) scale(1.6); opacity: 0; }
    }
    @keyframes puffUp {
      0% { transform: translateY(0) scale(0.5); opacity: 0.8; }
      60% { opacity: 0.5; }
      100% { transform: translateY(-50px) scale(1.6); opacity: 0; }
    }

    #drive-car-wrap {
      position: absolute;
      bottom: 37%;
      left: 0;
      will-change: transform;
      transform: translate3d(-180px,0,0);
    }
    #drive-car-wrap.playing {
      -webkit-animation: carDrive 3.2s forwards;
      animation: carDrive 3.2s forwards;
    }
    #drive-smoke-wrap.playing {
      -webkit-animation: smokeDrive 3.2s forwards;
      animation: smokeDrive 3.2s forwards;
    }

    @-webkit-keyframes carDrive {
      0%   { -webkit-transform: translate3d(-180px,0,0); animation-timing-function: cubic-bezier(0.25,0.1,0.25,1); }
      35%  { -webkit-transform: translate3d(calc(50vw - 80px),0,0); animation-timing-function: linear; }
      39%  { -webkit-transform: translate3d(calc(50vw - 74px),0,0); }
      43%  { -webkit-transform: translate3d(calc(50vw - 86px),0,0); }
      47%  { -webkit-transform: translate3d(calc(50vw - 73px),0,0); }
      51%  { -webkit-transform: translate3d(calc(50vw - 87px),0,0); }
      55%  { -webkit-transform: translate3d(calc(50vw - 75px),0,0); }
      59%  { -webkit-transform: translate3d(calc(50vw - 85px),0,0); }
      63%  { -webkit-transform: translate3d(calc(50vw - 80px),0,0); animation-timing-function: cubic-bezier(0.6,0,1,0.4); }
      100% { -webkit-transform: translate3d(calc(100vw + 200px),0,0); }
    }
    @keyframes carDrive {
      0%   { transform: translate3d(-180px,0,0); animation-timing-function: cubic-bezier(0.25,0.1,0.25,1); }
      35%  { transform: translate3d(calc(50vw - 80px),0,0); animation-timing-function: linear; }
      39%  { transform: translate3d(calc(50vw - 74px),0,0); }
      43%  { transform: translate3d(calc(50vw - 86px),0,0); }
      47%  { transform: translate3d(calc(50vw - 73px),0,0); }
      51%  { transform: translate3d(calc(50vw - 87px),0,0); }
      55%  { transform: translate3d(calc(50vw - 75px),0,0); }
      59%  { transform: translate3d(calc(50vw - 85px),0,0); }
      63%  { transform: translate3d(calc(50vw - 80px),0,0); animation-timing-function: cubic-bezier(0.6,0,1,0.4); }
      100% { transform: translate3d(calc(100vw + 200px),0,0); }
    }

    /* Wheel spin */
    .car-wheel {
      -webkit-animation: wheelSpin 0.3s linear infinite;
      animation: wheelSpin 0.3s linear infinite;
      transform-origin: center;
    }

    @-webkit-keyframes wheelSpin { to { -webkit-transform: rotate(360deg); } }
    @keyframes wheelSpin { to { transform: rotate(360deg); } }

    #drive-car-svg {
      width: 160px;
      height: 84px;
      filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .5));
    }

    #drive-label {
      position: absolute;
      bottom: 57%;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(255, 255, 255, .15);
      backdrop-filter: blur(12px);
      border: 2px solid rgba(255, 255, 255, .4);
      border-radius: 22px;
      padding: 12px 28px;
      text-align: center;
      white-space: nowrap;
      animation: labelPop 0.45s 0.25s var(--ease-bounce) both;
    }

    @keyframes labelPop {
      from {
        transform: translateX(-50%) scale(0.7);
        opacity: 0;
      }

      to {
        transform: translateX(-50%) scale(1);
        opacity: 1;
      }
    }

    #drive-label .dl-top {
      font-family: var(--body);
      font-size: 13px;
      font-weight: 700;
      color: rgba(255, 255, 255, .85);
      letter-spacing: .08em;
      text-transform: uppercase;
    }

    #drive-label .dl-dest {
      font-family: var(--display);
      font-size: 26px;
      font-weight: 800;
      color: #fff;
      text-shadow: 0 2px 10px rgba(0, 0, 0, .3);
      margin-top: 4px;
    }

    /* Speed lines */
    #drive-speed-lines {
      position: absolute;
      inset: 0;
      pointer-events: none;
      overflow: hidden;
    }

    .speed-line {
      position: absolute;
      height: 2px;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
      border-radius: 2px;
      animation: speedLine 0.6s linear infinite;
    }

    @keyframes speedLine {
      from {
        transform: translateX(100%);
      }

      to {
        transform: translateX(-200%);
      }
    }

    /* ── SAVINGS JAR + SLIDE-OUT SHOP MENU ── */
    .savebox {
      display: flex;
      align-items: center;
      gap: 3px;
      background: linear-gradient(135deg, var(--purple), var(--purple-d));
      color: #fff;
      font-family: var(--display);
      font-weight: 800;
      padding: 5px 11px;
      border-radius: 999px;
      box-shadow: var(--shadow-sm);
      font-size: 15px;
    }

    .savebox .sj {
      font-size: 9px;
      letter-spacing: .5px;
      opacity: .85;
      margin-right: 2px;
    }

    .savebox .c {
      opacity: .9;
    }


    /* EVO LEVEL BADGE */
    .evobadge {
      display: flex;
      align-items: center;
      gap: 4px;
      background: linear-gradient(145deg, #ff9f20, #e65100);
      color: #fff;
      font-family: var(--display);
      font-weight: 900;
      font-size: 15px;
      padding: 7px 12px;
      border-radius: 20px;
      box-shadow: 0 3px 0 #9c3200, 0 4px 14px rgba(230, 81, 0, .35);
      border: 2px solid rgba(255, 255, 255, .3);
      white-space: nowrap;
      transition: transform .2s var(--ease-bounce);
    }

    .evobadge:hover {
      transform: scale(1.05);
    }

    .evobadge .ev-tiny {
      font-size: 9px;
      opacity: .75;
      letter-spacing: .08em;
      text-transform: uppercase;
    }

    /* EVO PROGRESS BAR */
    .evo-bar-wrap {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 2px;
      min-width: 80px;
    }
    .evobar {
      width: 80px;
      height: 8px;
      background: rgba(0,0,0,0.28);
      border-radius: 8px;
      border: 1.5px solid rgba(255,255,255,0.20);
      overflow: hidden;
      box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
    }
    .evobar-fill {
      height: 100%;
      width: 0%;
      border-radius: 8px;
      background: linear-gradient(90deg, #22c55e, #86efac);
      transition: width 0.5s cubic-bezier(0.22,1,0.36,1);
      box-shadow: 0 0 8px rgba(34,197,94,0.7);
    }
    .evobar.zeroed .evobar-fill {
      background: linear-gradient(90deg, #ef4444, #fca5a5);
      box-shadow: 0 0 8px rgba(239,68,68,0.8);
      animation: evobarPulse 0.8s ease-in-out infinite alternate;
    }
    @keyframes evobarPulse {
      from { opacity: 0.5; }
      to   { opacity: 1.0; }
    }
    .evobar-label {
      font-family: var(--body);
      font-size: 8px;
      color: rgba(255,255,255,0.65);
      white-space: nowrap;
      text-align: right;
      max-width: 100px;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* LEVEL UP POPUP */
    #levelup-overlay {
      position: absolute;
      inset: 0;
      z-index: 70;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(6, 12, 24, .8);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      padding: 20px;
    }

    #levelup-overlay.show {
      display: flex;
      animation: fade .3s;
    }

    /* ── LEVEL-DOWN OVERLAY ── */
    #leveldown-overlay {
      position: absolute;
      inset: 0;
      z-index: 71;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(20, 0, 0, .88);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      padding: 20px;
    }

    #leveldown-overlay.show {
      display: flex;
      animation: fade .3s;
    }

    .leveldown-card {
      background: linear-gradient(170deg, #2a1212 0%, #1a0808 100%);
      border-radius: var(--radius-lg);
      max-width: 360px;
      width: 100%;
      box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1.5px rgba(239, 68, 68, .4);
      animation: levelPop .45s cubic-bezier(.3, 1.4, .5, 1);
      overflow: hidden;
      text-align: center;
    }

    .leveldown-banner {
      background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
      padding: 24px 20px 20px;
    }

    @keyframes petCry {
      0% {
        transform: rotate(-10deg) translateY(0);
      }

      25% {
        transform: rotate(10deg) translateY(-4px);
      }

      50% {
        transform: rotate(-10deg) translateY(0);
      }

      75% {
        transform: rotate(8deg) translateY(-2px);
      }

      100% {
        transform: rotate(0deg) translateY(0);
      }
    }

    #ld-emoji-anim {
      font-size: 56px;
      display: block;
      margin-bottom: 10px;
      animation: petCry .55s ease 3;
    }

    #ld-title {
      font-family: var(--display);
      font-weight: 800;
      font-size: 22px;
      color: #fff;
      margin-bottom: 4px;
    }

    #ld-stat-msg {
      font-size: 13px;
      color: rgba(255, 255, 255, .85);
    }

    .leveldown-body {
      padding: 20px;
    }

    #ld-msg {
      font-size: 13px;
      color: var(--ink-muted);
      line-height: 1.5;
      margin-bottom: 14px;
    }

    #ld-level-badge {
      display: inline-block;
      background: rgba(239, 68, 68, .15);
      border: 1px solid rgba(239, 68, 68, .35);
      color: #ef4444;
      font-family: var(--display);
      font-weight: 800;
      font-size: 15px;
      padding: 8px 22px;
      border-radius: 50px;
      margin-bottom: 18px;
    }

    .leveldown-ok-btn {
      width: 100%;
      padding: 13px;
      background: #ef4444;
      color: #fff;
      font-family: var(--display);
      font-weight: 800;
      font-size: 16px;
      border: none;
      border-radius: 12px;
      cursor: pointer;
    }

    /* ── PET SPECIES PICKER ── */
    @keyframes speciesBounce {

      0%,
      100% {
        transform: translateY(0)
      }

      50% {
        transform: translateY(-10px)
      }
    }

    @keyframes speciesFloat {

      0%,
      100% {
        transform: translateY(0) rotate(-4deg)
      }

      50% {
        transform: translateY(-7px) rotate(4deg)
      }
    }

    @keyframes speciesHop {

      0%,
      45%,
      100% {
        transform: translateY(0)
      }

      22% {
        transform: translateY(-14px) scaleX(.9) scaleY(1.1)
      }
    }

    @keyframes speciesSlide {

      0%,
      100% {
        transform: translateX(0)
      }

      50% {
        transform: translateX(7px)
      }
    }

    @keyframes speciesWiggle {

      0%,
      100% {
        transform: rotate(0)
      }

      25% {
        transform: rotate(-9deg)
      }

      75% {
        transform: rotate(9deg)
      }
    }

    .species-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-bottom: 18px;
    }

    .species-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 12px 6px 10px;
      gap: 4px;
      background: var(--surface-2);
      border: 2px solid var(--border);
      border-radius: 14px;
      cursor: pointer;
      transition: border-color .2s, background .2s, transform .15s;
      user-select: none;
    }

    .species-card:hover {
      background: var(--surface-3);
    }

    .species-card.selected {
      border-color: var(--gold);
      background: rgba(255, 200, 61, .12);
      transform: scale(1.04);
    }

    .species-card .sp-emoji {
      font-size: 36px;
      line-height: 1;
      display: block;
    }

    .species-card .sp-name {
      font-family: var(--display);
      font-weight: 800;
      font-size: 11px;
      color: var(--ink);
    }

    .species-card .sp-desc {
      font-size: 9px;
      color: var(--ink-muted);
      text-align: center;
      line-height: 1.3;
    }

    /* ── PROFILE PHOTO PREVIEW ── */
    #profile-photo-preview {
      width: 64px;
      height: 64px;
      border-radius: 50%;
      background: linear-gradient(135deg, #ffe0b2, #ffb74d);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 36px;
      overflow: hidden;
      flex-shrink: 0;
      border: 2px solid var(--border-strong);
    }

    #profile-photo-preview img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 50%;
    }

    .photo-upload-label {
      display: block;
      padding: 10px 16px;
      background: var(--surface-2);
      border: 1.5px solid var(--border-strong);
      border-radius: 10px;
      cursor: pointer;
      font-family: var(--display);
      font-weight: 700;
      font-size: 13px;
      color: var(--ink);
      text-align: center;
    }

    .levelup-card {
      background: linear-gradient(170deg, #1a2540 0%, #12193a 100%);
      border-radius: var(--radius-lg);
      padding: 0;
      text-align: center;
      max-width: 360px;
      width: 100%;
      box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1.5px rgba(255, 200, 61, .25);
      animation: levelPop .45s var(--ease-bounce);
      overflow: hidden;
    }

    .levelup-banner {
      background: linear-gradient(135deg, #FF9800 0%, #E65100 100%);
      padding: 22px 20px 18px;
      position: relative;
      overflow: hidden;
    }

    .levelup-banner::before {
      content: '';
      position: absolute;
      inset: 0;
      background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='160' cy='30' r='80' fill='rgba(255,255,255,.08)'/%3E%3Ccircle cx='20' cy='160' r='60' fill='rgba(255,255,255,.05)'/%3E%3C/svg%3E") center/cover no-repeat;
      pointer-events: none;
    }

    @keyframes levelPop {
      0% {
        transform: scale(.55) translateY(30px);
        opacity: 0;
      }

      70% {
        transform: scale(1.04) translateY(-4px);
        opacity: 1;
      }

      100% {
        transform: scale(1) translateY(0);
        opacity: 1;
      }
    }

    @keyframes starPulse {

      0%,
      100% {
        transform: scale(1);
      }

      50% {
        transform: scale(1.15);
      }
    }

    .levelup-stars {
      font-size: 32px;
      letter-spacing: 6px;
      margin-bottom: 10px;
      display: block;
      animation: starPulse 1.2s ease-in-out infinite;
    }

    .levelup-lvlbadge {
      display: inline-block;
      color: white;
      font-family: var(--display);
      font-weight: 900;
      font-size: 13px;
      padding: 4px 14px;
      border-radius: 20px;
      margin-bottom: 6px;
      background: rgba(255, 255, 255, .2);
      letter-spacing: 1px;
      text-transform: uppercase;
    }

    .levelup-title {
      font-family: var(--display);
      font-size: 30px;
      font-weight: 900;
      color: #fff;
      text-shadow: 0 2px 12px rgba(0, 0, 0, .3);
      letter-spacing: -0.5px;
    }

    .levelup-body {
      padding: 20px 22px 22px;
    }

    .levelup-msg {
      font-size: 14px;
      color: rgba(255, 255, 255, .7);
      font-weight: 600;
      line-height: 1.55;
      margin-bottom: 16px;
    }

    .levelup-perks {
      background: rgba(255, 255, 255, .07);
      border-radius: 14px;
      padding: 13px 15px;
      margin-bottom: 20px;
      text-align: left;
      border: 1.5px solid rgba(255, 255, 255, .12);
    }

    .levelup-perk {
      display: flex;
      align-items: flex-start;
      gap: 9px;
      font-size: 13px;
      font-weight: 600;
      color: rgba(255, 255, 255, .88);
      padding: 5px 0;
      line-height: 1.4;
    }

    .levelup-perk+.levelup-perk {
      border-top: 1px solid rgba(255, 255, 255, .08);
    }

    .levelup-perk-icon {
      flex-shrink: 0;
      font-size: 15px;
    }

    .levelup-continue-btn {
      width: 100%;
      background: linear-gradient(135deg, #FFC83D, #E8A92B);
      color: #243042;
      border: none;
      border-radius: var(--radius-md);
      padding: 15px;
      font-size: 16px;
      font-weight: 900;
      font-family: var(--display);
      cursor: pointer;
      box-shadow: 0 5px 0 #a06a10;
      transition: transform .1s, box-shadow .1s;
      letter-spacing: 0.3px;
    }

    .levelup-continue-btn:active {
      transform: translateY(3px);
      box-shadow: 0 2px 0 #a06a10;
    }

    /* LOCKED TIER OVERLAY on shop items */
    .tier-locked-badge {
      font-size: 9px;
      font-weight: 800;
      padding: 2px 6px;
      border-radius: 6px;
      background: rgba(255, 255, 255, .08);
      color: var(--ink-muted);
      border: 1px solid var(--border);
      font-family: var(--display);
    }

    /* FOCUS RING — keyboard navigation */
    :focus-visible {
      outline: 3px solid var(--gold);
      outline-offset: 2px;
    }

    /* ── MINI-GAME OVERLAY ── */
    #minigame-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 9999;
      background: rgba(0, 0, 0, 0.82);
      backdrop-filter: blur(4px);
      align-items: center;
      justify-content: center;
    }

    #minigame-overlay.show {
      display: flex;
    }

    .mg-card {
      background: #1a2030;
      border-radius: 24px;
      padding: 0;
      width: min(92vw, 420px);
      max-height: 90vh;
      overflow: hidden;
      box-shadow: 0 24px 80px rgba(0, 0, 0, .6), 0 0 0 2px rgba(255, 200, 61, .3);
      display: flex;
      flex-direction: column;
    }

    .mg-header {
      background: linear-gradient(135deg, #243042, #1a2030);
      padding: 16px 20px 12px;
      border-bottom: 1px solid rgba(255, 255, 255, .08);
    }

    .mg-title {
      font-family: 'Baloo 2', sans-serif;
      font-size: 20px;
      font-weight: 800;
      color: #FFC83D;
      margin: 0;
    }

    .mg-subtitle {
      font-family: 'Fredoka', sans-serif;
      font-size: 13px;
      color: rgba(255, 255, 255, .55);
      margin: 2px 0 0;
    }

    .mg-arena {
      flex: 1;
      position: relative;
      min-height: 240px;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* ── REPORT PREVIEW OVERLAY ── */
    #report-preview-overlay {
      position: fixed;
      inset: 0;
      z-index: 120;
      background: rgba(20, 48, 77, .55);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 18px;
    }

    #report-preview-overlay.show {
      display: flex;
    }

    .rp-sheet {
      width: min(94vw, 460px);
      max-height: 88vh;
      background: var(--surface);
      border-radius: 20px;
      box-shadow: var(--shadow);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      border: 1px solid var(--border);
      animation: slideup .3s var(--ease-out);
    }

    .rp-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      padding: 16px 18px 10px;
    }

    .rp-title {
      font-family: var(--display);
      font-weight: 800;
      font-size: 19px;
      color: var(--ink);
    }

    .rp-sub {
      font-size: 12px;
      color: var(--ink-muted);
      margin-top: 2px;
    }

    .rp-close {
      flex: 0 0 auto;
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: var(--surface-3);
      color: var(--ink);
      font-size: 16px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      border: none;
    }

    #rp-frame {
      flex: 1;
      min-height: 300px;
      width: 100%;
      border: none;
      background: #fff;
      border-top: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
    }

    .rp-actions {
      padding: 12px 16px 6px;
    }

    .rp-send-btn {
      width: 100%;
      padding: 13px;
      border: none;
      border-radius: 12px;
      cursor: pointer;
      background: linear-gradient(135deg, #f59e0b, #d97706);
      color: #fff;
      font-family: var(--display);
      font-weight: 800;
      font-size: 15px;
    }

    .rp-send-btn:active {
      transform: scale(.98);
    }

    #rp-status {
      font-size: 12px;
      color: var(--ink-muted);
      text-align: center;
      padding: 2px 16px 12px;
      min-height: 16px;
    }

    .mg-footer {
      padding: 10px 16px 14px;
      display: flex;
      gap: 8px;
      border-top: 1px solid rgba(255, 255, 255, .07);
    }

    .mg-skip-btn {
      flex: 1;
      background: transparent;
      border: 1px solid rgba(255, 255, 255, .18);
      color: rgba(255, 255, 255, .45);
      border-radius: 10px;
      padding: 8px;
      font-family: 'Fredoka', sans-serif;
      font-size: 13px;
      cursor: pointer;
    }

    .mg-result {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 10;
      background: rgba(0, 0, 0, .7);
      border-radius: 0;
    }

    .mg-result-title {
      font-family: 'Baloo 2', sans-serif;
      font-size: 32px;
      font-weight: 800;
      margin: 0;
      padding: 0;
    }

    .mg-result-title.win {
      color: #5BBE6B;
      text-shadow: 0 0 24px #5BBE6B88;
    }

    .mg-result-title.lose {
      color: #FF6B6B;
      text-shadow: 0 0 24px #FF6B6B88;
    }

    .mg-result-sub {
      font-family: 'Fredoka', sans-serif;
      font-size: 14px;
      color: rgba(255, 255, 255, .65);
      margin-top: 6px;
      text-align: center;
      padding: 0 16px;
    }

    /* Coin Catch */
    #mg-coin-arena {
      background: linear-gradient(180deg, #0f1e2e 0%, #1a3048 100%);
      width: 100%;
      height: 280px;
      position: relative;
      overflow: hidden;
    }

    .mg-coin {
      position: absolute;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: radial-gradient(circle at 35% 35%, #FFD96B, #E8A92B);
      box-shadow: 0 0 8px rgba(255, 200, 61, .5), inset 0 2px 4px rgba(255, 255, 255, .3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 800;
      color: #8B5E10;
      font-family: 'Baloo 2', sans-serif;
      transition: opacity 0.2s;
    }

    .mg-coin.caught {
      opacity: 0;
      transform: scale(0);
    }

    #mg-basket {
      position: absolute;
      bottom: 8px;
      width: 72px;
      height: 32px;
      background: linear-gradient(180deg, #3F7DE0, #2C5BC0);
      border-radius: 8px 8px 16px 16px;
      box-shadow: 0 4px 12px rgba(63, 125, 224, .4);
      cursor: grab;
      transform: translateX(-50%);
    }

    #mg-basket::before {
      content: '';
      position: absolute;
      top: -8px;
      left: 50%;
      transform: translateX(-50%);
      width: 40px;
      height: 10px;
      background: #5599F0;
      border-radius: 5px 5px 0 0;
    }

    .mg-timer-bar {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 5px;
      background: rgba(255, 255, 255, .1);
    }

    .mg-timer-fill {
      height: 100%;
      background: linear-gradient(90deg, #5BBE6B, #FFC83D);
      transition: width 0.1s linear;
      border-radius: 0 2px 2px 0;
    }

    .mg-catch-count {
      position: absolute;
      top: 10px;
      right: 12px;
      font-family: 'Baloo 2', sans-serif;
      font-size: 15px;
      font-weight: 800;
      color: #FFD96B;
    }

    /* Sort Rush */
    #mg-sort-arena {
      background: linear-gradient(180deg, #1a1040 0%, #2a1a60 100%);
      width: 100%;
      height: 280px;
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 16px;
    }

    .mg-sort-card {
      background: #EEF3FF;
      border-radius: 18px;
      padding: 20px 24px;
      text-align: center;
      min-width: 200px;
      transition: transform 0.15s, background 0.15s;
      box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
    }

    .mg-sort-card.correct {
      background: #c8f7d8;
    }

    .mg-sort-card.wrong {
      background: #ffd0d0;
    }

    .mg-sort-icon {
      font-size: 26px;
      font-family: 'Baloo 2', sans-serif;
      font-weight: 900;
      margin-bottom: 8px;
      letter-spacing: 1px;
    }

    .mg-sort-label {
      font-family: 'Baloo 2', sans-serif;
      font-size: 18px;
      font-weight: 900;
      color: #1A0A40;
    }

    .mg-sort-progress {
      position: absolute;
      top: 11px;
      right: 14px;
      font-family: 'Baloo 2', sans-serif;
      font-size: 14px;
      font-weight: 800;
      color: rgba(255, 255, 255, .78);
    }

    .mg-sort-btns {
      display: flex;
      gap: 16px;
    }

    .mg-sort-btn {
      flex: 1;
      padding: 12px 20px;
      border: none;
      border-radius: 14px;
      font-family: 'Baloo 2', sans-serif;
      font-size: 16px;
      font-weight: 800;
      cursor: pointer;
      transition: transform 0.1s, box-shadow 0.1s;
    }

    .mg-sort-btn:active {
      transform: scale(.94);
    }

    .mg-sort-btn.need {
      background: linear-gradient(135deg, #5BBE6B, #3E9E4E);
      color: #fff;
      box-shadow: 0 4px 0 #2d7a3a;
    }

    .mg-sort-btn.want {
      background: linear-gradient(135deg, #0EA5E9, #0284C7);
      color: #fff;
      box-shadow: 0 4px 0 #025a87;
    }

    /* Budget Blitz */
    #mg-blitz-arena {
      background: linear-gradient(180deg, #1a0a2e 0%, #2d1060 100%);
      width: 100%;
      height: 280px;
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 20px;
    }

    .mg-blitz-bar {
      width: 88%;
      height: 44px;
      border-radius: 22px;
      overflow: hidden;
      position: relative;
      border: 2px solid rgba(255, 255, 255, .15);
      background: #0a0520;
    }

    .mg-blitz-zone {
      position: absolute;
      top: 0;
      height: 100%;
    }

    .mg-blitz-zone.cheap {
      left: 0;
      width: 30%;
      background: linear-gradient(90deg, rgba(255, 107, 107, .5), rgba(255, 107, 107, .3));
    }

    .mg-blitz-zone.sweet {
      left: 30%;
      width: 40%;
      background: linear-gradient(90deg, rgba(91, 190, 107, .4), rgba(91, 190, 107, .6), rgba(91, 190, 107, .4));
    }

    .mg-blitz-zone.expensive {
      left: 70%;
      width: 30%;
      background: linear-gradient(90deg, rgba(255, 107, 107, .3), rgba(255, 107, 107, .5));
    }

    .mg-blitz-label {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      font-family: 'Fredoka', sans-serif;
      font-size: 11px;
      font-weight: 700;
      color: rgba(255, 255, 255, .7);
      pointer-events: none;
      text-align: center;
      width: 100%;
    }

    .mg-blitz-zone.cheap .mg-blitz-label {
      left: 0;
      width: 100%;
    }

    .mg-blitz-zone.sweet .mg-blitz-label {
      left: 0;
      width: 100%;
      color: #fff;
      font-size: 13px;
      font-weight: 800;
      font-family: 'Baloo 2', sans-serif;
    }

    .mg-blitz-zone.expensive .mg-blitz-label {
      left: 0;
      width: 100%;
    }

    #mg-blitz-needle {
      position: absolute;
      top: -4px;
      bottom: -4px;
      width: 6px;
      background: var(--surface);
      border-radius: 3px;
      box-shadow: 0 0 10px rgba(255, 255, 255, .9);
      transform: translateX(-50%);
      transition: none;
    }

    .mg-blitz-tap-btn {
      width: 110px;
      height: 110px;
      border-radius: 50%;
      background: radial-gradient(circle at 35% 35%, #FFC83D, #E8A92B);
      box-shadow: 0 6px 0 #C08820, 0 0 24px rgba(255, 200, 61, .4);
      border: none;
      cursor: pointer;
      font-family: 'Baloo 2', sans-serif;
      font-size: 20px;
      font-weight: 800;
      color: #5A3A00;
      transition: transform 0.08s, box-shadow 0.08s;
    }

    .mg-blitz-tap-btn:active {
      transform: translateY(4px);
      box-shadow: 0 2px 0 #C08820, 0 0 24px rgba(255, 200, 61, .4);
    }

    .mg-blitz-rounds {
      font-family: 'Fredoka', sans-serif;
      font-size: 13px;
      color: rgba(255, 255, 255, .5);
    }

    /* Stack & Save */
    #mg-stack-arena {
      background: linear-gradient(180deg, #1a0a2e 0%, #1a1040 100%);
      width: 100%;
      height: 280px;
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 14px;
    }

    #mg-jar-wrap {
      width: 90px;
      height: 130px;
      position: relative;
    }

    #mg-jar-svg {
      width: 100%;
      height: 100%;
    }

    #mg-jar-fill-pct {
      font-family: 'Baloo 2', sans-serif;
      font-size: 22px;
      font-weight: 800;
      color: #FFD96B;
      text-align: center;
    }

    .mg-hold-btn {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      background: radial-gradient(circle at 35% 35%, #0EA5E9, #0284C7);
      box-shadow: 0 6px 0 #025a87, 0 0 24px rgba(14, 165, 233, .35);
      border: none;
      cursor: pointer;
      font-family: 'Baloo 2', sans-serif;
      font-size: 15px;
      font-weight: 800;
      color: #fff;
      user-select: none;
      -webkit-user-select: none;
      touch-action: none;
    }

    .mg-hold-btn:active {
      transform: translateY(3px);
      box-shadow: 0 3px 0 #025a87;
    }

    .mg-target-label {
      font-family: 'Fredoka', sans-serif;
      font-size: 12px;
      color: rgba(255, 255, 255, .4);
    }

    /* ── Color Match ── */
    #mg-cmatch-arena {
      background: linear-gradient(180deg, #0f1e2e 0%, #1a3048 100%);
      width: 100%;
      height: 280px;
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
    }

    #cm-swatch {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      border: 4px solid rgba(255, 255, 255, .4);
      box-shadow: 0 0 24px rgba(255, 255, 255, .3);
    }

    #cm-label {
      font-family: 'Baloo 2', sans-serif;
      font-size: 16px;
      font-weight: 800;
      color: #fff;
    }

    #cm-choices {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: center;
    }

    .cm-choice-btn {
      width: 64px;
      height: 64px;
      border-radius: 16px;
      border: none;
      background: rgba(255, 255, 255, .12);
      font-size: 34px;
      cursor: pointer;
      transition: transform 0.1s, background 0.15s;
      box-shadow: 0 4px 0 rgba(0, 0, 0, .3);
    }

    .cm-choice-btn:active {
      transform: scale(.9);
    }

    /* ── Balloon Pop ── */
    #mg-balloon-arena {
      background: linear-gradient(180deg, #0a1628 0%, #1a2a50 100%);
      width: 100%;
      height: 280px;
      position: relative;
      overflow: hidden;
    }

    .bp-balloon {
      position: absolute;
      font-size: 40px;
      cursor: pointer;
      user-select: none;
      filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4));
    }

    .bp-balloon:active {
      transform: scale(1.2);
    }

    /* ── Sleep mini-games (Home / rest) ── */
    #mg-sleep-arena {
      background: linear-gradient(180deg, #1b1746 0%, #2a2566 55%, #3a3680 100%);
      width: 100%;
      height: 280px;
      position: relative;
      overflow: hidden;
    }

    #mg-sleep-arena::before {
      content: '';
      position: absolute;
      inset: 0;
      pointer-events: none;
      background-image:
        radial-gradient(1.5px 1.5px at 18% 28%, rgba(255, 255, 255, .75), transparent),
        radial-gradient(1.5px 1.5px at 68% 18%, rgba(255, 255, 255, .55), transparent),
        radial-gradient(1.5px 1.5px at 42% 66%, rgba(255, 255, 255, .5), transparent),
        radial-gradient(2px 2px at 84% 58%, rgba(255, 255, 255, .6), transparent),
        radial-gradient(1.5px 1.5px at 30% 84%, rgba(255, 255, 255, .45), transparent);
    }

    .sl-item {
      position: absolute;
      font-size: 40px;
      cursor: pointer;
      user-select: none;
      line-height: 1;
      filter: drop-shadow(0 3px 7px rgba(0, 0, 0, .35));
      will-change: transform, top, left;
    }

    .sl-item:active {
      transform: scale(1.2);
    }

    #sl-meter {
      position: absolute;
      left: 16px;
      right: 16px;
      bottom: 12px;
      height: 12px;
      border-radius: 8px;
      background: rgba(255, 255, 255, .18);
      overflow: hidden;
      z-index: 5;
    }

    #sl-meter-fill {
      height: 100%;
      width: 0%;
      border-radius: 8px;
      background: linear-gradient(90deg, #8B7BE8, #B9A7FF);
      transition: width .2s var(--ease-out);
    }

    /* ── Bubble Burst ── */
    #mg-bubble-arena {
      background: linear-gradient(180deg, #0d1e3a 0%, #1a3060 100%);
      width: 100%;
      height: 280px;
      position: relative;
      overflow: hidden;
    }

    #bb2-msg {
      position: absolute;
      top: 36px;
      width: 100%;
      text-align: center;
      font-family: 'Fredoka', sans-serif;
      font-size: 14px;
      color: rgba(255, 255, 255, .5);
    }

    .bb2-bubble {
      position: absolute;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      filter: drop-shadow(0 4px 12px rgba(56, 225, 240, .4));
    }

    .bb2-bubble:active {
      transform: scale(1.3) !important;
    }

    /* ── Memory Match ── */
    #mg-mem-arena {
      background: linear-gradient(180deg, #0f1e2e 0%, #1a3048 100%);
      width: 100%;
      height: 280px;
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      padding-top: 32px;
    }

    #mem-grid {
      display: grid;
      grid-template-columns: repeat(4, 52px);
      gap: 8px;
    }

    .mem-card {
      width: 52px;
      height: 52px;
      border-radius: 10px;
      cursor: pointer;
      position: relative;
      transform-style: preserve-3d;
      transition: transform 0.35s;
    }

    .mem-card.flipped,
    .mem-card.matched {
      transform: rotateY(180deg);
    }

    .mem-card.matched .mem-back {
      background: rgba(91, 190, 107, .35);
    }

    .mem-front,
    .mem-back {
      position: absolute;
      inset: 0;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
    }

    .mem-front {
      background: linear-gradient(135deg, #38BDF8, #0284C7);
      font-size: 22px;
      font-weight: 900;
      color: #fff;
      box-shadow: 0 3px 0 #025a87;
    }

    .mem-back {
      background: rgba(255, 255, 255, .1);
      font-size: 26px;
      transform: rotateY(180deg);
      border: 2px solid rgba(255, 255, 255, .2);
    }

    /* ════════════════════════════════════════════════════════════
       NEON CITY OVERHAUL — responsive, hover polish & accessibility
       ════════════════════════════════════════════════════════════ */

    /* Keyboard focus — luminous ring, visible on dark surfaces */
    :focus-visible {
      outline: 3px solid var(--cyan);
      outline-offset: 2px;
      border-radius: 6px;
    }

    /* Desktop / tablet: cap readable overlay content & center it.
       The game scene stays full-bleed (canvas sizes to the viewport). */
    .work-wrap,
    .reports-wrap {
      max-width: 640px;
      margin-inline: auto;
      width: 100%;
    }

    .chat-interface,
    .menu-list,
    .menu-head,
    #goal-slot {
      max-width: 680px;
      margin-inline: auto;
      width: 100%;
    }

    .drive-body {
      max-width: 560px;
      margin-inline: auto;
      width: 100%;
    }

    @media (min-width: 720px) {
      .overlay {
        justify-content: center;
      }

      .sheet {
        max-width: 560px;
        border-radius: 28px 28px 0 0;
      }

      .top-nav-bar {
        padding: 5px;
      }

      .top-nav-btn {
        font-size: 14px;
        padding: 7px 18px;
      }
    }

    /* Pointer-capable devices: gentle hover lift on primary actions.
       Transform/opacity only — GPU-accelerated, no layout thrash. */
    @media (hover: hover) and (pointer: fine) {

      .actbtn,
      .auth-main-btn,
      .auth-submit-btn,
      .levelup-continue-btn,
      #intro #play {
        transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out);
      }

      .actbtn:hover,
      .auth-main-btn:hover,
      .auth-submit-btn:hover,
      .levelup-continue-btn:hover,
      #intro #play:hover {
        transform: translateY(-2px);
        filter: brightness(1.06);
      }

      .nav-arrow-btn {
        transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
      }

      .nav-arrow-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 0 #2274a5, 0 8px 22px rgba(0, 0, 0, .3);
      }

      .buybtn {
        transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out);
      }

      .buybtn:hover {
        transform: translateY(-1px);
        filter: brightness(1.08);
      }

      .menu-card,
      .work-job-card,
      .rs-card,
      .tx-row {
        transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
      }

      .menu-card:hover,
      .rs-card:hover,
      .tx-row:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-sm), 0 0 0 1px var(--border-strong);
      }

      .edu-opt:not(:disabled):hover {
        border-color: var(--violet);
        background: var(--surface-2);
      }


      .closeb:hover {
        background: rgba(255, 255, 255, .4) !important;
      }
    }

    /* Coin pulse — subtle arcade energy on the primary CTA */
    #enter-now.show {
      animation: enterGlow 2.4s var(--ease-out) infinite;
    }

    @keyframes enterGlow {

      0%,
      100% {
        box-shadow: 0 5px 0 #2e7a3c, 0 8px 24px rgba(0, 0, 0, .28);
      }

      50% {
        box-shadow: 0 5px 0 #2e7a3c, 0 8px 24px rgba(0, 0, 0, .28), 0 0 26px rgba(70, 214, 126, .55);
      }
    }

    @keyframes shopBgPop {
      0% {
        opacity: 0;
        transform: scale(.96);
      }

      100% {
        opacity: 1;
        transform: scale(1);
      }
    }

    /* Very small phones — keep stat labels legible */
    @media (max-width: 360px) {
      .stat .lab {
        font-size: 10.5px;
      }

      .coinbox {
        font-size: 16px;
        padding: 6px 11px;
      }
    }

    /* REDUCED MOTION — respect user preference */
    @media (prefers-reduced-motion: reduce) {

      *,
      *::before,
      *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
      }
    }

    /* ── CARTOON ANIMATIONS ── */
    @keyframes mgPopIn {
      0% {
        transform: scale(.8) translateY(24px);
        opacity: 0;
      }

      70% {
        transform: scale(1.04) translateY(-3px);
        opacity: 1;
      }

      100% {
        transform: scale(1) translateY(0);
        opacity: 1;
      }
    }

    @keyframes shopBgPop {
      0% {
        opacity: 0;
        transform: scale(.96);
      }

      100% {
        opacity: 1;
        transform: scale(1);
      }
    }

    /* ══════════════════════════════════════════
       CARTOON OVERRIDES — appended last so they
       always win over earlier declarations
       ══════════════════════════════════════════ */

    /* Drive / Work action buttons */
    .actbtn {
      background: linear-gradient(170deg, #FFE84A 0%, #FFBA00 55%, #E8960A 100%) !important;
      color: #3A2400 !important;
      font-size: 15px !important;
      font-weight: 900 !important;
      padding: 0 22px !important;
      height: 48px !important;
      border-radius: 24px !important;
      box-shadow: 0 7px 0 #8A5400, 0 10px 22px rgba(0, 0, 0, .28) !important;
      border: 3px solid rgba(255, 255, 255, .78) !important;
      position: relative !important;
      overflow: hidden !important;
      letter-spacing: 0.5px !important;
    }

    .actbtn::after {
      content: '' !important;
      position: absolute !important;
      top: 0;
      left: 0;
      right: 0;
      height: 46% !important;
      background: rgba(255, 255, 255, .22) !important;
      border-radius: 24px 24px 50% 50% !important;
      pointer-events: none !important;
    }

    .actbtn:hover {
      transform: translateY(-3px) !important;
      box-shadow: 0 10px 0 #8A5400, 0 14px 26px rgba(0, 0, 0, .32) !important;
      filter: brightness(1.06) !important;
    }

    .actbtn:active {
      transform: translateY(5px) !important;
      box-shadow: 0 2px 0 #8A5400, 0 3px 8px rgba(0, 0, 0, .2) !important;
    }

    /* Nav arrows ◀ ▶ */
    .nav-arrow-btn {
      width: 58px !important;
      height: 58px !important;
      font-size: 22px !important;
      background: linear-gradient(145deg, #FF9F6C, #E8612E) !important;
      box-shadow: 0 7px 0 #8A2E00, 0 10px 20px rgba(0, 0, 0, .3) !important;
      border: 3px solid rgba(255, 255, 255, .65) !important;
      position: relative !important;
      overflow: hidden !important;
    }

    .nav-arrow-btn::after {
      content: '' !important;
      position: absolute !important;
      top: 0;
      left: 0;
      right: 0;
      height: 46% !important;
      background: rgba(255, 255, 255, .2) !important;
      border-radius: 50% !important;
      pointer-events: none !important;
    }

    .nav-arrow-btn:hover {
      transform: translateY(-3px) !important;
      box-shadow: 0 10px 0 #8A2E00, 0 14px 24px rgba(0, 0, 0, .35) !important;
    }

    .nav-arrow-btn:active {
      transform: translateY(5px) !important;
      box-shadow: 0 2px 0 #8A2E00, 0 3px 8px rgba(0, 0, 0, .2) !important;
    }

    /* Buy button */
    .buybtn {
      background: linear-gradient(170deg, #7AEB8A 0%, #3E9E4E 100%) !important;
      font-weight: 900 !important;
      font-size: 14px !important;
      padding: 11px 20px !important;
      border-radius: 16px !important;
      box-shadow: 0 5px 0 #1E6A2E !important;
      border: 2px solid rgba(255, 255, 255, .5) !important;
    }

    .buybtn:hover {
      transform: translateY(-2px) !important;
      box-shadow: 0 7px 0 #1E6A2E !important;
      filter: brightness(1.08) !important;
    }

    .buybtn:active {
      transform: translateY(4px) !important;
      box-shadow: 0 1px 0 #1E6A2E !important;
    }

    /* Auth buttons */
    .auth-main-btn {
      border-radius: 22px !important;
      position: relative !important;
      overflow: hidden !important;
    }

    .auth-main-btn::after {
      content: '' !important;
      position: absolute !important;
      top: 0;
      left: 0;
      right: 0;
      height: 44% !important;
      background: rgba(255, 255, 255, .18) !important;
      border-radius: 22px 22px 50% 50% !important;
      pointer-events: none !important;
    }

    .auth-main-btn:hover {
      transform: translateY(-2px) !important;
      filter: brightness(1.06) !important;
    }

    .auth-main-btn:active {
      transform: translateY(3px) scale(.98) !important;
    }

    .auth-btn-signin {
      background: linear-gradient(170deg, #FFE84A, #FFBA00 55%, #E8960A 100%) !important;
      border: 3px solid rgba(255, 255, 255, .7) !important;
      box-shadow: 0 7px 0 #8A5400, 0 10px 22px rgba(0, 0, 0, .2) !important;
    }

    /* Minigame card */
    .mg-card {
      background: #1E1050 !important;
      border-radius: 28px !important;
      box-shadow: 0 24px 80px rgba(0, 0, 0, .65), 0 0 0 4px rgba(255, 230, 50, .55), 0 0 0 8px rgba(255, 200, 61, .18) !important;
      animation: mgPopIn .38s var(--ease-bounce) !important;
    }

    /* Minigame header */
    .mg-header {
      background: linear-gradient(135deg, #5A22AA, #2E0E6A) !important;
      border-bottom: 3px solid rgba(255, 220, 50, .45) !important;
    }

    .mg-title {
      color: #FFE84A !important;
      font-size: 22px !important;
      font-weight: 900 !important;
      text-shadow: 0 2px 10px rgba(0, 0, 0, .5) !important;
    }

    .mg-subtitle {
      color: rgba(255, 255, 255, .82) !important;
      font-weight: 600 !important;
    }

    /* Minigame footer */
    .mg-footer {
      border-top: 2px solid rgba(255, 255, 255, .12) !important;
      background: rgba(0, 0, 0, .12) !important;
    }

    /* Minigame result */
    .mg-result {
      background: rgba(8, 4, 26, .84) !important;
      backdrop-filter: blur(5px) !important;
      animation: mgPopIn .3s var(--ease-bounce) !important;
    }

    .mg-result-title {
      font-size: 40px !important;
      font-weight: 900 !important;
      letter-spacing: -.5px !important;
    }

    .mg-result-title.win {
      color: #7AFF90 !important;
      text-shadow: 0 0 32px #5BBE6B, 0 5px 0 #1E6A2E !important;
    }

    .mg-result-title.lose {
      color: #FF8E8E !important;
      text-shadow: 0 0 32px #FF6B6B, 0 5px 0 #881818 !important;
    }

    .mg-result-sub {
      font-size: 15px !important;
      color: rgba(255, 255, 255, .85) !important;
      font-weight: 600 !important;
      line-height: 1.45 !important;
      margin-top: 12px !important;
    }

    /* Coin Catch arena */
    #mg-coin-arena {
      background: linear-gradient(180deg, #0A2250 0%, #1A5090 55%, #1A3A7A 100%) !important;
    }

    /* Coins */
    .mg-coin {
      width: 36px !important;
      height: 36px !important;
      background: radial-gradient(circle at 32% 28%, #FFFAD0, #FFD700 45%, #E8A92B 100%) !important;
      box-shadow: 0 0 14px rgba(255, 200, 61, .8), inset 0 3px 5px rgba(255, 255, 255, .4), 0 4px 0 rgba(0, 0, 0, .2) !important;
      font-size: 14px !important;
      font-weight: 900 !important;
      color: #6A4000 !important;
    }

    /* Timer bar */
    .mg-timer-bar {
      height: 9px !important;
      background: rgba(0, 0, 0, .35) !important;
    }

    .mg-timer-fill {
      background: linear-gradient(90deg, #FF6B6B, #FFB800 50%, #7AFF8A) !important;
      box-shadow: 0 0 10px rgba(255, 220, 50, .7) !important;
      border-radius: 0 5px 5px 0 !important;
    }

    /* Catch count */
    .mg-catch-count {
      font-size: 18px !important;
      font-weight: 900 !important;
      color: #FFE84A !important;
      text-shadow: 0 2px 8px rgba(0, 0, 0, .6) !important;
    }

    /* Basket */
    #mg-basket {
      width: 80px !important;
      height: 38px !important;
      background: linear-gradient(170deg, #5599FF, #2C5BC0) !important;
      border-radius: 10px 10px 18px 18px !important;
      box-shadow: 0 5px 0 #1A3A90, 0 8px 18px rgba(63, 125, 224, .5) !important;
      border: 3px solid rgba(255, 255, 255, .55) !important;
    }

    #mg-basket::before {
      width: 46px !important;
      height: 12px !important;
      background: #7AB4FF !important;
      top: -10px !important;
      border-radius: 6px 6px 0 0 !important;
      border: 2px solid rgba(255, 255, 255, .45) !important;
      border-bottom: none !important;
    }

    /* Sort Rush arena */
    #mg-sort-arena {
      background: linear-gradient(180deg, #1A0A42 0%, #3A1A7A 100%) !important;
    }

    /* Sort card */
    .mg-sort-card {
      background: #fff !important;
      border-radius: 22px !important;
      box-shadow: 0 7px 0 rgba(0, 0, 0, .18), 0 12px 30px rgba(0, 0, 0, .32) !important;
      border: 3px solid rgba(255, 255, 255, .9) !important;
    }

    .mg-sort-card.correct {
      background: #AFFFCC !important;
      border-color: #5BBE6B !important;
      box-shadow: 0 7px 0 #2A7A3A, 0 0 22px rgba(91, 190, 107, .4) !important;
      transform: scale(1.04) !important;
    }

    .mg-sort-card.wrong {
      background: #FFCCCC !important;
      border-color: #FF6B6B !important;
      box-shadow: 0 7px 0 #882222 !important;
      transform: scale(0.96) !important;
    }

    /* Sort icon */
    .mg-sort-icon {
      font-size: 26px !important;
      font-family: 'Baloo 2', sans-serif !important;
      font-weight: 900 !important;
      margin-bottom: 8px !important;
      letter-spacing: 1px !important;
    }

    .mg-sort-label {
      font-size: 18px !important;
      font-weight: 900 !important;
      color: #1A0A40 !important;
    }

    .mg-sort-progress {
      font-family: 'Baloo 2', sans-serif !important;
      font-size: 14px !important;
      font-weight: 800 !important;
      color: rgba(255, 255, 255, .78) !important;
    }

    /* Sort buttons */
    .mg-sort-btn {
      padding: 14px 16px !important;
      border-radius: 18px !important;
      font-size: 17px !important;
      font-weight: 900 !important;
      border: 3px solid rgba(255, 255, 255, .6) !important;
      position: relative !important;
      overflow: hidden !important;
    }

    .mg-sort-btn::after {
      content: '' !important;
      position: absolute !important;
      top: 0;
      left: 0;
      right: 0;
      height: 44% !important;
      background: rgba(255, 255, 255, .18) !important;
      border-radius: 18px 18px 50% 50% !important;
      pointer-events: none !important;
    }

    .mg-sort-btn:hover {
      filter: brightness(1.08) !important;
    }

    .mg-sort-btn:active {
      transform: translateY(5px) scale(.97) !important;
    }

    .mg-sort-btn.need {
      background: linear-gradient(170deg, #7AEB8A 0%, #3E9E4E 100%) !important;
      color: #fff !important;
      box-shadow: 0 7px 0 #1E6A2E !important;
    }

    .mg-sort-btn.want {
      background: linear-gradient(170deg, #A07FFF 0%, #5E35D6 100%) !important;
      color: #fff !important;
      box-shadow: 0 7px 0 #3A1EA8 !important;
    }

    /* Budget Blitz arena */
    #mg-blitz-arena {
      background: linear-gradient(180deg, #120828 0%, #2A0E60 60%, #3A1A80 100%) !important;
    }

    .mg-blitz-zone.cheap {
      background: linear-gradient(90deg, rgba(255, 80, 80, .65), rgba(255, 80, 80, .4)) !important;
    }

    .mg-blitz-zone.sweet {
      background: linear-gradient(90deg, rgba(80, 220, 120, .45), rgba(80, 220, 120, .75), rgba(80, 220, 120, .45)) !important;
    }

    .mg-blitz-zone.expensive {
      background: linear-gradient(90deg, rgba(255, 80, 80, .4), rgba(255, 80, 80, .65)) !important;
    }

    #mg-blitz-needle {
      width: 7px !important;
      background: #fff !important;
      box-shadow: 0 0 14px rgba(255, 255, 255, 1), 0 0 4px rgba(255, 255, 255, .8) !important;
      border-radius: 4px !important;
      top: -6px !important;
      bottom: -6px !important;
    }

    .mg-blitz-zone.sweet .mg-blitz-label {
      color: #fff !important;
      font-size: 13px !important;
      font-weight: 800 !important;
      font-family: 'Baloo 2', sans-serif !important;
    }

    .mg-blitz-rounds {
      font-size: 14px !important;
      font-weight: 700 !important;
      color: rgba(255, 255, 255, .7) !important;
    }

    /* Blitz tap button */
    .mg-blitz-tap-btn {
      width: 120px !important;
      height: 120px !important;
      background: radial-gradient(circle at 30% 28%, #FFE84A, #FFBA00 50%, #E8960A 100%) !important;
      box-shadow: 0 8px 0 #8A5400, 0 0 32px rgba(255, 220, 50, .55) !important;
      border: 4px solid rgba(255, 255, 255, .72) !important;
      font-size: 22px !important;
      font-weight: 900 !important;
      color: #3A2200 !important;
      position: relative !important;
      overflow: hidden !important;
    }

    .mg-blitz-tap-btn::after {
      content: '' !important;
      position: absolute !important;
      top: 5px;
      left: 5px;
      right: 5px;
      height: 40% !important;
      background: rgba(255, 255, 255, .24) !important;
      border-radius: 50% !important;
      pointer-events: none !important;
    }

    .mg-blitz-tap-btn:active {
      transform: translateY(7px) !important;
      box-shadow: 0 1px 0 #8A5400 !important;
    }

    /* Stack & Save arena */
    #mg-stack-arena {
      background: linear-gradient(180deg, #09172e 0%, #0d2952 60%, #061e3d 100%) !important;
    }

    /* Hold button */
    .mg-hold-btn {
      width: 112px !important;
      height: 112px !important;
      background: radial-gradient(circle at 30% 28%, #7DD3FC, #0EA5E9 50%, #0284C7 100%) !important;
      box-shadow: 0 8px 0 #015682, 0 0 30px rgba(14, 165, 233, .55) !important;
      border: 4px solid rgba(255, 255, 255, .62) !important;
      font-size: 16px !important;
      font-weight: 900 !important;
      position: relative !important;
      overflow: hidden !important;
    }

    .mg-hold-btn::after {
      content: '' !important;
      position: absolute !important;
      top: 5px;
      left: 5px;
      right: 5px;
      height: 40% !important;
      background: rgba(255, 255, 255, .22) !important;
      border-radius: 50% !important;
      pointer-events: none !important;
    }

    .mg-hold-btn:active {
      transform: translateY(6px) !important;
      box-shadow: 0 2px 0 #015682 !important;
    }

    /* Skip button */
    .mg-skip-btn {
      background: rgba(255, 255, 255, .07) !important;
      border: 2px solid rgba(255, 255, 255, .22) !important;
      color: rgba(255, 255, 255, .65) !important;
      border-radius: 14px !important;
      padding: 10px !important;
      font-weight: 700 !important;
    }

    .mg-skip-btn:hover {
      background: rgba(255, 255, 255, .14) !important;
      border-color: rgba(255, 255, 255, .42) !important;
    }

    /* ── SPOTLIGHT TUTORIAL ── */
    #tut-blocker {
      position: fixed;
      inset: 0;
      z-index: 8900;
      pointer-events: all;
      background: transparent;
      display: none;
    }

    #tut-spotlight {
      position: fixed;
      z-index: 8901;
      pointer-events: none;
      display: none;
      border-radius: 20px;
      box-shadow: 0 0 0 9999px rgba(8, 11, 22, 0.88);
      transition: top .38s var(--ease-out), left .38s var(--ease-out),
        width .38s var(--ease-out), height .38s var(--ease-out),
        border-radius .38s var(--ease-out);
    }

    #tut-spotlight::after {
      content: '';
      position: absolute;
      inset: -5px;
      border-radius: inherit;
      border: 2.5px solid rgba(139, 123, 255, .8);
      animation: tutRing 1.9s ease-in-out infinite;
      pointer-events: none;
      box-sizing: border-box;
    }

    @keyframes tutRing {

      0%,
      100% {
        opacity: .45;
        transform: scale(1);
      }

      50% {
        opacity: 1;
        transform: scale(1.04);
      }
    }

    #tut-card {
      position: fixed;
      z-index: 8903;
      display: none;
      pointer-events: all;
      width: min(300px, calc(100vw - 28px));
      background: var(--surface-2);
      border: 1.5px solid rgba(56, 189, 248, .32);
      border-radius: 20px;
      padding: 18px 20px 16px;
      box-shadow: 0 20px 56px rgba(0, 0, 0, .7),
        0 0 0 1px rgba(56, 189, 248, .06),
        inset 0 1px 0 rgba(255, 255, 255, .06);
      transition: top .38s var(--ease-out), left .38s var(--ease-out);
    }

    #tut-card-step {
      font-size: 10.5px;
      font-weight: 700;
      letter-spacing: .09em;
      color: var(--violet);
      text-transform: uppercase;
      font-family: var(--body);
      margin-bottom: 5px;
    }

    #tut-card-title {
      font-family: var(--display);
      font-size: 17px;
      font-weight: 800;
      color: var(--ink);
      margin-bottom: 7px;
      line-height: 1.2;
    }

    #tut-card-body {
      font-family: var(--body);
      font-size: 13.5px;
      color: var(--ink-muted);
      line-height: 1.5;
      margin-bottom: 14px;
    }

    .tut-btns {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    #tut-skip {
      background: none;
      border: 1.5px solid var(--border-strong);
      color: var(--ink-subtle);
      font-family: var(--body);
      font-size: 13px;
      font-weight: 600;
      padding: 9px 14px;
      border-radius: 12px;
      cursor: pointer;
      transition: border-color .15s, color .15s;
      flex-shrink: 0;
    }

    #tut-skip:hover {
      border-color: var(--violet);
      color: var(--ink);
    }

    #tut-next {
      background: linear-gradient(135deg, var(--violet), var(--violet-d));
      border: none;
      color: #fff;
      font-family: var(--display);
      font-size: 14px;
      font-weight: 800;
      padding: 9px 18px;
      border-radius: 12px;
      cursor: pointer;
      flex: 1;
      box-shadow: 0 4px 18px rgba(56, 189, 248, .42);
      transition: transform .12s, box-shadow .12s;
    }

    #tut-next:active {
      transform: scale(.96);
      box-shadow: 0 2px 8px rgba(56, 189, 248, .3);
    }

    .tut-dots {
      display: flex;
      gap: 6px;
      justify-content: center;
      margin-top: 12px;
    }

    .tut-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--border-strong);
      transition: background .2s, transform .2s, width .2s;
    }

    .tut-dot.active {
      background: var(--violet);
      transform: scale(1.3);
      width: 18px;
      border-radius: 3px;
    }

    #tut-arrow {
      position: fixed;
      z-index: 8902;
      width: 40px;
      height: 44px;
      display: none;
      pointer-events: none;
      transition: top .38s var(--ease-out), left .38s var(--ease-out);
    }

    #tut-arrow.bounce-down {
      animation: tutBounceD .85s ease-in-out infinite;
    }

    #tut-arrow.bounce-up {
      animation: tutBounceU .85s ease-in-out infinite;
    }

    @keyframes tutBounceD {

      0%,
      100% {
        transform: translateY(0);
      }

      50% {
        transform: translateY(8px);
      }
    }

    @keyframes tutBounceU {

      0%,
      100% {
        transform: translateY(0);
      }

      50% {
        transform: translateY(-8px);
      }
    }

    @media (prefers-reduced-motion: reduce) {
      #tut-spotlight {
        transition: none;
      }

      #tut-card {
        transition: none;
      }

      #tut-spotlight::after {
        animation: none;
      }

      #tut-arrow {
        animation: none !important;
      }
    }
    #airport-booking-screen {
      background: #080B16;
      color: #EEF1FB;
      font-family: 'Fredoka', system-ui, sans-serif;
      display: none;
      height: 100vh;
      width: 100%;
      flex-direction: column;
      position: relative;
    }
    #airport-booking-screen.active { display: flex; }
    .booking-header {
      background: #161C34;
      padding: 14px 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1.5px solid rgba(160, 176, 230, .14);
      z-index: 1001;
    }
    .booking-body { display: flex; flex: 1; height: calc(100vh - 70px); overflow: hidden; }
    .booking-map-pane { flex: 1; position: relative; background: #eaf0f8; }
    .booking-sidebar {
      width: 390px; background: #0e1326;
      border-left: 1.5px solid rgba(160, 176, 230, .14);
      display: flex; flex-direction: column;
      padding: 20px; overflow-y: auto; box-sizing: border-box; z-index: 1001;
    }
    .booking-back-btn {
      background: rgba(239,68,68,.12); border: 1.5px solid rgba(239,68,68,.35);
      color: #fca5a5; border-radius: 12px; padding: 8px 16px;
      font-size: 13.5px; font-weight: 700; cursor: pointer;
      font-family: 'Baloo 2', sans-serif; transition: all 0.15s ease;
    }
    .booking-back-btn:hover { background: rgba(239,68,68,.24); transform: scale(1.03); }
    .map-checkbox-overlay {
      position: absolute; top: 15px; left: 15px; z-index: 1000;
      background: rgba(14,19,38,0.94); border: 1.5px solid rgba(160,176,230,0.2);
      border-radius: 12px; padding: 12px; box-shadow: 0 4px 22px rgba(0,0,0,0.45);
      display: flex; flex-direction: column; gap: 10px;
    }
    .map-checkbox-item {
      display: flex; align-items: center; gap: 10px; font-size: 12px;
      color: #EEF1FB; cursor: pointer; user-select: none; font-weight: 600;
    }
    .map-checkbox-item input { accent-color: #38E1F0; width: 15px; height: 15px; cursor: pointer; }
    .route-airline-card {
      background: #161C34; border: 1px solid rgba(160,176,230,.14);
      border-radius: 12px; padding: 14px; margin-bottom: 14px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    .airline-name-header {
      font-family: 'Baloo 2', sans-serif; font-size: 15px; font-weight: 800; color: #38E1F0;
      margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between;
      border-bottom: 1px solid rgba(160,176,230,0.1); padding-bottom: 6px;
    }
    .cabin-price-row {
      display: flex; align-items: center; justify-content: space-between;
      padding: 7px 0; border-bottom: 1px dashed rgba(160,176,230,.08);
    }
    .cabin-price-row:last-child { border-bottom: none; }
    .cabin-name { font-size: 11.5px; color: #EEF1FB; font-weight: 600; }
    .cabin-cost { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 12.5px; color: #FFC83D; }
    .cabin-book-btn {
      background: linear-gradient(135deg, #10b981, #059669); border: none; color: #fff;
      font-weight: 800; font-size: 10.5px; border-radius: 6px; padding: 5px 12px;
      cursor: pointer; text-transform: uppercase; transition: all 0.15s ease;
      box-shadow: 0 2px 6px rgba(16,185,129,0.2);
    }
    .cabin-book-btn:hover { background: linear-gradient(135deg, #059669, #047857); transform: scale(1.05); }
    .cabin-book-btn:disabled { background: #28315A !important; color: #8E98BE !important; cursor: not-allowed; transform: none; box-shadow: none; }
    #skip-flight-btn {
      position: absolute; bottom: 28px; right: 22px; z-index: 60;
      background: rgba(255,255,255,0.18); border: 1.5px solid rgba(255,255,255,0.35);
      color: #fff; font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 15px;
      padding: 10px 22px; border-radius: 24px; cursor: pointer; display: none;
      backdrop-filter: blur(6px); box-shadow: 0 4px 16px rgba(0,0,0,0.25);
      transition: all 0.15s ease;
    }
    #skip-flight-btn:hover { background: rgba(15,23,42,0.9); }
    #skip-flight-btn:active { transform: scale(0.95); }
