/* ==========================================================
   MARKETOPIA 2.0 RE — interface
   High-octane chunky mobile-game styling: vibrant fills,
   gloss highlights, extruded 3D shadows, tactile spring physics.
   ========================================================== */

:root{
  --ink:        #1f182d;
  --ink-soft:   #342a4a;
  --paper:      #ffffff;
  --cream:      #fff8ec;

  --orange:     #ff9a3d;
  --orange-dp:  #d87320;
  --yellow:     #ffcd38;
  --yellow-dp:  #e09c12;
  --red:        #ff5252;
  --red-dp:     #d42d2d;
  --green:      #4cd964;
  --green-dp:   #2ea643;
  --teal:       #30d6d6;
  --teal-dp:    #16a8a8;
  --blue:       #4d7cff;
  --blue-dp:    #2d5be3;
  --purple:     #7f3bee;
  --purple-dp:  #5c1dbd;
  --pink:       #ff6ea7;
  --pink-dp:    #de3f80;
  --grass:      #52cf9c;
  --grass-dp:   #349f75;

  /* Marketopia 2.0 RE Glass & Glow Tokens */
  --glow-gold:   0 0 24px rgba(255, 205, 56, 0.45);
  --glow-purple: 0 0 24px rgba(127, 59, 238, 0.45);
  --glow-cyan:   0 0 24px rgba(48, 214, 214, 0.45);
  --glass-bg:    rgba(255, 255, 255, 0.94);
  --glass-card:  rgba(255, 255, 255, 0.97);

  --f-display: 'Fredoka', 'Baloo 2', system-ui, sans-serif;
  --f-ui:      'Nunito', system-ui, sans-serif;

  --e-back: cubic-bezier(.34,1.6,.5,1);
  --e-out:  cubic-bezier(.16,.84,.34,1);
}

*{ margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

html,body{
  height:100%;
  height:-webkit-fill-available;   /* iOS: the real drawable height */
  width:100%;
  overflow:hidden;
  position:fixed;                   /* stops the rubber-band scroll on iOS */
  inset:0;
  background:#140e26;
  font-family:var(--f-ui);
  color:var(--ink);
  user-select:none; -webkit-user-select:none;
  -webkit-text-size-adjust:100%;
  overscroll-behavior:none;
  touch-action:none;                /* no pan, no pinch, no double-tap zoom */
  -webkit-touch-callout:none;
}

#gl{ position:absolute; display:block; image-rendering:auto; }

#ui{
  position:absolute;
  width:720px; height:1280px;
  pointer-events:none;
  z-index:5;
}
#ui *{ pointer-events:auto; }
#ui > *{ pointer-events:none; }

/* ============ the chunky button 2.0 ============ */
.btn{
  position:relative;
  touch-action:manipulation;
  min-height:72px;
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  padding:18px 34px;
  border:5px solid var(--ink);
  border-radius:24px;
  background:var(--yellow);
  background-image:linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,0) 60%);
  box-shadow:inset 0 3px 0 rgba(255,255,255,.55), 0 8px 0 var(--yellow-dp), 0 16px 24px rgba(31,24,45,.28);
  font-family:var(--f-display); font-weight:700; font-size:30px;
  color:var(--ink);
  cursor:pointer;
  transition:transform .09s var(--e-out), box-shadow .09s var(--e-out), filter .15s;
  white-space:nowrap;
}
.btn .bi{ font-style:normal; font-size:.95em; line-height:1; }
.btn:active{ transform:translateY(7px); box-shadow:inset 0 1px 0 rgba(255,255,255,.35), 0 1px 0 var(--yellow-dp), 0 4px 10px rgba(31,24,45,.3); }
.btn:disabled{ filter:grayscale(.6) opacity(.55); cursor:default; }
.btn:disabled:active{ transform:none; }

.btn.green {
  background:var(--green);
  background-image:linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,0) 60%);
  box-shadow:inset 0 3px 0 rgba(255,255,255,.55), 0 8px 0 var(--green-dp), 0 16px 24px rgba(31,24,45,.28);
}
.btn.green:active { box-shadow:inset 0 1px 0 rgba(255,255,255,.35), 0 1px 0 var(--green-dp); }

.btn.red {
  background:var(--red);
  background-image:linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,0) 60%);
  box-shadow:inset 0 3px 0 rgba(255,255,255,.45), 0 8px 0 var(--red-dp), 0 16px 24px rgba(31,24,45,.28);
  color:#fff;
}
.btn.red:active { box-shadow:inset 0 1px 0 rgba(255,255,255,.3), 0 1px 0 var(--red-dp); }

.btn.blue {
  background:var(--blue);
  background-image:linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,0) 60%);
  box-shadow:inset 0 3px 0 rgba(255,255,255,.45), 0 8px 0 var(--blue-dp), 0 16px 24px rgba(31,24,45,.28);
  color:#fff;
}
.btn.blue:active { box-shadow:inset 0 1px 0 rgba(255,255,255,.3), 0 1px 0 var(--blue-dp); }

.btn.purple {
  background:var(--purple);
  background-image:linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,0) 60%);
  box-shadow:inset 0 3px 0 rgba(255,255,255,.45), 0 8px 0 var(--purple-dp), 0 16px 24px rgba(31,24,45,.28);
  color:#fff;
}
.btn.purple:active { box-shadow:inset 0 1px 0 rgba(255,255,255,.3), 0 1px 0 var(--purple-dp); }

.btn.teal {
  background:var(--teal);
  background-image:linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,0) 60%);
  box-shadow:inset 0 3px 0 rgba(255,255,255,.55), 0 8px 0 var(--teal-dp), 0 16px 24px rgba(31,24,45,.28);
}
.btn.teal:active { box-shadow:inset 0 1px 0 rgba(255,255,255,.35), 0 1px 0 var(--teal-dp); }

.btn.white {
  background:#fff;
  background-image:linear-gradient(180deg, rgba(255,255,255,.9) 0%, rgba(240,238,248,0) 60%);
  box-shadow:inset 0 3px 0 #fff, 0 8px 0 #cfc9dd, 0 16px 24px rgba(31,24,45,.24);
}
.btn.white:active { box-shadow:inset 0 1px 0 #fff, 0 1px 0 #cfc9dd; }

.btn.ghost {
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  box-shadow:inset 0 2px 0 rgba(255,255,255,.8), 0 6px 0 rgba(31,24,45,.2);
  font-size:24px; padding:14px 26px;
}

.btn.lg{ font-size:38px; padding:22px 52px; border-radius:30px; }
.btn.sm{ font-size:22px; padding:12px 22px; min-height:56px; border-radius:18px; border-width:4px; box-shadow:inset 0 2px 0 rgba(255,255,255,.4), 0 5px 0 var(--yellow-dp); }
.btn.wide{ width:100%; }

.btn.icon{
  width:88px; height:88px; min-height:0; padding:0; border-radius:24px;
  font-size:30px; background:#fff;
  background-image:linear-gradient(180deg, rgba(255,255,255,.9) 0%, rgba(240,238,248,0) 60%);
  box-shadow:inset 0 2px 0 #fff, 0 6px 0 #cfc9dd;
}
.btn.icon:active{ box-shadow:inset 0 1px 0 #fff, 0 1px 0 #cfc9dd; }

/* ============ HUD ============ */
.hud{
  position:absolute;
  /* every HUD pill, card and button inside sits within the notch-safe area */
  inset:var(--safe-t,0px) var(--safe-r,0px) var(--safe-b,0px) var(--safe-l,0px);
}

.hud-pill{
  position:absolute;
  display:flex; align-items:center; gap:12px;
  padding:12px 22px;
  background:var(--glass-bg);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border:5px solid var(--ink); border-radius:100px;
  box-shadow:inset 0 2px 0 rgba(255,255,255,.8), 0 7px 0 rgba(31,24,45,.22);
  font-family:var(--f-display); font-weight:700;
}
.hud-pill .lbl{
  font-family:var(--f-ui); font-weight:800; font-size:17px;
  letter-spacing:.06em; text-transform:uppercase; color:#8a819c;
}
.hud-pill b{ font-size:32px; line-height:1; }
.hud-pill .unit{ font-size:19px; color:#8a819c; }

/* Experimental Version Tab Badge */
.hud-tab-badge {
  position:absolute;
  top:24px; left:50%; transform:translateX(-50%);
  display:flex; align-items:center; gap:8px;
  padding:10px 18px;
  background:#ffffff;
  background-image:linear-gradient(180deg, #ffffff 0%, #fff9ec 100%);
  border:4.5px solid var(--ink);
  border-radius:100px;
  box-shadow:inset 0 2px 0 rgba(255,255,255,.95), 0 6px 0 rgba(31,24,45,.22), 0 12px 20px rgba(31,24,45,.14);
  z-index:10;
  cursor:pointer;
  user-select:none;
  transition:transform .12s var(--e-out), box-shadow .12s var(--e-out);
}
.hud-tab-badge:hover {
  transform:translateX(-50%) translateY(-2px);
  box-shadow:inset 0 2px 0 rgba(255,255,255,.95), 0 8px 0 rgba(31,24,45,.24), 0 14px 24px rgba(31,24,45,.18);
}
.hud-tab-badge:active {
  transform:translateX(-50%) translateY(4px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8), 0 2px 0 rgba(31,24,45,.22);
}
.hud-tab-badge .badge-dot {
  width:9px; height:9px; border-radius:50%;
  background:#ff5277;
  box-shadow:0 0 8px #ff5277;
  animation:badgeDotGlow 1.8s ease-in-out infinite;
}
@keyframes badgeDotGlow {
  0%, 100% { transform:scale(1); opacity:.85; box-shadow:0 0 6px rgba(255,82,119,.6); }
  50%      { transform:scale(1.35); opacity:1; box-shadow:0 0 12px rgba(255,82,119,1); }
}
.hud-tab-badge .badge-icon {
  font-size:14px; line-height:1;
}
.hud-tab-badge .badge-text {
  font-family:var(--f-display);
  font-weight:700;
  font-size:16px;
  letter-spacing:.03em;
  color:var(--ink);
  white-space:nowrap;
}
.hud-tab-badge .badge-tag {
  display:inline-block;
  font-family:var(--f-ui);
  font-weight:900;
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#1f182d;
  background:linear-gradient(135deg, #ffcd38 0%, #ff7a5c 100%);
  padding:3px 8px;
  border-radius:8px;
  line-height:1.1;
  box-shadow:0 2px 4px rgba(255,122,92,.3);
}

.hud-card{
  position:absolute;
  padding:16px 20px;
  background:var(--glass-card);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border:5px solid var(--ink); border-radius:26px;
  box-shadow:inset 0 2px 0 rgba(255,255,255,.8), 0 8px 0 rgba(31,24,45,.2);
}
.hud-card .lbl{
  display:block; font-weight:900; font-size:16px; letter-spacing:.08em;
  text-transform:uppercase; color:#8a819c; margin-bottom:4px;
}
.hud-card b{ font-family:var(--f-display); font-size:34px; line-height:1; }

/* meter */
.meter{ width:100%; height:20px; border:4px solid var(--ink); border-radius:100px; background:#eceaf3; overflow:hidden; }
.meter > i{ display:block; height:100%; background:var(--green); border-radius:100px; transition:width .18s linear, background .3s; }
.meter.warn > i{ background:var(--yellow); }
.meter.crit > i{ background:var(--red); }

/* ============ toasts ============ */
.toasts{
  position:absolute;
  left:var(--safe-l,0px); right:var(--safe-r,0px);
  top:calc(330px + var(--safe-t,0px));
  display:flex; flex-direction:column; align-items:center; gap:10px;
}
.toast{
  padding:14px 28px;
  background:#fff; border:5px solid var(--ink); border-radius:100px;
  box-shadow:0 7px 0 rgba(43,36,56,.22);
  font-family:var(--f-display); font-weight:700; font-size:26px;
  animation:toastIn .3s var(--e-back) both;
  max-width:640px; text-align:center;
}
.toast.good{ background:var(--green); }
.toast.bad { background:var(--red); color:#fff; }
.toast.info{ background:var(--teal); }
.toast.out { animation:toastOut .3s var(--e-out) both; }
@keyframes toastIn { from{ opacity:0; transform:translateY(-22px) scale(.9);} }
@keyframes toastOut{ to  { opacity:0; transform:translateY(-16px) scale(.95);} }

/* ============ floating score pops ============ */
.pop{
  position:absolute; transform:translate(-50%,-50%);
  font-family:var(--f-display); font-weight:700; font-size:40px;
  color:#fff; -webkit-text-stroke:6px var(--ink); paint-order:stroke fill;
  animation:popUp .95s var(--e-out) both;
}
.pop.good{ color:var(--green); }
.pop.bad { color:var(--red); }
.pop.cash{ color:var(--yellow); }
@keyframes popUp{ 0%{opacity:0; transform:translate(-50%,-30%) scale(.5);} 25%{opacity:1; transform:translate(-50%,-60%) scale(1.1);} 100%{opacity:0; transform:translate(-50%,-160%) scale(1);} }

/* ============ bottom sheet ============ */
.sheet-wrap{
  position:absolute;
  inset:var(--safe-t,0px) var(--safe-r,0px) 0 var(--safe-l,0px);
  display:flex; align-items:flex-end;
}
.sheet-wrap.dim{ background:rgba(18,12,32,.65); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); }
.sheet{
  width:100%;
  padding:32px 32px calc(38px + var(--safe-b,0px));
  max-height:84%;
  overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
  background:var(--glass-card);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border:6px solid var(--ink);
  border-radius:40px 40px 0 0;
  box-shadow:inset 0 2px 0 rgba(255,255,255,.9), 0 -10px 0 rgba(31,24,45,.18);
  animation:sheetUp .38s var(--e-back) both;
}
@keyframes sheetUp{ from{ transform:translateY(105%); } }
.sh-kicker{
  display:inline-block; padding:7px 18px; border-radius:100px;
  background:var(--yellow);
  background-image:linear-gradient(180deg, rgba(255,255,255,.4) 0%, rgba(255,255,255,0) 60%);
  border:4px solid var(--ink);
  box-shadow:inset 0 2px 0 rgba(255,255,255,.6), 0 4px 0 var(--yellow-dp);
  font-weight:900; font-size:17px; letter-spacing:.08em; text-transform:uppercase;
  margin-bottom:12px;
}
.sh-title{ font-family:var(--f-display); font-weight:700; font-size:44px; line-height:1.08; margin-bottom:10px; }
.sh-body{ font-size:23px; line-height:1.5; color:#5a5270; }
.sh-body b{ color:var(--ink); }
.sh-actions{ display:flex; gap:14px; margin-top:24px; flex-wrap:wrap; }
.sh-actions .btn{ flex:1; min-width:0; }

/* ============ modal ============ */
.modal-wrap{
  position:absolute; inset:0;
  display:grid; justify-items:center; align-items:start; align-content:safe center;
  padding:calc(26px + var(--safe-t,0px)) calc(26px + var(--safe-r,0px))
          calc(26px + var(--safe-b,0px)) calc(26px + var(--safe-l,0px));
  overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
  background:rgba(18,12,32,.65);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  animation:fade .3s var(--e-out) both;
}
@keyframes fade{ from{opacity:0;} }
.modal{
  width:100%; max-width:660px;
  padding:34px 32px 32px;
  max-height:100%;
  background:var(--glass-card);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border:6px solid var(--ink);
  border-radius:40px;
  box-shadow:inset 0 3px 0 rgba(255,255,255,.9), 0 14px 0 rgba(31,24,45,.25), 0 28px 45px rgba(18,12,32,.35);
  animation:modalIn .42s var(--e-back) both;
}
@keyframes modalIn{ from{ opacity:0; transform:translateY(40px) scale(.92);} }
.m-kicker{
  display:inline-block; padding:7px 18px; border-radius:100px;
  background:var(--yellow);
  background-image:linear-gradient(180deg, rgba(255,255,255,.4) 0%, rgba(255,255,255,0) 60%);
  border:4px solid var(--ink);
  box-shadow:inset 0 2px 0 rgba(255,255,255,.6), 0 4px 0 var(--yellow-dp);
  font-weight:900; font-size:18px; letter-spacing:.08em; text-transform:uppercase;
}
.m-kicker.good{ background:var(--green); box-shadow:inset 0 2px 0 rgba(255,255,255,.6), 0 4px 0 var(--green-dp); }
.m-kicker.bad { background:var(--red); box-shadow:inset 0 2px 0 rgba(255,255,255,.4), 0 4px 0 var(--red-dp); color:#fff; }
.m-title{ font-family:var(--f-display); font-weight:700; font-size:50px; line-height:1.05; margin:14px 0 6px; }
.m-sub{ font-size:23px; line-height:1.5; color:#5a5270; margin-bottom:18px; }
.m-actions{ display:flex; gap:14px; margin-top:26px; flex-wrap:wrap; }
.m-actions .btn{ flex:1; min-width:0; }

/* stat row */
.stat-row{ display:flex; gap:12px; margin:18px 0; flex-wrap:wrap; }
.stat{
  flex:1; min-width:120px; padding:18px 14px; text-align:center;
  background:var(--cream);
  background-image:linear-gradient(180deg, rgba(255,255,255,.6) 0%, rgba(255,248,236,.3) 100%);
  border:5px solid var(--ink); border-radius:24px;
  box-shadow:inset 0 2px 0 rgba(255,255,255,.8), 0 6px 0 rgba(31,24,45,.14);
}
.stat b{ display:block; font-family:var(--f-display); font-size:38px; line-height:1; }
.stat span{ display:block; margin-top:5px; font-weight:800; font-size:16px; letter-spacing:.05em; text-transform:uppercase; color:#8a819c; }
.stat.good{ background:#dcf7e4; background-image:linear-gradient(180deg, rgba(255,255,255,.7) 0%, rgba(220,247,228,.4) 100%); }
.stat.bad { background:#ffe1e1; background-image:linear-gradient(180deg, rgba(255,255,255,.7) 0%, rgba(255,225,225,.4) 100%); }
.stat.warn{ background:#fff2d3; background-image:linear-gradient(180deg, rgba(255,255,255,.7) 0%, rgba(255,242,211,.4) 100%); }

/* debrief lines */
.lines{ display:flex; flex-direction:column; gap:12px; margin:6px 0 4px; }
.line{
  display:grid; grid-template-columns:46px 1fr; gap:12px; align-items:start;
  padding:14px 16px; border-radius:20px;
  background:#f6f4fb; border:4px solid rgba(43,36,56,.14);
}
.line i{ font-style:normal; font-size:28px; line-height:1.1; text-align:center; }
.line p{ font-size:20px; line-height:1.5; color:#4a4260; }
.line p b{ color:var(--ink); }
.line.good{ background:#e6f9ec; border-color:rgba(63,174,63,.35); }
.line.bad { background:#ffeaea; border-color:rgba(214,61,61,.32); }
.line.warn{ background:#fff5dc; border-color:rgba(229,169,31,.4); }

.takeaway{
  margin-top:18px; padding:20px 22px; border-radius:24px;
  background:var(--cream); border:5px solid var(--ink);
}
.tk-label{ font-weight:900; font-size:17px; letter-spacing:.1em; text-transform:uppercase; color:var(--orange-dp); margin-bottom:8px; }
.takeaway p{ font-size:21px; line-height:1.55; }

/* quiz */
.quiz{ margin-top:20px; padding:20px; border-radius:24px; background:#f4f1fb; border:5px solid var(--ink); }
.q-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.q-head span{ font-weight:900; font-size:17px; letter-spacing:.1em; text-transform:uppercase; color:#8a819c; }
.q-head b{ font-family:var(--f-display); font-size:24px; }
.q-head b.final{ color:var(--green-dp); }
.q + .q{ margin-top:20px; padding-top:20px; border-top:4px dashed rgba(43,36,56,.16); }
.q-text{ font-size:21px; line-height:1.45; font-weight:700; margin-bottom:12px; }
.q-opts{ display:flex; flex-direction:column; gap:9px; }
.q-opt{
  min-height:64px; padding:14px 18px; text-align:left; touch-action:manipulation;
  background:#fff; border:4px solid var(--ink); border-radius:18px;
  box-shadow:0 5px 0 rgba(43,36,56,.16);
  font-family:var(--f-ui); font-weight:700; font-size:19px; color:var(--ink);
  cursor:pointer; transition:transform .08s;
}
.q-opt:active{ transform:translateY(4px); box-shadow:0 1px 0 rgba(43,36,56,.16); }
.q-opt.right{ background:var(--green); }
.q-opt.wrong{ background:var(--red); color:#fff; }
.q-opt:disabled{ cursor:default; }
.q-why{ margin-top:12px; padding:14px 16px; border-radius:16px; background:#e6f9ec; border:4px solid rgba(63,174,63,.4); font-size:19px; line-height:1.5; }
.q-why.bad{ background:#ffeaea; border-color:rgba(214,61,61,.4); }
.q-why b{ font-weight:900; }

/* ============ controls row ============ */
.ctl-row{
  position:absolute; display:flex; gap:12px;
  right:calc(26px + var(--safe-r,0px));
  bottom:calc(26px + var(--safe-b,0px));
}
.ctl-row.above-left {
  right:auto; left:calc(26px + var(--safe-l,0px));
  bottom:calc(170px + var(--safe-b,0px));
}
.ctl-row.top-left {
  right:auto; left:calc(26px + var(--safe-l,0px));
  top:calc(26px + var(--safe-t,0px)); bottom:auto;
}

/* ==========================================================
   MARKETOPIA 2.0 RE — PRE-BOOT SPLASH SEQUENCE
   Phase 1: White Apple Screen (Powered by Apple SwiftUI)
   Phase 2: DCNX Studio Screen
   ========================================================== */
#splash-sequence{
  position:fixed; inset:0; z-index:100;
  background:#ffffff;
  overflow:hidden;
  user-select:none; -webkit-user-select:none;
  cursor:pointer;
  transition:opacity .5s var(--e-out);
}
#splash-sequence.gone{ opacity:0; pointer-events:none; }

.splash-screen{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  opacity:0; pointer-events:none;
  transition:opacity .45s cubic-bezier(.16,.84,.34,1), transform .45s cubic-bezier(.16,.84,.34,1);
  transform:scale(.96);
}
.splash-screen.active{
  opacity:1; pointer-events:auto;
  transform:scale(1);
}
.splash-screen.fading{
  opacity:0; transform:scale(1.03);
  transition:opacity .45s ease-out, transform .45s ease-out;
}

/* Screen 1: Pure White Apple SwiftUI Screen */
#splash-apple{
  background:#ffffff;
}
.splash-apple-content{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:18px; padding:24px;
  animation:appleIn .8s cubic-bezier(.16,.84,.34,1) both;
}
@keyframes appleIn{
  from{ opacity:0; transform:translateY(18px) scale(.94); }
  to  { opacity:1; transform:translateY(0) scale(1); }
}
.splash-apple-logo-wrap{
  position:relative;
  display:inline-flex; align-items:center; justify-content:center;
  animation:appleFloat 3s ease-in-out infinite alternate;
}
@keyframes appleFloat{
  0%  { transform:translateY(0) scale(1); }
  100%{ transform:translateY(-5px) scale(1.02); }
}
.splash-apple-logo{
  width:min(180px, 42vw);
  height:auto;
  max-height:120px;
  object-fit:contain;
  filter:drop-shadow(0 6px 18px rgba(0,0,0,.08));
}
.splash-apple-text{
  font-family:-apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  font-weight:600;
  font-size:clamp(21px, 4.4vw, 28px);
  letter-spacing:-0.02em;
  color:#1d1d1f;
  text-align:center;
}

/* Native Apple SwiftUI Loading Indicator */
.swiftui-loader{
  display:flex; flex-direction:column; align-items:center;
  gap:14px; margin-top:14px;
  animation:swiftuiFadeIn .8s .35s cubic-bezier(.16,.84,.34,1) both;
}
@keyframes swiftuiFadeIn{
  from{ opacity:0; transform:translateY(8px); }
  to  { opacity:1; transform:translateY(0); }
}

/* Authentic 12-blade iOS Activity Indicator */
.ios-spinner{
  position:relative;
  width:32px; height:32px;
  display:inline-block;
}
.ios-spinner i{
  position:absolute;
  left:14px; top:2px;
  width:3.5px; height:8px;
  background:#1d1d1f;
  border-radius:3px;
  transform-origin:1.75px 14px;
  transform:rotate(calc(var(--i) * 30deg));
  opacity:calc(0.14 + (var(--i) / 12) * 0.86);
  animation:iosSpin 1s steps(12, end) infinite;
  animation-delay:calc(var(--i) * (1s / 12) - 1s);
}
@keyframes iosSpin{
  0%  { opacity:1; }
  100%{ opacity:0.14; }
}

/* SwiftUI progress track */
.swiftui-track{
  width:min(210px, 52vw); height:5px;
  background:#e5e5ea;
  border-radius:100px;
  overflow:hidden;
  position:relative;
  box-shadow:inset 0 1px 2px rgba(0,0,0,.08);
}
.swiftui-fill{
  position:absolute; inset:0;
  width:0%;
  border-radius:100px;
  background:linear-gradient(90deg, #1d1d1f 0%, #3a3a3c 100%);
  animation:swiftuiProgress 2.4s cubic-bezier(.22, 1, .36, 1) forwards;
}
@keyframes swiftuiProgress{
  0%  { width:0%; }
  35% { width:46%; }
  70% { width:84%; }
  100%{ width:100%; }
}

.swiftui-status{
  font-family:-apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size:12px; font-weight:600;
  color:#86868b;
  letter-spacing:.03em;
  text-transform:uppercase;
}
.swiftui-dots{
  display:inline-block;
  animation:dots 1.4s steps(4,end) infinite;
}

/* Screen 2: Cinema Dolby Atmos Screen */
#splash-dolby{
  background:#08080c;
  background-image:radial-gradient(circle at 50% 50%, rgba(30,35,55,.6) 0%, #060609 80%);
}
.splash-dolby-content{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; gap:20px; padding:26px;
  animation:dolbyIn .85s cubic-bezier(.16,.84,.34,1) both;
}
@keyframes dolbyIn{
  from{ opacity:0; transform:translateY(16px) scale(.94); }
  to  { opacity:1; transform:translateY(0) scale(1); }
}
.splash-dolby-kicker{
  font-family:var(--f-ui);
  font-weight:900;
  font-size:clamp(13px, 2.4vw, 16px);
  letter-spacing:0.32em;
  color:#8e8e9c;
  text-transform:uppercase;
}
.splash-dolby-logo-wrap{
  position:relative;
  display:flex; align-items:center; justify-content:center;
  padding:12px;
}
.splash-dolby-logo{
  width:min(340px, 78vw);
  height:auto;
  max-height:120px;
  object-fit:contain;
  filter:invert(1) drop-shadow(0 0 24px rgba(255,255,255,.3));
  animation:dolbyGlow 3s ease-in-out infinite alternate;
}
@keyframes dolbyGlow{
  0%  { filter:invert(1) drop-shadow(0 0 16px rgba(255,255,255,.2)); }
  100%{ filter:invert(1) drop-shadow(0 0 32px rgba(100,160,255,.6)); }
}

/* Spatial Equalizer Waves */
.dolby-spatial-waves{
  display:flex; align-items:center; justify-content:center;
  gap:8px; height:54px; margin-top:6px;
}
.dolby-spatial-waves i{
  display:block;
  width:5px;
  height:var(--h, 24px);
  border-radius:100px;
  background:linear-gradient(180deg, #60a5fa 0%, #a78bfa 50%, #f472b6 100%);
  box-shadow:0 0 12px rgba(96,165,250,.6);
  animation:dolbyEq 1.2s ease-in-out infinite alternate;
  animation-delay:var(--d, 0s);
}
@keyframes dolbyEq{
  0%  { transform:scaleY(0.35); opacity:0.6; }
  100%{ transform:scaleY(1.15); opacity:1; }
}

.dolby-tagline{
  font-family:var(--f-ui);
  font-weight:700;
  font-size:clamp(14px, 2.4vw, 17px);
  color:#94a3b8;
  letter-spacing:0.18em;
  text-transform:uppercase;
}

/* Screen 3: Cinematic DCNX Studio Screen */
#splash-dcnx {
  background: radial-gradient(circle at 50% 48%, #140b28 0%, #080312 60%, #030107 100%);
  overflow: hidden;
  perspective: 1200px;
}
.dcnx-stage {
  position: relative;
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
}
.dcnx-spotlight {
  position: absolute;
  top: 42%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 120vw); height: min(720px, 120vw);
  background: radial-gradient(circle, rgba(168, 85, 247, 0.16) 0%, rgba(123, 63, 228, 0.06) 45%, transparent 72%);
  pointer-events: none;
  animation: dcnxSpotlightPulse 3.5s ease-in-out infinite alternate;
}
@keyframes dcnxSpotlightPulse {
  0%   { transform: translate(-50%, -50%) scale(0.92); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

.dcnx-ambient-glow {
  position: absolute;
  top: 38%; left: 50%;
  transform: translate(-50%, -50%);
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.28) 0%, transparent 70%);
  filter: blur(28px);
  pointer-events: none;
}

/* Center Brand Logo Frame with 3D perspective */
.dcnx-frame {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}

/* Screen shake on X impact */
.dcnx-frame.impact-shake {
  animation: dcnxCamShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes dcnxCamShake {
  0%   { transform: translate3d(0, 0, 0); }
  18%  { transform: translate3d(-7px, 4px, 10px) rotate(-0.7deg); }
  36%  { transform: translate3d(6px, -5px, -8px) rotate(0.6deg); }
  54%  { transform: translate3d(-4px, 3px, 6px) rotate(-0.3deg); }
  72%  { transform: translate3d(3px, -2px, -3px) rotate(0.2deg); }
  88%  { transform: translate3d(-1px, 1px, 2px); }
  100% { transform: translate3d(0, 0, 0); }
}

/* Square Logo Box containing Base + Flying X */
.dcnx-canvas-wrap {
  position: relative;
  width: min(440px, 86vw);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  transform-style: preserve-3d;
}

/* Base Artwork: Rabbit Emblem + "DCN" + Tagline */
.dcnx-base-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transform: scale(0.92);
  filter: drop-shadow(0 6px 30px rgba(147, 51, 234, 0.25));
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease;
}
#splash-dcnx.active .dcnx-base-art {
  opacity: 1;
  transform: scale(1);
}
#splash-dcnx.active .dcnx-frame.docked .dcnx-base-art {
  filter: drop-shadow(0 8px 36px rgba(168, 85, 247, 0.45));
}

/* The Flying 'X' Element */
.dcnx-flying-x {
  position: absolute;
  top: 60.35%;
  left: 67.68%;
  width: 23.73%;
  height: 16.89%;
  transform-origin: 50% 50%;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transform-style: preserve-3d;
}

.dcnx-x-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 16px rgba(192, 132, 252, 0.9));
}

/* Flying Animation Triggered by .flying class */
.dcnx-flying-x.flying {
  animation: dcnxFlyAndSlam 0.82s cubic-bezier(0.12, 0.85, 0.22, 1) forwards;
}

@keyframes dcnxFlyAndSlam {
  0% {
    opacity: 0;
    /* Zooming in from the top-right depths of 3D space */
    transform: translate3d(360px, -260px, 420px) scale(5.2) rotate(78deg) skewX(-14deg);
    filter: blur(14px) brightness(2.8) drop-shadow(0 0 50px #a855f7);
  }
  20% {
    opacity: 1;
    filter: blur(8px) brightness(2.2) drop-shadow(0 0 40px #c084fc);
  }
  65% {
    opacity: 1;
    transform: translate3d(45px, -32px, 60px) scale(1.45) rotate(14deg) skewX(-3deg);
    filter: blur(1.5px) brightness(1.6) drop-shadow(0 0 28px #d946ef);
  }
  88% {
    /* Slight dynamic impact overshoot */
    transform: translate3d(-3px, 2px, 0) scale(0.97) rotate(-2deg);
    filter: blur(0px) brightness(1.8) drop-shadow(0 0 35px #f0abfc);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg) skewX(0);
    filter: blur(0px) brightness(1.15) drop-shadow(0 0 16px rgba(216, 180, 254, 0.95));
  }
}

/* Impact Effects Anchored on X's Docking Target */
.dcnx-fx-dock {
  position: absolute;
  top: 68.80%;
  left: 79.54%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 15;
}

/* Radial Shockwaves */
.dcnx-impact-shockwave {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}
.dcnx-fx-dock.impact-active .dcnx-impact-shockwave.wave-1 {
  animation: dcnxWaveExplode1 0.65s cubic-bezier(0.1, 0.8, 0.25, 1) forwards;
}
.dcnx-fx-dock.impact-active .dcnx-impact-shockwave.wave-2 {
  animation: dcnxWaveExplode2 0.78s cubic-bezier(0.1, 0.8, 0.25, 1) 0.08s forwards;
}

@keyframes dcnxWaveExplode1 {
  0% {
    width: 20px; height: 20px;
    border: 3.5px solid #ffffff;
    box-shadow: 0 0 25px #d946ef, inset 0 0 20px #e879f9;
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.2);
  }
  50% {
    border-color: #c084fc;
    opacity: 0.85;
  }
  100% {
    width: 480px; height: 480px;
    border: 1px solid rgba(168, 85, 247, 0);
    box-shadow: 0 0 45px rgba(217, 70, 239, 0), inset 0 0 25px rgba(232, 121, 249, 0);
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes dcnxWaveExplode2 {
  0% {
    width: 20px; height: 20px;
    border: 2.5px solid #22e9ff;
    box-shadow: 0 0 20px #22e9ff;
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(0.2);
  }
  100% {
    width: 620px; height: 620px;
    border: 1px solid rgba(34, 233, 255, 0);
    box-shadow: 0 0 40px rgba(34, 233, 255, 0);
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Anamorphic Horizontal Lens Flare */
.dcnx-impact-flare {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 0; height: 3px;
  background: linear-gradient(90deg, transparent, #c084fc 20%, #ffffff 50%, #22e9ff 80%, transparent);
  box-shadow: 0 0 35px 6px #e879f9;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.dcnx-fx-dock.impact-active .dcnx-impact-flare {
  animation: dcnxFlareAnamorphic 0.55s cubic-bezier(0.12, 0.9, 0.3, 1) forwards;
}
@keyframes dcnxFlareAnamorphic {
  0% {
    width: 0;
    opacity: 1;
    transform: translate(-50%, -50%) scaleY(2.5);
  }
  30% {
    width: clamp(240px, 60vw, 420px);
    opacity: 1;
    transform: translate(-50%, -50%) scaleY(1.8);
  }
  100% {
    width: clamp(340px, 80vw, 560px);
    opacity: 0;
    transform: translate(-50%, -50%) scaleY(0.4);
  }
}

/* Impact Center Flash Burst */
.dcnx-impact-flash {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.98) 0%, rgba(192, 132, 252, 0.75) 40%, rgba(147, 51, 234, 0.3) 70%, transparent 100%);
  opacity: 0;
  pointer-events: none;
}
.dcnx-fx-dock.impact-active .dcnx-impact-flash {
  animation: dcnxFlashBurst 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes dcnxFlashBurst {
  0%   { transform: translate(-50%, -50%) scale(0.2); opacity: 1; }
  35%  { transform: translate(-50%, -50%) scale(1.4); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}

/* Radial Sparks */
.dcnx-sparks-wrap {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 0; height: 0;
  pointer-events: none;
}
.dcnx-spark {
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 16px;
  border-radius: 2px;
  background: linear-gradient(to bottom, #ffffff, #d946ef);
  box-shadow: 0 0 10px #e879f9;
  opacity: 0;
  transform-origin: 50% 100%;
}
.dcnx-fx-dock.impact-active .spk-1 { animation: dcnxSparkFly 0.5s ease-out forwards; transform: rotate(0deg) translateY(-8px); }
.dcnx-fx-dock.impact-active .spk-2 { animation: dcnxSparkFly 0.52s ease-out 0.02s forwards; transform: rotate(60deg) translateY(-8px); }
.dcnx-fx-dock.impact-active .spk-3 { animation: dcnxSparkFly 0.48s ease-out 0.01s forwards; transform: rotate(120deg) translateY(-8px); }
.dcnx-fx-dock.impact-active .spk-4 { animation: dcnxSparkFly 0.54s ease-out 0.03s forwards; transform: rotate(180deg) translateY(-8px); }
.dcnx-fx-dock.impact-active .spk-5 { animation: dcnxSparkFly 0.5s ease-out 0.02s forwards; transform: rotate(240deg) translateY(-8px); }
.dcnx-fx-dock.impact-active .spk-6 { animation: dcnxSparkFly 0.53s ease-out 0.01s forwards; transform: rotate(300deg) translateY(-8px); }

@keyframes dcnxSparkFly {
  0% {
    opacity: 1;
    height: 12px;
  }
  60% {
    opacity: 0.9;
    height: 24px;
  }
  100% {
    opacity: 0;
    height: 30px;
    transform: rotate(var(--rot, 0deg)) translateY(-70px);
  }
}

/* Studio Tagline & Footer Meta */
.dcnx-footer-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
#splash-dcnx.active .dcnx-frame.docked ~ .dcnx-footer-meta,
#splash-dcnx.active .dcnx-footer-meta.show {
  opacity: 1;
  transform: translateY(0);
}
.dcnx-meta-line {
  width: 24px; height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.6));
}
.dcnx-footer-meta .dcnx-meta-line:last-child {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.6), transparent);
}
.dcnx-meta-text {
  font-family: var(--f-ui);
  font-size: clamp(11px, 2vw, 13px);
  font-weight: 800;
  letter-spacing: 0.28em;
  color: #c084fc;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

/* ============ boot (Marketopia 2.0 RE Cartoon World) ============ */
#boot{
  position:fixed; inset:0; z-index:50;
  background:#8ec4ff;
  overflow:hidden;
  transition:opacity .6s var(--e-out);
}
#boot.gone{ opacity:0; pointer-events:none; }
#bootCanvas{ position:absolute; inset:0; width:100%; height:100%; display:block; }

.boot-cartoon-wrap {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  padding: clamp(14px, 2.8vh, 28px) clamp(16px, 3.5vw, 24px);
  pointer-events: none;
  z-index: 2;
  user-select: none;
  max-width: 580px;
  margin: 0 auto;
  width: 100%;
}

/* Top Experimental Badge (Matches Screenshot) */
.boot-tab-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 3px solid #2b2438;
  border-radius: 999px;
  box-shadow: 0 5px 0 rgba(43, 36, 56, 0.22);
  user-select: none;
  animation: badgeHoverBob 2.8s ease-in-out infinite alternate;
}
@keyframes badgeHoverBob {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}
.boot-tab-badge .badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff5277;
  box-shadow: 0 0 8px rgba(255, 82, 119, 0.85);
  animation: dotBlink 1.4s infinite ease-in-out;
}
.boot-tab-badge .badge-icon { font-size: 14px; line-height: 1; }
.boot-tab-badge .badge-text {
  font-family: var(--f-ui); font-size: 12px; font-weight: 800;
  color: #2b2438; letter-spacing: 0.02em;
}
.boot-tab-badge .badge-tag {
  background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%);
  color: #ffffff;
  font-family: var(--f-ui); font-size: 10px; font-weight: 900;
  padding: 2px 7px; border-radius: 999px; letter-spacing: 0.04em;
  border: 1.5px solid #2b2438;
}

/* 3D Chunky Bubble Title (Matches Screenshot) */
.boot-brand-center {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  margin: 4px 0;
  gap: 4px;
}
.boot-title-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.boot-title-bubble .b-char {
  display: inline-block;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(38px, 8.5vw, 56px);
  line-height: 1;
  color: #ffcd38;
  -webkit-text-stroke: 3px #2b2438;
  text-shadow: 0 3px 0 #c47a12, 0 6px 0 #2b2438, 0 8px 12px rgba(43, 36, 56, 0.35);
  animation: bubbleBounce 2.2s ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
  transform-origin: 50% 100%;
}
@keyframes bubbleBounce {
  0%   { transform: translateY(0) rotate(0deg) scale(1); }
  50%  { transform: translateY(-7px) rotate(-1.5deg) scale(1.04); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}

.boot-title-sub-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 2px;
}
.boot-re-pill {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(16px, 3.4vw, 22px);
  color: #ffffff;
  background: linear-gradient(180deg, #ff6b6b 0%, #ff4747 100%);
  padding: 3px 14px;
  border: 2.5px solid #2b2438;
  border-radius: 999px;
  box-shadow: 0 4px 0 #2b2438;
  letter-spacing: 0.04em;
}
.boot-dcnx-tag {
  background: #ffffff;
  border: 2.5px solid #2b2438;
  border-radius: 999px;
  padding: 4px 12px;
  font-family: var(--f-ui);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #7b3fe4;
  box-shadow: 0 3px 0 rgba(43, 36, 56, 0.2);
}

/* Robert's Comic Speech Bubble */
.boot-speech-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 440px;
  width: 94%;
  margin: 4px auto;
}
.boot-speech-bubble {
  background: #ffffff;
  border: 3.5px solid #2b2438;
  border-radius: 20px;
  padding: 8px 16px;
  box-shadow: 0 5px 0 rgba(43, 36, 56, 0.22);
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.boot-speech-bubble .speech-icon {
  font-size: 20px;
  line-height: 1;
}
.boot-speech-bubble .speech-msg {
  font-family: var(--f-ui);
  font-weight: 800;
  font-size: clamp(12px, 2.2vw, 14px);
  color: #2b2438;
  line-height: 1.3;
}
.boot-speech-tail {
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #2b2438;
  margin-top: -1px;
  margin-left: -40px;
}

/* 3 Mini-Game Preview Cards (Matches Screenshot) */
.boot-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 440px;
  margin: 2px auto;
}
.boot-game-card {
  background: #ffffff;
  border: 3px solid #2b2438;
  border-radius: 16px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 0 rgba(43, 36, 56, 0.2);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s, box-shadow 0.3s;
}
.boot-game-card.ready {
  transform: scale(1.02);
  box-shadow: 0 5px 0 rgba(43, 36, 56, 0.25);
}
.bgc-icon-wrap {
  width: 36px; height: 36px;
  border: 2px solid #2b2438;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  box-shadow: 0 2.5px 0 #2b2438;
  flex-shrink: 0;
}
.bgc-icon-1 { background: #ffeaa7; }
.bgc-icon-2 { background: #ffccd5; }
.bgc-icon-3 { background: #e8d7ff; }

.bgc-num {
  position: absolute; top: -4px; left: -4px;
  width: 15px; height: 15px;
  border: 1.5px solid #2b2438; border-radius: 50%;
  background: #ffffff;
  font-family: var(--f-ui); font-weight: 900; font-size: 8.5px;
  display: flex; align-items: center; justify-content: center;
  color: #2b2438;
}
.bgc-emoji { font-size: 17px; line-height: 1; }

.bgc-body {
  flex: 1;
  min-width: 0;
}
.bgc-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(13px, 2.5vw, 15px);
  color: #2b2438;
  line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bgc-stars {
  font-size: 10px;
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 2px;
}
.bgc-dots {
  font-size: 8px;
  margin-left: 4px;
}

.bgc-status {
  border: 2px solid #2b2438;
  border-radius: 999px;
  padding: 2.5px 9px;
  font-family: var(--f-ui);
  font-weight: 900;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  background: #fff3c4;
  color: #634300;
  box-shadow: 0 2px 0 #2b2438;
  transition: all 0.3s;
}
.boot-game-card.ready .bgc-status {
  background: #5ec99f;
  color: #104630;
}

/* Bottom Chunky Cartoon Loading Track */
.boot-cartoon-foot {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  width: 100%; max-width: 480px;
  margin: 0 auto;
}
.boot-foot-meta-row {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%;
}
.boot-status-txt {
  font-family: var(--f-ui); font-weight: 900;
  font-size: clamp(12px, 2.2vw, 14px);
  color: #2b2438;
  letter-spacing: 0.02em;
}
.boot-pct-pill {
  font-family: var(--f-display); font-weight: 800;
  font-size: 15px;
  color: #2b2438;
  background: #ffcd38;
  padding: 2px 10px;
  border: 2.5px solid #2b2438;
  border-radius: 999px;
  box-shadow: 0 3px 0 #2b2438;
  letter-spacing: 0.02em;
}

.boot-pill-track {
  position: relative;
  width: 100%; height: 24px;
  background: #fffbe6;
  border: 3.5px solid #2b2438;
  border-radius: 999px;
  box-shadow: 0 5px 0 rgba(43, 36, 56, 0.22), inset 0 2px 4px rgba(0,0,0,0.08);
}
.boot-pill-fill {
  height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffc93c 0%, #ff9800 60%, #ff5c5c 100%);
  position: relative;
  transition: width 0.12s linear;
}
.boot-runner-head {
  position: absolute;
  right: -16px; top: 50%;
  transform: translateY(-50%);
  font-size: 22px; line-height: 1;
  filter: drop-shadow(0 2px 0 #2b2438);
  animation: runnerBob 0.32s infinite alternate ease-in-out;
}
@keyframes runnerBob {
  0%   { transform: translateY(-50%) rotate(-4deg); }
  100% { transform: translateY(-68%) rotate(4deg); }
}

.boot-credits-bar {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%;
  font-family: var(--f-ui); font-weight: 800; font-size: 11px;
  letter-spacing: 0.08em; color: #3b2c52;
  text-transform: uppercase;
}

/* ============ rotate hint ============ */
#rotate{
  position:fixed; inset:0; z-index:60; display:none;
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  place-items:center; text-align:center; padding:40px;
  background:#7b3fe4; color:#fff;
}
@media (orientation: landscape) and (max-height: 520px){
  #rotate{ display:grid; }
}
#rotate h3{ font-family:var(--f-display); font-size:34px; margin:18px 0 10px; }
#rotate p{ font-size:19px; opacity:.9; max-width:420px; }

/* ============ GAME 1 — the price sheet ============ */
.setup-sheet .sh-body{ color:var(--ink); }

.price-row{ display:flex; align-items:center; gap:16px; margin:6px 0 18px; }
.pbtn{
  width:96px; height:96px; flex:none; touch-action:manipulation;
  border:5px solid var(--ink); border-radius:26px; background:#fff;
  box-shadow:0 7px 0 #cfc9dd;
  font-family:var(--f-display); font-weight:700; font-size:48px; line-height:1; color:var(--ink);
  cursor:pointer;
}
.pbtn:active{ transform:translateY(6px); box-shadow:0 1px 0 #cfc9dd; }
.price-box{
  flex:1; text-align:center; padding:12px 10px;
  background:var(--cream); border:5px solid var(--ink); border-radius:26px;
}
.pb-val{ font-family:var(--f-display); font-weight:700; font-size:52px; line-height:1; }
.pb-val b{ font-weight:700; }
.pb-sub{ margin-top:6px; font-size:18px; font-weight:800; color:#8a819c; }
.pb-sub b{ color:var(--green-dp); }
.pb-sub .bad{ color:var(--red-dp); }

.rival-row{ display:flex; gap:12px; margin-bottom:18px; }
.rv{
  flex:1; padding:12px 14px; border-radius:20px;
  background:#f6f4fb; border:4px solid var(--ink);
  border-left:10px solid var(--rc);
}
.rv b{ display:block; font-size:18px; }
.rv span{ display:block; font-family:var(--f-display); font-size:30px; line-height:1.1; }
.rv u{ display:block; text-decoration:none; margin-top:3px; font-size:14px; color:#8a819c; line-height:1.3; }

.lever-label{ font-weight:900; font-size:17px; letter-spacing:.08em; text-transform:uppercase; color:#8a819c; margin-bottom:9px; }
.lever-row{ display:flex; gap:10px; }
.lever{
  flex:1; min-height:104px; padding:12px 6px 10px; text-align:center; touch-action:manipulation;
  background:#fff; border:4px solid var(--ink); border-radius:20px;
  box-shadow:0 5px 0 rgba(43,36,56,.16);
  font-family:var(--f-ui); color:var(--ink); cursor:pointer;
  transition:transform .08s, background .15s;
}
.lever:active{ transform:translateY(4px); box-shadow:0 1px 0 rgba(43,36,56,.16); }
.lever.on{ background:var(--yellow); box-shadow:0 5px 0 var(--yellow-dp); }
.lever i{ display:block; font-style:normal; font-size:30px; line-height:1.1; }
.lever b{ display:block; font-size:15px; line-height:1.15; margin-top:4px; }
.lever span{ display:block; font-size:13px; font-weight:800; color:#8a819c; margin-top:2px; }
.lever.on span{ color:#6b5a1e; }
.lever-desc{
  margin-top:12px; padding:12px 14px; border-radius:16px;
  background:#f4f1fb; border:4px solid rgba(43,36,56,.14);
  font-size:17px; line-height:1.45; color:#5a5270;
}
.lever-desc b{ color:var(--ink); }

/* ============ GAME 2 — the counter ============ */
.counter-sheet .sheet, .result-sheet .sheet{ padding-bottom:30px; }
.tell{
  display:grid; grid-template-columns:44px 1fr; gap:12px; align-items:center;
  padding:14px 16px; margin-bottom:16px; border-radius:20px;
  background:#fff5dc; border:4px solid var(--yellow-dp);
  font-size:19px; font-weight:700; color:#7a5f18;
}
.tell i{ font-style:normal; font-size:28px; text-align:center; }

.opt-list{ display:flex; flex-direction:column; gap:11px; }
.opt{
  width:100%; min-height:78px; padding:18px 20px; text-align:left; touch-action:manipulation;
  background:#fff; border:5px solid var(--ink); border-radius:22px;
  box-shadow:0 6px 0 rgba(43,36,56,.18);
  font-family:var(--f-ui); font-weight:700; font-size:21px; line-height:1.35; color:var(--ink);
  cursor:pointer; transition:transform .08s, background .15s;
}
.opt:active{ transform:translateY(5px); box-shadow:0 1px 0 rgba(43,36,56,.18); }
.opt:hover{ background:#fffaf0; }

.result-sheet.good .sheet{ border-color:var(--green-dp); }
.result-sheet.bad  .sheet{ border-color:var(--red-dp); }
.result-sheet.warn .sheet{ border-color:var(--yellow-dp); }
.result-sheet .sh-kicker{ background:var(--yellow); }
.result-sheet.good .sh-kicker{ background:var(--green); }
.result-sheet.bad  .sh-kicker{ background:var(--red); color:#fff; }
.result-sheet p{ font-size:21px; line-height:1.5; color:#5a5270; }
.sat-line{
  display:inline-block; margin-top:14px; padding:8px 18px; border-radius:100px;
  border:4px solid var(--ink); font-weight:900; font-size:19px;
}
.sat-line.up  { background:var(--green); }
.sat-line.down{ background:var(--red); color:#fff; }

/* ============ GAME 3 — the dials and the day ============ */
.dials{
  position:absolute; left:50%; transform:translateX(-50%); top:112px;
  width:660px; padding:14px 18px;
  background:#fff; border:5px solid var(--ink); border-radius:26px;
  box-shadow:0 8px 0 rgba(43,36,56,.2);
  display:grid; grid-template-columns:1fr 1fr; gap:10px 18px;
}
.dial{ display:grid; grid-template-columns:34px 1fr 44px; gap:9px; align-items:center; }
.dial i{ font-style:normal; font-size:24px; line-height:1; text-align:center; }
.dial .dl span{
  display:block; font-weight:900; font-size:14px; letter-spacing:.07em;
  text-transform:uppercase; color:#8a819c; margin-bottom:3px;
}
.dial .meter{ height:15px; border-width:3px; }
.dial b{ font-family:var(--f-display); font-size:24px; text-align:right; }
.dial b.low { color:var(--red-dp); }
.dial b.high{ color:var(--green-dp); }

.ceo-brief{ font-size:21px; line-height:1.5; color:#5a5270; margin-bottom:16px; }
.opt.choice{ padding:16px 20px; }
.opt.choice b{ display:block; font-size:22px; line-height:1.3; }
.opt.choice span{
  display:block; margin-top:4px; font-size:16px; font-weight:800;
  letter-spacing:.04em; text-transform:uppercase; color:#8a819c;
}

.fx-row{ display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.fx{
  flex:1; min-width:120px; display:grid; grid-template-columns:24px 1fr auto;
  gap:6px; align-items:center;
  padding:9px 12px; border-radius:14px;
  background:#f2f0f8; border:3px solid rgba(43,36,56,.16);
}
.fx i{ font-style:normal; font-size:17px; }
.fx span{ font-weight:800; font-size:14px; color:#8a819c; }
.fx b{ font-family:var(--f-display); font-size:20px; }
.fx.up  { background:#e6f9ec; border-color:rgba(63,174,63,.45); }
.fx.up b{ color:var(--green-dp); }
.fx.dn  { background:#ffeaea; border-color:rgba(214,61,61,.45); }
.fx.dn b{ color:var(--red-dp); }
.fx.flat b{ color:#8a819c; }

/* the hunt's running cost breakdown */
.cost-split{
  display:flex; gap:14px; margin-top:8px; padding-top:8px;
  border-top:3px dashed rgba(43,36,56,.16);
}
.cost-split span{ font-weight:800; font-size:15px; color:#8a819c; }
.cost-split b{ font-family:var(--f-display); font-size:19px; color:var(--ink); }
.perbird{
  margin-top:8px; padding:6px 12px; border-radius:100px; display:inline-block;
  background:var(--yellow); border:4px solid var(--ink);
  font-weight:900; font-size:15px; letter-spacing:.05em; text-transform:uppercase;
}
.perbird b{ font-family:var(--f-display); font-size:22px; letter-spacing:0; }
.hud-pill.bagged{ background:var(--green); }

/* ==========================================================
   Bloom's taxonomy ladder — the rungs either side of play,
   the slider workshop that closes each game, and the
   certificate the Master Challenge unlocks.
   ========================================================== */

.modal.bloom{ text-align:left; }
.bl-head{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.bl-verb{ font-family:var(--f-ui); font-weight:900; font-size:19px; letter-spacing:.06em;
  text-transform:uppercase; color:#9a92ad; }

.bl-chip{
  display:inline-flex; align-items:center; gap:9px;
  background:var(--bl, var(--blue)); color:#fff;
  border:4px solid var(--ink); border-radius:999px;
  padding:8px 18px 8px 14px; box-shadow:0 5px 0 rgba(43,36,56,.25);
}
.bl-chip i{ font-style:normal; font-size:22px; line-height:1; }
.bl-chip b{ font-family:var(--f-ui); font-weight:900; font-size:18px; letter-spacing:.05em;
  text-transform:uppercase; opacity:.85; }
.bl-chip span{ font-family:var(--f-display); font-weight:700; font-size:24px; }
.bl-chip.full{ background:var(--green); }
.bl-chip.full.gold{ background:var(--yellow); color:var(--ink); }

/* the six-rung rail: where this question sits in the climb */
.bl-rail{ display:flex; gap:6px; margin:0 0 20px; }
.bl-pip{
  flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; gap:5px;
  opacity:.42; transition:opacity .25s var(--e-out);
}
.bl-pip i{
  font-style:normal; width:100%; height:12px; border-radius:999px;
  background:#ded8ea; display:flex; align-items:center; justify-content:center;
  font-size:0; color:transparent;
}
.bl-pip em{ font-style:normal; font-family:var(--f-ui); font-weight:900; font-size:13px;
  letter-spacing:.03em; text-transform:uppercase; color:#9a92ad; white-space:nowrap; }
.bl-pip.done{ opacity:1; }
.bl-pip.done i{ background:var(--bl); }
.bl-pip.done em{ color:#6f6784; }
.bl-pip.now{ opacity:1; }
.bl-pip.now i{ background:var(--bl); height:16px; margin-top:-2px;
  box-shadow:0 0 0 4px color-mix(in srgb, var(--bl) 28%, transparent);
  animation:blPulse 1.5s ease-in-out infinite; }
.bl-pip.now em{ color:var(--ink); }
@keyframes blPulse{ 50%{ box-shadow:0 0 0 9px color-mix(in srgb, var(--bl) 12%, transparent); } }

.bl-title{ margin:0 0 10px; font-size:46px; }
.bl-prompt{ font-size:25px; line-height:1.48; color:#4a4360; margin:0 0 18px; }
.bl-prompt b{ color:var(--ink); }
.bl-note{
  background:var(--cream); border:3px solid rgba(43,36,56,.14); border-radius:18px;
  padding:14px 18px; font-size:21px; line-height:1.45; color:#6b6280; margin-bottom:18px;
}

.bl-opts{ display:flex; flex-direction:column; gap:10px; }
.bl-opt{ font-size:23px; line-height:1.4; padding:16px 20px; text-align:left; }

.bl-why{
  margin-top:16px; background:#eaf9ea; border:3px solid var(--green);
  border-radius:20px; padding:16px 20px; font-size:21px; line-height:1.5; color:#3f4a3f;
}
.bl-why b{ color:var(--green-dp); }
.bl-why.bad{ background:#fdeef0; border-color:var(--red); color:#5a4348; }
.bl-why.bad b{ color:var(--red-dp); }

/* ---------------------------------------------- slider lab */
.bl-sliders{ display:flex; flex-direction:column; gap:22px; margin:6px 0 18px; }
.bl-slider{ background:#f6f4fb; border:3px solid rgba(43,36,56,.1);
  border-radius:22px; padding:16px 20px 12px; }
.bl-sl-top{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; }
.bl-sl-top label{ font-family:var(--f-ui); font-weight:900; font-size:21px; color:#5a5270; }
.bl-sl-top b{ font-family:var(--f-display); font-weight:700; font-size:32px; color:var(--ink); }
.bl-sl-ends{ display:flex; justify-content:space-between;
  font-family:var(--f-ui); font-weight:800; font-size:15px; color:#a49cb8; }

.bl-slider input[type=range]{
  -webkit-appearance:none; appearance:none; width:100%; height:20px;
  background:transparent; margin:10px 0 4px; cursor:pointer;
}
.bl-slider input[type=range]::-webkit-slider-runnable-track{
  height:16px; border-radius:999px; background:#ded8ea; border:3px solid var(--ink);
}
.bl-slider input[type=range]::-moz-range-track{
  height:16px; border-radius:999px; background:#ded8ea; border:3px solid var(--ink);
}
.bl-slider input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none; width:38px; height:38px; margin-top:-14px;
  border-radius:50%; background:var(--purple); border:4px solid var(--ink);
  box-shadow:0 5px 0 var(--purple-dp);
}
.bl-slider input[type=range]::-moz-range-thumb{
  width:38px; height:38px; border-radius:50%; background:var(--purple);
  border:4px solid var(--ink); box-shadow:0 5px 0 var(--purple-dp);
}
.bl-slider input[type=range]:active::-webkit-slider-thumb{ box-shadow:0 1px 0 var(--purple-dp); }

.bl-derived{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  border:4px solid var(--ink); border-radius:22px; padding:14px 22px; margin-bottom:18px;
  background:#eaf9ea;
}
.bl-derived span{ font-family:var(--f-ui); font-weight:900; font-size:21px; color:#5a5270; }
.bl-derived b{ font-family:var(--f-display); font-weight:700; font-size:34px; }
.bl-derived.warn{ background:#fff6e0; }
.bl-derived.bad{ background:#fdeef0; }

.bl-out{ margin-top:18px; border:4px solid var(--ink); border-radius:26px;
  padding:20px 22px; background:#f6f4fb; }
.bl-out.good{ background:#eaf9ea; }
.bl-out.bad{ background:#fdeef0; }
.bl-out.invalid{ background:#fff6e0; }
.bl-out-head{ font-family:var(--f-display); font-weight:700; font-size:34px;
  display:flex; align-items:center; gap:10px; margin-bottom:6px; }
.bl-verdict{ font-size:22px; line-height:1.5; color:#4a4360; margin:14px 0 0; }

/* ------------------------------------------ master challenge */
.bl-dots{ display:flex; gap:10px; margin:0 0 18px; }
.bl-dots i{ flex:1; height:12px; border-radius:999px; background:#ded8ea; }
.bl-dots i.ok{ background:var(--green); }
.bl-dots i.now{ background:var(--yellow); }
.bl-dots i.bad{ background:var(--red); }
.bl-master-sub{ font-size:22px; color:#6b6280; }
.bl-q{ font-size:26px; }

.bl-unlock{
  margin-top:18px; background:var(--cream); border:4px solid var(--yellow);
  border-radius:22px; padding:18px 22px; font-size:22px; line-height:1.5; color:#5a4a2a;
}

/* ------------------------------------------------ certificate */
.modal.cert{ background:#fdfbf5; }
.cert{
  border:6px double var(--ink); border-radius:20px; padding:30px 26px 24px;
  text-align:center; background:
    radial-gradient(circle at 12% 8%, rgba(255,201,60,.16), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(123,63,228,.13), transparent 42%), #fffdf7;
}
.cert-rule{ width:76px; height:7px; border-radius:999px; background:var(--yellow);
  margin:0 auto 16px; }
.cert-kicker{ font-family:var(--f-ui); font-weight:900; font-size:17px; letter-spacing:.26em;
  text-transform:uppercase; color:#a08a4e; }
.cert-brand{ font-family:var(--f-display); font-weight:700; font-size:52px; line-height:1.05;
  margin:6px 0 14px; color:var(--ink); }
.cert-awarded{ font-size:19px; color:#8d84a3; font-style:italic; }
.cert-name{
  display:block; width:100%; margin:6px auto 12px; padding:6px 4px 10px;
  font-family:var(--f-display); font-weight:700; font-size:42px; text-align:center;
  color:var(--ink); background:transparent; border:0; border-bottom:4px dashed #cfc6e0;
  outline:none;
}
.cert-name:focus{ border-bottom-color:var(--purple); }
.cert-name::placeholder{ color:#cfc6e0; }
.cert-for{ font-size:20px; line-height:1.5; color:#5a5270; max-width:520px; margin:0 auto 20px; }

.cert-games{ display:flex; flex-direction:column; gap:8px; margin-bottom:18px; }
.cert-game{ display:flex; align-items:baseline; justify-content:space-between; gap:14px;
  border-bottom:2px dotted #ded6ea; padding-bottom:7px; text-align:left; }
.cert-game b{ font-family:var(--f-display); font-weight:700; font-size:23px; }
.cert-game span{ font-family:var(--f-ui); font-weight:800; font-size:18px;
  color:var(--yellow-dp); white-space:nowrap; }

.cert-ladder{ display:flex; flex-wrap:wrap; gap:7px; justify-content:center; margin-bottom:20px; }
.cert-ladder span{
  display:inline-flex; align-items:center; gap:5px;
  border:3px solid var(--bl); border-radius:999px; padding:4px 13px;
  font-family:var(--f-ui); font-weight:900; font-size:15px; color:var(--ink);
  text-transform:uppercase; letter-spacing:.04em;
}
.cert-ladder i{ font-style:normal; font-size:15px; }

.cert-foot{ display:flex; gap:12px; justify-content:center; margin-bottom:16px; }
.cert-foot div{ flex:1; }
.cert-foot b{ display:block; font-family:var(--f-display); font-weight:700; font-size:26px; }
.cert-foot span{ font-family:var(--f-ui); font-weight:900; font-size:14px; letter-spacing:.12em;
  text-transform:uppercase; color:#a49cb8; }
.cert-sig{ font-family:var(--f-ui); font-weight:900; font-size:15px; letter-spacing:.2em;
  text-transform:uppercase; color:#a08a4e; }

/* printing gives the student the certificate on its own */
@media print{
  body > *{ display:none !important; }
  #ui, .modal-wrap, .modal.cert{ display:block !important; position:static !important;
    background:none !important; box-shadow:none !important; border:0 !important;
    padding:0 !important; margin:0 !important; max-height:none !important; overflow:visible !important; }
  .modal.cert .m-actions{ display:none !important; }
  .cert-name{ border-bottom-color:#ccc !important; }
}

/* Ladder buttons carry longer labels than the rest of the game, so they are
   allowed to wrap rather than overflow their own outline. */
.modal.bloom .m-actions{ gap:12px; }
.modal.bloom .m-actions .btn{ flex:1 1 210px; white-space:normal; line-height:1.16; }
.modal.bloom .m-actions .btn.lg{ font-size:30px; padding:18px 26px; }

/* ==========================================================
   VIRTUAL JOYSTICK & TOUCH CONTROLS
   ========================================================== */
.v-controls-wrap {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 220px;
  pointer-events: none;
  z-index: 99;
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 28px 24px;
}
.v-joystick-base {
  pointer-events: auto;
  position: relative;
  width: 120px; height: 120px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 4.5px solid var(--ink);
  border-radius: 50%;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.8), 0 8px 16px rgba(31,24,45,0.25);
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
  user-select: none;
}
.v-joystick-knob {
  position: absolute;
  width: 58px; height: 58px;
  background: linear-gradient(135deg, #ffcd38 0%, #ff7a5c 100%);
  border: 4px solid var(--ink);
  border-radius: 50%;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.8), 0 4px 10px rgba(31,24,45,0.3);
  pointer-events: none;
  transition: transform 0.04s ease-out;
}
.v-joystick-hint {
  position: absolute;
  bottom: -22px;
  font-family: var(--f-ui);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink);
  white-space: nowrap;
}

.v-actions-wrap {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.v-action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #ffffff;
  border: 4px solid var(--ink);
  border-radius: 100px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.9), 0 6px 0 rgba(31,24,45,0.22);
  font-family: var(--f-display);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.08s var(--e-out), box-shadow 0.08s var(--e-out);
}
.v-action-btn:active {
  transform: translateY(5px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 0 rgba(31,24,45,0.22);
}
.v-btn-fire {
  padding: 16px 28px;
  font-size: 22px;
  color: #fff;
  background: var(--red);
  background-image: linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,0) 60%);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.5), 0 7px 0 var(--red-dp), 0 12px 20px rgba(31,24,45,.28);
}
.v-btn-fire:active {
  transform: translateY(6px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 0 var(--red-dp);
}
.v-btn-pause {
  width: 56px; height: 56px;
  font-size: 20px;
  padding: 0;
}

/* Controller selection ring for DOM & Canvas */
.controller-focus {
  outline: 4.5px solid #22e9ff !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 18px rgba(34, 233, 255, 0.75) !important;
  animation: ctrlFocusPulse 1.4s ease-in-out infinite alternate;
}
@keyframes ctrlFocusPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

/* ==========================================================
   SETTINGS MODAL & PLAYER MANAGEMENT
   ========================================================== */
.hud-pill-btn {
  cursor: pointer;
  background: #ffffff !important;
  transition: transform 0.1s var(--e-out), box-shadow 0.1s var(--e-out);
}
.hud-pill-btn:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.9), 0 9px 0 rgba(31,24,45,.24);
}
.hud-pill-btn:active {
  transform: translateY(5px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 2px 0 rgba(31,24,45,.22);
}

.settings-modal {
  max-width: 620px;
  max-height: 84vh;
  overflow-y: auto;
  text-align: left;
}
.settings-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 14px 0 8px;
}
.settings-section {
  background: rgba(255, 255, 255, 0.75);
  border: 3.5px solid var(--ink);
  border-radius: 22px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 5px 0 rgba(31,24,45,0.08);
}
.sec-head {
  display: flex; align-items: center; gap: 10px;
  border-bottom: 2.5px dashed #ded6ea;
  padding-bottom: 8px;
}
.sec-head b {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
.sec-icon { font-size: 22px; line-height: 1; }

.pad-status-card {
  display: flex; align-items: center; gap: 12px;
  background: #f4f2f8;
  border: 3px solid #ded6ea;
  border-radius: 14px;
  padding: 10px 14px;
}
.pad-status-card.connected {
  background: #eaffea;
  border-color: #8ed68e;
}
.pad-status-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #ff5277;
}
.pad-status-card.connected .pad-status-dot {
  background: #28a745;
  box-shadow: 0 0 8px #28a745;
}
.pad-status-title {
  font-family: var(--f-ui); font-weight: 900; font-size: 15px; color: var(--ink);
}
.pad-status-sub {
  font-family: var(--f-ui); font-size: 12px; color: #7a718c;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.setting-row.slider-row {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.s-label {
  display: flex; flex-direction: column; gap: 2px;
}
.s-label b {
  font-family: var(--f-display); font-weight: 700; font-size: 18px; color: var(--ink);
}
.s-label span {
  font-family: var(--f-ui); font-size: 13px; color: #7a718c; font-weight: 700;
}

.seg-ctrl {
  display: flex; align-items: center;
  background: #eceaf3;
  border: 3px solid var(--ink);
  border-radius: 100px;
  padding: 3px;
  gap: 4px;
}
.seg-btn {
  padding: 6px 14px;
  border: 0;
  border-radius: 100px;
  background: transparent;
  font-family: var(--f-ui);
  font-weight: 900;
  font-size: 13px;
  color: #716982;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, transform 0.08s;
}
.seg-btn.active {
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(31,24,45,0.25);
}
.seg-btn.active.warn {
  background: var(--red);
  color: #ffffff;
}

.s-slider {
  width: 100%;
  height: 12px;
  -webkit-appearance: none;
  background: #eceaf3;
  border: 3px solid var(--ink);
  border-radius: 100px;
  outline: none;
}
.s-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--yellow);
  border: 3px solid var(--ink);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--yellow-dp);
}

.s-input {
  padding: 8px 14px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  outline: none;
  max-width: 240px;
}
.s-input:focus { border-color: var(--purple); }

.setting-actions {
  display: flex; align-items: center; gap: 8px;
}
.btn-danger {
  background: #fee !important;
  color: var(--red-dp) !important;
  border: 3px solid var(--red-dp) !important;
}
.btn-danger:hover {
  background: var(--red) !important;
  color: #fff !important;
}

/* ==========================================================
   GAME 1: BRAND & STRATEGY STUDIO (POST-HUNT)
   Scaled to full 720x1280 stage coordinate system for desktop & mobile
   ========================================================== */
.strategy-studio-container {
  position: relative;
  width: 100%;
  max-width: 660px;
  max-height: 92%;
  margin: 10px auto;
  pointer-events: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(22, 28, 48, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 6px solid var(--ink);
  border-radius: 36px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.25), 0 16px 0 rgba(18, 12, 32, 0.35), 0 30px 50px rgba(10, 8, 20, 0.6);
  padding: 28px 24px 30px;
  color: #ffffff;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
  animation: stratPopIn 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes stratPopIn {
  from { opacity: 0; transform: scale(0.92) translateY(24px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.strategy-studio-container::-webkit-scrollbar {
  width: 8px;
}
.strategy-studio-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 10px;
}

.strat-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.strat-pill-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 205, 56, 0.22);
  border: 3px solid #ffcd38;
  border-radius: 100px;
  padding: 6px 20px;
  font-family: var(--f-ui);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.1em;
  color: #ffcd38;
  text-transform: uppercase;
}
.strat-title {
  font-family: var(--f-display);
  font-size: 44px;
  line-height: 1.1;
  font-weight: 700;
  color: #ffffff;
  margin: 8px 0 4px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
}
.strat-subtitle {
  font-family: var(--f-ui);
  font-size: 21px;
  line-height: 1.45;
  color: #d0def4;
  margin: 0;
  max-width: 580px;
}
.strat-subtitle b {
  color: #ffcd38;
}

.strat-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 3.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 18px 20px;
}
.strat-section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-ui);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #b0c9f5;
}
.strat-section-label .step-num {
  background: var(--purple);
  color: #fff;
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 900;
}
.hhi-badge {
  margin-left: auto;
  font-size: 14px;
  font-weight: 900;
  background: rgba(231, 76, 60, 0.25);
  border: 2px solid #e74c3c;
  color: #ff7675;
  border-radius: 100px;
  padding: 4px 12px;
}

/* Brand Grid */
.brand-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.brand-select-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 3.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
}
.brand-select-card:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}
.brand-select-card.active {
  background: rgba(255, 205, 56, 0.16);
  border-color: #ffcd38;
  box-shadow: 0 6px 20px rgba(255, 205, 56, 0.35);
}
.bsc-icon-wrap {
  width: 58px; height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
  border: 3px solid rgba(255, 255, 255, 0.35);
}
.bsc-info {
  flex: 1;
  min-width: 0;
}
.bsc-name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 24px;
  color: #fff;
  line-height: 1.2;
}
.bsc-tier {
  font-family: var(--f-ui);
  font-weight: 800;
  font-size: 16px;
  color: #ffcd38;
  margin-top: 3px;
}
.bsc-perk {
  font-family: var(--f-ui);
  font-size: 15px;
  color: #b0c9f5;
  margin-top: 2px;
}
.bsc-check {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: transparent;
}
.brand-select-card.active .bsc-check {
  background: #ffcd38;
  border-color: #ffcd38;
  color: #1a162b;
}

/* Market Concentration Card */
.concentration-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.conc-chart-bar {
  display: flex;
  height: 40px;
  border-radius: 14px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.25);
  font-family: var(--f-ui);
  font-weight: 900;
  font-size: 16px;
}
.conc-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
}
.conc-seg.ramesh { background: #3498db; }
.conc-seg.fresh { background: #2ecc71; }
.conc-seg.open { background: #f39c12; color: #1a162b; }

.conc-intel-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.intel-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 17px;
  line-height: 1.4;
  color: #d1dcf0;
}
.intel-box .dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.intel-box.ramesh .dot { background: #3498db; }
.intel-box.fresh .dot { background: #2ecc71; }
.intel-box.open .dot { background: #f39c12; }

/* Ocean Strategy Dual Cards */
.ocean-strategy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 540px) {
  .ocean-strategy-grid { grid-template-columns: 1fr; }
}

.ocean-card {
  border-radius: 22px;
  padding: 16px 18px;
  cursor: pointer;
  border: 3.5px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
}
.ocean-card.blue {
  background: linear-gradient(135deg, rgba(26, 82, 118, 0.75), rgba(41, 128, 185, 0.45));
}
.ocean-card.red {
  background: linear-gradient(135deg, rgba(120, 40, 31, 0.75), rgba(192, 57, 43, 0.45));
}
.ocean-card:hover {
  transform: translateY(-3px);
}
.ocean-card.blue.active {
  border-color: #29b6f6;
  box-shadow: 0 0 28px rgba(41, 182, 246, 0.5);
  background: linear-gradient(135deg, rgba(26, 82, 118, 0.95), rgba(41, 128, 185, 0.75));
}
.ocean-card.red.active {
  border-color: #ff5252;
  box-shadow: 0 0 28px rgba(255, 82, 82, 0.5);
  background: linear-gradient(135deg, rgba(120, 40, 31, 0.95), rgba(192, 57, 43, 0.75));
}

.ocean-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ocean-icon {
  font-size: 32px;
}
.ocean-title {
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}
.ocean-concept {
  font-family: var(--f-ui);
  font-size: 14px;
  color: #cbe0fc;
}
.ocean-selected-badge {
  display: none;
  position: absolute;
  top: -12px; right: 16px;
  background: #ffcd38;
  color: #1a162b;
  font-family: var(--f-ui);
  font-weight: 900;
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 100px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}
.ocean-card.active .ocean-selected-badge {
  display: block;
}

.ocean-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ocean-bullet {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 16px;
  line-height: 1.38;
  color: #e4eaf7;
}
.ocean-bullet span { font-size: 17px; flex-shrink: 0; }

/* Launch Button */
.strat-launch-wrap {
  margin-top: 6px;
}
.btn-launch-stall {
  width: 100%;
  padding: 18px 24px;
  border: 5px solid #fff;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffcd38, #f39c12);
  color: #1a162b;
  font-family: var(--f-display);
  cursor: pointer;
  box-shadow: 0 8px 0 #b9770e, 0 14px 28px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-launch-stall:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 #b9770e, 0 16px 32px rgba(0, 0, 0, 0.55);
}
.btn-launch-stall:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #b9770e;
}
.btn-l-text {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.btn-l-tag {
  font-family: var(--f-ui);
  font-size: 16px;
  font-weight: 900;
  background: #3498db;
  color: #fff;
  padding: 4px 16px;
  border-radius: 100px;
}

/* Market Strategy HUD Pill */
.strat-pill {
  border-width: 3px !important;
  font-size: 15px !important;
}
.strat-pill.strat-blue {
  background: rgba(41, 128, 185, 0.95) !important;
  border-color: #29b6f6 !important;
  color: #fff !important;
}
.strat-pill.strat-red {
  background: rgba(192, 57, 43, 0.95) !important;
  border-color: #ff7675 !important;
  color: #fff !important;
}

/* ==========================================================
   GAME 3: CUSTOMER LIFETIME VALUE (CLTV) STYLING
   ========================================================== */
.cltv-hud-pill {
  background: linear-gradient(180deg, #2c1a4d, #1c1033) !important;
  border: 2.5px solid #a29bfe !important;
  color: #ffffff !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 14px !important;
}
.cltv-hud-pill b {
  color: #ffeaa7 !important;
  font-size: 19px !important;
  text-shadow: 0 0 10px rgba(255, 234, 167, 0.4);
}
.cltv-sub {
  font-family: var(--f-ui);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 100px;
  margin-top: 1px;
}
.cltv-sub.good { background: rgba(46, 204, 113, 0.25); color: #2ecc71; }
.cltv-sub.warn { background: rgba(243, 156, 18, 0.25); color: #f39c12; }
.cltv-sub.bad { background: rgba(231, 76, 60, 0.25); color: #e74c3c; }

.cltv-delta-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}
.cltv-delta-badge.good {
  background: rgba(46, 204, 113, 0.15);
  border: 1.5px solid #2ecc71;
  color: #27ae60;
}
.cltv-delta-badge.bad {
  background: rgba(231, 76, 60, 0.15);
  border: 1.5px solid #e74c3c;
  color: #c0392b;
}
.cltv-delta-badge small {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.85;
}


