:root {
  --bg: #0a0614;
  --bg2: #140b26;
  --ink: #e9e4ff;
  --dim: #8a80a8;
  --pink: #ff3df2;
  --cyan: #3df2ff;
  --gold: #ffd23d;
  --pixel: 'Press Start 2P', ui-monospace, monospace;
  --term: 'VT323', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(ellipse at 50% -10%, #2a1050 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%) fixed;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--term);
  font-size: 20px;
  min-height: 100vh;
}
/* CRT scanlines over everything */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  z-index: 100;
}
html.no-crt body::after { display: none; }
a { color: inherit; }

/* ---------- arcade index ---------- */
.marquee {
  text-align: center;
  padding: 76px 16px 24px; /* clear of the coffee button in the corner */
}
.marquee h1 {
  font-family: var(--pixel);
  font-size: clamp(28px, 6vw, 64px);
  margin: 0;
  letter-spacing: 4px;
  color: #fff;
  text-shadow: 0 0 6px var(--pink), 0 0 18px var(--pink), 0 0 40px #8a1aff, 4px 4px 0 #3b0b5e;
}
.marquee h1 span { color: var(--cyan); text-shadow: 0 0 4px rgba(61, 242, 255, .8), 0 0 12px rgba(61, 242, 255, .5), 0 0 30px rgba(26, 107, 255, .6), 4px 4px 0 #0b2a5e; }
.marquee p {
  font-family: var(--pixel);
  font-size: clamp(9px, 1.4vw, 12px);
  color: var(--dim);
  margin: 18px 0 0;
  letter-spacing: 2px;
}
.marquee .tagline { color: #e9e4ff; line-height: 1.6; text-shadow: 0 0 8px rgba(255, 61, 242, .45); }
.marquee .tagline b { white-space: nowrap; color: var(--gold); font-weight: normal; text-shadow: 0 0 8px rgba(255, 210, 61, .55); }
.coin { color: var(--gold); animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

#lobby { max-width: 1440px; margin: 0 auto; padding: 8px 24px 48px; }
.shelf { margin-top: 28px; scroll-margin-top: 64px; }

/* category quick-jump bar: sticks to the top while you scroll */
.cats {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 112px;
  background: rgba(10, 6, 20, .88);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid #2b1c4a;
}
.cats a {
  font-family: var(--pixel); font-size: 10px; letter-spacing: 1px;
  color: #e9e4ff; text-decoration: none; white-space: nowrap;
  padding: 9px 12px; border: 2px solid #2b1c4a; border-radius: 6px; background: #120a22;
  transition: border-color .15s, color .15s, background .15s;
}
.cats a small { font-size: 7px; color: var(--dim); margin-left: 4px; }
.cats a:hover, .cats a:focus-visible { border-color: var(--gold); color: var(--gold); outline: none; }
.cats a.on { background: var(--gold); border-color: var(--gold); color: #1a0a2a; }
.cats a.on small { color: #4a3a10; }
@media (max-width: 640px) {
  .cats { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding: 10px 104px 10px 16px; scrollbar-width: none; gap: 8px; } /* room for the coffee cup and gear */
  .cats::-webkit-scrollbar { display: none; }
  .cats a { font-size: 9px; padding: 8px 10px; }
  .shelf { scroll-margin-top: 56px; }
}
.shelf-title {
  display: flex; align-items: baseline; gap: 14px;
  margin: 0 0 14px; padding-bottom: 8px;
  border-bottom: 2px dashed rgba(255, 255, 255, .15);
  font: 400 clamp(11px, 1.6vw, 15px)/1.4 'Press Start 2P', monospace;
  color: var(--gold); letter-spacing: 2px;
}
.shelf-title small { font-size: .6em; color: var(--dim); letter-spacing: 1px; }
.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 1150px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 880px)  { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } #lobby { padding: 0 16px 32px; } .shelf { margin-top: 20px; } }

.tile {
  --c: var(--pink);
  display: flex; flex-direction: column;
  text-decoration: none;
  background: #120a22;
  border: 2px solid #2b1c4a;
  border-radius: 10px;
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  outline: none;
}
.tile:hover, .tile:focus-visible {
  transform: translateY(-4px);
  border-color: var(--c);
  box-shadow: 0 0 0 1px var(--c), 0 0 24px -4px var(--c), 0 12px 30px -10px #000;
}
.screen {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #000;
  border-bottom: 2px solid #2b1c4a;
  overflow: hidden;
}
.screen img {
  width: 100%; height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
  filter: saturate(1.15) contrast(1.05);
  transition: transform .3s ease;
}
.tile:hover .screen img { transform: scale(1.04); }
/* gameplay preview clip, laid over the screenshot while hovering */
.screen .preview {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; image-rendering: pixelated;
  opacity: 0; transition: opacity .2s; z-index: 1;
}
.tile.previewing .preview { opacity: 1; }
.tile.previewing .play { background: none; place-items: end center; padding-bottom: 8px; font-size: 9px; z-index: 2; }
.screen .num, .screen .saved, .screen .play { z-index: 2; }
.screen::after { /* glass glare */
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.08) 0%, transparent 35%);
  pointer-events: none;
}
.screen .num {
  position: absolute; top: 6px; left: 6px;
  font-family: var(--pixel); font-size: 8px;
  background: rgba(0,0,0,.7); color: var(--c);
  padding: 4px 5px; border-radius: 3px;
}
.screen .play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--pixel); font-size: 11px; color: #fff;
  background: rgba(0,0,0,.45);
  opacity: 0; transition: opacity .15s;
  text-shadow: 0 0 8px var(--c);
}
.tile:hover .play, .tile:focus-visible .play { opacity: 1; }
.screen .saved {
  position: absolute; top: 6px; right: 6px;
  font-family: var(--pixel); font-size: 7px;
  background: var(--gold); color: #1a0a2a;
  padding: 4px 5px; border-radius: 3px;
}
@media (pointer: coarse) { .screen .play { display: none; } }
.fallback {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-family: var(--pixel); font-size: 10px; color: var(--c);
}
.meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.meta h2 {
  font-family: var(--pixel);
  font-size: clamp(8px, 0.9vw, 11px);
  line-height: 1.4;
  margin: 0;
  color: var(--c);
}
.meta .genre { font-size: 17px; color: var(--dim); }
.meta .blurb { font-size: 17px; line-height: 1.05; color: #c9c1e6; margin: 2px 0 0; }
.meta .hi { margin-top: auto; padding-top: 6px; font-family: var(--pixel); font-size: 7px; color: var(--gold); }
@media (max-width: 640px) { .meta .blurb { display: none; } }

footer.site {
  text-align: center;
  color: var(--dim);
  padding: 0 16px 40px;
  font-size: 18px;
}
footer.site kbd {
  font-family: var(--pixel); font-size: 8px;
  border: 1px solid #3b2b5e; border-radius: 3px; padding: 3px 5px; color: var(--ink);
}

/* ---------- play page ---------- */
body.play { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 2px solid #2b1c4a;
  background: rgba(10, 6, 20, .8);
  font-family: var(--pixel); font-size: 10px;
}
.bar a.back { text-decoration: none; color: var(--cyan); white-space: nowrap; }
.bar a.back:hover { text-shadow: 0 0 8px var(--cyan); }
.bar h1 { flex: 1; text-align: center; font-size: clamp(10px, 2vw, 16px); margin: 0; color: var(--c, var(--pink)); text-shadow: 0 0 10px var(--c, var(--pink)); }
.bar button {
  font-family: var(--pixel); font-size: 9px;
  background: #1c1235; color: var(--ink);
  border: 1px solid #3b2b5e; border-radius: 4px;
  padding: 7px 9px; cursor: pointer;
}
.bar button:hover { border-color: var(--c, var(--pink)); }
.stage {
  flex: 1; min-height: 0;
  display: grid; place-items: center;
  padding: 12px;
}
.cabinet {
  padding: 10px;
  border-radius: 12px;
  background: #05030a;
  box-shadow: 0 0 0 2px #2b1c4a, 0 0 40px -8px var(--c, var(--pink));
  line-height: 0;
}
#screen {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
  touch-action: none;
  display: block;
}
.help {
  text-align: center;
  color: var(--dim);
  padding: 6px 16px 12px;
  font-size: 19px;
}
.help b { color: var(--ink); font-weight: normal; }

/* pause menu, drawn over the canvas */
.cabinet { position: relative; }
.pausemenu {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 10px;
  line-height: normal; text-align: center;
}
.pausemenu h2 { margin: 0; font-family: var(--pixel); font-size: clamp(12px, 4vw, 20px); color: var(--gold); text-shadow: 0 0 10px var(--gold); }
.pausemenu p { margin: 0 0 6px; font-size: 17px; color: #c9c1e6; }
.pausemenu[hidden] { display: none; }
/* how to play card, over the game screen */
.howto { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; padding: 10px; background: rgba(6, 3, 14, .82); }
.howto[hidden] { display: none; }
.howto-card {
  max-width: 520px; width: 100%; max-height: 100%; overflow-y: auto;
  background: #120a22; border: 2px solid var(--c, var(--pink)); border-radius: 8px; padding: 14px 18px;
  box-shadow: 0 0 24px -6px var(--c, var(--pink)); text-align: left;
}
.howto h2 { margin: 0 0 8px; font-family: var(--pixel); font-size: clamp(10px, 2.6vw, 14px); color: var(--gold); line-height: 1.5; }
.howto h3 { margin: 10px 0 2px; font-family: var(--pixel); font-size: 9px; color: var(--c, var(--cyan)); letter-spacing: 1px; }
.howto p, .howto li { margin: 0; font-size: 18px; line-height: 1.2; color: #e9e4ff; }
.howto .howto-about { color: #c9c1e6; }
.howto ul { margin: 0; padding-left: 18px; }
.howto li { margin: 2px 0; }
.howto button {
  margin-top: 12px; display: inline-flex; gap: 10px; align-items: center; cursor: pointer;
  font-family: var(--pixel); font-size: 10px; color: var(--ink); background: #1c1235;
  border: 2px solid #3b2b5e; border-radius: 6px; padding: 9px 14px;
}
.howto button:hover, .howto button:focus-visible { border-color: var(--c, var(--pink)); outline: none; }
.howto kbd { font-family: var(--pixel); font-size: 8px; color: var(--dim); border: 1px solid #3b2b5e; border-radius: 3px; padding: 2px 4px; }
body.has-touch .howto kbd { display: none; }
html.shot .howto { display: none !important; }
.pausemenu button {
  min-width: min(240px, 70%);
  font-family: var(--pixel); font-size: 11px;
  background: rgba(20, 11, 38, .92); color: var(--ink);
  border: 2px solid #3b2b5e; border-radius: 8px;
  padding: clamp(7px, 1.6vh, 12px) 16px; cursor: pointer;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.pausemenu button:hover, .pausemenu button:focus-visible { border-color: var(--c, var(--pink)); box-shadow: 0 0 14px -4px var(--c, var(--pink)); outline: none; }
.pausemenu kbd { font-family: var(--pixel); font-size: 8px; color: var(--dim); border: 1px solid #3b2b5e; border-radius: 3px; padding: 3px 5px; }
body.has-touch .pausemenu kbd { display: none; }
body.has-touch .pausemenu button { justify-content: center; }
/* phones: the pause menu and How to Play fill the screen and sit dead centre, instead of being
   squeezed into the game screen (which is tiny when the phone is sideways) */
body.has-touch .pausemenu, body.has-touch .howto {
  position: fixed; inset: 0; z-index: 70;
  padding: calc(12px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}
body.has-touch .pausemenu { background: rgba(6, 3, 14, .88); }
body.has-touch .pausemenu button { min-width: 0; width: min(280px, 100%); white-space: nowrap; font-size: 12px; padding: 13px 16px; }
body.has-touch .howto-card { max-height: 100%; }
@media (orientation: landscape) {
  /* sideways there's little height, so the buttons sit two by two */
  body.has-touch .pausemenu { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); justify-content: center; align-content: center; gap: 10px 12px; }
  body.has-touch .pausemenu h2, body.has-touch .pausemenu p { grid-column: 1 / -1; }
  body.has-touch .pausemenu button { width: 100%; }
}

/* touch controls: a translucent overlay, only on touch screens */
.touch { display: none; }
body.has-touch .touch {
  display: block;
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 0; pointer-events: none;
  z-index: 50;
  user-select: none; -webkit-user-select: none;
}
body.has-touch .help { display: none; }
body.play.has-touch { touch-action: none; overscroll-behavior: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.stick {
  position: fixed;
  left: calc(22px + env(safe-area-inset-left));
  bottom: calc(26px + env(safe-area-inset-bottom));
  width: 128px; height: 128px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.05) 0 55%, rgba(255,255,255,.09) 56% 100%);
  border: 2px solid rgba(255,255,255,.18);
  pointer-events: auto; touch-action: none;
  display: grid; place-items: center;
}
.stick::before { /* faint direction ticks */
  content: ''; position: absolute; inset: 10px; border-radius: 50%;
  background:
    linear-gradient(rgba(255,255,255,.18), rgba(255,255,255,.18)) center 0 / 2px 10px no-repeat,
    linear-gradient(rgba(255,255,255,.18), rgba(255,255,255,.18)) center 100% / 2px 10px no-repeat,
    linear-gradient(rgba(255,255,255,.18), rgba(255,255,255,.18)) 0 center / 10px 2px no-repeat,
    linear-gradient(rgba(255,255,255,.18), rgba(255,255,255,.18)) 100% center / 10px 2px no-repeat;
}
.knob {
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255,255,255,.16);
  border: 2px solid rgba(255,255,255,.3);
  pointer-events: none;
  transition: transform .06s linear;
}
.stick.aim { left: auto; right: calc(22px + env(safe-area-inset-right)); }
.stick.aim::after { /* crosshair marks it as the fire stick */
  content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.22);
}
/* d-pad variant of the stick: a cross of four arrow arms */
.stick.dpad { width: 144px; height: 144px; border-radius: 0; background: none; border: 0; }
.stick.dpad::before { display: none; }
.dpad .arm, .dpad .hub { position: absolute; width: 48px; height: 48px; pointer-events: none;
  background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.24); box-sizing: border-box; }
.dpad .hub { left: 48px; top: 48px; border-radius: 4px; background: rgba(255,255,255,.06); }
.dpad .up { left: 48px; top: 0; border-radius: 12px 12px 4px 4px; }
.dpad .down { left: 48px; bottom: 0; border-radius: 4px 4px 12px 12px; }
.dpad .left { left: 0; top: 48px; border-radius: 12px 4px 4px 12px; }
.dpad .right { right: 0; top: 48px; border-radius: 4px 12px 12px 4px; }
.dpad .arm::after { content: ''; position: absolute; left: 50%; top: 50%; width: 0; height: 0; border: 9px solid transparent; }
.dpad .up::after { border-bottom: 12px solid rgba(255,255,255,.55); transform: translate(-50%, -75%); }
.dpad .down::after { border-top: 12px solid rgba(255,255,255,.55); transform: translate(-50%, -25%); }
.dpad .left::after { border-right: 12px solid rgba(255,255,255,.55); transform: translate(-75%, -50%); }
.dpad .right::after { border-left: 12px solid rgba(255,255,255,.55); transform: translate(-25%, -50%); }
.dpad .arm.on { background: color-mix(in srgb, var(--c, #ff3df2) 40%, transparent); border-color: color-mix(in srgb, var(--c, #ff3df2) 75%, transparent); }
body.has-aim .abtns { bottom: calc(170px + env(safe-area-inset-bottom)); }
.stick.on { border-color: color-mix(in srgb, var(--c, #ff3df2) 60%, transparent); }
.stick.on .knob { background: color-mix(in srgb, var(--c, #ff3df2) 35%, transparent); transition: none; }
.abtns {
  position: fixed;
  right: calc(18px + env(safe-area-inset-right));
  bottom: calc(30px + env(safe-area-inset-bottom));
  display: flex; gap: 14px; align-items: flex-end;
  pointer-events: auto;
}
.touch .act {
  width: 70px; height: 70px; border-radius: 50%;
  background: rgba(255,255,255,.07);
  border: 2px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.75);
  font-family: var(--pixel); font-size: 8px; letter-spacing: -.5px;
  touch-action: none; padding: 0;
}
.touch .act[data-btn=b] { margin-bottom: 34px; width: 58px; height: 58px; }
.touch .act.on { background: color-mix(in srgb, var(--c, #ff3df2) 35%, transparent); border-color: var(--c, #ff3df2); color: #fff; }
/* portrait phones: keep the game above the controls */
@media (orientation: portrait) {
  body.has-touch .stage { padding-bottom: calc(180px + env(safe-area-inset-bottom)); padding-top: 10px; }
  body.has-touch.has-aim .stage { padding-bottom: calc(250px + env(safe-area-inset-bottom)); }
}
@media (orientation: landscape) {
  body.has-touch .stage { padding: 6px calc(10px + env(safe-area-inset-right)) 6px calc(10px + env(safe-area-inset-left)); }
  body.has-touch .bar { padding-top: 4px; padding-bottom: 4px; }
}
@media (max-width: 640px), (pointer: coarse) {
  .bar { gap: 8px; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .bar .wide { display: none; }
  .bar a.back { font-size: 16px; padding: 4px 6px; }
  .bar button { padding: 9px 10px; min-height: 34px; }
  .bar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* buy me a coffee */
.coffee {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  width: 34px; height: 34px; border-radius: 6px;
  background: #1c1235; border: 1px solid #3b2b5e;
  flex: none;
}
.coffee:hover, .coffee:focus-visible { border-color: var(--gold); box-shadow: 0 0 12px -2px var(--gold); outline: none; }
.coffee svg { width: 22px; height: 22px; image-rendering: pixelated; shape-rendering: crispEdges; }
.coffee-corner { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: calc(54px + env(safe-area-inset-right)); z-index: 60;
  width: auto; gap: 8px; padding: 0 10px 0 7px; }
.coffee-text { font-family: var(--pixel); font-size: 8px; line-height: 1.3; color: var(--dim, #b8b0d8); white-space: nowrap; }
.coffee-text b { color: var(--gold); font-weight: normal; }
.coffee-corner:hover .coffee-text b, .coffee-corner:focus-visible .coffee-text b { text-shadow: 0 0 8px var(--gold); }
/* phones: just the cup up top (the line at the bottom carries the words) */
@media (max-width: 640px) { .coffee-corner { width: 34px; padding: 0; } .coffee-text { display: none; } }
/* once the page scrolls, the category bar sits up top: shrink back to the cup so it stays clear */
body.scrolled .coffee-corner { width: 34px; padding: 0; }
body.scrolled .coffee-text { display: none; }
.coffee-line { text-align: center; padding: 4px 16px 10px; font-family: var(--pixel); font-size: 9px; }
.coffee-line a { color: var(--gold); text-decoration: none; }
.coffee-line .copy { display: block; margin-top: 8px; font-size: 7px; color: var(--dim); opacity: .7; letter-spacing: 1px; }
body.has-touch .coffee-line .copy { margin-top: 3px; font-size: 6px; }
.coffee-line a:hover { text-shadow: 0 0 8px var(--gold); text-decoration: underline; }
body.has-touch .coffee-line {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(6px + env(safe-area-inset-bottom));
  padding: 0; font-size: 7px; opacity: .8; z-index: 55; white-space: nowrap;
}

/* screenshot mode: only the screen, letterboxed */
html.shot body::after, html.shot .bar, html.shot .help, html.shot .touch, html.shot .coffee-line { display: none !important; }
html.shot body { background: #000; }
html.shot .stage { padding: 0; }
html.shot .cabinet { padding: 0; box-shadow: none; border-radius: 0; }

.touch-only { display: none; }
@media (pointer: coarse) { .touch-only { display: inline; } .kbd-only { display: none; } }
@media (max-width: 640px) { .marquee { padding-top: 56px; } }

/* settings: gear in the top-right corner, opens a cabinet-style panel */
.gear-corner {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); z-index: 60;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border-radius: 6px; cursor: pointer;
  background: #1c1235; border: 1px solid #3b2b5e;
}
.gear-corner:hover, .gear-corner:focus-visible { border-color: var(--cyan); box-shadow: 0 0 12px -2px var(--cyan); outline: none; }
.gear-corner:hover svg { animation: gear-turn 1.2s steps(8) infinite; }
@keyframes gear-turn { to { transform: rotate(360deg); } }
.gear-corner svg { width: 22px; height: 22px; image-rendering: pixelated; shape-rendering: crispEdges; }
@media (prefers-reduced-motion: reduce) { .gear-corner:hover svg { animation: none; } }

dialog.settings {
  width: min(380px, calc(100vw - 32px)); padding: 18px 20px 14px;
  background: #120a22; color: var(--ink);
  border: 3px solid var(--cyan); border-radius: 4px;
  box-shadow: 0 0 0 3px #120a22, 0 0 0 6px var(--pink), 0 0 40px -4px var(--pink);
  font-family: var(--pixel);
}
dialog.settings::backdrop { background: rgba(5, 2, 12, .75); }
.set-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.set-head h2 { margin: 0; font-size: 14px; letter-spacing: 3px; color: var(--gold); text-shadow: 2px 2px 0 #5e3b0b; }
.set-x {
  font: 18px/1 var(--pixel); color: var(--dim); background: none; border: 0; cursor: pointer; padding: 4px 6px;
}
.set-x:hover, .set-x:focus-visible { color: var(--pink); outline: none; }
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 2px dashed rgba(255, 255, 255, .12); font-size: 11px; letter-spacing: 1px;
}
/* two-segment ON/OFF switch; the lit half is the current value */
.switch { display: inline-flex; padding: 0; border: 2px solid #3b2b5e; border-radius: 4px; background: #0a0614; cursor: pointer; }
.switch b { font: 400 9px/1 var(--pixel); padding: 8px 10px; color: #5a5078; }
.switch[aria-checked="true"] b:first-child { background: var(--cyan); color: #0a0614; }
.switch[aria-checked="false"] b:last-child { background: var(--pink); color: #0a0614; }
.switch:hover, .switch:focus-visible { border-color: var(--gold); outline: none; }
.set-danger { padding: 16px 0 4px; text-align: center; }
.set-danger p { font: 16px/1.2 var(--term); color: var(--dim); margin: 8px 0 0; }
.set-danger button {
  font: 400 10px/1 var(--pixel); letter-spacing: 1px; cursor: pointer;
  padding: 11px 14px; border-radius: 4px; border: 2px solid #ff3d5a; background: #2a0a14; color: #ff6b80;
}
.set-danger button:hover, .set-danger button:focus-visible { background: #ff3d5a; color: #fff; outline: none; }
.set-danger .set-no { border-color: #3b2b5e; background: #1c1235; color: var(--ink); }
.set-danger .set-no:hover, .set-danger .set-no:focus-visible { background: var(--gold); border-color: var(--gold); color: #1a0a2a; }
.set-danger p.set-ask { font: 10px/1.6 var(--pixel); color: #ff6b80; margin: 0 0 12px; }
.set-danger p.set-ask.done { color: var(--gold); margin: 6px 0; animation: blink 1s steps(2, start) 3; }
.set-yn { display: flex; gap: 10px; justify-content: center; }
.set-foot { margin: 14px 0 0; font-size: 7px; color: var(--dim); text-align: center; letter-spacing: 1px; }
@media (pointer: coarse) { .set-foot { display: none; } }
.nw { white-space: nowrap; }
