:root {
  --room: #221852;
  --room-2: #3b2d86;
  --shell: #7fd8b8;
  --shell-hi: #c2f5df;
  --shell-lo: #56b796;
  --shell-edge: #3a8d72;
  --shell-deep: #2c705a;
  --plum: #2a1638;
  --plum-2: #170b22;
  --cherry: #ff4f6d;
  --cherry-lo: #b92744;
  --butter: #ffd84a;
  --butter-lo: #b9951a;
  --lcd: #c8d6e5;
  --lcd-mid: #8da2be;
  --lcd-ink: #1e2a4a;
  --wood: #c08050;
  --wood-hi: #e2ab78;
  --wood-lo: #8c5331;
  --walnut: #3a2318;
  --walnut-2: #24150e;
  --cw: clamp(80px, 20vw, 112px);
  --ch: calc(var(--cw) * 1.22);
  --ledge: 74px;
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  min-height: 100svh; overflow-x: hidden; color: #efe9ff;
  font-family: 'Rubik', system-ui, sans-serif;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 1.5px) 0 0 / 22px 22px,
    radial-gradient(ellipse 90% 70% at 30% 10%, var(--room-2), var(--room) 70%);
  -webkit-tap-highlight-color: transparent;
}
.lamp { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse 50% 40% at 22% 0%, rgba(255, 226, 170, .18), transparent 70%); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px dashed var(--butter); outline-offset: 4px; }

.room { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; min-height: 100svh; padding: 26px 16px 30px; }

/* ================= display rack ================= */
.rack {
  position: relative; width: min(920px, 100%); padding: 12px 12px 0;
  border-radius: 12px 12px 6px 6px;
  background:
    var(--noise),
    repeating-linear-gradient(90deg, rgba(60,25,5,.07) 0 2px, transparent 2px 11px, rgba(255,230,190,.05) 11px 12px, transparent 12px 31px),
    linear-gradient(180deg, var(--wood-hi), var(--wood) 40%, var(--wood-lo));
  box-shadow:
    inset 0 2px 0 rgba(255,235,200,.55), inset 0 -2px 0 rgba(0,0,0,.25),
    0 6px 0 #6a3c22,
    0 40px 40px -18px rgba(5, 0, 25, .75), 0 70px 80px -30px rgba(5, 0, 25, .55);
}
.rack-crown { position: absolute; left: -8px; right: -8px; top: -10px; height: 14px; border-radius: 6px; background: linear-gradient(var(--wood-hi), var(--wood-lo)); box-shadow: 0 3px 0 #6a3c22, 0 8px 10px rgba(0,0,0,.35); }
.bracket { position: absolute; bottom: -26px; width: 14px; height: 30px; background: linear-gradient(90deg, #8a9099, #e6eaef 40%, #9aa1aa); border-radius: 0 0 4px 4px; box-shadow: 0 6px 8px rgba(0,0,0,.4); }
.bracket.l { left: 40px; } .bracket.r { right: 40px; }
.rack-back {
  position: relative; overflow: hidden; border-radius: 6px 6px 0 0;
  background:
    var(--noise),
    repeating-linear-gradient(90deg, rgba(0,0,0,.35) 0 2px, transparent 2px 92px),
    linear-gradient(180deg, var(--walnut-2), var(--walnut));
  box-shadow: inset 0 18px 20px -8px rgba(0,0,0,.8), inset 14px 0 16px -10px rgba(0,0,0,.7), inset -14px 0 16px -10px rgba(0,0,0,.7);
}
.rack-scroll { overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain; }
.rack-scroll::-webkit-scrollbar { display: none; }
.rack-inner { position: relative; display: flex; justify-content: center; width: max-content; min-width: 100%; padding: 34px 18px 0; }
/* the ledge: top surface + front face, spanning the whole run of bays */
.rack-inner::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: var(--ledge); z-index: 0;
  background:
    linear-gradient(180deg, #f0c08c 0, var(--wood-hi) 5px, #d29a66 15px, #6a3c22 16px, #6a3c22 17px, transparent 17px),
    var(--noise),
    repeating-linear-gradient(90deg, rgba(60,25,5,.08) 0 3px, transparent 3px 14px, rgba(255,230,190,.06) 14px 15px, transparent 15px 37px),
    linear-gradient(180deg, var(--wood) 20%, var(--wood-lo));
  box-shadow: 0 -10px 18px rgba(0,0,0,.45);
}
.rail {
  position: absolute; left: 0; right: 0; bottom: 14px; height: 30px; z-index: 1;
  background: linear-gradient(180deg, #f3f5f8, #c4cad2 45%, #9aa2ac 55%, #dfe3e8);
  box-shadow: 0 2px 0 rgba(0,0,0,.35), inset 0 1px 0 #fff;
}
.rail::before, .rail::after { content: ''; position: absolute; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #8a9099 70%); }
.rail::before { left: 10px; } .rail::after { right: 10px; }

.bay { position: relative; z-index: 2; width: calc(var(--cw) + 34px); display: flex; justify-content: center; padding-bottom: calc(var(--ledge) - 9px); scroll-snap-align: center; }
.bay::before { /* contact shadow inside the groove */
  content: ''; position: absolute; left: 18%; right: 18%; bottom: calc(var(--ledge) - 13px); height: 10px; border-radius: 50%;
  background: rgba(0,0,0,.6); filter: blur(4px); z-index: -1;
}
.bay::after { /* front lip of the groove, drawn over the cart's foot */
  content: ''; position: absolute; left: 10px; right: 10px; bottom: calc(var(--ledge) - 10px); height: 8px; z-index: 3;
  background: linear-gradient(180deg, #4a2a18 0 2px, #d6a06c 3px, var(--wood-hi) 6px, #d29a66);
  border-radius: 2px;
}
.tag {
  position: absolute; left: 50%; bottom: 17px; translate: -50% 0; z-index: 4; width: calc(var(--cw) + 14px);
  padding: 3px 6px 3px; background: #fbf6ea; color: #2a1d14; border-radius: 2px; text-align: center;
  box-shadow: 0 1px 0 rgba(0,0,0,.25); font: 700 10px/1.15 'Rubik', sans-serif; pointer-events: none;
}
.tag b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag i { display: block; font-style: normal; font-weight: 500; font-size: 9px; color: #6d5a48; }
.tag i.live { color: #1c8a5f; }
.bay.sel .tag { box-shadow: 0 1px 0 rgba(0,0,0,.25), inset 0 -3px 0 var(--accent, var(--cherry)); }

/* ================= cartridge ================= */
.cart {
  position: relative; display: block; width: var(--cw); height: var(--ch); flex: none;
  transition: translate .3s cubic-bezier(.3,1.7,.5,1), rotate .3s;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.25));
}
.cart::before {
  content: ''; position: absolute; inset: 0; border-radius: 9px 4px 6px 6px; background-color: var(--c);
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.35) 0 4px, transparent 4px calc(100% - 5px), rgba(0,0,0,.18) calc(100% - 5px)),
    linear-gradient(180deg, rgba(255,255,255,.25), transparent 30%, transparent 75%, rgba(0,0,0,.2)),
    var(--noise);
  clip-path: polygon(0 0, 76% 0, 100% 13%, 100% 100%, 0 100%);
}
.cart.clear::before { backdrop-filter: blur(3px); background-image: linear-gradient(90deg, rgba(255,255,255,.45) 0 3px, transparent 3px), linear-gradient(160deg, rgba(255,255,255,.4), transparent 35%), radial-gradient(circle at 50% 60%, rgba(0,0,0,.15), transparent 70%); }
.ridges { position: absolute; left: 12%; right: 30%; top: 5%; height: 11%; background: repeating-linear-gradient(90deg, rgba(0,0,0,.22) 0 2px, rgba(255,255,255,.18) 2px 3px, transparent 3px 6px); border-radius: 2px; }
.label {
  position: absolute; left: 9%; right: 9%; top: 22%; bottom: 8%; border-radius: 4px; overflow: hidden;
  display: flex; flex-direction: column; background: var(--lbg);
  box-shadow: 0 1px 0 rgba(255,255,255,.4), inset 0 0 0 1px rgba(0,0,0,.08);
}
.label::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.35), transparent 40%); pointer-events: none; }
.label svg { flex: 1; width: 100%; min-height: 0; display: block; }
.label-name { font: 600 clamp(8px, 2vw, 11px)/1.1 'Pixelify Sans', monospace; color: var(--link); padding: 3px 5px 4px; background: var(--lbg); border-top: 2px solid var(--lacc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soon-stamp { position: absolute; right: -4px; top: 30%; rotate: 18deg; z-index: 2; font: 400 clamp(8px, 1.8vw, 10px) 'Bungee', sans-serif; background: var(--butter); color: var(--plum); padding: 2px 6px; box-shadow: 0 2px 0 rgba(0,0,0,.3); }

.bay .cart:hover { translate: 0 -8px; }
.bay.sel .cart { translate: 0 -18px; rotate: -1.5deg; }
.bay.sel .cart::after { content: ''; position: absolute; inset: -6px; border-radius: 12px; box-shadow: 0 0 0 2px rgba(255,216,74,.85), 0 0 22px rgba(255,216,74,.5); pointer-events: none; }
.bay.gone .cart { visibility: hidden; }
.bay .cart:focus-visible { outline: 3px dashed var(--butter); outline-offset: 6px; }

/* ================= console ================= */
.console {
  position: relative; isolation: isolate; width: min(760px, 100%);
  display: grid; align-items: center; column-gap: 18px; row-gap: 14px;
  grid-template-columns: 1fr minmax(0, 400px) 1fr;
  grid-template-areas: "brand brand brand" "dpad screen ab" "pills pills extras";
  padding: 58px clamp(22px, 4vw, 40px) 34px;
  margin-top: calc(var(--ch) * .68);
}
.shell {
  position: absolute; inset: 0; z-index: 0;
  border-radius: 50% 50% 70px 70px / 30% 30% 70px 70px;
  background:
    radial-gradient(ellipse 45% 30% at 28% 14%, rgba(255,255,255,.55), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 115%, var(--shell-lo), transparent 70%),
    radial-gradient(ellipse 30% 50% at 100% 60%, rgba(30,100,80,.25), transparent 70%),
    var(--shell);
  box-shadow:
    inset 0 -14px 0 var(--shell-lo), inset 0 -15px 0 rgba(255,255,255,.25), inset 0 8px 0 var(--shell-hi), inset 6px 0 10px -6px rgba(255,255,255,.6),
    0 10px 0 var(--shell-edge), 0 18px 0 var(--shell-deep);
}
.shell::before { /* parting line between front and back halves */
  content: ''; position: absolute; inset: 9px; border-radius: inherit;
  box-shadow: inset 0 0 0 1.5px rgba(44,112,90,.28), 0 1px 0 rgba(255,255,255,.35);
}
.shell::after { /* matte plastic texture */
  content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--noise); mix-blend-mode: soft-light; opacity: .55;
}
.floor-shadow { width: min(700px, 92%); height: 46px; margin-top: -10px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(5,0,25,.75), transparent 70%); filter: blur(6px); }

.console > :not(.shell) { position: relative; z-index: 1; }
.console > .slot {
  position: absolute; z-index: 1; top: 6px; left: 50%; translate: -50% 0;
  width: calc(var(--cw) + 26px); height: 18px; border-radius: 10px;
  background: radial-gradient(ellipse 48% 70% at 50% 35%, #000 40%, #12081a 75%, #2a1638);
  box-shadow: inset 0 4px 5px #000, inset 0 -2px 0 rgba(255,255,255,.06), 0 2px 0 rgba(255,255,255,.7), 0 -1px 0 rgba(30,90,70,.5);
}
.console > .port {
  position: absolute; z-index: 2; left: 50%; translate: -50% 0; pointer-events: none;
  width: calc(var(--cw) + 40px); height: calc(var(--ch) + 30px); top: calc(15px - var(--ch) - 30px);
  overflow: hidden; /* the bottom edge is the slot's mouth: anything below it is inside the console */
}
.port-cart { position: absolute; left: 20px; bottom: 0; }
.console > .screw { position: absolute; z-index: 1; bottom: 26px; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #d9f7ea, #5fae92 60%, #3a8d72); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.console > .screw::after { content: ''; position: absolute; left: 2px; right: 2px; top: 4.25px; height: 1.5px; background: rgba(20,60,48,.6); rotate: 35deg; }
.console > .s1 { left: 34px; } .console > .s2 { right: 34px; }

.brand { grid-area: brand; display: flex; align-items: baseline; justify-content: center; gap: 10px; color: var(--plum); }
.logo { font: 400 clamp(26px, 5vw, 38px) 'Bungee', sans-serif; letter-spacing: .02em; text-shadow: 0 2px 0 var(--shell-hi), 0 -1px 0 rgba(30,90,70,.35); }
.sub { font: 700 13px 'Rubik'; opacity: .7; }

.bezel {
  grid-area: screen; padding: 16px 18px 22px; border-radius: 18px 18px 44px 18px;
  background: var(--noise), linear-gradient(170deg, #3d2350, var(--plum) 40%, #1f0f2b);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.12), inset 0 -5px 0 var(--plum-2), 0 0 0 3px rgba(44,112,90,.35), 0 4px 0 var(--shell-hi);
}
.led { position: absolute; left: 6px; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: #4a2a3a; transition: background .2s, box-shadow .2s; }
.led.on { background: var(--cherry); box-shadow: 0 0 10px var(--cherry); }
.led.blink { animation: ledblink .12s steps(2) 4; }
@keyframes ledblink { 50% { background: #4a2a3a; box-shadow: none; } }

.screen {
  position: relative; overflow: hidden; aspect-ratio: 10 / 7; border-radius: 6px;
  container-type: inline-size; color: var(--lcd-ink); font-family: 'Pixelify Sans', monospace;
  background:
    linear-gradient(rgba(30,42,74,.05) 1px, transparent 1px) 0 0 / 3px 3px,
    linear-gradient(90deg, rgba(30,42,74,.05) 1px, transparent 1px) 0 0 / 3px 3px,
    var(--lcd);
  box-shadow: inset 0 0 0 2px #0c0612;
}
.screen.dark { background: #0a0710; }
.screen::after { /* glass: reflection + edge vignette */
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 20;
  background: linear-gradient(158deg, rgba(255,255,255,.28), rgba(255,255,255,.06) 32%, transparent 33%), radial-gradient(ellipse at center, transparent 60%, rgba(10,5,20,.35));
  box-shadow: inset 0 6px 10px rgba(10,5,20,.35);
}
.scr { position: absolute; inset: 0; padding: 6cqw 7cqw; display: flex; flex-direction: column; font-size: 5.2cqw; line-height: 1.25; }

.scr-boot { align-items: center; justify-content: center; gap: 2cqw; }
.boot-logo { font: 400 15cqw 'Bungee', sans-serif; animation: drop .9s steps(8) both; }
.boot-sub { font-size: 5cqw; animation: blink 1s steps(2) .8s both; }
.scr-boot.quick .boot-logo { animation-duration: .35s; }
.scr-boot.quick .boot-sub { animation-delay: .3s; }
@keyframes drop { from { transform: translateY(-120cqw); } }
@keyframes blink { from { opacity: 0; } }

.scr-top { display: flex; justify-content: space-between; font-size: 4.2cqw; border-bottom: 2px solid var(--lcd-ink); padding-bottom: 1.5cqw; margin-bottom: 3cqw; }
.menu { list-style: none; display: grid; gap: 2.6cqw; }
.menu li { display: grid; grid-template-columns: 4cqw 37cqw 1fr; align-items: center; cursor: pointer; padding: .6cqw 1cqw; border-radius: 3px; }
.menu .cur { visibility: hidden; }
.menu li.on { background: var(--lcd-ink); color: var(--lcd); }
.menu li.on .cur { visibility: visible; animation: nudge .6s steps(2) infinite; }
@keyframes nudge { 50% { transform: translateX(.8cqw); } }
.menu .v { min-width: 0; display: flex; align-items: center; }
.menu .v b { flex: 1; text-align: center; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu .tri { opacity: .6; padding: 0 1.2cqw; }
.menu li.on .tri { opacity: 1; }
.menu input, .g-menu input {
  font: inherit; color: inherit; background: transparent; border: 0; outline: none; width: 100%;
  border-bottom: 2px dotted currentColor; padding: 0 .5cqw;
}
.menu input::placeholder, .g-menu input::placeholder { color: inherit; opacity: .45; }
.menu input.code, .g-menu input { text-transform: uppercase; letter-spacing: 1.2cqw; width: 22cqw; }
.menu label { white-space: nowrap; }
.menu label { cursor: pointer; }
.scr-foot { margin-top: auto; font-size: 4.2cqw; display: flex; justify-content: flex-end; gap: 4cqw; }

/* ---- inserted game: live preview + overlay ---- */
.scr-game { padding: 0; color: #fff; }
.scr-game canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.g-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,7,16,.55), transparent 30%, transparent 48%, rgba(10,7,16,.7)); }
.g-head { position: relative; padding: 4.5cqw 5cqw 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 3cqw; }
.g-title { font: 400 8.4cqw/0.95 'Bungee', sans-serif; text-shadow: 0 .6cqw 0 rgba(0,0,0,.55); max-width: 70%; }
.g-live { font-size: 3.8cqw; background: rgba(10,7,16,.6); padding: .6cqw 2cqw; border-radius: 99px; white-space: nowrap; }
.g-live::before { content: '●'; color: #5ef19a; margin-right: 1cqw; }
.g-live.none::before { color: #b8b0c9; }
.g-menu { position: relative; list-style: none; margin-top: auto; margin-inline: 4cqw; display: grid; gap: 1cqw; padding: 2cqw; background: rgba(200,214,229,.93); color: var(--lcd-ink); border-radius: 1.5cqw; box-shadow: 0 1cqw 0 rgba(0,0,0,.35); }
.g-menu li { display: flex; align-items: center; gap: 2cqw; padding: .8cqw 1.5cqw; border-radius: 1cqw; cursor: pointer; font-size: 4.8cqw; }
.g-menu li .a { font-size: 4cqw; opacity: 0; }
.g-menu li .hint { margin-left: auto; font-size: 3.4cqw; opacity: .7; }
.g-menu li.on { background: var(--lcd-ink); color: var(--lcd); }
.g-menu li.on .a { opacity: 1; animation: nudge .6s steps(2) infinite; }
.g-menu li input { width: 20cqw; margin-left: auto; }
.g-foot { position: relative; font-size: 3.6cqw; text-align: right; padding: 1.6cqw 5cqw 2.6cqw; text-shadow: 0 1px 0 #000; }
.scr-game.solo .g-menu li { justify-content: center; font-size: 6cqw; }

.scr-msg { justify-content: center; gap: 2.6cqw; }
.m-title { font: 400 8cqw 'Bungee', sans-serif; line-height: 1; }
.m-body { font-size: 5cqw; max-width: 32ch; }
.m-tags { display: flex; flex-wrap: wrap; gap: 1.5cqw; font-size: 3.6cqw; }
.m-tags span { border: 2px solid var(--lcd-ink); padding: 0 1.5cqw; border-radius: 2px; }

/* power-on wipe */
.wipe { position: absolute; inset: 0; z-index: 15; pointer-events: none; opacity: 0; background: #f4fbff; }
.wipe.go { animation: wipe .45s ease-out; }
@keyframes wipe {
  0% { opacity: 1; clip-path: inset(49.5% 0 49.5% 0); }
  45% { opacity: 1; clip-path: inset(0 0 0 0); }
  100% { opacity: 0; clip-path: inset(0 0 0 0); }
}

/* ================= controls ================= */
.dpad-wrap { grid-area: dpad; justify-self: center; position: relative; padding: 12px; border-radius: 50%; background: radial-gradient(circle, rgba(44,112,90,.35) 55%, rgba(44,112,90,.15) 68%, transparent 71%); box-shadow: inset 0 3px 4px rgba(20,70,55,.35); }
.dpad { display: grid; grid-template-columns: repeat(3, 42px); grid-template-rows: repeat(3, 42px); filter: drop-shadow(0 5px 0 var(--plum-2)) drop-shadow(0 8px 6px rgba(0,0,0,.25)); }
.d { background: linear-gradient(160deg, #46295c, var(--plum) 55%, #21102c); transition: translate .06s; }
.d.up { grid-area: 1 / 2; border-radius: 9px 9px 0 0; }
.d.left { grid-area: 2 / 1; border-radius: 9px 0 0 9px; }
.d.mid { grid-area: 2 / 2; background: var(--plum); }
.d.mid::after { content: ''; display: block; margin: 12px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 50% 65%, #4a2f5e, var(--plum-2) 75%); }
.d.right { grid-area: 2 / 3; border-radius: 0 9px 9px 0; }
.d.down { grid-area: 3 / 2; border-radius: 0 0 9px 9px; }
.d.up::after, .d.down::after, .d.left::after, .d.right::after { content: ''; display: block; margin: auto; width: 0; height: 0; border: 6px solid transparent; opacity: .45; }
.d.up::after { border-bottom-color: var(--shell); translate: 0 6px; }
.d.down::after { border-top-color: var(--shell); translate: 0 18px; }
.d.left::after { border-right-color: var(--shell); translate: 6px 15px; }
.d.right::after { border-left-color: var(--shell); translate: 18px 15px; }
.d:active, .d.is-down { translate: 0 4px; }

.ab { grid-area: ab; justify-self: center; position: relative; width: 150px; height: 120px; }
.well { position: absolute; width: 76px; height: 76px; border-radius: 50%; background: radial-gradient(circle, rgba(30,90,70,.45) 60%, rgba(44,112,90,.2) 70%, transparent 72%); box-shadow: inset 0 3px 4px rgba(20,70,55,.35); }
.well.wa { right: -6px; top: -6px; } .well.wb { left: -6px; bottom: -6px; }
.btn {
  position: absolute; width: 64px; height: 64px; border-radius: 50%;
  font: 400 22px 'Bungee', sans-serif; transition: translate .06s, box-shadow .06s;
}
.btn::after { content: ''; position: absolute; left: 22%; top: 14%; width: 30%; height: 20%; border-radius: 50%; background: rgba(255,255,255,.5); filter: blur(2px); }
.btn-a { right: 0; top: 0; background: radial-gradient(circle at 38% 32%, #ff93a6, var(--cherry) 45%, #e0385a 85%); color: #fff4f6; text-shadow: 0 -1px 0 rgba(0,0,0,.2); box-shadow: 0 6px 0 var(--cherry-lo), 0 10px 8px rgba(0,0,0,.25); }
.btn-b { left: 0; bottom: 0; background: radial-gradient(circle at 38% 32%, #fff0a8, var(--butter) 45%, #e9bd28 85%); color: var(--plum); box-shadow: 0 6px 0 var(--butter-lo), 0 10px 8px rgba(0,0,0,.25); }
.btn:active, .btn.is-down { translate: 0 5px; }
.btn-a:active, .btn-a.is-down { box-shadow: 0 1px 0 var(--cherry-lo), 0 2px 3px rgba(0,0,0,.25); }
.btn-b:active, .btn-b.is-down { box-shadow: 0 1px 0 var(--butter-lo), 0 2px 3px rgba(0,0,0,.25); }

.pills { grid-area: pills; display: flex; gap: 22px; justify-content: center; }
.pill { display: grid; justify-items: center; gap: 7px; font: 700 11px 'Rubik'; color: var(--plum); opacity: .85; }
.pill span { width: 52px; height: 15px; border-radius: 10px; background: linear-gradient(180deg, #7a8aa2, #56667e); rotate: -22deg; box-shadow: 0 4px 0 #3c4859, 0 0 0 4px rgba(44,112,90,.25); transition: translate .06s, box-shadow .06s; }
.pill:active span, .pill.is-down span { translate: 0 3px; box-shadow: 0 1px 0 #3c4859, 0 0 0 4px rgba(44,112,90,.25); }

.extras { grid-area: extras; display: flex; align-items: center; justify-content: center; gap: 22px; }
.switch { display: grid; justify-items: center; gap: 6px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { width: 48px; height: 22px; border-radius: 12px; background: var(--plum); padding: 3px; box-shadow: inset 0 3px 0 var(--plum-2), 0 1px 0 var(--shell-hi); }
.knob { display: block; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0, var(--butter) 60%); transition: translate .2s cubic-bezier(.3,1.6,.5,1); }
.switch input:checked + .track .knob { translate: 26px 0; }
.switch input:focus-visible + .track { outline: 3px dashed var(--butter); outline-offset: 3px; }
.sw-label { font: 700 11px 'Rubik'; color: var(--plum); }
.grille { width: 72px; height: 48px; rotate: -22deg; background: radial-gradient(circle, #1f5c48 0 2.4px, rgba(255,255,255,.55) 2.6px 3.2px, transparent 3.5px) 0 0 / 14px 12px; }

.help { margin-top: 10px; font-size: 13px; opacity: .55; text-align: center; }

/* ================= big screens ================= */
@media (min-width: 1000px) and (min-height: 820px) {
  :root { --cw: 122px; --ledge: 80px; }
  .rack { width: min(980px, 100%); }
  .console { width: min(940px, 100%); grid-template-columns: 1fr minmax(0, 490px) 1fr; padding: 66px 52px 40px; row-gap: 18px; }
  .shell { border-radius: 50% 50% 90px 90px / 30% 30% 90px 90px; }
  .logo { font-size: 44px; }
  .sub { font-size: 15px; }
  .bezel { padding: 20px 24px 28px; border-radius: 22px 22px 56px 22px; }
  .dpad { grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 52px); }
  .d.mid::after { margin: 16px; height: 20px; }
  .d.up::after { translate: 0 9px; }
  .d.down::after { translate: 0 23px; }
  .d.left::after { translate: 9px 20px; }
  .d.right::after { translate: 23px 20px; }
  .ab { width: 186px; height: 148px; }
  .btn { width: 78px; height: 78px; font-size: 26px; }
  .well { width: 92px; height: 92px; }
  .pill span { width: 62px; height: 17px; }
  .pill, .sw-label { font-size: 12px; }
  .grille { width: 92px; height: 60px; }
  .tag { font-size: 11px; }
}

/* ================= phone ================= */
@media (max-width: 640px) {
  :root { --ledge: 66px; }
  .rack { padding: 8px 8px 0; }
  .rack-inner { padding: 28px 10px 0; justify-content: flex-start; }
  .tag { bottom: 12px; }
  .rail { bottom: 10px; height: 28px; }
  .bracket { display: none; }
  .console {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "brand brand" "screen screen" "dpad ab" "pills extras";
    padding: 50px 18px 34px; row-gap: 18px;
  }
  .shell { border-radius: 46% 46% 46px 46px / 14% 14% 46px 46px; }
  .dpad { grid-template-columns: repeat(3, 36px); grid-template-rows: repeat(3, 36px); }
  .dpad-wrap { padding: 8px; }
  .d.mid::after { margin: 10px; height: 16px; }
  .d.down::after { translate: 0 14px; }
  .d.right::after { translate: 14px 12px; }
  .d.left::after { translate: 6px 12px; }
  .ab { width: 124px; height: 100px; }
  .btn { width: 54px; height: 54px; }
  .well { width: 66px; height: 66px; }
  .pills { gap: 12px; }
  .pill span { width: 40px; }
  .extras { gap: 12px; }
  .grille { width: 44px; }
  .console > .screw { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------- account: corner bar (shared widget) + on-screen Player screen ---------- */
.corner { position: fixed; top: 12px; right: 14px; left: 14px; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 10px; pointer-events: none; }
.corner > * { pointer-events: auto; }
.corner-link { font: 700 13px 'Rubik', sans-serif; color: #fdf6e9; text-decoration: none; padding: 8px 14px; border-radius: 999px; background: rgba(40, 24, 34, .55); box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 3px 0 rgba(0,0,0,.35); backdrop-filter: blur(6px); }
.corner-link:hover { background: rgba(40, 24, 34, .75); }
.acct { display: flex; align-items: center; gap: 8px; }
.acct-row { display: flex; gap: 6px; }
.acct-btn { display: inline-flex; align-items: center; gap: 6px; font: 700 12px 'Rubik', sans-serif; color: #2b1d2a; padding: 8px 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #fff4dc, #ffd98a); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15), 0 3px 0 #a06d1e; transition: transform .1s; }
.acct-btn:hover { transform: translateY(-1px); }
.acct-btn:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0,0,0,.15), 0 1px 0 #a06d1e; }
.acct-btn svg { width: 15px; height: 15px; }
.acct-me { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: #fdf6e9; font: 700 13px 'Rubik', sans-serif; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(40, 24, 34, .55); box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.acct-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: #ff7a8a; font: 700 12px 'Rubik', sans-serif; }
.acct-out { border: 0; background: none; color: #fdf6e9; opacity: .75; font: 500 12px 'Rubik', sans-serif; text-decoration: underline; cursor: pointer; }
.acct-cta { color: #ffd98a; font: 700 13px 'Rubik', sans-serif; }

.scr-acct { display: flex; flex-direction: column; }
.a-head { font-size: 4.2cqw; line-height: 1.35; margin-bottom: 3cqw; }
.a-head p { opacity: .85; }
.a-who { display: flex; align-items: center; gap: 3cqw; margin-bottom: 2cqw; }
.a-who img, .a-who span { width: 12cqw; height: 12cqw; border-radius: 2cqw; object-fit: cover; image-rendering: pixelated; filter: grayscale(1) contrast(1.2); mix-blend-mode: multiply;
  display: grid; place-items: center; background: var(--lcd-ink); color: var(--lcd); }
.a-who b { font-size: 6cqw; font-weight: 600; }
.a-menu li { grid-template-columns: 4cqw 1fr; }
@media (max-width: 640px) { .corner-link { font-size: 12px; padding: 7px 10px; } .acct-btn span { display: none; } .acct-out { display: none; } }
.scr-acct .a-head { margin-bottom: 1.5cqw; font-size: 3.8cqw; }
.scr-acct .a-who { margin-bottom: 1cqw; }
.scr-acct .a-menu { gap: 1.2cqw; }
.scr-acct .scr-foot { font-size: 3.6cqw; }
