/* Point Dental Training — 16-bit pixel RPG theme */
@font-face{font-family:'Press Start 2P';src:url('../assets/fonts/PressStart2P-Regular.woff2') format('woff2'),url('../assets/fonts/PressStart2P-Regular.ttf') format('truetype');font-display:swap}
@font-face{font-family:'Silkscreen';src:url('../assets/fonts/Silkscreen-Regular.woff2') format('woff2'),url('../assets/fonts/Silkscreen-Regular.ttf') format('truetype');font-display:swap}
@font-face{font-family:'Silkscreen';src:url('../assets/fonts/Silkscreen-Bold.woff2') format('woff2'),url('../assets/fonts/Silkscreen-Bold.ttf') format('truetype');font-weight:700;font-display:swap}
@font-face{font-family:'Inter';src:url('../assets/fonts/Inter-Regular.woff2') format('woff2');font-weight:400;font-display:swap}
@font-face{font-family:'Inter';src:url('../assets/fonts/Inter-Medium.woff2') format('woff2');font-weight:500;font-display:swap}
@font-face{font-family:'Inter';src:url('../assets/fonts/Inter-SemiBold.woff2') format('woff2');font-weight:600;font-display:swap}
@font-face{font-family:'Inter';src:url('../assets/fonts/Inter-Bold.woff2') format('woff2');font-weight:700;font-display:swap}

:root, [data-theme="uk"]{
  --ink:#39271d; --navy:#39271d; --navy2:#4a3428; --panel:#5C3A24; --panel2:#7A4E2D;
  --teal:#C4A574; --teal2:#c4a574; --teal-dim:#8B6914;
  --gold:#C8A046; --gold2:#E8C878; --red:#C44838; --green:#6AA84F;
  --muted:#8a7a68; --pale:#eee9e2; --parchment:#e3dbcf; --beige:#e3dbcf; --beige-light:#eee9e2;
  --wood:#5C3A24; --wood-deep:#39271d; --wood-light:#8B5A2B; --lamp:#FFC878;
  --mint:#aad2c3; --charcoal:#37373a;
  --burgundy:#7a2630; --burgundy-deep:#5c1c24; --cream:#eee9e2;
  --pixel:2px;
  --font-pixel:'Silkscreen','Press Start 2P',monospace;
  --font-ui:'Press Start 2P',monospace;
  --font-body:Inter,system-ui,sans-serif;
  --checker:none;
  --dialog-bg:linear-gradient(180deg,#eee9e2 0%,#e3dbcf 100%);
  --dialog-ink:#39271d;
  --hud-bg:linear-gradient(180deg,#5C3A24 0%,#39271d 100%);
}
[data-theme="gb"]{
  --ink:#071812; --navy:#071812; --navy2:#0F382A; --panel:#0F382A; --panel2:#146044;
  --teal:#489068; --teal2:#9CCE89; --teal-dim:#306850;
  --gold:#E8A434; --gold2:#F0C878; --red:#C44838; --green:#9CCE89;
  --muted:#7A9E78; --pale:#C6DEAA; --parchment:#C6DEAA; --wood:#0F382A; --wood-deep:#071812;
  --wood-light:#146044; --lamp:#9CCE89;
  --checker:url('../assets/pixel/bg_checker.png');
  --dialog-bg:var(--panel); --dialog-ink:var(--pale);
  --hud-bg:var(--navy2);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:var(--ink);color:var(--pale);font-family:var(--font-body);overflow:hidden}
img.pixel,canvas.pixel,.pixelated{image-rendering:pixelated;image-rendering:crisp-edges;-ms-interpolation-mode:nearest-neighbor}
canvas.ob-preview,canvas.smooth,.smooth{image-rendering:auto;-ms-interpolation-mode:bicubic}
#app{height:100%;display:flex;flex-direction:column;max-width:480px;margin:0 auto;position:relative;background:var(--ink);background-image:var(--checker);background-repeat:repeat;background-size:32px 32px}
[data-theme="uk"] #app{background:#1A100C;background-image:none}

/* HUD — UK dark-wood bar: avatar/level, XP, coins, streak */
.hud{display:flex;align-items:center;gap:8px;padding:6px 10px;background:var(--hud-bg);border-bottom:3px solid #1A0E08;z-index:20;box-shadow:inset 0 -2px 0 #8B5A2B, inset 0 2px 0 #A07040}
.hud-avatar{position:relative;width:36px;height:36px;flex-shrink:0;border:2px solid var(--gold);border-radius:6px;background:var(--burgundy-deep);overflow:hidden}
.hud-avatar img{width:100%;height:100%;object-fit:cover;object-position:top;image-rendering:auto;-ms-interpolation-mode:bicubic}
.hud-lvl{position:absolute;right:-4px;bottom:-4px;background:var(--burgundy);color:var(--cream);font-family:var(--font-pixel);font-size:9px;padding:1px 4px;border:2px solid #1A0E08;border-radius:4px}
.hud-stat{display:flex;align-items:center;gap:4px;font-family:var(--font-pixel);font-size:11px;color:var(--pale)}
.hud-stat img{width:16px;height:16px;image-rendering:pixelated}
.streak-ico{font-size:12px;line-height:1}
.xp-wrap{flex:1;min-width:70px}
.xp-bar{height:10px;background:#1A0E08;border:2px solid #8B5A2B;position:relative;overflow:hidden;border-radius:2px}
.xp-bar>i{display:block;height:100%;background:linear-gradient(180deg,var(--gold2),var(--gold));width:0%}
.hearts{display:flex;gap:2px}
.hearts img{width:14px;height:14px;image-rendering:pixelated}
[data-theme="gb"] .hud{box-shadow:none;border-bottom-color:#000}
[data-theme="gb"] .xp-bar{border-color:#334155}
[data-theme="gb"] .xp-bar>i{background:linear-gradient(180deg,var(--teal2),var(--teal))}

/* Screens */

.screen{display:none;flex:1;flex-direction:column;min-height:0;overflow:hidden}
.screen.active{display:flex}
.screen-scroll{overflow:auto;-webkit-overflow-scrolling:touch;padding:12px;flex:1}

/* Pixel panel / RPG box */
.pixel-box{
  background:var(--panel);
  border:4px solid #000;
  box-shadow: inset -4px -4px 0 #061018, inset 4px 4px 0 #1E4A6E;
  padding:12px; margin:8px 0;
}
.pixel-box.gold{box-shadow: inset -4px -4px 0 #78350F, inset 4px 4px 0 #FBBF24; border-color:#000; background:#1C1408}
.dialog{
  display:flex; gap:10px; align-items:flex-end;
  background:var(--dialog-bg); border:4px solid #2A1C14;
  box-shadow: inset -4px -4px 0 #C4A574, inset 4px 4px 0 #FFF8E7, 0 4px 0 #1A0E08;
  padding:10px; margin:8px 10px;
}
.dialog img.guide{width:64px;height:64px;image-rendering:auto;flex-shrink:0;background:transparent;border:0}
.dialog .bubble{flex:1;font-size:14px;line-height:1.45;color:var(--dialog-ink)}
.dialog .who{font-family:var(--font-pixel);font-size:11px;color:#6b4a32;margin-bottom:4px}

h1,h2,h3,.pixel-title{font-family:var(--font-ui);letter-spacing:0;line-height:1.5}
h1{font-size:12px;margin:0 0 8px} h2{font-size:11px;margin:0 0 8px} h3{font-size:10px}

.btn{
  font-family:var(--font-pixel); font-size:12px; color:#eee9e2;
  background:linear-gradient(180deg,#9a3340,#7a2630);
  border:4px solid #1A0E08; padding:10px 12px; cursor:pointer;
  box-shadow: inset -3px -3px 0 #561a22, inset 3px 3px 0 #c45a66;
  text-align:center; width:100%; margin:6px 0;
}
.btn:active{transform:translate(1px,1px); box-shadow: inset 3px 3px 0 #561a22}
.btn.secondary{color:#2A1C14; background:linear-gradient(180deg,#F3EBE0,#E8DCC8); border:3px solid #7a2630; box-shadow: inset 0 2px 0 #fff8e7, 0 3px 0 #3a1218}
.btn.gold{color:#451A03; background:linear-gradient(180deg,#FCD34D,#F59E0B); box-shadow: inset -3px -3px 0 #B45309, inset 3px 3px 0 #FDE68A}
.btn.danger{color:#fff; background:linear-gradient(180deg,#F87171,#DC2626); box-shadow: inset -3px -3px 0 #991B1B, inset 3px 3px 0 #FECACA}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.small{font-size:10px;padding:8px}

/* Map screen */
#screen-map.active{display:flex;flex-direction:column;flex:1;min-height:0;padding:0}
#screen-map .map-stage{flex:1;position:relative;min-height:0;background:#1A100C;overflow:hidden;display:block}
#clinic-canvas{image-rendering:pixelated;display:block;width:100%;height:100%;background:#1A100C;position:absolute;inset:0}
.map-prompt{
  position:absolute;left:50%;bottom:12px;transform:translateX(-50%);
  background:#0F2740;border:4px solid #000;padding:8px 12px;
  font-family:var(--font-pixel);font-size:11px;color:var(--gold2);
  box-shadow:4px 4px 0 #000; white-space:nowrap; max-width:92%; overflow:hidden; text-overflow:ellipsis;
  display:none;z-index:5;
}
.map-prompt.show{display:block}
.map-prompt.locked{color:#C8A046;background:#3a3a3a}

/* Virtual joystick */
.joy-zone{position:absolute;left:0;right:0;bottom:0;height:120px;pointer-events:none;z-index:6}
.joystick{
  pointer-events:auto; position:absolute; left:16px; bottom:16px;
  width:96px;height:96px;border-radius:50%;
  background:rgba(15,39,64,.75); border:4px solid #000;
  box-shadow: inset 0 0 0 2px #1E4A6E;
  touch-action:none;
}
.joystick .knob{
  position:absolute; width:40px;height:40px; border-radius:50%;
  background:linear-gradient(180deg,#9a3340,#7a2630); border:3px solid #1A0E08;
  left:28px;top:28px; box-shadow: inset -2px -2px 0 #561a22;
}
.map-actions{position:absolute;right:12px;bottom:24px;display:flex;flex-direction:column;gap:8px;pointer-events:auto;z-index:6}
.map-actions .btn{width:auto;padding:12px 14px;margin:0;font-size:11px}

/* Station / lesson */
.station-hero{display:flex;gap:10px;align-items:center}
.station-hero img{width:48px;height:48px;image-rendering:pixelated}
.chip{display:inline-block;font-family:var(--font-pixel);font-size:10px;padding:3px 6px;border:2px solid #7a2630;background:#F3EBE0;color:#2A1C14;margin:2px}
.chip.clinic{background:#7a2630;color:#eee9e2;border-color:#3a1218}.chip.general{background:#E8DCC8;color:#2A1C14}.chip.inactive{background:#d8cfc2;color:#5a4a3a;border-color:#8a7a6a}

.choice{
  display:block;width:100%;text-align:left;margin:8px 0;padding:12px;
  font-family:var(--font-body);font-size:15px;line-height:1.35;color:var(--pale);
  background:var(--panel);border:4px solid #000;
  box-shadow: inset -3px -3px 0 #061018, inset 3px 3px 0 #1E4A6E; cursor:pointer;
}
.choice:active,.choice.selected{background:#134E4A}
.choice.correct{background:#14532D;box-shadow: inset -3px -3px 0 #052E16, inset 3px 3px 0 #22C55E}
.choice.wrong{background:#7F1D1D;box-shadow: inset -3px -3px 0 #450A0A, inset 3px 3px 0 #EF4444}
.q-progress{font-family:var(--font-pixel);font-size:10px;color:var(--muted);margin-bottom:6px}
.prompt-text{font-size:16px;line-height:1.45;margin:8px 0 12px;font-weight:500}

/* Boss */
.boss-bar{height:16px;background:#000;border:3px solid #000;margin:8px 0;position:relative}
.boss-bar>i{display:block;height:100%;background:linear-gradient(180deg,#F87171,#B91C1C);width:100%;transition:width .25s}
.boss-label{font-family:var(--font-pixel);font-size:11px;color:var(--red)}

/* Minigames */
.tap-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.tap-cell{
  font-family:var(--font-pixel);font-size:11px;padding:18px 8px;text-align:center;
  background:var(--panel);border:4px solid #000;cursor:pointer;color:var(--pale);
}
.tap-cell.ok{background:#14532D}.tap-cell.bad{background:#7F1D1D}
.timer{font-family:var(--font-ui);font-size:14px;color:var(--gold)}
.order-list{list-style:none;padding:0;margin:0}
.order-list li{
  padding:12px;margin:6px 0;background:var(--panel);border:4px solid #000;
  font-size:14px;cursor:grab;display:flex;gap:8px;align-items:center;color:var(--pale);
}
.order-list li .num{font-family:var(--font-pixel);font-size:11px;color:var(--teal2);width:20px}
.order-list li.dragging{opacity:.5}

/* Reward */
.reward-screen{text-align:center;padding:24px 16px}
.reward-screen img.chest{width:96px;height:96px;image-rendering:pixelated;margin:12px auto}
.reward-stats{font-family:var(--font-pixel);font-size:12px;line-height:1.8}

/* Tabs / nav */
.bottom-nav{
  display:flex;border-top:4px solid #000;background:var(--navy2);z-index:20;
}
.bottom-nav button{
  flex:1;background:transparent;border:0;border-right:2px solid #000;color:var(--muted);
  font-family:var(--font-pixel);font-size:9px;padding:10px 4px;cursor:pointer;
}
.bottom-nav button:last-child{border-right:0}
.bottom-nav button.active{color:var(--gold2);background:#5C3A24}

/* Leaderboard */
.lb-row{display:flex;align-items:center;gap:8px;padding:8px;border:3px solid #000;margin:6px 0;background:var(--panel)}
.lb-row.you{background:#134E4A}
.lb-rank{font-family:var(--font-ui);font-size:10px;width:28px;color:var(--gold)}

/* Dashboard cleaner */
.dash .pixel-box{box-shadow: inset -2px -2px 0 #061018, inset 2px 2px 0 #1E4A6E}
.heat{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}
.heat i{display:block;height:28px;border:2px solid #000;font-style:normal;font-size:9px;text-align:center;line-height:28px;font-family:var(--font-pixel)}

.toast{
  position:fixed;left:50%;top:52px;bottom:auto;transform:translateX(-50%);
  background:#3a2418;border:3px solid #1A0E08;padding:10px 14px;
  font-family:var(--font-pixel);font-size:11px;color:#eee9e2;
  z-index:60;display:none;max-width:90%;
  border-radius:8px;box-shadow:0 4px 0 #1A0E08;
  pointer-events:none;
}
.toast.show{display:block}

.hidden{display:none!important}
.source-tag{font-size:11px;color:var(--muted);margin-top:6px}

/* Avatar picker */
.avatar-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.avatar-opt{border:4px solid #000;padding:6px;background:var(--panel);cursor:pointer;text-align:center}
.avatar-opt.selected{outline:3px solid var(--teal2)}
.avatar-opt img{width:32px;height:32px;image-rendering:auto}

@media (min-width:481px){
  #app{border-left:4px solid #000;border-right:4px solid #000}
}

/* UK dialog — big overlapping portrait, parchment box, wood name tab */
.uk-dialog{
  position:relative; z-index:15; flex-shrink:0;
  padding:0 8px 4px; margin-top:0;
  pointer-events:none; background:#1A100C;
}
.uk-dialog .dlg-skip{
  pointer-events:auto; position:absolute; top:-28px; right:12px; z-index:16;
  background:rgba(26,14,8,.55); color:var(--cream); border:none;
  font-family:var(--font-pixel); font-size:10px; padding:6px 10px; cursor:pointer;
  letter-spacing:1px;
}
.uk-dialog-inner{
  pointer-events:auto; position:relative;
  background:linear-gradient(180deg,#f3ebe0 0%,#e3dbcf 100%);
  border:3px solid #39271d;
  box-shadow: 0 3px 0 #1A0E08, inset 0 1px 0 #fff8e7;
  min-height:108px; padding:18px 14px 16px 42%;
  margin-left:4px;
}
.uk-portrait{
  position:absolute; left:4px; bottom:6px;
  width:38%; max-width:160px; height:auto;
  image-rendering:auto; /* clean U1-style drawings — not pixelated */
  -ms-interpolation-mode:bicubic;
  filter: drop-shadow(2px 3px 0 rgba(26,14,8,.35));
  background:transparent; border:none; pointer-events:none;
  z-index:2;
}
.uk-nameplate{
  position:absolute; left:40%; top:-14px;
  background:linear-gradient(180deg,#5C3A24,#39271d);
  color:#eee9e2; font-family:var(--font-pixel); font-size:11px;
  padding:5px 12px 4px; border:2px solid #1A0E08;
  box-shadow: inset 0 1px 0 #8B5A2B, 0 2px 0 rgba(0,0,0,.25);
  white-space:nowrap; z-index:3;
}
.uk-text{
  font-family:var(--font-body), Inter, system-ui, sans-serif;
  font-size:15px; line-height:1.45; font-weight:500;
  color:#2A1C14; min-height:3.6em;
  text-transform:none !important; letter-spacing:0;
  font-variant:normal; white-space:normal; overflow-wrap:anywhere; word-break:break-word;
}
.uk-nameplate{text-transform:uppercase; letter-spacing:0.5px;}

.uk-arrow{
  position:absolute; right:12px; bottom:6px;
  color:var(--burgundy); font-size:12px;
  animation: ukBob 0.7s ease-in-out infinite;
}
@keyframes ukBob{0%,100%{transform:translateY(0)}50%{transform:translateY(4px)}}
.uk-dialog.compact .uk-dialog-inner{padding-left:36%; min-height:88px}
.uk-dialog.compact .uk-portrait{width:32%; max-width:120px}
/* legacy class alias */
.dialog-bar{display:none}
[data-theme="gb"] .uk-dialog-inner{background:var(--panel);border-color:#000;color:var(--pale)}
[data-theme="gb"] .uk-text{color:var(--pale)}
[data-theme="gb"] .uk-nameplate{background:var(--navy2);color:var(--teal2)}

/* Burgundy accent buttons / tabs alongside gold */
.btn.primary{background:linear-gradient(180deg,#9a3340,var(--burgundy))!important;color:#eee9e2!important;border-color:#3a1218!important}
.btn.gold{background:linear-gradient(180deg,#E8C878,#C8A046);color:#39271d}
.bottom-nav button.active{background:var(--burgundy)!important;color:var(--cream)!important;box-shadow:inset 0 0 0 2px var(--gold)}
.theme-toggle{border-color:var(--burgundy)!important}

.btn{border-radius:10px;background:linear-gradient(180deg,#8B5A2B,#5C3A24);color:var(--pale);border:3px solid #2A1C14;font-family:var(--font-pixel);box-shadow:inset 0 2px 0 #C4A574, 0 3px 0 #1A0E08}
.btn:active{transform:translateY(2px);box-shadow:inset 0 2px 0 #C4A574}
.btn.primary{background:linear-gradient(180deg,#9a3340,#7a2630);color:#eee9e2}
.btn.secondary{color:#2A1C14!important;background:linear-gradient(180deg,#F3EBE0,#E8DCC8)!important;border:3px solid #7a2630!important;box-shadow:inset 0 2px 0 #fff8e7, 0 3px 0 #3a1218!important}
.choice{border-radius:10px;background:#F3E6C8;color:#2A1C14;border:3px solid #2A1C14}
.choice:active,.choice.selected{background:#F0C878}
.pixel-box{
  background:var(--panel); border:4px solid #2A1C14; border-radius:12px;
  box-shadow: inset -4px -4px 0 #3B2416, inset 4px 4px 0 #8B5A2B;
}
.map-prompt{border-radius:10px;background:rgba(42,28,20,.88);color:var(--gold2);border:2px solid #8B5A2B;padding:6px 10px;font-family:var(--font-pixel);font-size:10px}

/* Map stage */
#screen-map.active{display:flex;flex-direction:column;flex:1;min-height:0}
#screen-map .map-stage{position:relative;flex:1;min-height:0;background:#1A100C;overflow:hidden;display:flex}
#map-canvas{display:block;width:100%;height:100%;image-rendering:auto}
.joystick{position:absolute;right:16px;bottom:16px;width:96px;height:96px;border-radius:50%;background:rgba(42,28,20,.55);border:3px solid #8B5A2B;touch-action:none;z-index:5}
.joystick .knob{position:absolute;left:50%;top:50%;width:40px;height:40px;margin:-20px 0 0 -20px;border-radius:50%;background:radial-gradient(circle at 35% 35%,#F0C878,#8B5A2B);border:3px solid #2A1C14;box-shadow:0 3px 0 #1A0E08}
.theme-toggle{font-family:var(--font-pixel);font-size:9px;padding:4px 8px;background:#3B2416;color:var(--gold2);border:2px solid #8B5A2B;cursor:pointer}

/* Station / quiz screens warm */
#screen-station, #screen-quiz, #screen-boss, #screen-reward, #screen-mini{background:#1A100C}
.boss-hp{height:12px;background:#1A0E08;border:2px solid #8B5A2B}
.boss-hp>i{display:block;height:100%;background:linear-gradient(180deg,#E07060,#C44838)}

/* Boot / loading — before intro */
.boot-screen{
  position:absolute; inset:0; z-index:90;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:18px; padding:24px;
  background:#1e0c0e; color:#FFF8F0; text-align:center;
  transition:opacity .3s ease;
}
.boot-screen.is-done{ opacity:0; pointer-events:none; }
.boot-screen.hidden{ display:none; }
.boot-logo{
  width:72px; height:auto;
  image-rendering:pixelated; image-rendering:crisp-edges;
  -ms-interpolation-mode:nearest-neighbor;
}
.boot-bar{
  width:min(70%, 220px); height:14px;
  border:3px solid #C8A046; background:#12080a;
  box-shadow:inset 0 0 0 1px #1A0E08;
  overflow:hidden;
}
.boot-bar-fill{
  height:100%; width:0%;
  background:#7A1E2E;
  box-shadow:inset 0 2px 0 #a84858, inset 0 -2px 0 #4a121c;
  transition:width .15s steps(4);
}
.boot-tip{
  margin:0; max-width:280px;
  font-family:var(--font-pixel); font-size:10px; line-height:1.55;
  color:rgba(255,248,240,.72);
}

/* Title / splash — intro_hands full-bleed (intro only) */
.title-screen{
  position:absolute; inset:0; z-index:80;
  display:flex; flex-direction:column;
  align-items:center; justify-content:space-between;
  padding:
    max(14px, calc(env(safe-area-inset-top) + 10px))
    18px
    max(18px, calc(env(safe-area-inset-bottom) + 14px));
  background:#050304; color:#FFF8F0; text-align:center; overflow:hidden;
  isolation:isolate;
}
.title-screen.is-booting{ visibility:hidden; }
.title-screen.hidden{display:none}
.title-bg-wrap{
  position:absolute; inset:0; z-index:0; overflow:hidden; pointer-events:none;
  background:#050304;
}
.title-bg{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover;
  /* Centre on the fingertip spark (slightly above + left of mid) */
  object-position:46% 42%;
  image-rendering:pixelated; image-rendering:crisp-edges;
  -ms-interpolation-mode:nearest-neighbor;
}
.title-glow{
  position:absolute; left:46%; top:42%;
  width:min(78vw, 340px); height:min(78vw, 340px);
  transform:translate(-50%,-50%);
  pointer-events:none; z-index:1;
  background:radial-gradient(circle,
    rgba(255,214,110,.55) 0%,
    rgba(232,176,64,.28) 28%,
    rgba(180,120,40,.1) 52%,
    transparent 72%);
  animation: titleGlowPulse 3s ease-in-out infinite;
  mix-blend-mode:screen;
}
@keyframes titleGlowPulse{
  0%,100%{ opacity:.6; transform:translate(-50%,-50%) scale(1); }
  50%{ opacity:1; transform:translate(-50%,-50%) scale(1.05); }
}
.title-glow.is-burst{
  animation: titleGlowBurst .4s ease-out forwards;
}
@keyframes titleGlowBurst{
  from{ opacity:1; transform:translate(-50%,-50%) scale(1); }
  to{ opacity:1; transform:translate(-50%,-50%) scale(1.28); }
}
.title-sparks{
  position:absolute; left:46%; top:42%; width:0; height:0;
  pointer-events:none; z-index:1;
}
.title-spark{
  position:absolute; width:2px; height:2px; background:#F0D070;
  border:0; box-shadow:none; font-size:0; line-height:0;
  animation: titleSparkFloat linear infinite; opacity:0;
}
@keyframes titleSparkFloat{
  0%{ transform:translate(0,0) scale(1); opacity:0; }
  14%{ opacity:.9; }
  100%{ transform:translate(var(--sx), var(--sy)) scale(.35); opacity:0; }
}
.title-vignette{
  position:absolute; inset:0; z-index:2; pointer-events:none;
  /* Smooth dark falloffs — no stepped bands */
  background:
    linear-gradient(180deg,
      rgba(5,3,4,.88) 0%,
      rgba(5,3,4,.55) 14%,
      rgba(5,3,4,.18) 28%,
      transparent 42%),
    linear-gradient(0deg,
      rgba(5,3,4,.9) 0%,
      rgba(5,3,4,.58) 16%,
      rgba(5,3,4,.2) 32%,
      transparent 46%);
}
.title-spark-layer{
  position:absolute; inset:0; z-index:4; pointer-events:none; overflow:hidden;
}
.title-header{
  position:relative; z-index:3; width:100%;
  display:flex; justify-content:center; pointer-events:none;
  padding-top:6px;
}
.title-mark-wrap{
  position:relative;
  width:100px; /* ~5px cells from 95px source */
  animation: titleMarkBob 2s steps(2) infinite;
}
.title-mark{
  width:100%; height:auto; display:block;
  image-rendering:pixelated; image-rendering:crisp-edges;
  -ms-interpolation-mode:nearest-neighbor;
}
.title-mark-spark{
  position:absolute; left:50%; bottom:6%;
  width:6px; height:6px; margin-left:-3px;
  background:#E8C860;
  box-shadow:0 0 0 1px #2A0A10;
  image-rendering:pixelated;
  animation: titleSparkle 3.2s steps(2) infinite;
  pointer-events:none;
}
@keyframes titleMarkBob{
  0%,100%{ transform:translateY(0); }
  50%{ transform:translateY(1px); }
}
@keyframes titleSparkle{
  0%,70%,100%{ opacity:.55; background:#C8A046; }
  78%,88%{ opacity:1; background:#F0E0A0; }
}
.title-footer{
  position:relative; z-index:3; width:100%;
  display:flex; flex-direction:column; align-items:center; gap:14px;
  padding:0 32px max(2px, env(safe-area-inset-bottom));
  box-sizing:border-box;
}
.title-returning{
  display:flex; flex-direction:column; align-items:center; gap:8px;
  margin-bottom:2px;
}
.title-returning.hidden{ display:none; }
.title-returning-av{
  width:56px; height:56px; object-fit:cover; object-position:top;
  border:3px solid #C8A046; background:#1e0c0e;
  image-rendering:auto; box-shadow:2px 2px 0 #050304;
}
.title-returning-line{
  margin:0; max-width:320px;
  font-family:var(--font-pixel); font-size:10px; line-height:1.45;
  color:#FFF8F0; text-shadow:2px 2px 0 #050304;
}
.title-enter{
  width:100%; max-width:320px; min-height:54px; margin:0 auto;
  font-family:var(--font-ui); font-size:clamp(11px, 3.6vw, 14px);
  letter-spacing:.04em; color:#FFF8F0;
  background:#7A1E2E;
  border:4px solid #1A0E08;
  padding:16px 12px; cursor:pointer;
  box-shadow:
    inset -3px -3px 0 #4a121c,
    inset 3px 3px 0 #a84858,
    0 4px 0 #050304;
  -webkit-tap-highlight-color:transparent;
  transition: transform .08s steps(2), box-shadow .08s steps(2), filter .08s steps(2);
}
.title-enter:active, .title-enter.is-pressing{
  transform:translateY(3px);
  filter:brightness(1.14);
  box-shadow:
    inset 3px 3px 0 #4a121c,
    0 1px 0 #050304;
}
.title-brand-name{
  margin:8px 0 0;
  font-family:var(--font-pixel); font-size:18px; line-height:1.35;
  letter-spacing:.08em; color:#FFF8F0;
  text-shadow:2px 2px 0 #050304;
}
@media (max-width:390px){
  .title-brand-name{ font-size:18px; }
}
@media (min-width:391px){
  .title-brand-name{ font-size:20px; }
}
.title-copy{
  margin:0;
  font-family:var(--font-pixel); font-size:8px; line-height:1.4;
  letter-spacing:.04em; color:rgba(255,248,240,.6);
}
@media (prefers-reduced-motion: reduce){
  .title-bg{ animation:none; transform:none; }
  .title-glow{ animation:none; opacity:.8; }
  .title-spark{ animation:none !important; display:none; }
  .title-mark-wrap{ animation:none; }
  .title-mark-spark{ animation:none; opacity:.85; }
  .title-enter{ transition:none; }
}

/* App-wide press + float FX */
button.is-pressing, .btn.is-pressing, .tab.is-pressing, .nav-item.is-pressing,
.choice.is-pressing, .quiz-choice.is-pressing{
  transform:translateY(2px) !important;
  filter:brightness(1.06);
}
.fx-spark{
  position:absolute; width:4px; height:4px; background:#E8C878;
  animation: fxSparkPop .4s ease-out forwards; pointer-events:none;
}
@keyframes fxSparkPop{
  0%{ opacity:1; transform:translateY(0) scale(1); }
  100%{ opacity:0; transform:translateY(-14px) scale(.5); }
}
.fx-float{
  position:fixed; z-index:300; pointer-events:none;
  font-family:var(--font-pixel); font-size:12px; color:#6AA84F;
  text-shadow:1px 1px 0 #0A0604;
  animation: fxFloatUp .85s ease-out forwards;
}
.fx-float.bad{ color:#E07060; }
@keyframes fxFloatUp{
  from{ opacity:1; transform:translateY(0); }
  to{ opacity:0; transform:translateY(-28px); }
}
.fx-dissolve-canvas{ image-rendering:pixelated; image-rendering:crisp-edges; }
.quiz-choice.correct, .choice.correct{ box-shadow: inset 0 0 0 999px rgba(106,168,79,.18); }
.quiz-choice.wrong, .choice.wrong{ box-shadow: inset 0 0 0 999px rgba(196,72,56,.2); }
.xp-bar>i{ transition: width .45s ease; }
.xp-bar.has-sparkle::after{
  content:""; position:absolute; right:0; top:-2px; width:6px; height:6px;
  background:#E8C878; animation: fxSparkPop .5s ease-out;
}
.screen{ transition: opacity .3s ease; }
.badge-earn{ animation: badgeFlip .55s ease; }
@keyframes badgeFlip{
  from{ transform:rotateY(90deg); filter:brightness(1.4); }
  to{ transform:rotateY(0); filter:brightness(1); }
}
.lvl-banner-in{ animation: lvlSlide .45s ease; }
@keyframes lvlSlide{
  from{ transform:translateY(-12px); opacity:0; }
  to{ transform:translateY(0); opacity:1; }
}

/* Hide clinic chrome until check-in / continue */
#app.app-gated .hud,
#app.app-gated #bottom-nav,
#app.app-gated .screen{
  visibility:hidden !important; pointer-events:none !important;
}

/* Staff treatment card — full-screen gate (no map behind) */
.treatment-screen{
  position:absolute; inset:0; z-index:70;
  display:flex; align-items:flex-start; justify-content:center;
  padding:max(12px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  overflow:auto; -webkit-overflow-scrolling:touch;
}
.treatment-screen.hidden{display:none}
.treatment-bg{
  position:fixed; inset:0; z-index:0; pointer-events:none;
  background:
    linear-gradient(0deg, rgba(30,12,14,.6), rgba(30,12,14,.6)),
    url('../assets/intro/intro_hands.jpg') center 42%/cover no-repeat;
  image-rendering:pixelated;
}
.treatment-card{
  position:relative; z-index:1; width:100%; max-width:360px;
  margin:12px auto 24px; padding:0 0 14px;
  background:#F4EBDD; color:#2A0A10;
  border:3px solid #2A0A10;
  box-shadow:4px 4px 0 #2A0A10;
  font-family:var(--font-pixel);
}
.treatment-clip{
  position:absolute; left:50%; top:-10px; width:48px; height:18px;
  margin-left:-24px; background:#7A1E2E; border:3px solid #2A0A10;
  box-shadow:inset 0 -2px 0 #4a121c;
  z-index:2;
}
.treatment-clip::after{
  content:""; position:absolute; left:50%; top:14px; width:10px; height:10px;
  margin-left:-5px; background:#C8A046; border:2px solid #2A0A10; border-radius:0;
}
.treatment-header{
  display:flex; align-items:center; gap:8px;
  background:#7A1E2E; color:#F4EBDD;
  border-bottom:3px solid #2A0A10;
  padding:8px 10px 8px 8px; margin-top:8px;
}
.treatment-logo{
  width:36px; height:auto; flex-shrink:0;
  image-rendering:pixelated; image-rendering:crisp-edges;
}
.treatment-header-title{
  font-size:10px; line-height:1.35; letter-spacing:.04em;
}
.treatment-body{
  position:relative; display:grid;
  grid-template-columns:84px 1fr; gap:10px 12px;
  padding:14px 12px 10px;
}
.treatment-photo{
  grid-row:1 / span 2; position:relative;
  width:84px; border:3px solid #2A0A10; background:#E8DFD2;
  padding:4px 4px 6px; text-align:center;
}
.treatment-photo-label{
  display:block; font-size:8px; color:#5a3a2a; margin-bottom:2px;
}
.treatment-photo-canvas{
  width:72px; height:72px; display:block; margin:0 auto;
  image-rendering:pixelated; background:#1e0c0e;
}
.treatment-photo-cycle{
  margin-top:4px; width:100%; min-height:26px;
  font-family:var(--font-pixel); font-size:12px;
  background:#F4EBDD; border:2px solid #2A0A10; color:#2A0A10; cursor:pointer;
}
.treatment-fields{ display:flex; flex-direction:column; gap:10px; min-width:0; }
.treatment-row{
  display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 6px;
  font-size:9px; line-height:1.4;
}
.treatment-key{ color:#5a2a30; letter-spacing:.06em; flex-shrink:0; }
.treatment-val{ color:#2A0A10; border-bottom:2px dotted #7A1E2E; flex:1; min-width:0; padding-bottom:2px; }
.treatment-line{
  flex:1; min-width:0; min-height:28px; font-size:16px;
  font-family:var(--font-body); color:#2A0A10;
  background:transparent; border:none; border-bottom:2px solid #2A0A10;
  border-radius:0; padding:4px 2px; outline:none;
}
.treatment-select{
  appearance:none; -webkit-appearance:none;
  background:transparent; cursor:pointer;
}
.treatment-stamp-new{
  position:absolute; right:8px; bottom:8px;
  font-size:11px; color:#C44838; border:3px solid #C44838;
  padding:3px 6px; transform:rotate(-12deg);
  background:rgba(244,235,221,.85); letter-spacing:.08em;
  pointer-events:none;
}
.treatment-stamp-approved{
  position:absolute; left:50%; top:42%;
  transform:translate(-50%,-50%) rotate(-8deg) scale(.2);
  font-size:16px; color:#2E7D4F; border:4px solid #2E7D4F;
  padding:6px 10px; letter-spacing:.1em;
  background:rgba(244,235,221,.92); pointer-events:none;
  opacity:0; z-index:3;
}
.treatment-stamp-approved.is-on{
  opacity:1;
  animation: tcApproved 280ms steps(2) forwards;
}
.treatment-stamp-approved.hidden{ display:none; }
@keyframes tcApproved{
  0%{ transform:translate(-50%,-50%) rotate(-8deg) scale(.2); opacity:0; }
  50%{ transform:translate(-50%,-50%) rotate(-8deg) scale(1.15); opacity:1; }
  100%{ transform:translate(-50%,-50%) rotate(-8deg) scale(1); opacity:1; }
}
.treatment-error{
  margin:0 12px 8px; font-size:9px; color:#7A1E2E; text-align:center;
}
.treatment-error.hidden{display:none}
.treatment-checkin{
  display:block; width:calc(100% - 24px); max-width:none; margin:4px 12px 0;
}
.treatment-note{
  margin:8px 12px 0; font-size:8px; text-align:center; color:rgba(42,10,16,.55);
}
@media (max-width:390px){
  .treatment-body{ grid-template-columns:76px 1fr; }
  .treatment-photo{ width:76px; }
  .treatment-photo-canvas{ width:64px; height:64px; }
  .treatment-header-title{ font-size:9px; }
}

/* Auth screen — legacy / unused gate */
.auth-screen{
  position:absolute; inset:0; z-index:55; display:flex; align-items:center; justify-content:center;
  padding:20px 16px; background:rgba(26,16,12,.72);
}
.auth-screen.hidden{display:none}
.auth-card{ width:100%; max-width:360px; max-height:92vh; overflow:auto; }
.auth-tabs{
  display:flex; gap:6px; margin:10px 0 14px; padding:4px;
  background:#E8DCC8; border-radius:10px; border:2px solid #2A1C14;
}
.auth-tab{
  flex:1; min-height:40px; border:none; border-radius:8px; background:transparent;
  color:#2A1C14; font-weight:700; font-size:13px; cursor:pointer;
}
.auth-tab.active{
  background:#7a2630; color:#FFF9F2 !important;
}
.auth-card input[type="email"],
.auth-card input[type="password"]{
  width:100%; box-sizing:border-box; margin:0 0 10px;
  padding:12px 12px; font-size:16px; border-radius:10px;
  border:2px solid #2A1C14; background:#FFFCF5; color:#2A1C14;
}
.auth-error{
  color:#7a2630; font-weight:700; font-size:13px; margin:0 0 10px; min-height:1.2em;
}
.auth-error.hidden{display:none}
.auth-link{
  display:block; width:100%; margin:0 0 12px; padding:0; border:none; background:none;
  color:#7a2630; font-weight:700; font-size:13px; text-align:left; text-decoration:underline;
  cursor:pointer;
}
.auth-code-box{
  background:#FFFCF5; border:2px solid #7a2630; border-radius:12px;
  padding:12px; margin:10px 0 14px; text-align:center;
}
.auth-code-label{ font-size:11px; font-weight:700; color:#5a4638; letter-spacing:0.04em; text-transform:uppercase; }
.auth-code{
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:28px; font-weight:800; letter-spacing:0.18em; color:#7a2630; margin:6px 0;
}
#btn-auth-signin, #btn-auth-create, #btn-auth-send-recovery, #btn-auth-reset, #btn-auth-goto-reset, #btn-auth-reenter{
  margin-top:4px;
}

.uk-dialog .uk-text{text-transform:none !important;}
#screen-map.active,#screen-map{flex:1;min-height:0;}
.screen{display:none;flex-direction:column;flex:1;min-height:0;}
.screen.active{display:flex;}


/* demo phone polish */
#screen-map.active{display:flex;flex-direction:column;min-height:0;flex:1}
.map-wrap{flex:1;min-height:0;position:relative}
#clinic-canvas{width:100%!important;height:100%!important;display:block}
.map-prompt{border-radius:8px;background:#5C3A24;border-color:#1A0E08;color:#eee9e2}
.uk-dialog{z-index:40}
.choice{font-size:14px;line-height:1.35;padding:12px 10px}
#quiz-prompt,.prompt-text{font-size:15px;line-height:1.4;color:var(--dialog-ink,#39271d)}


/* Map dialog open/close */
#map-dialog{display:none; pointer-events:none}
#map-dialog.open{display:block; pointer-events:none}
#map-dialog.open .dlg-skip,
#map-dialog.open .uk-dialog-inner{pointer-events:auto}
#map-dialog .dlg-skip{display:none}
#map-dialog.open .dlg-skip{display:block}
#quiz-dialog{display:block}
#screen-quiz:not(.active) #quiz-dialog{display:none}

/* force hide inactive map */
#screen-map:not(.active){display:none!important}
#screen-quiz.active,#screen-station.active,#screen-boss.active,#screen-reward.active,#screen-mini.active{display:flex;flex-direction:column;flex:1;min-height:0;background:#1A100C}


/* johnson-pass polish */
body.dialog-open #map-prompt,
body.dialog-open .map-prompt { display:none !important; }
body.dialog-open #joystick,
body.dialog-open #btn-map-action { visibility:hidden !important; pointer-events:none !important; }

#map-dialog .uk-dialog-inner {
  min-height: 132px;
  padding: 20px 14px 18px 40%;
}
#map-dialog .uk-text {
  max-height: none;
  overflow: visible;
}

/* Quiz: cream panel + dark ink, compact fill */
#screen-quiz {
  background: #1A100C;
}
#screen-quiz #quiz-scroll {
  padding: 8px 12px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
#screen-quiz #quiz-scroll > .pixel-box {
  background: #f3ebe0 !important;
  border: 3px solid #2A1C14 !important;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 #fff8e7, 0 3px 0 #1A0E08 !important;
  padding: 12px;
  margin: 0;
  flex: 1 0 auto;
}
#screen-quiz .q-progress {
  color: #E8C878;
  margin: 0 0 2px;
}
#screen-quiz #quiz-prompt,
#screen-quiz .prompt-text {
  color: #2A1C14 !important;
  font-family: var(--font-body), Inter, system-ui, sans-serif !important;
  font-size: 16px !important;
  line-height: 1.4 !important;
  font-weight: 600;
  margin: 4px 0 10px;
}
#screen-quiz .choice {
  background: #fff8e7 !important;
  color: #2A1C14 !important;
  border: 3px solid #2A1C14 !important;
  border-radius: 10px;
  box-shadow: 0 2px 0 #1A0E08 !important;
  margin: 6px 0;
  padding: 12px 10px;
  font-size: 14px;
  line-height: 1.35;
}
#screen-quiz .choice.correct {
  background: #c8f0c8 !important;
  border-color: #1a7a3a !important;
  color: #0d3d1c !important;
}
#screen-quiz .choice.wrong {
  background: #f5c4c4 !important;
  border-color: #a33 !important;
  color: #5a1010 !important;
}
#screen-quiz #quiz-feedback {
  background: #f3ebe0 !important;
  border: 3px solid #2A1C14 !important;
  color: #2A1C14 !important;
  font-family: var(--font-body), Inter, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  padding: 10px;
  margin: 0;
}
#screen-quiz #quiz-feedback.ok {
  background: #d4f5d4 !important;
  border-color: #1a7a3a !important;
  color: #0d3d1c !important;
}
#screen-quiz #quiz-feedback.bad {
  background: #f8d0d0 !important;
  border-color: #a33 !important;
  color: #5a1010 !important;
}
#screen-quiz #quiz-source {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: #6a5a4a;
  font-family: var(--font-body), system-ui, sans-serif;
}
#screen-quiz #quiz-source .chip { display: none !important; }
#screen-quiz #quiz-dialog {
  flex-shrink: 0;
  background: transparent;
  padding: 0 8px 6px;
  margin-top: auto;
}
#screen-quiz #quiz-dialog .uk-dialog-inner {
  min-height: 72px;
  padding: 14px 12px 12px 36%;
}
#screen-quiz .choice { margin: 4px 0; padding: 10px 10px; }
#screen-quiz #quiz-prompt, #screen-quiz .prompt-text { margin: 2px 0 6px; font-size: 15px !important; }
#app:has(#screen-quiz.active) .bottom-nav,
#app:has(#screen-reward.active) .bottom-nav,
#app:has(#screen-station.active) .bottom-nav { display: none !important; }

#screen-quiz #quiz-dialog .uk-portrait {
  background: transparent !important;
  border: none !important;
  box-shadow: none;
  filter: drop-shadow(2px 3px 0 rgba(26,14,8,.35));
}
#screen-quiz #btn-quiz-next {
  margin: 4px 0 0;
}

/* Transparent portraits everywhere */
.uk-portrait {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}


/* persist-onboard-board */
.demo-banner{
  display:inline-block; background:#7a2630; color:#eee9e2;
  font-family:var(--font-pixel); font-size:10px; letter-spacing:1px;
  padding:4px 8px; border-radius:6px; margin:0 0 8px;
}
.onboard, .welcome-back{
  position:fixed; inset:0; z-index:80; background:rgba(26,16,12,.92);
  display:flex; align-items:center; justify-content:center; padding:16px;
}
.onboard.hidden, .welcome-back.hidden{display:none!important}
.onboard-card{
  width:100%; max-width:360px; max-height:92vh; overflow:auto;
  background:linear-gradient(180deg,#f3ebe0,#e8dfd2);
  border:3px solid #2A1C14; border-radius:16px; padding:18px 16px 16px;
  box-shadow:0 8px 0 #1A0E08; color:#2A1C14;
}
.onboard-card h1{font-family:var(--font-body), Inter, system-ui, sans-serif; font-size:22px; font-weight:800; margin:6px 0 8px; color:#7a2630; letter-spacing:0}
.onboard-lead{font-size:14px; line-height:1.4; margin:0 0 12px; color:#4a3a2a}
.onboard-label{display:block; font-size:12px; font-weight:700; margin:10px 0 4px}
.onboard-card input{
  width:100%; padding:12px; border:3px solid #2A1C14; border-radius:10px;
  font-size:16px; background:#fff8e7; color:#2A1C14; box-sizing:border-box;
}
.role-grid{display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:14px}
.role-grid button{
  padding:12px 8px; border:3px solid #2A1C14; border-radius:10px;
  background:#fff8e7; color:#2A1C14; font-size:13px; font-weight:600; cursor:pointer;
}
.role-grid button.active{background:#7a2630; color:#eee9e2; border-color:#3a1218}
.ob-preview{
  display:block; margin:8px auto 12px; image-rendering:auto; -ms-interpolation-mode:bicubic;
  background:transparent; border:3px solid #2A1C14; border-radius:12px;
  background-image:linear-gradient(45deg,#e8dfd2 25%,transparent 25%),linear-gradient(-45deg,#e8dfd2 25%,transparent 25%);
  background-size:12px 12px;
}
.ob-controls{display:flex; flex-direction:column; gap:8px}
.ob-controls .btn, .ob-row .btn{width:100%; margin:0}
.ob-row{display:flex; gap:8px; margin-top:12px}
.ob-row .btn{flex:1}
.onboard-note{font-size:11px; color:#6a5a4a; text-align:center; margin:8px 0}
.onboard-badge{
  display:inline-block; background:#C8A046; color:#2A1C14;
  font-family:var(--font-pixel); font-size:9px; padding:3px 6px; border-radius:4px;
}
.seg-toggle{display:flex; gap:0; margin:8px 0 10px; border:3px solid #2A1C14; border-radius:10px; overflow:hidden}
.seg-toggle button{
  flex:1; padding:10px; border:none; background:#f3ebe0; color:#2A1C14;
  font-family:var(--font-pixel); font-size:10px; cursor:pointer;
}
.seg-toggle button.active{background:#7a2630; color:#eee9e2}
.lb-row{
  display:flex; align-items:center; gap:10px; padding:10px;
  border:3px solid #2A1C14; margin:8px 0; background:#f3ebe0; color:#2A1C14;
  border-radius:12px;
}
.lb-row.you{background:#f8e8b0; box-shadow:inset 0 0 0 2px #C8A046}
.lb-row.gold{background:linear-gradient(180deg,#ffe9a8,#f0d078)}
.lb-row.silver{background:linear-gradient(180deg,#ececec,#d0d0d0)}
.lb-row.bronze{background:linear-gradient(180deg,#f0d0b0,#d4a574)}
.lb-rank{font-family:var(--font-pixel); font-size:14px; width:28px; color:#7a2630}
.lb-av{width:40px;height:40px;image-rendering:auto;border-radius:8px;background:transparent}
.lb-meta{font-size:12px; color:#5a4a3a}
.lb-badges{display:flex; gap:4px; margin-top:4px}
.lb-badges span{
  font-size:10px; background:#7a2630; color:#eee9e2; padding:2px 5px; border-radius:4px;
  font-family:var(--font-pixel);
}
.mgr-card{
  background:#f3ebe0; border:3px solid #2A1C14; border-radius:12px;
  padding:12px; margin:8px 0; color:#2A1C14; cursor:pointer;
}
.mgr-card:active{transform:scale(0.99)}
.mgr-card .mgr-top{display:flex; justify-content:space-between; gap:8px; align-items:flex-start}
.mgr-card .mgr-stats{font-size:12px; color:#5a4a3a; margin-top:6px; line-height:1.45}
.mgr-bar{height:8px; background:#d8cfc2; border-radius:4px; margin-top:8px; overflow:hidden}
.mgr-bar>i{display:block; height:100%; background:#7a2630}
.mgr-lesson{
  display:flex; justify-content:space-between; gap:8px; padding:8px 0;
  border-bottom:1px solid #d8cfc2; font-size:13px;
}
.mgr-lesson:last-child{border-bottom:none}
.tag-done{color:#1a7a3a; font-weight:700}
.tag-ns{color:#8a6a4a}
#screen-manager .pixel-box, #screen-board .pixel-box{
  background:#f3ebe0!important; color:#2A1C14!important; border-color:#2A1C14!important;
}
#screen-manager h1, #screen-board h1, #screen-weeks h1{color:#eee9e2}
#screen-manager h2, #screen-board h2{color:#E8C878; font-size:14px}
#hud-avatar-img{background:transparent}

#board-toggle button{
  color:#2A1C14; background:#F3EBE0; border:2px solid #7a2630; font-family:var(--font-pixel); font-size:10px; padding:8px 10px;
}
#board-toggle button.active{ background:#7a2630; color:#eee9e2; }

.ob-cycle-row{display:flex; align-items:center; gap:6px; margin:6px 0;}
.ob-cycle-row .ob-arrow{
  flex:0 0 40px; width:40px; height:40px; padding:0; margin:0;
  font-size:16px; line-height:1; color:#2A1C14 !important;
  background:linear-gradient(180deg,#F3EBE0,#E8DCC8)!important;
  border:3px solid #7a2630!important; border-radius:10px;
  box-shadow:inset 0 2px 0 #fff8e7, 0 2px 0 #3a1218!important;
  font-family:var(--font-pixel);
}
.ob-cycle-row .ob-label{
  flex:1; text-align:center; padding:10px 8px; margin:0;
  font-family:var(--font-pixel); font-size:11px; color:#2A1C14;
  background:#F3EBE0; border:3px solid #7a2630; border-radius:10px;
}
.reward-coach{display:flex; flex-direction:column; align-items:center; gap:8px; margin:16px 0 8px;}
.reward-coach img{width:140px; height:140px; object-fit:contain; image-rendering:auto; -ms-interpolation-mode:bicubic;}
.reward-coach p{font-size:14px; color:#eee9e2; max-width:280px; margin:0; line-height:1.4;}
.reward-actions{display:flex; flex-direction:column; gap:8px; width:100%; max-width:280px; margin:12px auto 0;}
.lb-av{width:40px;height:40px;border-radius:8px;object-fit:cover;image-rendering:auto;-ms-interpolation-mode:bicubic;border:2px solid #2A1C14;background:#F3EBE0;flex-shrink:0}

/* chip contrast fix */
.chip{
  background:#F3EBE0 !important;
  color:#2A1C14 !important;
  border:2px solid #7a2630 !important;
}
.chip.clinic{ background:#7a2630 !important; color:#eee9e2 !important; border-color:#3a1218 !important; }
.chip.inactive{
  background:#E5D9C8 !important;
  color:#5a4a3a !important;
  border:2px solid #8a7a6a !important;
  font-size:9px;
}

/* —— Static map (no joystick) —— */
.map-stage{position:relative;flex:1;min-height:0;overflow:hidden;background:#E8DFD2}
#clinic-canvas{display:block;width:100%;touch-action:none}
.joy-zone,.joystick{display:none!important}

.how-btn{width:32px;height:32px;border-radius:50%;border:2px solid #2A1C14;background:#F5F0E4;color:#2A1C14;font-weight:800;font-size:16px;line-height:1;padding:0}
.how-box h2{margin:0 0 6px;font-size:14px;color:#7a2630}
.how-list{margin:0;padding-left:18px;font-size:13px;line-height:1.55;color:#2A1C14}
.how-list b{color:#7a2630}
.how-p{margin:0;font-size:13px;line-height:1.45;color:#2A1C14}
.btn.small{padding:6px 10px;font-size:12px}

.xp-breakdown{margin:10px 0;font-size:13px;line-height:1.5;text-align:left}
.xp-breakdown .xp-row{display:flex;justify-content:space-between;gap:8px;padding:2px 0;border-bottom:1px dashed rgba(42,28,20,.15)}
.xp-breakdown .xp-total{font-weight:800;margin-top:6px;color:#7a2630}

.modal{position:fixed;inset:0;background:rgba(20,12,8,.55);display:flex;align-items:center;justify-content:center;z-index:80;padding:24px}
.modal.hidden{display:none}
.modal-card{max-width:320px;width:100%;text-align:center;background:#F5F0E4;color:#2A1C14}
.lvl-badge{display:inline-block;background:#7a2630;color:#F5F0E4;font-size:11px;font-weight:800;letter-spacing:.08em;padding:4px 10px;border-radius:999px}
.lvl-num{font-size:42px;font-weight:900;margin:8px 0 0;color:#7a2630}
.lvl-name{font-size:18px;font-weight:800;margin-bottom:8px}

.board-row{display:flex;align-items:center;gap:8px;padding:8px;margin:6px 0;background:rgba(255,252,245,.92);border:2px solid #2A1C14;border-radius:8px;color:#2A1C14;font-size:12px}
.board-row.top{background:linear-gradient(180deg,#FFF6D8,#F5E6B8);border-color:#8B5A2B}
.board-row .rank{width:22px;font-weight:800}
.board-row .av{width:36px;height:36px;border-radius:50%;object-fit:cover;background:#ddd;border:2px solid #2A1C14}
.board-row .meta{flex:1;min-width:0}
.board-row .meta b{display:block;font-size:13px}
.board-row .badges{display:flex;flex-wrap:wrap;gap:3px;margin-top:2px}
.board-row .badge{font-size:9px;background:#7a2630;color:#F5F0E4;padding:1px 5px;border-radius:999px}
.board-row .xp{font-weight:800;white-space:nowrap}
.board-you{position:sticky;bottom:0;padding-top:6px;background:linear-gradient(180deg,transparent,#E8DFD2 30%)}
.board-you .board-row{border-color:#7a2630;box-shadow:0 0 0 2px rgba(122,38,48,.2)}
.demo-tag{font-size:9px;color:#FFF9F2;font-weight:800;background:#7a2630;padding:2px 6px;border-radius:6px}

/* Me / profile */
.me-header{display:flex;gap:12px;align-items:center}
.me-header canvas,.me-header img.me-av{width:96px;height:96px;border-radius:12px;border:3px solid #2A1C14;background:#1a1210;image-rendering:auto}
.me-header .me-info{flex:1;min-width:0}
.me-header .me-info h1{margin:0 0 4px;font-size:18px}
.me-meta{font-size:12px;color:var(--muted);margin:2px 0}
.me-badges{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
.me-badges .badge{font-size:10px;background:#7a2630;color:#F5F0E4;padding:2px 7px;border-radius:999px}
.me-hist-row{display:block;width:100%;text-align:left;border:2px solid #2A1C14;border-radius:8px;background:#FFFCF5;color:#2A1C14;padding:10px;margin:8px 0;cursor:pointer;font:inherit}
.me-hist-row:active{background:#F3E6C8}
.me-hist-row b{display:block;font-size:13px}
.me-hist-row span{font-size:11px;color:#5a4638}
.me-check li{font-size:13px;margin:4px 0;list-style:none}
.me-ans{padding:8px;margin:6px 0;border-radius:8px;border:2px solid #2A1C14;font-size:12px}
.me-ans.ok{background:#E4F0E2}
.me-ans.bad{background:#F5E0E0}
.board-row .av-fallback{width:36px;height:36px;border-radius:50%;background:#7a2630;border:2px solid #2A1C14;flex-shrink:0}
.me-ans,.me-ans b,.me-ans div{color:#2A1C14 !important}
.me-hist-row,.me-hist-row b,.me-hist-row span{color:#2A1C14}
.me-check li{color:#2A1C14}
#me-detail-body h1,#me-detail-body h2{color:var(--pale,#F5F0E4)}
#me-detail-body .me-meta{color:#D9C9B4}

/* === demo polish: crisp soft art + WCAG contrast (Nov 2) === */
#clinic-canvas{
  image-rendering: auto !important;
  -ms-interpolation-mode: bicubic;
}
.dialog img.guide,
.station-hero img,
.uk-portrait,
.lb-av,
.hud-avatar img,
.me-header canvas,
.me-header img.me-av{
  image-rendering: auto !important;
  -ms-interpolation-mode: bicubic;
}

/* Station / lesson header — cream card, dark readable ink */
#screen-station .station-hero.pixel-box{
  background: linear-gradient(180deg,#FFFCF5,#F3EBE0) !important;
  border: 3px solid #2A1C14 !important;
  border-radius: 14px;
  box-shadow: 0 4px 0 rgba(26,14,8,.35), inset 0 1px 0 #fff !important;
  padding: 12px 14px;
  gap: 12px;
}
#screen-station .station-hero img{
  width: 64px; height: 64px; border-radius: 10px;
  object-fit: contain; background: transparent;
  filter: drop-shadow(1px 2px 0 rgba(26,14,8,.25));
}
#screen-station #station-title{
  font-family: var(--font-body), Inter, system-ui, sans-serif !important;
  font-size: 18px !important; font-weight: 800; color: #2A1C14 !important;
  letter-spacing: 0; line-height: 1.25; margin: 0 0 4px;
}
#screen-station #station-meta{ color: #5a4638; font-size: 12px; }
#screen-station #station-blurb{ color: #F5F0E4 !important; }

/* Dark panels: force near-white text */
.pixel-box{ color: #F5F0E4; }
.pixel-box h1, .pixel-box h2, .pixel-box h3{ color: #FFF9F2; }
.lb-row{ color: #FFF9F2; }
.lb-row .lb-meta, .lb-meta{ color: #E8DCC8 !important; }
.lb-row.you{ color: #FFF9F2; }
.bottom-nav button{ color: #D9C9B4; }
.bottom-nav button.active{ color: #FFF9F2 !important; }
.hud-stat, .hud-lvl{ color: #FFF9F2 !important; }
.toast{ color: #FFF9F2 !important; }
.reward-screen, .reward-stats{ color: #FFF9F2; }
.q-progress{ color: #F0D78A !important; }
.boss-label{ color: #FFD0C8 !important; }

/* Cream / light surfaces keep dark ink */
.how-box, .how-box *{ color: #2A1C14; }
.how-box h2, .how-list b{ color: #7a2630 !important; }
.lvl-name, .lvl-num{ color: #7a2630 !important; }
#levelup-modal .how-p, #levelup-msg{ color: #2A1C14 !important; }
.lvl-badge{ background:#7a2630; color:#FFF9F2 !important; }

/* Builder / onboard contrast */
.onboard .pixel-box, .welcome-back .pixel-box{
  background: #F3EBE0 !important; color: #2A1C14 !important;
  border-radius: 12px;
}
.onboard label, .onboard .chip, .welcome-back label{ color: #2A1C14; }
.avatar-opt{ background:#FFFCF5; color:#2A1C14; border-radius:10px; }
.avatar-opt.selected{ outline:3px solid #7a2630; }

/* Me profile readability on dark shell */
#screen-me .pixel-box{
  background: #F3EBE0 !important;
  color: #2A1C14 !important;
  border-radius: 12px;
  box-shadow: 0 3px 0 rgba(26,14,8,.3) !important;
}
#screen-me .pixel-box h1,
#screen-me .pixel-box h2,
#screen-me .me-header .me-info h1{ color: #2A1C14 !important; }
#screen-me .me-meta{ color: #5a4638 !important; }
#screen-me .me-badges .badge{ color:#FFF9F2 !important; }

/* Buttons on burgundy: bright text */
.btn, .btn.primary{ color: #FFF9F2 !important; font-weight: 700; }
.btn.secondary{ color: #2A1C14 !important; }
.btn.gold{ color: #3A2208 !important; }

/* Leaderboard light-row overrides from earlier polish */
.lb-row{
  background: #F3EBE0 !important;
  color: #2A1C14 !important;
  border-radius: 10px;
}
.lb-row.you{ background: #f8e8b0 !important; color: #2A1C14 !important; }
.lb-rank{ color: #7a2630 !important; }


/* === contrast / polish pass 2 (Nov 2 Johnson) === */
#screen-mgr .pixel-box,
#screen-weeks .pixel-box,
#screen-board .pixel-box{
  background:#F3EBE0 !important;
  color:#2A1C14 !important;
  border-radius:12px;
}
#screen-mgr h1,#screen-mgr h2,#screen-weeks h1,#screen-weeks h2,
#screen-board h1,#screen-board h2{ color:#2A1C14 !important; }
#screen-mgr p,#screen-weeks p,#screen-board p,
#screen-mgr label,#screen-weeks label{ color:#3A2A1C !important; }
#screen-mgr .chip,#screen-weeks .chip{ color:#2A1C14; }

/* Quiz / boss / reward dark shell: bright readable copy */
#screen-boss .pixel-box,
#screen-reward .pixel-box,
#screen-mini .pixel-box{
  color:#FFF9F2;
}
#screen-quiz .pixel-box{ color:#2A1C14; }
#screen-quiz h1,#screen-quiz h2,
#screen-boss h1,#screen-boss h2,
#screen-reward h1,#screen-reward h2,
#screen-mini h1{ color:#FFF9F2 !important; }
.choice{ color:#1A100C !important; font-weight:600; background:#FFF9F2 !important; }
.choice.selected{ background:#F0C878 !important; color:#1A100C !important; }
.choice.correct{ background:#14532D !important; color:#FFF9F2 !important; }
.choice.wrong{ background:#7F1D1D !important; color:#FFF9F2 !important; }

/* Title / how-it-works / banners */
.title-screen h1,.title-screen h2,.title-tag,.title-sub,.title-line{ color:#FFF9F2 !important; }
.title-screen .btn{ color:#FFF9F2 !important; }
.how-box{ background:#FFFCF5 !important; border-radius:14px; box-shadow:0 6px 24px rgba(0,0,0,.35); }
.how-box h2{ color:#7a2630 !important; }
.how-box .how-p,.how-box li{ color:#2A1C14 !important; }

/* Skip / toast / prompt */
.uk-dialog .dlg-skip{ color:#FFF9F2 !important; background:rgba(26,14,8,.72); }
.map-prompt{ color:#FFF3C8 !important; }
.toast{ background:rgba(26,14,8,.92); color:#FFF9F2 !important; border:2px solid #C8A046; }

/* Week section chips on map already canvas-drawn; soft HUD help */
.theme-toggle, #btn-help, .hud .btn-help{ color:#FFF9F2 !important; }

/* Me history rows on cream */
.me-hist-row{ background:#FFFCF5; border:2px solid #D9CBB8; border-radius:10px; color:#2A1C14; }
.me-hist-row b{ color:#2A1C14; }
.me-hist-row span{ color:#5a4638; }
.me-check li{ color:#2A1C14; font-size:13px; }

/* Gold accent on next room already in canvas; station start CTA */
#screen-station .btn.primary{ letter-spacing:0.02em; }


/* Weeks + Manager readability */
#screen-weeks h1, #screen-manager h1,
#screen-weeks h2, #screen-manager h2{ color:#FFF9F2 !important; }
#screen-weeks .pixel-box, #screen-manager .pixel-box{
  background:#F3EBE0 !important; color:#2A1C14 !important; border-radius:12px;
}
#screen-weeks .pixel-box h2, #screen-manager .pixel-box h2{ color:#7a2630 !important; }
#screen-weeks .pixel-box p, #screen-manager .pixel-box p,
#screen-weeks .pixel-box strong, #screen-manager label span{ color:#2A1C14 !important; }
#screen-weeks > .screen-scroll > p{ color:#E8DCC8 !important; }
#mgr-pin{ background:#FFFCF5 !important; color:#2A1C14 !important; border-color:#7a2630 !important; border-radius:8px; }
.mgr-card{
  background:#F3EBE0; color:#2A1C14; border:3px solid #2A1C14; border-radius:12px;
  padding:12px; margin:8px 0; cursor:pointer;
  box-shadow:0 3px 0 rgba(26,14,8,.25);
}
.mgr-card strong{ color:#2A1C14; }
.mgr-stats{ color:#5a4638; font-size:12px; line-height:1.4; margin:4px 0; }
.mgr-bar{ height:8px; background:#E0D4C4; border-radius:4px; overflow:hidden; margin-top:6px; }
.mgr-bar > i{ display:block; height:100%; background:linear-gradient(90deg,#C8A046,#7a2630); }
.mgr-lesson{ display:flex; justify-content:space-between; gap:8px; padding:6px 0; border-bottom:1px solid #D9CBB8; color:#2A1C14; font-size:13px; }
#screen-manager .demo-banner{ color:#FFF9F2; background:#7a2630; display:inline-block; padding:4px 10px; border-radius:999px; font-size:11px; font-weight:700; }

/* Soften reward burgundy empty bar if present */
#screen-reward .pixel-box{ background:transparent; box-shadow:none; border:none; }

/* Map prompt clear of bottom nav */
#screen-map .map-prompt{
  bottom: 12px !important;
  z-index: 6;
  color: #FFF9F2 !important;
  font-weight: 600;
  letter-spacing: 0.01em;
}
/* Weeks lesson rows cleaner */
#weeks-root .pixel-box > div[style]{
  background: #FFFCF5 !important;
  box-shadow: 0 2px 0 rgba(26,14,8,.12);
}


/* Late polish: quiz progress + title screen + toast */
#quiz-progress, .q-progress{ color:#FFF3C8 !important; font-weight:700; }
.title-screen .title-tag{ color:#F0D78A !important; }
.title-screen p, .title-screen .title-sub{ color:#F5F0E4 !important; }
.toast{ border-radius:10px; padding:10px 14px; font-weight:600; }
#screen-reward h1{ color:#FFF9F2 !important; }
#screen-reward p, #screen-reward .reward-msg{ color:#F5F0E4 !important; }
.seg-toggle button{ color:#2A1C14; }
.seg-toggle button.active{ color:#FFF9F2 !important; background:#7a2630 !important; }
.demo-banner{ color:#FFF9F2 !important; }


/* Board DEMO / inactive chips readable */
.lb-row .chip, .mgr-card .chip{
  font-weight:700;
}
.chip.inactive{
  background:#5a4a3a !important;
  color:#FFF9F2 !important;
  border-color:#2A1C14 !important;
}
.lb-row .chip.demo, .chip.demo{
  background:#7a2630 !important;
  color:#FFF9F2 !important;
}

#screen-board .board-row{
  background:#F3EBE0 !important; color:#2A1C14 !important;
  border:3px solid #2A1C14; border-radius:12px; margin:8px 0; padding:10px;
  display:flex; align-items:center; gap:10px;
}
#screen-board .board-row .rank{ color:#7a2630 !important; font-weight:800; }
#screen-board .board-row .meta, #screen-board .board-row .meta b,
#screen-board .board-row .xp{ color:#2A1C14 !important; }
#screen-board .board-row .badge{
  background:#7a2630; color:#FFF9F2; border-radius:999px; padding:2px 8px; font-size:10px; margin-right:4px;
}
#screen-board h1{ color:#FFF9F2 !important; }
#screen-board #board-week{ color:#E8DCC8 !important; }

/* tap targets late */
.btn{ min-height:44px; }
.bottom-nav button{ min-height:48px; }
.choice{ min-height:44px; padding:12px 14px; }


/* === polish pass 3 (Johnson 4-7) === */
/* Weeks/Manager page titles sit on dark shell — keep near-white; cream cards keep dark ink */
#screen-weeks > .screen-scroll > h1,
#screen-manager > .screen-scroll > h1,
#screen-board > .screen-scroll > h1{ color:#FFF9F2 !important; }
#screen-weeks .pixel-box h1, #screen-weeks .pixel-box h2,
#screen-manager .pixel-box h1, #screen-manager .pixel-box h2,
#screen-board .pixel-box h1, #screen-board .pixel-box h2{ color:#7a2630 !important; }

/* Quiz source sits on cream card — dark ink; feedback uses .ok/.bad rules */
#screen-quiz #quiz-source, #screen-quiz .source-tag{ color:#5a4638 !important; }
#screen-quiz #quiz-prompt, #screen-quiz .prompt-text{ color:#2A1C14 !important; }

/* Station blurb on dark shell */
#screen-station #station-blurb{ color:#F5F0E4 !important; }
#screen-station #station-meta{ color:#5a4638 !important; } /* inside cream hero */

/* Secondary buttons: cream face, dark ink for AA */
.btn.secondary{
  background:linear-gradient(180deg,#FFF9F2,#E8DCC8) !important;
  color:#2A1C14 !important;
  border-color:#2A1C14 !important;
  box-shadow:inset 0 2px 0 #fff, 0 3px 0 #1A0E08 !important;
}
.btn.gold{
  background:linear-gradient(180deg,#F0C878,#C8A046) !important;
  color:#2A1C14 !important;
}

/* Dialog nameplate: white on burgundy */
.uk-nameplate{ color:#FFF9F2 !important; background:#7a2630 !important; }
.uk-text{ color:#2A1C14 !important; } /* dialog cream face */
.uk-dialog-inner{ background:linear-gradient(180deg,#FFFCF5,#F3EBE0) !important; color:#2A1C14 !important; }

/* Chip inactive readable */
.chip.inactive{ background:#d8cfc2 !important; color:#2A1C14 !important; border-color:#8a7a6a !important; }
.chip.clinic{ color:#FFF9F2 !important; }

/* Modal overlays */
.modal .how-box, #levelup-modal .how-box{ background:#FFFCF5 !important; }
#levelup-modal h2, #levelup-title{ color:#7a2630 !important; }

/* Tap targets */
.bottom-nav button{ min-height:48px; }
.choice{ min-height:44px; padding:12px 14px !important; }

/* Board muted DEMO was fixed; ensure rank # readable */
.lb-row .lb-name{ color:#2A1C14 !important; font-weight:700; }
.lb-row .lb-meta{ color:#5a4638 !important; }


/* === polish pass 4 === */
#screen-quiz .choice.selected{
  background:#F0C878 !important;
  border-color:#8B5A2B !important;
  color:#1A100C !important;
  box-shadow:0 0 0 2px #C8A046, 0 2px 0 #1A0E08 !important;
}
#board-week, #screen-board .screen-scroll > p{
  color:#E8DCC8 !important;
}
/* Station hero tighter */
#screen-station .station-hero.pixel-box{ align-items:center; }
#screen-station #station-meta{ font-weight:600; }


/* === polish pass 5 === */
#screen-how h1{ color:#FFF9F2 !important; }
#screen-how .how-box{
  background:#FFFCF5 !important; color:#2A1C14 !important;
  border-radius:14px; box-shadow:0 3px 0 rgba(26,14,8,.3) !important;
}
#screen-how .how-box h2{ color:#7a2630 !important; }
#screen-how .how-list, #screen-how .how-p, #screen-how li{ color:#2A1C14 !important; }
#screen-how .how-list b{ color:#7a2630 !important; }

#levelup-modal .modal-card, #levelup-modal .pixel-box{
  background:#FFFCF5 !important; color:#2A1C14 !important;
  border-radius:16px; border:3px solid #2A1C14 !important;
  box-shadow:0 8px 28px rgba(0,0,0,.45) !important;
}
#levelup-modal .lvl-name{ color:#7a2630 !important; font-weight:800; }
#levelup-modal .lvl-num{ color:#2A1C14 !important; }
#levelup-msg{ color:#2A1C14 !important; }

/* Weeks lesson rows: ensure START/REPLAY white on burgundy */
#screen-weeks .btn, #screen-weeks button.btn{ color:#FFF9F2 !important; }
#screen-weeks .btn.secondary, #screen-weeks .done-tag{
  color:#2A1C14 !important; background:#FFF9F2 !important;
}

/* Builder preview canvas crisp */
#builder-preview, #av-preview, canvas.av-preview{
  image-rendering:auto; border-radius:12px; background:#F5F0E4;
}


/* === polish pass 6 === */
.dlg-skip, .uk-dialog .dlg-skip, #dlg-skip{
  color:#FFF9F2 !important;
  background:rgba(26,14,8,.78) !important;
  border:2px solid #C8A046; border-radius:8px;
  font-weight:700; padding:6px 10px;
}
/* Focus / tap feedback */
.btn:focus-visible, .choice:focus-visible, .bottom-nav button:focus-visible{
  outline:3px solid #C8A046; outline-offset:2px;
}
/* HUD UK theme chip readable */
.theme-toggle, #btn-theme, .hud-theme{
  color:#FFF9F2 !important; background:#5c1c24 !important;
  border:2px solid #C8A046 !important; border-radius:8px;
}
/* Reward encouragement */
#screen-reward .reward-msg, #reward-msg{ color:#FFF9F2 !important; font-weight:600; }
#screen-reward h1{ color:#FFF9F2 !important; }


/* === polish pass 7 === */
.mgr-card .inactive, .badge-inactive, .tag-inactive{
  background:#5a4638 !important; color:#FFF9F2 !important;
  border-radius:6px; padding:2px 6px; font-size:10px; font-weight:700;
}
#mgr-panel h2, #screen-manager #mgr-panel h2{ color:#FFF9F2 !important; }
#mgr-panel .mgr-card, #mgr-nurses .mgr-card{
  background:#F3EBE0 !important; color:#2A1C14 !important;
}
#mgr-panel label, #mgr-panel .mgr-card *{ color:#2A1C14; }
#mgr-panel .pct{ color:#7a2630 !important; font-weight:800; }


/* === polish pass 8 === */
@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-nav{ padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .hud{ padding-top: max(6px, env(safe-area-inset-top)); }
}
.uk-portrait, .dialog img.guide{
  width: 120px; height: auto; max-height: 220px;
  object-fit: contain; image-rendering: auto;
}
#screen-how .btn.primary{ color:#FFF9F2 !important; }


/* coach soft-crisp */
.dialog img.guide, .uk-portrait, #station-guide, .station-hero img{
  image-rendering: auto !important;
  -ms-interpolation-mode: bicubic;
}


/* === polish pass 9 === */
.onboard-card, .welcome-back-card{
  background:#FFFCF5 !important; color:#2A1C14 !important;
  border-radius:16px; box-shadow:0 8px 28px rgba(0,0,0,.35);
}
.onboard h1, .welcome-back h1{ color:#7a2630 !important; }
.onboard-lead, .onboard-label, .onboard p{ color:#2A1C14 !important; }
.role-grid button{
  background:#F3EBE0; color:#2A1C14; border:2px solid #2A1C14; border-radius:10px;
  min-height:44px; font-weight:700;
}
.role-grid button.selected, .role-grid button[aria-pressed="true"]{
  background:#7a2630; color:#FFF9F2 !important; border-color:#3a1218;
}
.ob-cycle-row .ob-label{ color:#2A1C14 !important; font-weight:600; }
.title-screen .title-line{ color:#FFF9F2 !important; }


/* === polish pass 10 === */
.toast{ z-index:9999; font-weight:700; letter-spacing:0.01em; }
#me-badges:empty::before, .me-badges:empty::before{ content:"No badges yet"; color:#5a4638; }
.week-row, .weeks-lesson{
  background:#FFFCF5; border:2px solid #D9CBB8; border-radius:12px;
  color:#2A1C14; padding:10px 12px; margin:8px 0;
}
.weeks-lesson h3, #screen-weeks h3{ color:#2A1C14 !important; }
.weeks-lesson p{ color:#5a4638 !important; }
#screen-weeks .btn.start, #screen-weeks .btn.primary, #screen-weeks button[data-action="start"]{
  background:#7a2630 !important; color:#FFF9F2 !important;
}


/* === polish pass 11 === */
.bottom-nav button{ color:#E8DCC8 !important; font-weight:700; }
.bottom-nav button.active{ color:#FFF9F2 !important; }
/* Ensure early muted nav rule cannot win */
.bottom-nav button span, .bottom-nav button{ opacity:1; }

/* === polish pass 12 — contrast + crisp avatars === */
.role-grid button.active{
  background:#7a2630 !important; color:#FFF9F2 !important; border-color:#3a1218 !important;
}
.onboard-note, #wb-sub, .welcome-back .onboard-lead{ color:#3A2A1C !important; }
.hud-lvl{ color:#FFF9F2 !important; background:#7a2630 !important; }
.map-prompt, #screen-map .map-prompt{ color:#FFF9F2 !important; text-shadow:0 1px 2px rgba(0,0,0,.45); }
#clinic-canvas, .ob-preview, .me-av, #wb-preview, #ob-preview{
  image-rendering:auto;
}
/* Dialog / quiz dark shells: bright body copy */
.uk-dialog .uk-text, .dialog .bubble, .dialog .txt{ color:#2A1C14 !important; }
#screen-quiz .pixel-box.q-card, #quiz-card{
  background:#FFFCF5 !important; color:#2A1C14 !important;
}
#screen-boss .boss-label, #screen-boss p{ color:#FFD8D0 !important; }
#screen-reward .reward-stats, #reward-stats{ color:#FFF9F2 !important; }
.xp-row, .xp-total{ color:#FFF9F2 !important; }
.xp-total{ font-weight:800; color:#F0D78A !important; }
