:root {
  --green: #0b6e4f;
  --green-dark: #07503a;
  --cream: #fff6e3;
  --ink: #2a1a0e;
  --orange: #f2711c;
  --far: #19b8a6;      /* far-lane colour */
  --near: #f5b014;     /* near-lane colour */
  --p1: #1f9d55;
  --p2: #e4572e;
  --radius: 16px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Trebuchet MS", system-ui, sans-serif;
}

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

html, body {
  margin: 0;
  height: 100%;
  background: #2a1a0e;
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

[hidden] { display: none !important; }

#app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #8fd3ff;
  overflow: hidden;
}

/* ---------- HUD ---------- */
#hud {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  background: var(--green-dark);
  color: var(--cream);
  z-index: 2;
}
.pchip {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-bottom: 4px solid var(--p1);
}
.pchip.p2 { justify-content: flex-end; text-align: right; border-bottom-color: var(--p2); }
.pchip.p1 { justify-content: space-between; }
.pchip.p2 { justify-content: space-between; }
.pmeta { min-width: 0; }
.pname { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prole { font-size: 11px; font-weight: 700; letter-spacing: 0.02em; opacity: 0.95; white-space: nowrap; }
.prole b { color: #ffd76a; }
.pstatus { font-size: 11px; opacity: 0.75; min-height: 14px; }
.pstatus.ready { color: #9af0b5; opacity: 1; }
.pscore {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-width: 1.2em;
  text-align: center;
}
.pscore.bump { animation: bump 0.35s ease-out; }
@keyframes bump { 30% { transform: scale(1.45); color: #ffd76a; } }

.mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.pchip.atk { background: rgba(255, 215, 106, 0.22); box-shadow: inset 0 0 0 2px #ffd76a; }
.strikes { display: flex; gap: 4px; margin-top: 2px; }
.pchip.p2 .strikes { justify-content: flex-end; }
.strikes i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--cream); }
.strikes i.on { background: #ffd76a; border-color: #ffd76a; }
.midbtns { display: flex; gap: 6px; }
button.icon {
  font: inherit;
  font-size: 12px;
  width: 30px;
  height: 26px;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: var(--cream);
  cursor: pointer;
}
button.icon.off { opacity: 0.45; text-decoration: line-through; }

/* ---------- Tutorial ---------- */
#tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #ffd76a;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  z-index: 2;
}
#tip span { flex: 1; }
#tip b { color: #7a3d00; }
#tip button {
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(42, 26, 14, 0.14);
  color: var(--ink);
  cursor: pointer;
}
.coachtext { margin: 0; font-size: 15px; line-height: 1.45; text-align: left; }
#coach h2 { font-size: 26px; }
#coach .tag { margin: 0; }
button.leg.hint { animation: hint 0.7s ease-in-out infinite alternate; }
@keyframes hint {
  from { outline: 4px solid rgba(255, 255, 255, 0.2); outline-offset: -4px; }
  to { outline: 4px solid #fff; outline-offset: 2px; filter: brightness(1.15); }
}

/* ---------- Stage ---------- */
#stage { position: relative; flex: 1 1 auto; min-height: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

#bubble {
  position: absolute;
  left: 0; top: 0;
  padding: 6px 12px;
  background: #fffdf5;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-weight: 900;
  font-size: 17px;
  white-space: nowrap;
  pointer-events: none;
  transform-origin: 50% 100%;
  will-change: transform;
}
#bubble::after {            /* tail pointing down at the speaker */
  content: "";
  position: absolute;
  left: 62%; bottom: -9px;
  width: 12px; height: 12px;
  background: #fffdf5;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}
#bubble.right::after { left: 30%; }

#callout {
  position: absolute;
  left: 0; right: 0;
  top: 42px;                  /* clear of the camera button at the top centre */
  text-align: center;
  pointer-events: none;
  font-weight: 900;
  font-size: clamp(24px, 6vw, 38px);
  color: #fff;
  -webkit-text-stroke: 1px rgba(42, 26, 14, 0.5);
  text-shadow: 0 3px 0 rgba(42, 26, 14, 0.55), 0 0 18px rgba(0, 0, 0, 0.25);
  opacity: 0;
}
#callout small { display: block; font-size: 0.5em; margin-top: 2px; -webkit-text-stroke: 0; }
#callout.show { animation: pop 0.9s ease-out forwards; }
#callout.count.show { animation: pop 0.5s ease-out forwards; font-size: clamp(40px, 12vw, 80px); }
#callout.meet { color: #ffe27a; }
#callout.miss { color: #bff3ff; }
#callout.late { color: #ffb4a2; }
@keyframes pop {
  0% { opacity: 0; transform: scale(0.6); }
  15% { opacity: 1; transform: scale(1.12); }
  30% { transform: scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}

#beats {
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
#beats i {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: 2px solid rgba(42, 26, 14, 0.35);
  transition: transform 0.08s, background 0.08s;
}
#beats i.chant { width: 9px; height: 9px; }
#beats i.move { width: 20px; height: 20px; }
#beats i.on { background: #fff; transform: scale(1.35); }
#beats i.move.on { background: var(--orange); }

/* ---------- Controls ---------- */
#controls {
  display: flex;
  gap: 14px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: var(--green-dark);
  z-index: 2;
}
.cgroup { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.cgroup > label { color: var(--cream); font-size: 11px; font-weight: 800; text-align: center; opacity: 0.85; }
.cgroup .row { display: flex; gap: 8px; }
button.leg {
  flex: 1 1 0;
  min-width: 0;
  min-height: 62px;
  border: 0;
  border-radius: 14px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.05s, box-shadow 0.05s, filter 0.1s;
}
button.leg b { font-size: 17px; font-weight: 900; }
button.leg span { font-size: 11px; font-weight: 700; opacity: 0.75; }
button.leg.far { background: var(--far); }
button.leg.near { background: var(--near); }
button.leg.both { background: linear-gradient(100deg, var(--far) 0 50%, var(--near) 50% 100%); }
button.leg:active, button.leg.down { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
button.leg.chosen { outline: 4px solid #fff; outline-offset: -4px; filter: brightness(1.12); }
.two button.leg b { font-size: 14px; }
.two .cgroup .row { gap: 5px; }

/* ---------- Overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  /* keep clear of the phone's own bars: the status bar on top, the back/home buttons below */
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background: rgba(30, 16, 6, 0.45);
  overflow-y: auto;
}
.panel {
  position: relative;
  width: min(360px, 100%);
  margin: auto;
  padding: 26px 22px 22px;
  background: var(--cream);
  border-radius: 22px;
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.25), 0 24px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.panel.wide { width: min(480px, 100%); text-align: left; }
.ankara {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 14px;
  background:
    repeating-linear-gradient(135deg, var(--orange) 0 10px, transparent 10px 20px),
    repeating-linear-gradient(45deg, var(--green) 0 10px, #ffd76a 10px 20px);
}
h1 {
  margin: 10px 0 0;
  font-size: 58px;
  line-height: 1;
  letter-spacing: 0.06em;
  font-weight: 900;
  color: var(--green);
  text-shadow: 3px 3px 0 #ffd76a, 6px 6px 0 var(--orange);
}
h2 { margin: 4px 0 0; font-size: 30px; font-weight: 900; color: var(--green); }
.tag { margin: 0 0 6px; font-size: 14px; font-weight: 700; opacity: 0.7; }
.block { display: flex; flex-direction: column; gap: 8px; }

.btn {
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  padding: 14px 16px;
  border-radius: 14px;
  border: 0;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(42, 26, 14, 0.25);
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(42, 26, 14, 0.25); }
.btn.primary { background: var(--orange); color: #fff; box-shadow: 0 4px 0 #a9480b; }
.btn.ghost { background: transparent; box-shadow: none; text-decoration: underline; padding: 8px; font-size: 15px; }
.btn:focus-visible, .seg button:focus-visible, button.leg:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }

.seg { display: flex; background: #eadfc6; border-radius: 12px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 8px 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.seg button.on { background: var(--green); color: #fff; }

.rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.4; }
.keys { background: #f3e8cf; border-radius: 12px; padding: 10px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.keys .small { font-size: 12px; opacity: 0.8; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw.far { background: var(--far); }
.sw.near { background: var(--near); }
.sw.both { background: linear-gradient(100deg, var(--far) 0 50%, var(--near) 50% 100%); }
kbd {
  font-family: inherit;
  font-weight: 800;
  font-size: 12px;
  background: #fff;
  border-radius: 5px;
  padding: 1px 6px;
  box-shadow: 0 2px 0 rgba(42, 26, 14, 0.25);
}

.roles { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.roles div { background: #f3e8cf; border-radius: 12px; padding: 10px 12px; border-left: 6px solid var(--p1); text-align: left; }
.roles div.r2 { border-left-color: var(--p2); }
.styles { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.styles h3 { margin: 0 0 4px; font-size: 13px; font-weight: 800; }
.styles .srow { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.styles .srow > span { flex: 0 0 68px; font-size: 12px; font-weight: 700; opacity: 0.75; }
.styles .seg { flex: 1; }
.styles .seg button { font-size: 12px; padding: 7px 2px; }
.roles b.meet { color: #a36a00; }
.roles b.miss { color: #0b6e8f; }

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  #hud { gap: 5px; padding-left: 6px; padding-right: 6px; }
  .pchip { padding: 5px 7px; gap: 6px; }
  .pscore { font-size: 28px; }
  .pname { font-size: 13px; }
  .prole { font-size: 10px; }
  .mid { font-size: 11px; }
  #controls { gap: 8px; }
  h1 { font-size: 48px; }
}
@media (max-height: 520px) {
  button.leg { min-height: 46px; }
  .pstatus { display: none; }
}

/* keep a three-digit score from colliding with the role text */
.pmeta { flex: 1 1 auto; min-width: 0; }
.prole, .pstatus { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pscore { flex: 0 0 auto; }
@media (max-width: 480px) { .pscore { font-size: 24px; } }

/* ---------- Menu tucked away to watch the girls ---------- */
.peekhint { margin: 0; font-size: 12px; opacity: 0.6; }
.peekback { display: none; }
#menu { transition: background 0.2s; }
#menu.peek { background: transparent; cursor: pointer; }
#menu.peek .panel { display: none; }
#menu.peek .peekback {
  display: block;
  position: absolute;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(30, 16, 6, 0.6);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Two-player choice ---------- */
.btn small { display: block; font-size: 12px; font-weight: 600; opacity: 0.75; margin-top: 2px; }
.btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

/* ---------- Character select: a sheet along the bottom, students in view above ---------- */
.overlay.sheet {
  align-items: flex-end;
  padding: 0 10px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(30, 16, 6, 0) 35%, rgba(30, 16, 6, 0.55));
  pointer-events: none;
}
.sheet .panel {
  pointer-events: auto;
  width: min(620px, 100%);
  max-height: 60%;
  margin: auto auto 0;
  padding: 14px 14px 18px;
  gap: 8px;
  overflow-y: auto;
}
.chargrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.charcard {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 3px;
  border: 2px solid rgba(42, 26, 14, 0.18);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
}
.charcard img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 30%; transform: scale(1.25); transform-origin: 50% 40%; background: #dfeeff; }
.charcard span { position: relative; background: #fff; width: 100%; padding-top: 2px; }
.charcard.on { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange); }
.charcard i {
  position: absolute; top: 3px; left: 3px;
  padding: 1px 5px; border-radius: 999px;
  background: var(--p1, #1f9d55); color: #fff; font-style: normal; font-size: 10px;
}
.charcard:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 1px; }
.charinfo { text-align: left; }
.charinfo h2 { margin: 2px 0 0; font-size: 19px; }
.charinfo p { margin: 2px 0 0; font-size: 13px; }
.charinfo .tag { text-align: left; }
.charinfo .school { font-weight: 800; }
.sheetbtns { display: flex; gap: 10px; align-items: center; }
.sheetbtns .btn.primary { flex: 1; }
@media (max-width: 480px) {
  .chargrid { grid-template-columns: repeat(8, 1fr); gap: 3px; }
  .charcard { font-size: 8px; }
  .charcard { font-size: 9px; border-radius: 9px; }
  .sheet .panel { max-height: 64%; }
}

/* ---------- Story mode: journey map ---------- */
.jpanel { text-align: center; }
.jpanel .seg { align-self: center; }
.jmap { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 4px; }
.jnode { position: relative; width: 58px; display: flex; flex-direction: column; align-items: center; font-size: 10px; font-weight: 800; }
.jnode img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: 50% 28%; background: #dfeeff; border: 3px solid rgba(42, 26, 14, 0.2); }
.jnode.done img { filter: grayscale(1); opacity: 0.55; }
.jnode.done::after { content: '✓'; position: absolute; top: 12px; font-size: 22px; color: var(--p1, #1f9d55); }
.jnode.next img { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242, 113, 28, 0.35); }
.jnode.boss img { width: 58px; height: 58px; background: #1a1440; border-color: #8e1b24; }
.jnode.boss { width: 78px; }
.jstyle { text-align: left; font-size: 14px; }
.jstyle summary { cursor: pointer; font-weight: 800; padding: 4px 0; }
.sheetbtns { justify-content: center; }

/* ---------- Versus card ---------- */
#versus { background: rgba(20, 10, 4, 0.72); }
#versus.boss { background: rgba(12, 8, 40, 0.8); }
.vs { width: min(520px, 100%); margin: auto; color: #fff; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.vs p { margin: 0; font-weight: 800; letter-spacing: 0.04em; }
#vsStep { text-transform: uppercase; font-size: 13px; opacity: 0.85; }
.vsrow { display: flex; align-items: center; justify-content: center; gap: 10px; }
.vsside { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.vsside img { width: min(150px, 34vw); aspect-ratio: 1; object-fit: cover; object-position: 50% 28%; border-radius: 18px; background: #dfeeff; border: 4px solid var(--p1); }
.vsside.p2 img { border-color: var(--p2); transform: scaleX(-1); }
#versus.boss .vsside.p2 img { background: #1a1440; border-color: #8e1b24; }
.vsside b { font-size: 22px; }
.vsside span { font-size: 12px; opacity: 0.85; }
.vsmid { font-size: 34px; font-weight: 900; color: var(--orange); text-shadow: 0 3px 0 rgba(0, 0, 0, 0.4); animation: vsPop 0.5s ease-out; }
.vsside.p1 { animation: vsInL 0.45s ease-out; }
.vsside.p2 { animation: vsInR 0.45s ease-out; }
@keyframes vsPop { from { transform: scale(2.4); opacity: 0; } }
@keyframes vsInL { from { transform: translateX(-60px); opacity: 0; } }
@keyframes vsInR { from { transform: translateX(60px); opacity: 0; } }
.vs .btn { align-self: center; min-width: 160px; }
@media (prefers-reduced-motion: reduce) { .vsmid, .vsside.p1, .vsside.p2 { animation: none; } }

/* ---------- A move tied by Agbòràndùn ---------- */
button.leg.bound { filter: grayscale(1) brightness(0.55); position: relative; cursor: not-allowed; }
button.leg.bound::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: repeating-linear-gradient(45deg, transparent 0 14px, rgba(142, 27, 36, 0.85) 14px 20px);
}
button.leg.bound::after {
  content: 'Bound · ' attr(data-left); position: absolute; top: 4px; right: 6px;
  padding: 1px 7px; border-radius: 999px; background: #8e1b24; color: #fff; font-size: 11px; font-weight: 800;
}

/* ---------- Camera the player can turn ---------- */
#stage { touch-action: none; }
#btnSpin {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 48px; height: 30px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 0 0 13px 13px;
  background: var(--green-dark); color: var(--cream); cursor: pointer;
}
#btnSpin svg { width: 23px; height: 17px; }
#btnSpin[hidden] { display: none; }
#btnSpin.on { background: var(--orange); color: #fff; }
#btnSpin.on svg circle { fill: var(--orange); }
#btnSpin:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }

/* ---------- Story pages ---------- */
.sheet .panel.tale { background: rgba(24, 14, 30, 0.92); color: #fff6e3; text-align: left; gap: 6px; padding: 16px 18px 18px; }
.tale .tag { text-align: left; color: #f5b014; text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; margin: 0; }
#taleText { margin: 0; font-size: 18px; line-height: 1.45; min-height: 4.4em; }
#taleText.in { animation: taleIn 0.5s ease-out; }
@keyframes taleIn { from { opacity: 0; transform: translateY(6px); } }
.tale .sheetbtns { justify-content: space-between; }
.tale .sheetbtns .btn.primary { flex: 0 1 auto; min-width: 130px; }
.tale .btn.ghost { color: #fff6e3; }
#taleDots { font-size: 12px; opacity: 0.6; }
@media (prefers-reduced-motion: reduce) { #taleText.in { animation: none; } }

/* ---------- Locked characters, reward and shop ---------- */
.charcard.locked img { filter: grayscale(0.85) brightness(0.8); }
.charcard.secret img { filter: brightness(0) opacity(0.75); background: #2a2140; }
.charcard.owned { opacity: 0.4; }
.charcard em { position: absolute; top: 2px; right: 3px; font-style: normal; font-size: 13px; }
.btn.reward { background: var(--p1); color: #fff; box-shadow: 0 4px 0 #14693a; }
.shopnote { margin: 0; font-size: 14px; }
/* Shown after a purchase, on its own screen so it cannot be missed. */
.boughtfaces { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.boughtfaces img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; object-position: 50% 28%; background: #dfeeff; border: 3px solid var(--orange); animation: boughtIn 0.5s ease-out backwards; }
.boughtfaces.many img { width: 46px; height: 46px; border-width: 2px; }
.boughtline { margin: 0; font-size: 20px; font-weight: 900; color: var(--green); text-align: center; }
@keyframes boughtIn { from { opacity: 0; transform: scale(0.5); } }
@media (prefers-reduced-motion: reduce) { .boughtfaces img { animation: none; } }
.shoplist { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; }
.shoprow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; background: #fff; }
.shoprow img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 28%; background: #dfeeff; }
.shoprow div { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.shoprow span { font-size: 12px; opacity: 0.75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shoprow .btn { flex: 0 0 auto; padding: 8px 12px; font-size: 13px; }

/* ---------- Account ---------- */
.acctin { display: flex; flex-direction: column; gap: 8px; }
.acctin label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 800; text-align: left; }
.acctin input { font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 2px solid rgba(42, 26, 14, 0.25); background: #fff; color: var(--ink); }
.acctin input:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 1px; }
.acctin .or { font-size: 12px; opacity: 0.6; text-align: center; }
.acctin .sheetbtns .btn { flex: 1; }
.acctopt { display: flex; align-items: flex-start; gap: 10px; text-align: left; font-size: 14px; font-weight: 800; cursor: pointer; }
.acctopt[hidden] { display: none; }
.acctopt input { width: 22px; height: 22px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--green); }
.acctopt small { display: block; font-weight: 600; font-size: 12px; opacity: 0.75; margin-top: 2px; }
.acctmsg { margin: 0; min-height: 1.3em; font-size: 14px; font-weight: 700; color: #a8402a; text-align: center; }

/* ---------- Online ---------- */
.joinrow { display: flex; gap: 8px; }
.joinrow input { width: 6.5em; text-transform: uppercase; text-align: center; letter-spacing: 0.2em; font-weight: 800; }
.joinrow .btn { flex: 1; }
.coderow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 14px; background: #fff; }
.coderow div { display: flex; flex-direction: column; text-align: left; }
.coderow span { font-size: 12px; opacity: 0.7; }
.coderow b { font-size: 30px; letter-spacing: 0.18em; }
.coderow .btn { padding: 8px 12px; font-size: 13px; }
.lobrow { color: var(--ink); }
.lobrow .vsside img { width: min(110px, 28vw); }
.lobrow .vsside img.empty { filter: brightness(0) opacity(0.25); }
.lobrow .vsside b { font-size: 16px; }
.lobrow .vsmid { font-size: 24px; animation: none; }
.lobrow .vsside.p1, .lobrow .vsside.p2 { animation: none; }

/* ---------- Title ---------- */
#menu h1 span { display: block; margin-top: 6px; font-size: 0.4em; line-height: 1.2; letter-spacing: 0.03em; color: #8e1b24; text-shadow: none; -webkit-text-stroke: 0; }

/* ---------- Ranked and leaderboard ---------- */
.resrank { margin: 0; font-size: 17px; font-weight: 900; color: #a8402a; }
.resrank.up { color: var(--green); }
.boardrow { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: #fff; }
.boardrow.me { outline: 3px solid var(--orange); }
#boardTabs button { flex: 1; }
.boardwhen { font-size: 12px; opacity: 0.75; min-height: 1.2em; }
.boardchamp { margin: 0; padding: 7px 10px; border-radius: 12px; background: #fff3c9; font-size: 13px; font-weight: 700; text-align: center; }
.boardchamp[hidden] { display: none; }
.boardrow em small { display: block; font-size: 10px; font-weight: 700; opacity: 0.6; text-align: right; }
.boardrow i { width: 1.8em; font-style: normal; font-weight: 900; text-align: right; opacity: 0.7; }
.boardrow img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: 50% 28%; background: #dfeeff; }
.boardrow img.own { object-position: 50% 50%; }
.boardrow div { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.boardrow span { font-size: 12px; opacity: 0.75; }
.boardrow em { font-style: normal; font-weight: 900; font-size: 18px; color: var(--green); }
#menu .panel { gap: 8px; }

/* ---------- Watching ---------- */
#watchCount { font-size: 11px; font-weight: 800; color: var(--cream); opacity: 0.85; }
#watch .boardrow img + img { margin-left: -18px; }
#watch .boardrow .btn { flex: 0 0 auto; padding: 8px 14px; font-size: 13px; }
.coderow { flex-wrap: wrap; }
#menu .btn.ghost { padding: 5px 8px; font-size: 14px; }

/* ---------- No keyboard: hide key hints ---------- */
.nokb { display: none; }
.nokeys .kb, .nokeys button.leg span { display: none; }
.nokeys .nokb { display: block; }
.jnode.unseen img { filter: brightness(0) opacity(0.8); }
.jnode.unseen::before { content: '?'; position: absolute; top: 12px; font-size: 28px; font-weight: 900; color: #fff; z-index: 1; }

/* ---------- A flash of light (the woman becomes the girl) ---------- */
#flash { position: absolute; inset: 0; background: #fff8e0; opacity: 0; pointer-events: none; z-index: 1; }
#flash.go { animation: flashGo 1.1s ease-out; }
@keyframes flashGo { 0% { opacity: 0; } 12% { opacity: 0.95; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #flash.go { animation-duration: 0.01s; } }

/* ---------- Grown-up check ---------- */
.gaterow { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 26px; }
.gaterow input { width: 4em; font: inherit; font-size: 24px; font-weight: 800; text-align: center; padding: 8px; border-radius: 10px; border: 2px solid rgba(42, 26, 14, 0.25); background: #fff; color: var(--ink); }
.shoprow .btn:not(:disabled) { background: var(--orange); color: #fff; box-shadow: 0 3px 0 #a9480b; font-weight: 800; }

/* ---------- Links to the policy pages ---------- */
.legal { margin: 0; font-size: 12px; text-align: center; opacity: 0.8; }
.legal a { color: inherit; font-weight: 700; }
.ver { margin: 0; font-size: 11px; text-align: center; opacity: 0.55; user-select: text; -webkit-user-select: text; }

/* ---------- Delete account, forgot password ---------- */
.btn.small { font-size: 13px; padding: 4px 8px; }
.btn.danger { background: #a8402a; color: #fff; box-shadow: 0 4px 0 #6f2718; }
.dellist { margin: 0; padding-left: 20px; text-align: left; font-size: 14px; }
.dellabel { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 800; text-align: left; }
.dellabel input { font: inherit; font-size: 18px; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; padding: 10px 12px; border-radius: 10px; border: 2px solid rgba(42, 26, 14, 0.25); background: #fff; color: var(--ink); }
