:root{
  --amber:#ffb347;
  --amber-hot:#ffdc94;
  --amber-deep:#b76a18;
  --amber-dim:#69400f;
  --vermilion:#cc3a27;
  --vermilion-hot:#f05a42;
  --cyan:#a9e8ff;
  --ink:#0b090d;
  --casing:#1b171f;
  --casing-2:#141117;
  --edge:#4a404e;
  --display:'Dela Gothic One', impact, sans-serif;
  --text:'Chakra Petch', 'Segoe UI', sans-serif;
  --dot:'DotGothic16', monospace;
  --device-w: min(96vw, calc(97vh * 0.797), 660px);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:
    radial-gradient(55% 70% at 16% 22%, rgba(255,168,110,.15), transparent 62%),
    radial-gradient(52% 68% at 84% 72%, rgba(110,200,200,.10), transparent 64%),
    radial-gradient(120% 90% at 50% 8%, #3b2632 0%, #1b121a 46%, #0b080d 100%),
    #09070b;
  color:#f3e7d5;
  font-family:var(--text);
  overflow:hidden;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
button{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent}
button:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
.sprite{position:absolute;width:0;height:0;overflow:hidden}

.stage{
  position:relative;
  min-height:100svh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px;
  isolation:isolate;
}
.stage-glow{
  position:absolute;
  left:50%;top:48%;
  width:min(88vw,1000px);
  aspect-ratio:1;
  transform:translate(-50%,-50%);
  background:radial-gradient(circle, rgba(255,158,74,.26) 0%, rgba(255,120,70,.10) 34%, transparent 66%);
  filter:blur(10px);
  pointer-events:none;
  z-index:-1;
}
.stage-dust{
  position:absolute;inset:0;pointer-events:none;z-index:-1;
  background-image:
    radial-gradient(1.6px 1.6px at 18% 24%, rgba(255,214,160,.45), transparent 60%),
    radial-gradient(1.2px 1.2px at 76% 18%, rgba(255,214,160,.30), transparent 60%),
    radial-gradient(2px 2px at 88% 64%, rgba(169,232,255,.18), transparent 60%),
    radial-gradient(1.4px 1.4px at 12% 76%, rgba(255,214,160,.28), transparent 60%),
    radial-gradient(1.3px 1.3px at 62% 88%, rgba(169,232,255,.15), transparent 60%);
  opacity:.8;
}
.stage-note{
  position:absolute;
  bottom:max(6px, env(safe-area-inset-bottom));
  left:50%;
  transform:translateX(-50%);
  margin:0;
  font-size:9px;
  letter-spacing:.32em;
  color:rgba(255,196,120,.35);
  white-space:nowrap;
  pointer-events:none;
}

/* ---------------- device shell ---------------- */
.device{
  width:var(--device-w);
  aspect-ratio:736 / 923;
  position:relative;
  container-type:inline-size;
  filter:drop-shadow(0 34px 34px rgba(0,0,0,.55)) drop-shadow(0 0 40px rgba(255,132,54,.10));
  touch-action:manipulation;
}
.casing{
  position:absolute;inset:0;
  display:flex;
  flex-direction:column;
  padding:2.4cqw 2.7cqw 2.1cqw;
  border-radius:5.4cqw;
  background:
    linear-gradient(150deg, #3b333f 0%, #26212b 12%, #1a161d 40%, #131017 78%, #211c25 100%);
  border:1px solid #544858;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    inset 0 -2px 0 rgba(0,0,0,.8),
    inset 2px 0 0 rgba(255,255,255,.035),
    inset -3px 0 0 rgba(0,0,0,.45),
    0 0 0 2px #0b090d,
    0 0 0 5px #2b2430,
    0 0 0 6px #0d0b10;
  overflow:hidden;
  isolation:isolate;
}
.casing-grain{
  position:absolute;inset:0;z-index:0;pointer-events:none;opacity:.14;mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  border-radius:inherit;
}
.red-cheek{
  position:absolute;
  z-index:0;
  right:-2.5%;
  top:6%;
  width:9%;
  height:58%;
  transform:skewY(-13deg) rotate(2deg);
  background:
    linear-gradient(90deg, #5e130f 0%, #a32419 16%, #d13a28 44%, #8f1c14 78%, #3f0d0b 100%);
  box-shadow:
    inset 2px 0 0 rgba(255,130,100,.35),
    inset -3px 0 0 rgba(0,0,0,.55),
    0 0 14px rgba(190,44,30,.18);
  border-radius:1.4cqw;
  opacity:.95;
}
.red-cheek span{
  position:absolute;left:20%;top:3%;width:18%;height:94%;
  background:linear-gradient(180deg, rgba(255,190,160,.35), rgba(255,190,160,.02));
  filter:blur(1px);
}
.grille{
  position:absolute;z-index:1;
  top:2.4cqw;right:3.4cqw;
  display:flex;gap:.8cqw;
  transform:skewX(-16deg);
  opacity:.85;
}
.grille i{display:block;width:.7cqw;height:5cqw;background:linear-gradient(#0a080c,#3a323d);border-radius:1cqw;box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}
.screw{
  position:absolute;z-index:4;
  width:2.5cqw;height:2.5cqw;border-radius:50%;
  background:radial-gradient(circle at 35% 30%, #6e6372, #2b2630 42%, #16121a 76%);
  box-shadow:inset 0 -1px 1px rgba(0,0,0,.8), inset 0 1px 1px rgba(255,255,255,.2), 0 0 0 1px #0a080c;
}
.screw::after{
  content:"";position:absolute;left:18%;top:46%;width:64%;height:9%;
  background:#0a080c;border-radius:2px;transform:rotate(-24deg);
  box-shadow:0 1px 0 rgba(255,255,255,.12);
}
.s-tl{top:2.6cqw;left:2.4cqw}
.s-tr{top:2.6cqw;right:2.4cqw}
.s-bl{top:auto;bottom:2.3cqw;left:2.4cqw}
.s-br{top:auto;bottom:2.3cqw;right:2.4cqw}

.nameplate{
  position:relative;z-index:2;
  display:flex;align-items:flex-start;
  height:12.5cqw;
  padding:.8cqw 1.2cqw 0 6.6cqw;
  flex:0 0 auto;
}
.logo{
  margin:0;
  font-family:var(--display);
  font-weight:400;
  font-size:4.9cqw;
  line-height:.9;
  letter-spacing:-.03em;
  color:#f4ead8;
  text-transform:uppercase;
  text-shadow:
    0.52cqw 0.52cqw 0 var(--vermilion),
    0.62cqw 0.62cqw 0 #5b0e0a,
    0 0 1px #000;
  white-space:nowrap;
}
.logo span{display:block;margin-left:5.4cqw;margin-top:.1cqw}
.data-line{
  position:absolute;left:36%;right:13%;top:38%;
  display:flex;align-items:center;gap:0;pointer-events:none;
}
.data-line .dash{
  flex:1;height:1px;
  background:linear-gradient(90deg, rgba(169,232,255,0), rgba(169,232,255,.72) 18%, rgba(169,232,255,.45) 82%, rgba(169,232,255,.1));
  box-shadow:0 0 5px rgba(169,232,255,.4);
}
.data-line .dot{
  width:1.25cqw;height:1.25cqw;border-radius:50%;
  background:var(--amber);
  box-shadow:0 0 1.3cqw rgba(255,170,60,.95), 0 0 4cqw rgba(255,150,40,.5);
  margin-left:1.1cqw;
}
.plate-mark{
  position:absolute;right:15.5cqw;top:2.2cqw;
  font-family:var(--dot);
  font-size:1.18cqw;
  line-height:1.45;
  letter-spacing:.11em;
  color:#8e8390;
  text-align:right;
  opacity:.72;
}

/* ---------------- screen ---------------- */
.screen-frame{
  position:relative;z-index:2;
  width:100%;
  aspect-ratio:1.47;
  flex:0 0 auto;
  padding:2.5cqw;
  border-radius:4.2cqw;
  background:
    linear-gradient(155deg, #47404a 0%, #2a252e 10%, #1a161d 46%, #100d13 100%);
  border:1px solid #5d5262;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.14),
    inset 0 -3px 0 rgba(0,0,0,.8),
    inset 3px 0 0 rgba(0,0,0,.28),
    inset -2px 0 0 rgba(255,255,255,.045),
    0 0 0 2px #0a080c,
    0 6px 16px rgba(0,0,0,.5);
}
.screen{
  position:relative;
  width:100%;height:100%;
  border-radius:2.7cqw;
  overflow:hidden;
  background:#171113;
  box-shadow:
    inset 0 0 0 2px #080607,
    inset 0 0 2.6cqw rgba(0,0,0,.9),
    inset 0 0 8cqw rgba(255,150,60,.08);
}
#scene{
  position:absolute;
  inset:0;
  width:100%;height:100%;
  display:block;
  background:radial-gradient(circle at 40% 35%, #e9b49c, #a8788a 55%, #4b3a52);
  filter:saturate(1.04) contrast(1.015);
  pointer-events:none;
}
.screen-fx{
  position:absolute;inset:0;z-index:12;pointer-events:none;border-radius:inherit;
  background:
    linear-gradient(118deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.02) 18%, transparent 42%),
    radial-gradient(120% 90% at 50% 30%, transparent 54%, rgba(30,10,4,.33) 100%);
  mix-blend-mode:screen;
}
.screen-fx::after{
  content:"";position:absolute;inset:0;
  background:repeating-linear-gradient(180deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px);
  opacity:.35;mix-blend-mode:multiply;
}

/* boot */
.boot{
  position:absolute;inset:0;z-index:40;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:2.1cqw;
  background:
    radial-gradient(circle at 50% 42%, #2a1a10 0%, #120c09 48%, #070506 100%);
  color:var(--amber);
  transition:opacity .7s ease, visibility .7s;
}
.boot::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:repeating-linear-gradient(180deg, rgba(255,170,60,.06) 0 1px, transparent 1px 3px);
}
.boot.hide{opacity:0;visibility:hidden}
.boot-logo{
  font-family:var(--display);
  font-size:5.6cqw;
  letter-spacing:.02em;
  color:var(--amber);
  text-shadow:0 0 2.4cqw rgba(255,165,60,.55), 0.5cqw 0.5cqw 0 #5e2b06;
}
.boot-msg{
  font-family:var(--dot);
  font-size:1.8cqw;
  letter-spacing:.16em;
  color:var(--amber-hot);
  text-align:center;
  padding:0 3cqw;
}
.boot-bar{
  width:52%;height:1.1cqw;
  border:1px solid var(--amber-dim);
  background:#1c1109;
  padding:.18cqw;
  border-radius:1cqw;
}
.boot-bar i{
  display:block;height:100%;width:0%;
  background:repeating-linear-gradient(90deg,var(--amber) 0 3px,#b56b16 3px 4px);
  box-shadow:0 0 1cqw rgba(255,170,60,.65);
  transition:width .45s ease;
}
.boot-sub{
  font-family:var(--dot);
  font-size:1.25cqw;
  letter-spacing:.18em;
  color:rgba(255,196,120,.5);
}

/* hud */
.hud{position:absolute;inset:0;z-index:6;pointer-events:none;display:flex;flex-direction:column}
.hud-top{
  display:flex;align-items:flex-start;justify-content:space-between;
  gap:1.5cqw;
  padding:2.2cqw 2.2cqw 0;
}
.chip{
  display:flex;align-items:center;gap:.9cqw;
  padding:.8cqw 1.4cqw;
  border:1px solid rgba(255,179,71,.36);
  border-radius:2cqw;
  background:linear-gradient(rgba(20,12,8,.78),rgba(9,6,5,.72));
  backdrop-filter:blur(3px);
  font-family:var(--dot);
  font-size:clamp(7.5px,2.0cqw,11px);
  letter-spacing:.06em;
  color:var(--amber-hot);
  text-shadow:0 0 5px rgba(255,150,45,.5);
  box-shadow:0 0 0 1px rgba(0,0,0,.4), inset 0 0 1.2cqw rgba(255,150,45,.10);
  white-space:nowrap;
}
.chip-dot{
  width:.85cqw;height:.85cqw;border-radius:50%;
  background:var(--amber);
  box-shadow:0 0 1cqw rgba(255,170,60,.9);
  animation:pulse 2.4s ease-in-out infinite;
}
.chip-sub{
  color:rgba(255,214,150,.55);
  font-size:clamp(6.5px,1.55cqw,9px);
  letter-spacing:.08em;
}
.hud-right{display:flex;align-items:center;gap:1.2cqw;padding-top:.5cqw}
.bits{
  font-family:var(--dot);
  font-size:clamp(7px,1.65cqw,10px);
  letter-spacing:.1em;
  color:var(--amber);
  text-shadow:0 0 5px rgba(255,150,45,.55);
  padding:.55cqw 1cqw;
  border:1px solid rgba(255,179,71,.25);
  border-radius:1.4cqw;
  background:rgba(12,8,6,.62);
}
.sig{display:flex;align-items:flex-end;gap:.3cqw;height:1.9cqw}
.sig i{display:block;width:.45cqw;background:var(--amber);border-radius:.3cqw;box-shadow:0 0 3px rgba(255,170,60,.7)}
.sig i:nth-child(1){height:35%}
.sig i:nth-child(2){height:55%}
.sig i:nth-child(3){height:78%}
.sig i:nth-child(4){height:100%;opacity:.4}
.user{
  width:2.1cqw;height:2.1cqw;border:1.4px solid rgba(255,179,71,.7);border-radius:50%;
  position:relative;
}
.user::before{content:"";position:absolute;left:50%;top:16%;width:36%;height:36%;transform:translateX(-50%);border-radius:50%;background:var(--amber)}
.user::after{content:"";position:absolute;left:50%;bottom:10%;width:62%;height:42%;transform:translateX(-50%);border-radius:50% 50% 35% 35%;background:var(--amber)}
.hintline{
  position:absolute;left:4%;right:4%;bottom:2.2cqw;
  text-align:center;
  font-family:var(--dot);
  font-size:clamp(7.5px,1.85cqw,11px);
  letter-spacing:.2em;
  color:rgba(255,206,140,.68);
  text-shadow:0 1px 3px rgba(0,0,0,.9);
  transition:opacity .3s;
  white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis;
}
.screen.busy .hintline, .screen.modal-open .hintline{opacity:0}
.toast-zone{
  position:absolute;left:8%;right:8%;bottom:6.5cqw;
  display:flex;flex-direction:column;align-items:center;gap:.8cqw;
}
.toast{
  font-family:var(--dot);
  font-size:clamp(8px,2.0cqw,12px);
  letter-spacing:.07em;
  color:var(--amber-hot);
  text-shadow:0 0 6px rgba(255,150,45,.55);
  background:linear-gradient(rgba(16,10,6,.94),rgba(8,5,4,.9));
  border:1px solid rgba(255,179,71,.55);
  border-radius:1.2cqw;
  padding:.75cqw 1.6cqw;
  box-shadow:0 0 1.6cqw rgba(255,150,45,.18), inset 0 0 1cqw rgba(255,150,45,.08);
  animation:toastIn .28s ease both;
  max-width:100%;
  text-align:center;
}
.toast.warn{color:#ffd0a0;border-color:rgba(240,90,66,.7);box-shadow:0 0 1.6cqw rgba(240,80,50,.22)}
.toast.out{animation:toastOut .3s ease both}

/* training hud */
.train-hud{
  position:absolute;left:3cqw;right:3cqw;bottom:2.6cqw;
  pointer-events:auto;
  border:1px solid rgba(255,179,71,.55);
  border-radius:1.8cqw;
  background:linear-gradient(rgba(17,10,6,.92),rgba(8,5,4,.9));
  box-shadow:0 0 2.4cqw rgba(255,150,45,.18), inset 0 0 1.6cqw rgba(255,150,45,.06);
  padding:1.4cqw 1.8cqw 1.2cqw;
}
.train-top{display:flex;align-items:baseline;justify-content:space-between;gap:1cqw}
.train-title{font-family:var(--display);font-size:clamp(11px,2.7cqw,18px);letter-spacing:.03em;color:var(--amber-hot);text-shadow:0 0 1.4cqw rgba(255,150,45,.5)}
.train-time{font-family:var(--dot);font-size:clamp(8.5px,2.0cqw,13px);color:var(--amber)}
.train-instruction{font-family:var(--dot);font-size:clamp(8px,2.0cqw,12px);letter-spacing:.12em;color:rgba(255,206,140,.85);margin-top:.45cqw}
.train-meter{height:1.2cqw;border:1px solid var(--amber-dim);background:#1c1109;border-radius:1cqw;margin-top:1cqw;overflow:hidden}
.train-meter i{display:block;height:100%;width:0%;background:repeating-linear-gradient(90deg,var(--amber) 0 4px,#a95d13 4px 5px);box-shadow:0 0 1.2cqw rgba(255,170,60,.7);transition:width .18s ease}
.train-bottom{display:flex;align-items:center;justify-content:space-between;margin-top:.9cqw}
.train-score{font-family:var(--dot);font-size:clamp(8px,1.9cqw,12px);color:var(--amber-hot);letter-spacing:.1em}
.train-quit{
  pointer-events:auto;
  font-family:var(--dot);font-size:clamp(8px,1.7cqw,11px);letter-spacing:.1em;
  padding:.6cqw 1.3cqw;border:1px solid rgba(255,179,71,.45);border-radius:1cqw;
  background:rgba(255,150,45,.07);color:var(--amber);cursor:pointer;
}
.train-quit:active{background:rgba(255,150,45,.2)}

/* care tray */
.care-tray{
  position:absolute;left:3.4cqw;right:3.4cqw;bottom:3cqw;
  pointer-events:auto;
  border:1px solid rgba(255,179,71,.55);
  border-radius:1.8cqw;
  background:linear-gradient(rgba(17,10,6,.94),rgba(8,5,4,.92));
  box-shadow:0 0 2.4cqw rgba(255,150,45,.18);
  padding:1.2cqw 1.5cqw 1.5cqw;
}
.tray-head{display:flex;align-items:center;justify-content:space-between;font-family:var(--dot);font-size:clamp(8px,1.9cqw,12px);letter-spacing:.13em;color:var(--amber)}
.tray-head button{border:0;background:none;color:var(--amber);cursor:pointer;padding:.3cqw;display:flex}
.tray-head svg{width:1.8cqw;height:1.8cqw;stroke:currentColor;fill:none;stroke-width:2}
.tray-items{display:grid;grid-template-columns:repeat(3,1fr);gap:1cqw;margin-top:1cqw}
.food{
  border:1px solid rgba(255,179,71,.4);border-radius:1.2cqw;background:rgba(255,150,45,.06);
  padding:.9cqw .5cqw;display:flex;flex-direction:column;gap:.3cqw;cursor:pointer;color:var(--amber-hot);
}
.food b{font-family:var(--dot);font-size:clamp(8px,1.9cqw,12px);letter-spacing:.1em}
.food small{font-family:var(--dot);font-size:clamp(6.5px,1.35cqw,9px);color:rgba(255,206,140,.6);letter-spacing:.06em}
.food:active{background:rgba(255,150,45,.2)}

/* modals */
.modal{
  position:absolute;inset:0;z-index:35;
  display:grid;place-items:center;
  padding:3.4cqw;
  background:rgba(5,3,4,.74);
  backdrop-filter:blur(2.5px);
}
.modal[hidden]{display:none}
.modal-card{
  position:relative;
  width:100%;max-height:100%;
  overflow:auto;
  border:1px solid rgba(255,179,71,.5);
  border-radius:2.2cqw;
  background:
    radial-gradient(120% 100% at 30% 0%, #22160f 0%, #100b0a 50%, #080606 100%);
  box-shadow:0 0 0 1px #000, 0 1.6cqw 5cqw rgba(0,0,0,.6), inset 0 0 4cqw rgba(255,150,45,.06);
  padding:2.8cqw;
  color:#f2e4cf;
}
.modal-card h2{
  margin:.2cqw 0 1.4cqw;
  font-family:var(--display);
  font-weight:400;
  font-size:clamp(16px,3.6cqw,24px);
  line-height:1.05;
  color:var(--amber-hot);
  text-shadow:0 0 2cqw rgba(255,150,45,.35);
}
.modal-x{
  position:absolute;right:1.5cqw;top:1.5cqw;
  width:3cqw;height:3cqw;border:1px solid rgba(255,179,71,.3);border-radius:50%;
  display:grid;place-items:center;background:rgba(0,0,0,.25);color:var(--amber);cursor:pointer;
}
.modal-x svg{width:1.6cqw;height:1.6cqw;stroke:currentColor;fill:none;stroke-width:2}
.help-list{margin:0;padding:0 0 0 1.2cqw;list-style:none;display:flex;flex-direction:column;gap:1.15cqw}
.help-list li{
  position:relative;
  font-size:clamp(8px,2.25cqw,12px);line-height:1.35;color:rgba(244,230,212,.82);
  padding-left:1.6cqw;
}
.help-list li::before{content:"";position:absolute;left:0;top:.55cqw;width:.62cqw;height:.62cqw;background:var(--amber);transform:rotate(45deg);box-shadow:0 0 3px rgba(255,170,60,.6)}
.help-list b{color:var(--amber-hot);font-weight:600;letter-spacing:.02em}
.help-foot{display:flex;align-items:center;justify-content:space-between;gap:1.5cqw;margin-top:2.2cqw;border-top:1px solid rgba(255,179,71,.16);padding-top:1.6cqw}
.help-foot span{font-family:var(--dot);font-size:clamp(6.5px,1.3cqw,9px);color:rgba(255,206,140,.55);letter-spacing:.08em}
.modal-btn{
  border:1px solid rgba(255,179,71,.55);border-radius:1.2cqw;
  background:linear-gradient(rgba(255,170,60,.2),rgba(255,140,30,.07));
  color:var(--amber-hot);font-family:var(--dot);font-size:clamp(8px,1.8cqw,11px);letter-spacing:.1em;
  padding:.9cqw 1.6cqw;cursor:pointer;white-space:nowrap;
}
.modal-btn.ghost{background:rgba(0,0,0,.2);border-color:rgba(255,179,71,.25);color:rgba(255,206,140,.65)}
.modal-btn:active{background:rgba(255,150,45,.28)}

.code-card{padding-top:3.2cqw}
.svc-kicker{font-family:var(--dot);font-size:clamp(6.5px,1.3cqw,9px);letter-spacing:.2em;color:rgba(255,180,70,.55)}
.code-copy{margin:0 0 1.8cqw;font-size:clamp(8px,2.1cqw,12px);line-height:1.4;color:rgba(244,230,212,.7)}
.code-label{display:block;font-family:var(--dot);font-size:clamp(7px,1.55cqw,10px);letter-spacing:.18em;color:var(--amber);margin-bottom:.6cqw}
#codeInput{
  width:100%;
  border:1px solid rgba(255,179,71,.42);
  border-radius:1.2cqw;
  background:
    repeating-linear-gradient(180deg, rgba(255,170,60,.035) 0 1px, transparent 1px 4px),
    #080605;
  color:var(--amber-hot);
  font-family:var(--dot);
  font-size:clamp(14px,3.0cqw,22px);
  letter-spacing:.24em;
  padding:1.3cqw 1.5cqw;
  outline:none;
  box-shadow:inset 0 0 2cqw rgba(255,150,45,.06), inset 0 2px 8px rgba(0,0,0,.7);
}
#codeInput:focus{border-color:var(--amber);box-shadow:inset 0 0 2cqw rgba(255,150,45,.12),0 0 1.4cqw rgba(255,150,45,.28)}
.code-error{min-height:1.8cqw;margin-top:.6cqw;font-family:var(--dot);font-size:clamp(7px,1.5cqw,10px);letter-spacing:.1em;color:#ff8a70}
.code-actions{display:flex;gap:1cqw;margin-top:1.4cqw}
.coming-card{text-align:center}
.coming-icon{
  width:7cqw;height:7cqw;margin:0 auto 1.2cqw;border-radius:50%;
  display:grid;place-items:center;color:var(--amber);
  border:1px solid rgba(255,179,71,.4);
  background:radial-gradient(circle at 50% 35%, rgba(255,170,60,.16), rgba(0,0,0,.2));
  box-shadow:0 0 3cqw rgba(255,150,45,.16);
}
.coming-icon svg{width:3.4cqw;height:3.4cqw;stroke:currentColor;fill:none;stroke-width:1.6}
.coming-card .code-copy{margin-bottom:2cqw}

/* ---------------- service mode ---------------- */
.service{
  position:absolute;inset:0;z-index:38;
  display:flex;flex-direction:column;
  gap:1.2cqw;
  padding:2.1cqw 2.2cqw 1.8cqw;
  background:
    radial-gradient(90% 70% at 65% 20%, #1d1207 0%, #0a0704 55%, #040302 100%);
  color:var(--amber);
  font-family:var(--dot);
  overflow:hidden;
  animation:svcOn .32s steps(3) both;
}
.service[hidden]{display:none}
.service::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:
    repeating-linear-gradient(180deg, rgba(255,160,50,.055) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0,0,0,.55) 100%);
}
.svc-head{
  position:relative;z-index:2;
  display:flex;align-items:flex-start;justify-content:space-between;gap:1cqw;
  border-bottom:1px solid rgba(255,179,71,.3);
  padding-bottom:1cqw;
}
.svc-head .svc-kicker{display:block;font-size:1.03cqw;letter-spacing:.22em;color:rgba(255,180,70,.6)}
.svc-head b{display:block;font-size:2.1cqw;letter-spacing:.1em;color:var(--amber-hot);text-shadow:0 0 1.6cqw rgba(255,150,45,.45)}
#svcExit{
  border:1px solid rgba(255,179,71,.5);border-radius:.9cqw;background:rgba(255,150,45,.08);
  color:var(--amber);font-family:var(--dot);font-size:1.2cqw;letter-spacing:.14em;padding:.6cqw 1.1cqw;cursor:pointer;
}
.svc-body{
  position:relative;z-index:2;
  flex:1;min-height:0;
  display:grid;grid-template-columns:1.06fr .94fr;gap:1.2cqw;
}
.svc-list{overflow-y:auto;display:flex;flex-direction:column;gap:.7cqw;padding-right:.3cqw;scrollbar-width:thin}
.svc-row{
  display:grid;grid-template-columns:7.2cqw 1fr auto;align-items:center;gap:1cqw;
  border:1px solid rgba(255,179,71,.24);
  border-radius:.9cqw;
  background:rgba(255,150,45,.025);
  padding:.6cqw .8cqw;
  cursor:pointer;text-align:left;color:inherit;
}
.svc-row:hover{background:rgba(255,150,45,.08)}
.svc-row.sel{
  border-color:var(--amber);
  background:linear-gradient(90deg, rgba(255,170,60,.2), rgba(255,150,45,.06));
  box-shadow:0 0 1.4cqw rgba(255,150,45,.22), inset 0 0 1cqw rgba(255,150,45,.12);
}
.svc-thumb{width:7.2cqw;height:7.2cqw;background:#050403;border:1px solid rgba(255,179,71,.25);border-radius:.6cqw;display:block}
.svc-meta{min-width:0}
.svc-name{display:block;font-size:clamp(8px,1.9cqw,12px);letter-spacing:.08em;color:var(--amber-hot);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.svc-sub{display:block;font-size:clamp(6.5px,1.35cqw,9px);letter-spacing:.08em;color:rgba(255,206,140,.55);margin-top:.25cqw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.svc-index{font-size:clamp(6.5px,1.45cqw,9px);color:rgba(255,180,70,.55)}
.svc-preview{
  position:relative;min-height:0;border:1px solid rgba(255,179,71,.34);border-radius:1cqw;
  background:#040302;overflow:hidden;
  box-shadow:inset 0 0 3cqw rgba(255,150,45,.06);
}
#svcCanvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.svc-scan{position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(180deg, rgba(255,170,60,.05) 0 1px, transparent 1px 3px)}
.svc-tag{
  position:absolute;left:.8cqw;right:.8cqw;bottom:.7cqw;
  font-size:1.25cqw;letter-spacing:.16em;text-align:center;color:var(--amber-hot);
  text-shadow:0 0 6px rgba(255,150,45,.5);
  background:linear-gradient(transparent, rgba(0,0,0,.7));
  padding:.6cqw .4cqw .2cqw;
}
.svc-foot{position:relative;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:1cqw;border-top:1px solid rgba(255,179,71,.22);padding-top:1cqw}
.svc-actions{display:flex;gap:.8cqw;flex-wrap:wrap}
.svc-foot button{
  font-family:var(--dot);font-size:clamp(7px,1.45cqw,10px);letter-spacing:.08em;
  border:1px solid rgba(255,179,71,.5);border-radius:.8cqw;background:rgba(255,150,45,.08);
  color:var(--amber-hot);padding:.6cqw 1cqw;cursor:pointer;
}
.svc-foot button.ghost{background:transparent;border-color:rgba(255,179,71,.22);color:rgba(255,206,140,.6)}
.svc-build{font-size:clamp(6px,1.2cqw,8px);letter-spacing:.12em;color:rgba(255,180,70,.35);white-space:nowrap}
.device.service-mode .nameplate,
.device.service-mode .screen-frame,
.device.service-mode .deck,
.device.service-mode .louvre,
.device.service-mode .physical,
.device.service-mode .casing-foot,
.device.service-mode .red-cheek{filter:grayscale(.88) brightness(.68) contrast(.92)}
.device.service-mode .screen{box-shadow:inset 0 0 0 2px #050403, inset 0 0 3cqw rgba(0,0,0,.95), 0 0 2cqw rgba(255,150,45,.16)}
.device.service-mode .glow{filter:none}

/* ---------------- deck ---------------- */
.deck{
  position:relative;z-index:3;
  margin-top:1.15cqw;
  display:grid;
  grid-template-columns:repeat(7,1fr) 1.24fr;
  grid-template-rows:auto auto auto;
  gap:1.05cqw 1cqw;
  flex:0 0 auto;
}
.stats{
  grid-column:1/8;
  display:grid;grid-template-columns:repeat(6,1fr);gap:1.2cqw;
  padding:.15cqw .1cqw .1cqw;
}
.stat{min-width:0}
.stat-label{display:flex;align-items:baseline;justify-content:space-between;gap:.35cqw;font-size:clamp(7.5px,1.7cqw,10.5px);font-weight:600;letter-spacing:.02em;color:var(--amber)}
.stat-label b{font-family:var(--dot);font-weight:400;font-size:clamp(7.5px,1.65cqw,10px);color:var(--amber-hot);text-shadow:0 0 5px rgba(255,150,45,.55)}
.bar{
  height:1.15cqw;margin-top:.45cqw;
  border:1px solid #68400f;border-radius:.45cqw;background:#2a1809;
  box-shadow:inset 0 0 .7cqw #000, 0 0 0 1px rgba(0,0,0,.35);
  overflow:hidden;
}
.bar i{
  display:block;height:100%;width:50%;
  background:repeating-linear-gradient(90deg,var(--amber) 0 3px,#a95d13 3px 4px);
  box-shadow:0 0 1cqw rgba(255,170,60,.7);
  transition:width .45s ease;
}
.stat.low .bar i{background:repeating-linear-gradient(90deg,#ff8b52 0 3px,#a33b18 3px 4px);box-shadow:0 0 1cqw rgba(255,90,50,.7)}
.actions{
  grid-column:1/8;
  display:grid;grid-template-columns:repeat(7,1fr);gap:1.05cqw;
}
.action{
  height:9.1cqw;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.45cqw;
  border:1px solid #4a404c;border-radius:1.35cqw;
  background:
    linear-gradient(150deg,rgba(255,255,255,.055),transparent 38%),
    linear-gradient(#2b252f,#19151c 70%,#141118);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    inset 0 -2px 0 rgba(0,0,0,.55),
    0 0 0 1px rgba(0,0,0,.35);
  color:var(--amber);
  cursor:pointer;
  padding:.5cqw .2cqw;
  transition:transform .08s ease, background .15s ease, box-shadow .15s ease;
  position:relative;
  overflow:hidden;
}
.action::after{
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:radial-gradient(80% 60% at 50% 105%, rgba(255,160,55,.22), transparent 70%);
  opacity:.65;
}
.action svg{
  width:4.15cqw;height:4.15cqw;flex:0 0 auto;
  stroke:currentColor;fill:none;stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round;
  filter:drop-shadow(0 0 .55cqw rgba(255,165,60,.45));
}
.action span{
  display:block;max-width:100%;
  font-family:var(--text);font-weight:600;
  font-size:clamp(7.5px,1.75cqw,10.5px);
  line-height:1.02;letter-spacing:.01em;
  text-align:center;text-transform:uppercase;
  color:var(--amber);
  text-shadow:0 1px 2px #000;
  overflow-wrap:anywhere;
}
.action:hover{background:linear-gradient(150deg,rgba(255,255,255,.08),transparent 38%),linear-gradient(#332b37,#1c1720 70%,#161219);color:var(--amber-hot)}
.action:active,.action.press{transform:translateY(.35cqw);box-shadow:inset 0 2px 6px rgba(0,0,0,.6),0 0 1.5cqw rgba(255,160,55,.35);background:linear-gradient(rgba(255,160,55,.22),rgba(60,30,10,.5))}
.action.skip{opacity:.35;pointer-events:none}
.tabs{
  grid-column:8;grid-row:1/3;
  display:flex;flex-direction:column;gap:1.05cqw;
}
.tab{
  flex:1;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5cqw;
  border:1px solid #40383f;border-radius:1.35cqw;
  background:linear-gradient(150deg,rgba(255,255,255,.035),transparent 40%),linear-gradient(#211c24,#131017);
  color:rgba(255,179,71,.82);
  cursor:pointer;
  padding:.4cqw .2cqw;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08), inset 0 -2px 0 rgba(0,0,0,.5);
}
.tab:hover{color:var(--amber-hot);border-color:rgba(255,179,71,.55)}
.tab svg{width:3.9cqw;height:3.9cqw;stroke:currentColor;fill:none;stroke-width:1.5;filter:drop-shadow(0 0 .4cqw rgba(255,165,60,.25))}
.tab span{font-size:clamp(6.6px,1.32cqw,9px);font-weight:600;letter-spacing:.03em}
.tab:active{background:linear-gradient(rgba(255,160,55,.16),rgba(40,22,8,.4))}
.chat-socket{
  grid-column:1/9;
  display:flex;align-items:center;gap:1.2cqw;
  min-height:5.5cqw;
  padding:.75cqw 1.5cqw;
  border:1px solid rgba(255,179,71,.24);
  border-radius:1.35cqw;
  background:
    repeating-linear-gradient(180deg, rgba(255,170,60,.02) 0 1px, transparent 1px 4px),
    linear-gradient(rgba(255,150,45,.045),rgba(0,0,0,.18));
  color:rgba(255,179,71,.78);
  cursor:pointer;
  text-align:left;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04), inset 0 0 1.4cqw rgba(0,0,0,.5);
}
.chat-socket:hover{color:var(--amber-hot);border-color:rgba(255,179,71,.5)}
.chat-socket svg{width:2.6cqw;height:2.6cqw;stroke:currentColor;fill:none;stroke-width:1.5;flex:0 0 auto}
.chat-socket span{font-family:var(--dot);font-size:clamp(7px,1.35cqw,9.4px);letter-spacing:.14em}
.chat-socket em{margin-left:auto;font-family:var(--dot);font-style:normal;font-size:clamp(6.4px,1.05cqw,8px);letter-spacing:.14em;color:rgba(255,179,71,.52)}

.louvre{
  position:relative;z-index:2;
  display:flex;justify-content:center;align-items:center;gap:1.35cqw;
  height:2.2cqw;
  margin-top:1cqw;
  flex:0 0 auto;
}
.louvre::before{
  content:"";position:absolute;left:6%;right:6%;top:50%;height:1.5cqw;transform:translateY(-50%);
  background:radial-gradient(60% 100% at 50% 50%, rgba(255,160,55,.22), transparent 72%);
  filter:blur(2px);
}
.louvre i{position:relative;display:block;width:5.4cqw;height:.75cqw;border-radius:1cqw;background:linear-gradient(90deg,#3a210a,#ffb347 45%,#ffdf9a 55%,#5a330c);box-shadow:0 0 1.1cqw rgba(255,160,55,.55);opacity:.8}
.louvre i:nth-child(2n){width:3.6cqw;opacity:.55}

.physical{
  position:relative;z-index:3;
  margin-top:.5cqw;
  display:flex;align-items:center;justify-content:space-between;
  gap:1.2cqw;
  padding:0 1.4cqw;
  flex:0 0 auto;
  height:8cqw;
}
.round{
  width:5.2cqw;height:5.2cqw;border-radius:50%;
  display:grid;place-items:center;
  border:1px solid #4b414e;
  background:
    radial-gradient(circle at 36% 30%, #4a414e 0%, #201b23 44%, #100d12 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18), inset 0 -2px 3px rgba(0,0,0,.7), 0 1px 0 #000;
  color:rgba(255,179,71,.75);cursor:pointer;
  flex:0 0 auto;
}
.round svg{width:2.3cqw;height:2.3cqw;stroke:currentColor;fill:none;stroke-width:1.6}
.round:active{background:radial-gradient(circle at 36% 70%, #302934, #100d12)}
.arrow{
  width:3.6cqw;height:5.4cqw;
  display:grid;place-items:center;
  border:1px solid #3f3743;border-radius:1.1cqw;
  background:linear-gradient(#241f27,#141017);
  color:rgba(255,179,71,.7);cursor:pointer;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.09), inset 0 -2px 0 rgba(0,0,0,.5);
  flex:0 0 auto;
}
.arrow svg{width:2.6cqw;height:2.6cqw;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linejoin:round}
.arrow:active{background:linear-gradient(#332b37,#17121b);color:var(--amber-hot)}
.call{
  flex:1;
  height:6.2cqw;
  position:relative;
  border:1px solid #a9691c;
  border-radius:1.6cqw;
  background:
    linear-gradient(180deg,#ffd17c 0%,#ffb347 22%,#f08a25 58%,#b95a12 100%);
  box-shadow:
    0 0 1.6cqw rgba(255,160,55,.5),
    0 0 4.5cqw rgba(255,130,35,.22),
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -3px 0 rgba(90,40,4,.55);
  cursor:pointer;
  overflow:hidden;
}
.call i{
  position:absolute;left:12%;right:12%;top:50%;height:.62cqw;transform:translateY(-50%);
  border-radius:1cqw;background:linear-gradient(90deg,transparent,#5c2c05 12%,#5c2c05 88%,transparent);
  opacity:.55;
}
.call:active{filter:brightness(.82);box-shadow:0 0 1.2cqw rgba(255,160,55,.4),inset 0 2px 8px rgba(80,35,0,.5)}
.casing-foot{
  position:relative;z-index:3;
  display:flex;align-items:center;justify-content:space-between;
  padding:.8cqw .6cqw 0;
  font-family:var(--dot);font-size:.88cqw;letter-spacing:.11em;
  color:rgba(180,168,190,.3);
  flex:0 0 auto;
}
.foot-led{width:.65cqw;height:.65cqw;border-radius:50%;background:var(--amber);box-shadow:0 0 .9cqw rgba(255,170,60,.8);opacity:.8}

/* ---------------- shop, battle, chat ---------------- */
.panel{
  position:absolute;inset:0;z-index:38;
  display:flex;flex-direction:column;gap:1.2cqw;
  padding:2.1cqw 2.2cqw 1.8cqw;
  background:
    radial-gradient(90% 70% at 70% 12%, #24170c 0%, #0d0805 55%, #050303 100%);
  color:var(--amber);font-family:var(--dot);overflow:hidden;
  animation:svcOn .28s steps(3) both;
}
.panel[hidden]{display:none}
.panel::after{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(180deg, rgba(255,160,50,.045) 0 1px, transparent 1px 3px)}
.panel-head{
  position:relative;z-index:2;display:flex;align-items:flex-start;justify-content:space-between;gap:1cqw;
  border-bottom:1px solid rgba(255,179,71,.3);padding-bottom:1cqw;
}
.panel-head .svc-kicker{display:block;font-size:1.03cqw;letter-spacing:.22em;color:rgba(255,180,70,.6)}
.panel-head b{display:block;font-size:2.4cqw;letter-spacing:.12em;color:var(--amber-hot);text-shadow:0 0 1.6cqw rgba(255,150,45,.45)}
.panel-wallet{display:flex;align-items:center;gap:1cqw}
.panel-wallet span{font-size:clamp(7px,1.5cqw,11px);letter-spacing:.1em;color:var(--amber-hot);border:1px solid rgba(255,179,71,.35);border-radius:1cqw;padding:.5cqw 1cqw;background:rgba(0,0,0,.3)}
.panel-x{border:1px solid rgba(255,179,71,.35);border-radius:50%;width:3cqw;height:3cqw;display:grid;place-items:center;background:rgba(0,0,0,.25);color:var(--amber);cursor:pointer}
.panel-x svg{width:1.6cqw;height:1.6cqw;stroke:currentColor;fill:none;stroke-width:2}
.panel-foot{
  position:relative;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:1cqw;
  border-top:1px solid rgba(255,179,71,.2);padding-top:1cqw;
  font-size:clamp(6px,1.25cqw,9px);letter-spacing:.1em;color:rgba(255,206,140,.55);
}
.shop-tabs{position:relative;z-index:2;display:grid;grid-template-columns:repeat(3,1fr);gap:.8cqw}
.shop-tab{
  border:1px solid rgba(255,179,71,.25);border-radius:.9cqw;background:rgba(255,150,45,.03);
  color:rgba(255,206,140,.6);font-family:var(--dot);font-size:clamp(7px,1.45cqw,10px);letter-spacing:.1em;
  padding:.75cqw .5cqw;cursor:pointer;
}
.shop-tab.on{border-color:var(--amber);background:linear-gradient(rgba(255,170,60,.22),rgba(255,150,45,.06));color:var(--amber-hot);box-shadow:0 0 1.4cqw rgba(255,150,45,.22)}
.shop-grid{position:relative;z-index:2;flex:1;min-height:0;overflow-y:auto;display:grid;grid-template-columns:1fr 1fr;align-content:start;grid-auto-rows:max-content;gap:1cqw;padding-right:.3cqw}
.shop-card{
  display:grid;grid-template-columns:5.4cqw 1fr;grid-template-rows:auto auto;gap:.6cqw .9cqw;align-items:center;
  border:1px solid rgba(255,179,71,.24);border-radius:1cqw;padding:.85cqw;background:rgba(255,150,45,.035);
}
.shop-ico{grid-row:1;width:5.4cqw;height:5.4cqw;border:1px solid rgba(255,179,71,.3);border-radius:.8cqw;display:grid;place-items:center;color:var(--amber);background:rgba(0,0,0,.25)}
.shop-ico svg{width:2.9cqw;height:2.9cqw;stroke:currentColor;fill:none;stroke-width:1.5}
.shop-info{min-width:0}
.shop-info b{display:block;font-size:clamp(7.5px,1.55cqw,11px);letter-spacing:.06em;color:var(--amber-hot);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.shop-info small{display:block;font-size:clamp(6px,1.22cqw,9px);letter-spacing:.05em;color:rgba(255,206,140,.58);margin-top:.25cqw}
.shop-info em{display:block;font-style:normal;font-size:clamp(5.8px,1.15cqw,8px);letter-spacing:.1em;color:rgba(255,180,70,.5);margin-top:.3cqw}
.shop-actions{grid-column:1/3;display:flex;gap:.6cqw}
.shop-actions button{
  flex:1;border:1px solid rgba(255,179,71,.45);border-radius:.7cqw;background:rgba(255,150,45,.1);
  color:var(--amber-hot);font-family:var(--dot);font-size:clamp(6.5px,1.3cqw,9px);letter-spacing:.08em;
  padding:.6cqw .3cqw;cursor:pointer;
}
.shop-actions button:disabled{opacity:.35;cursor:default}
.shop-actions .shop-use{border-color:rgba(159,233,255,.5);color:var(--cyan);background:rgba(159,233,255,.07)}
.shop-actions .shop-use.on{background:rgba(159,233,255,.18);color:#e5fbff}

/* battle */
.battle-panel{
  position:absolute;inset:0;z-index:22;
  display:flex;flex-direction:column;gap:.9cqw;
  padding:2.2cqw;color:var(--amber-hot);font-family:var(--dot);
  pointer-events:none;
  background:linear-gradient(180deg, rgba(5,3,4,.62) 0%, transparent 30%, transparent 64%, rgba(5,3,4,.72) 100%);
}
.battle-panel[hidden]{display:none}
.battle-panel button{pointer-events:auto}
.duel-top{display:grid;grid-template-columns:1fr auto 1fr;gap:1.2cqw;align-items:start}
.fighter-card{
  border:1px solid rgba(255,179,71,.35);border-radius:1.1cqw;
  background:linear-gradient(rgba(18,11,7,.9),rgba(6,4,4,.82));
  padding:.7cqw 1cqw;min-width:0;box-shadow:0 0 1.4cqw rgba(255,150,45,.12);
}
.fighter-card.foe{border-color:rgba(159,233,255,.35);text-align:right}
.fighter-side{display:block;font-size:clamp(5.5px,1.05cqw,8px);letter-spacing:.18em;color:rgba(255,206,140,.55)}
.fighter-card.foe .fighter-side{color:rgba(159,233,255,.6)}
.fighter-card b{display:block;font-size:clamp(7px,1.5cqw,11px);letter-spacing:.06em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:.2cqw 0 .45cqw}
.hp-bar{height:1.25cqw;border:1px solid #6b3d0f;border-radius:.5cqw;background:#2a1307;overflow:hidden;box-shadow:inset 0 0 .6cqw #000}
.hp-bar i{display:block;height:100%;width:100%;background:repeating-linear-gradient(90deg,var(--amber) 0 3px,#b96a14 3px 4px);transition:width .32s ease;box-shadow:0 0 1cqw rgba(255,170,60,.55)}
.hp-bar.foe{border-color:#1c4a58}
.hp-bar.foe i{background:repeating-linear-gradient(90deg,#7fe6ff 0 3px,#2d7f96 3px 4px);box-shadow:0 0 1cqw rgba(127,230,255,.5)}
.hp-num{display:block;font-size:clamp(5.5px,1.1cqw,8px);letter-spacing:.1em;color:rgba(255,206,140,.65);margin-top:.35cqw}
.duel-center{text-align:center;padding-top:.4cqw}
.duel-round{display:block;font-size:clamp(5.5px,1.05cqw,8px);letter-spacing:.14em;color:rgba(255,206,140,.5);white-space:nowrap}
.duel-turn{display:block;font-size:clamp(8px,1.75cqw,13px);letter-spacing:.1em;color:var(--amber-hot);text-shadow:0 0 1.4cqw rgba(255,150,45,.6);margin-top:.4cqw;white-space:nowrap}
.duel-log{
  margin-top:auto;align-self:center;width:min(78%, 62cqw);max-height:9cqw;overflow:hidden;
  display:flex;flex-direction:column;gap:.2cqw;align-items:center;
  text-shadow:0 1px 4px #000;
}
.duel-line{font-size:clamp(6px,1.3cqw,9px);letter-spacing:.06em;color:rgba(255,228,190,.82);text-align:center}
.duel-modes{display:grid;grid-template-columns:1fr 1fr;gap:1cqw}
.duel-mode{
  border:1px solid rgba(255,179,71,.5);border-radius:1.1cqw;
  background:linear-gradient(rgba(255,170,60,.18),rgba(20,10,5,.9));
  color:var(--amber-hot);padding:1.1cqw .8cqw;cursor:pointer;
  display:flex;flex-direction:column;gap:.35cqw;align-items:center;
  box-shadow:0 0 1.6cqw rgba(255,150,45,.16), inset 0 0 1.2cqw rgba(255,150,45,.08);
}
.duel-mode b{font-size:clamp(7.5px,1.55cqw,11px);letter-spacing:.06em}
.duel-mode small{font-size:clamp(5.8px,1.15cqw,8.5px);letter-spacing:.1em;color:rgba(255,206,140,.55)}
.duel-mode:active{background:rgba(255,150,45,.3)}
.duel-lobby,.duel-result{
  align-self:center;width:min(88%, 66cqw);
  border:1px solid rgba(255,179,71,.5);border-radius:1.2cqw;
  background:linear-gradient(rgba(22,13,8,.96),rgba(7,5,4,.94));
  padding:1.4cqw 1.6cqw;text-align:center;box-shadow:0 0 2cqw rgba(255,150,45,.2);
}
.duel-lobby b,.duel-result b{display:block;font-size:clamp(8px,1.8cqw,13px);letter-spacing:.1em;color:var(--amber-hot)}
.duel-lobby p,.duel-result p{font-size:clamp(6px,1.28cqw,9px);line-height:1.45;letter-spacing:.06em;color:rgba(255,224,180,.7);margin:.7cqw 0}
.duel-seats{display:flex;flex-direction:column;gap:.35cqw;margin:.5cqw 0 .8cqw}
.duel-seat{font-size:clamp(6px,1.25cqw,9px);letter-spacing:.08em;color:rgba(255,206,140,.45);border:1px dashed rgba(255,179,71,.2);border-radius:.6cqw;padding:.4cqw}
.duel-seat.on{color:var(--amber-hot);border-style:solid;border-color:rgba(255,179,71,.5);background:rgba(255,150,45,.08)}
.duel-link{
  display:block;width:100%;margin:0 0 .8cqw;border:1px dashed rgba(159,233,255,.4);border-radius:.7cqw;
  background:rgba(159,233,255,.05);color:var(--cyan);font-family:var(--dot);font-size:clamp(5.8px,1.15cqw,8.5px);
  letter-spacing:.08em;padding:.55cqw .6cqw;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.duel-lobby-actions,.duel-result div{display:flex;gap:.8cqw;justify-content:center}
.duel-lobby-actions button,.duel-result button,.duel-foot button{
  border:1px solid rgba(255,179,71,.5);border-radius:.8cqw;background:rgba(255,150,45,.1);
  color:var(--amber-hot);font-family:var(--dot);font-size:clamp(6.5px,1.3cqw,9.5px);letter-spacing:.1em;
  padding:.6cqw 1.1cqw;cursor:pointer;
}
.duel-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:.8cqw}
.duel-move{
  border:1px solid rgba(255,179,71,.42);border-radius:.9cqw;
  background:linear-gradient(rgba(255,170,60,.12),rgba(12,7,5,.9));
  color:var(--amber-hot);padding:.8cqw .4cqw;cursor:pointer;
  display:flex;flex-direction:column;gap:.25cqw;align-items:center;min-width:0;
}
.duel-move b{font-size:clamp(6.5px,1.28cqw,9.5px);letter-spacing:.04em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.duel-move small{font-size:clamp(5.4px,1.05cqw,7.5px);letter-spacing:.08em;color:rgba(255,206,140,.55);white-space:nowrap}
.duel-move:disabled{opacity:.35;cursor:default}
.duel-foot{display:flex;align-items:center;justify-content:space-between;gap:1cqw}
.duel-foot span{font-size:clamp(5.8px,1.2cqw,8.5px);letter-spacing:.12em;color:rgba(255,206,140,.55);text-align:right}

/* chat */
.chat-panel{
  position:absolute;left:0;right:0;bottom:0;height:80%;z-index:24;
  display:flex;flex-direction:column;
  background:linear-gradient(180deg, rgba(12,8,6,.97), rgba(5,4,3,.99));
  border-top:1px solid rgba(255,179,71,.45);
  box-shadow:0 -1.2cqw 4cqw rgba(0,0,0,.65);
  color:var(--amber-hot);font-family:var(--dot);
}
.chat-panel[hidden]{display:none}
.chat-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1cqw;padding:1.6cqw 2cqw 1cqw;border-bottom:1px solid rgba(255,179,71,.22)}
.chat-head b{display:block;font-size:clamp(9px,2cqw,14px);letter-spacing:.1em;color:var(--amber-hot);margin-top:.2cqw}
.chat-head .svc-kicker{font-size:clamp(5.6px,1.1cqw,8px);letter-spacing:.14em}
.chat-log{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:.65cqw;padding:1.2cqw 2cqw}
.chat-msg{
  max-width:90%;font-size:clamp(7px,1.42cqw,10.5px);line-height:1.45;letter-spacing:.03em;
  padding:.7cqw 1cqw;border-radius:.9cqw;border:1px solid rgba(255,179,71,.22);
  background:rgba(255,150,45,.06);color:rgba(255,236,205,.9);
}
.chat-msg.user{align-self:flex-end;border-color:rgba(159,233,255,.35);background:rgba(159,233,255,.07);color:#dcf8ff;text-align:right}
.chat-msg.typing{opacity:.6;font-style:italic}
.chat-status{font-size:clamp(5.2px,1.02cqw,7.5px);letter-spacing:.12em;color:rgba(255,180,70,.45);padding:0 2cqw .6cqw;text-align:center}
.chat-quick{display:flex;gap:.6cqw;padding:0 1.6cqw .9cqw;overflow-x:auto;scrollbar-width:none}
.chat-quick::-webkit-scrollbar{display:none}
.chat-quick button{
  flex:0 0 auto;border:1px solid rgba(255,179,71,.3);border-radius:2cqw;background:rgba(255,150,45,.05);
  color:rgba(255,206,140,.75);font-family:var(--dot);font-size:clamp(5.8px,1.15cqw,8.5px);letter-spacing:.06em;
  padding:.5cqw 1cqw;cursor:pointer;white-space:nowrap;
}
.chat-form{display:flex;gap:.8cqw;padding:1cqw 1.6cqw 1.6cqw;border-top:1px solid rgba(255,179,71,.18)}
.chat-form input{
  flex:1;min-width:0;border:1px solid rgba(255,179,71,.4);border-radius:.9cqw;
  background:repeating-linear-gradient(180deg, rgba(255,170,60,.03) 0 1px, transparent 1px 4px),#080605;
  color:var(--amber-hot);font-family:var(--dot);font-size:clamp(7px,1.5cqw,11px);letter-spacing:.06em;
  padding:.85cqw 1cqw;outline:none;
}
.chat-form input:focus{border-color:var(--amber);box-shadow:0 0 1.2cqw rgba(255,150,45,.2)}
.chat-form button{
  border:1px solid rgba(255,179,71,.55);border-radius:.9cqw;background:linear-gradient(rgba(255,170,60,.22),rgba(255,140,30,.08));
  color:var(--amber-hot);font-family:var(--dot);font-size:clamp(6.5px,1.3cqw,9.5px);letter-spacing:.1em;padding:.6cqw 1.2cqw;cursor:pointer;
}
.chat-form button:disabled{opacity:.4;cursor:default}
.tray-hint{grid-column:1/4;font-family:var(--dot);font-size:clamp(6px,1.25cqw,9px);letter-spacing:.1em;color:rgba(255,206,140,.45);margin:.2cqw 0 0;text-align:center}
.food.empty{opacity:.4;cursor:default}

/* ---------------- responsive ---------------- */
@media (max-height: 720px){
  .stage-note{display:none}
}
@media (max-width: 640px) and (orientation: portrait){
  :root{--device-w: min(96vw, 500px)}
  .stage{padding:6px;align-items:stretch}
  .device{aspect-ratio:auto;width:100%;max-width:560px;height:calc(100svh - 12px);margin:0 auto}
  .casing{position:relative;inset:auto;height:100%}
  .screen-frame{aspect-ratio:auto;flex:1 1 auto;min-height:0}
  .nameplate{height:13.2cqw;padding-top:1.2cqw}
  .logo{font-size:4.9cqw}
  .action{height:10.4cqw}
  .physical{height:12cqw}
  .round{width:6.2cqw;height:6.2cqw}
  .arrow{width:4.4cqw;height:7.2cqw}
  .call{height:8.4cqw}
  .action{height:10.8cqw}
  .shop-grid{grid-template-columns:1fr}
  .duel-log{width:92%;max-height:11cqw}
  .duel-actions{grid-template-columns:repeat(3,1fr)}
  .chat-panel{height:84%}
  .stage-note{display:none}
}
@media (max-width: 400px) and (orientation: portrait){
  .stage{padding:4px}
  .device{height:calc(100svh - 8px)}
  :root{--device-w: 98vw}
  .logo{font-size:5.0cqw}
  .chip{font-size:1.9cqw}
  .chip-sub{font-size:1.5cqw}
  .stat-label{font-size:7.6px}
  .action span{font-size:8px}
}
@media (max-width: 350px){
  .plate-mark{display:none}
  .bits{display:none}
  .sig{display:none}
}
@media (orientation: landscape){
  .stage{padding:6px;align-items:stretch}
  .device{width:100%;max-width:none;height:calc(100svh - 12px);aspect-ratio:auto;margin:0 auto}
  .casing{
    position:absolute;inset:0;height:100%;
    display:grid;
    grid-template-columns:minmax(0,1.72fr) minmax(0,.82fr);
    grid-template-rows:auto minmax(0,1fr) auto;
    gap:1.1vh 1.2vw;
    padding:1.2vh 1.2vw;
    border-radius:2.6vh;
  }
  .nameplate{
    grid-column:1/3;grid-row:1;
    height:8vh;padding:0 0 0 9vh;
    display:flex;align-items:center;
  }
  .logo{font-size:clamp(16px,3.4vh,34px);line-height:.92}
  .logo span{margin-left:3.2vh;margin-top:0}
  .plate-mark{top:.6vh;right:1vh;font-size:1vh}
  .data-line{width:44%;height:.7vh;padding:.12vh}
  .screen-frame{
    grid-column:1;grid-row:2/4;
    width:100%;height:auto;align-self:stretch;
    aspect-ratio:auto;flex:0 0 auto;min-height:0;
    padding:1.2vh;border-radius:2.4vh;
  }
  .screen{height:100%;border-radius:1.4vh}
  .deck{
    grid-column:2;grid-row:2;
    margin-top:0;min-height:0;
    display:flex;flex-direction:column;
    gap:1vh;
    overflow-y:auto;
    container-type:inline-size;
  }
  .stats{grid-column:auto;grid-template-columns:repeat(3,1fr);gap:.8cqw}
  .actions{grid-column:auto;grid-template-columns:repeat(4,1fr);gap:.8cqw}
  .action{height:auto;min-height:6.4cqw;padding:.6cqw .3cqw}
  .action svg{width:3.2cqw;height:3.2cqw}
  .action span{font-size:clamp(7px,1.65cqw,10px)}
  .tabs{grid-column:auto;grid-row:auto;flex-direction:row;gap:.8cqw;flex:0 0 auto}
  .tab{flex:1;min-height:6.4cqw}
  .tab svg{width:2.9cqw;height:2.9cqw}
  .tab span{font-size:clamp(6.4px,1.3cqw,9px)}
  .chat-socket{grid-column:auto;min-height:5.6cqw;padding:.6cqw 1.2cqw}
  .physical{
    grid-column:2;grid-row:3;
    margin-top:0;height:8vh;padding:0 1vh;gap:1vh;
  }
  .round{width:4.2vh;height:4.2vh}
  .round svg{width:2vh;height:2vh}
  .arrow{width:3vh;height:5vh;border-radius:.8vh}
  .arrow svg{width:2.2vh;height:2.2vh}
  .call{height:5.6vh;border-radius:1.2vh}
  .call i{height:.5vh}
  .louvre,.casing-foot,.stage-note{display:none}
}

@media (prefers-reduced-motion: reduce){
  .chip-dot{animation:none}
  .toast{animation:none}
}

@keyframes pulse{0%,100%{opacity:.55}50%{opacity:1}}
@keyframes toastIn{from{opacity:0;transform:translateY(6px) scale(.97)}to{opacity:1;transform:none}}
@keyframes toastOut{to{opacity:0;transform:translateY(-4px)}}
@keyframes svcOn{0%{opacity:.1;filter:brightness(.4)}40%{opacity:.75;filter:brightness(1.25)}70%{opacity:.5}100%{opacity:1;filter:none}}

[hidden]{display:none!important}
body.busy .action, body.busy .tab, body.busy .chat-socket{opacity:.32;pointer-events:none;filter:saturate(.35)}
.svc-foot button:disabled{opacity:.42;cursor:default}
.svc-row:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
#codeInput.shake{animation:shake .28s ease}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}50%{transform:translateX(4px)}75%{transform:translateX(-2px)}}
.svc-locked{
  display:flex;justify-content:space-between;align-items:center;gap:.5cqw;
  margin-top:.15cqw;padding:.55cqw .8cqw;
  border-top:1px dashed rgba(255,179,71,.22);
  font-family:var(--dot);font-size:clamp(6px,1.2cqw,8px);
  letter-spacing:.08em;color:rgba(255,190,90,.42);
}
