/* DAWNWRIT UI — "illuminated neon": a manuscript page under a blacklight.
   Owned by the UI Engineer. Colour variables mirror RW.PAL in js/core.js. */

:root {
  --ink: #0d0a14; --night: #16111f; --stone: #2a2438; --mortar: #3d3551; --slate: #5a5070;
  --parchment: #e8dcc0; --vellum: #b9a888; --bone: #f6efdc;
  --blood: #c1121f; --blood-dark: #7a0c16;
  --ember: #ff2e88; --glass: #19d3c5; --gilt: #f2b632; --verdigris: #3ea37a; --royal: #6b3fa0;
  --timber: #6b4226; --timber-dark: #3f2616; --steel: #aab3c5; --steel-dark: #5d6578;

  --ember-deep: #b0125a;         /* ember, pressed into wax */
  --ink-soft: #3a3046;           /* secondary text on parchment */
  --gilt-deep: #a86f12;          /* gilt that still reads on parchment */

  --f-black: 'Pirata One', 'UnifrakturCook', 'Old English Text MT', 'Luminari', fantasy;
  --f-mark: 'UnifrakturCook', 'Pirata One', 'Old English Text MT', 'Luminari', fantasy;
  --f-px: 'Pixelify Sans', 'Silkscreen', ui-monospace, 'Courier New', monospace;

  --px: 2px;                     /* one "pixel" of the UI */
  --gap: 24px;
  --page: 1180px;
  --bar-h: 60px;
  --tab-h: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--f-px); font-size: 17px; line-height: 1.5; color: var(--parchment);
  font-variant-numeric: tabular-nums; background: var(--ink);
  display: flex; flex-direction: column;
  padding-bottom: var(--tab-h);
}
h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
canvas.px, .px { image-rendering: pixelated; image-rendering: crisp-edges; image-rendering: pixelated; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--glass); outline-offset: 3px; }
.folio :focus-visible { outline-color: var(--ember-deep); }
h1:focus-visible { outline: none; }

.skip { position: fixed; left: 12px; top: -80px; z-index: 90; padding: 10px 14px; background: var(--gilt); color: var(--ink); text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- the ground: slow hue drift behind everything ---------- */
.ground {
  position: fixed; inset: -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 12% 8%, rgba(255, 46, 136, .30), transparent 70%),
    radial-gradient(55% 55% at 92% 30%, rgba(25, 211, 197, .20), transparent 70%),
    radial-gradient(70% 60% at 50% 110%, rgba(107, 63, 160, .42), transparent 70%),
    var(--ink);
  animation: drift 48s linear infinite alternate;
}
/* masonry: faint courses of stone so the dark is a wall, not a void */
.ground::after {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(rgba(13, 10, 20, .55) 2px, transparent 2px),
    linear-gradient(90deg, rgba(13, 10, 20, .55) 2px, transparent 2px),
    linear-gradient(90deg, rgba(13, 10, 20, .55) 2px, transparent 2px);
  background-size: 96px 32px, 96px 64px, 96px 64px;
  background-position: 0 0, 0 0, 48px 32px;
  mask-image: linear-gradient(#000 0 0);
  background-repeat: repeat, repeat, repeat;
  clip-path: inset(0);
}
@keyframes drift {
  from { filter: hue-rotate(-18deg); transform: translate3d(-1.5%, 0, 0) scale(1.02); }
  to   { filter: hue-rotate(34deg);  transform: translate3d(1.5%, -1.5%, 0) scale(1.06); }
}
.scan { display: none; position: fixed; inset: 0; z-index: 80; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(13, 10, 20, 0) 0 2px, rgba(13, 10, 20, .13) 2px 4px); }
html.crt .scan { display: block; }
/* the hall draws its own scanlines into the canvas; two grilles on top of each other moire (QA-B03) */
html.crt body.is-play .scan { display: none; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--bar-h);
  display: flex; align-items: center; gap: 28px; padding: 0 max(20px, calc((100vw - var(--page)) / 2));
  background: rgba(13, 10, 20, .92);
  box-shadow: 0 2px 0 var(--mortar), 0 4px 0 var(--ink);
}
.brand { font-family: var(--f-mark); font-weight: 700; font-size: 30px; line-height: 1; color: var(--bone); text-decoration: none;
  text-shadow: 2px 0 0 var(--ember), -2px 0 0 var(--glass); padding: 4px 2px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { position: relative; padding: 8px 12px; text-decoration: none; color: var(--vellum); font-weight: 500; letter-spacing: .02em; }
.nav a:hover { color: var(--bone); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--gilt); box-shadow: 0 2px 0 var(--gilt-deep), 2px 0 0 var(--gilt), -2px 0 0 var(--gilt); }
.chip { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 12px 4px 4px; background: var(--night); box-shadow: 0 0 0 2px var(--mortar); max-width: 220px; }
.chip:hover { box-shadow: 0 0 0 2px var(--glass); }
.chip__portrait { width: 32px; height: 32px; display: block; background: var(--stone); flex: none; }
.chip__portrait canvas { display: block; width: 32px; height: 32px; }
.chip__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--bone); }

/* ---------- page frame ---------- */
main { flex: 1; width: 100%; max-width: calc(var(--page) + 40px); margin: 0 auto; padding: 0 20px; }
.view { padding: 36px 0 56px; }
.page-head { margin-bottom: 28px; }
.page-h { font-family: var(--f-black); font-weight: 400; font-size: clamp(44px, 7vw, 68px); line-height: 1; color: var(--bone);
  text-shadow: 3px 0 0 rgba(255, 46, 136, .8), -3px 0 0 rgba(25, 211, 197, .7); letter-spacing: .01em; }
.page-sub { margin-top: 10px; color: var(--vellum); max-width: 62ch; }

/* ---------- parchment folio + dark slab ---------- */
.folio {
  position: relative; color: var(--ink);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, .28), transparent 55%),
    radial-gradient(90% 80% at 100% 100%, rgba(107, 66, 38, .22), transparent 60%),
    var(--parchment);
  box-shadow:
    0 0 0 2px var(--ink), 0 0 0 4px var(--gilt), 0 0 0 6px var(--ink),
    0 0 46px 2px rgba(255, 46, 136, .30), 0 0 110px 10px rgba(25, 211, 197, .12);
  margin: 6px;
}
.slab { background: rgba(22, 17, 31, .88); box-shadow: 0 0 0 2px var(--mortar), 0 0 0 4px var(--ink); padding: 18px 20px; margin: 4px; }
.slab__h { font-family: var(--f-px); font-size: 15px; font-weight: 600; color: var(--gilt); letter-spacing: .04em; margin-bottom: 12px; }
.slab__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.link { color: var(--glass); text-underline-offset: 4px; }
.link:hover { color: var(--bone); }
.note { margin: 0 4px 18px; padding: 10px 14px; color: var(--bone); background: rgba(107, 63, 160, .28); box-shadow: inset 4px 0 0 var(--royal); max-width: 80ch; }

/* heraldic divider: gilt rule with a lozenge */
.rule { display: flex; align-items: center; height: 14px; margin: 0 28px; }
.rule::before, .rule::after { content: ''; flex: 1; height: 2px; background: var(--gilt-deep); box-shadow: 0 4px 0 -1px rgba(13, 10, 20, .25); }
.rule span { width: 10px; height: 10px; margin: 0 12px; background: var(--ember-deep); transform: rotate(45deg); box-shadow: 0 0 0 2px var(--parchment), 0 0 0 4px var(--gilt-deep); }
.rule--dark::before, .rule--dark::after { background: var(--mortar); box-shadow: none; }
.rule--dark span { background: var(--ember); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--mortar); }

/* drop cap */
.dropcap::first-letter { font-family: var(--f-black); font-weight: 400; float: left; font-size: 3.5em; line-height: .8; padding: 5px 9px 0 0; color: var(--ember-deep); text-shadow: 2px 2px 0 var(--gilt); }

/* ---------- buttons: stamped plaques ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 18px; border: 0; cursor: pointer; text-decoration: none;
  font-family: var(--f-px); font-weight: 600; font-size: 16px; letter-spacing: .03em; line-height: 1.1;
  color: var(--bone); background: var(--stone);
  box-shadow: inset 0 2px 0 var(--slate), inset 0 -2px 0 var(--ink), 0 0 0 2px var(--ink), 4px 4px 0 2px rgba(13, 10, 20, .55);
  user-select: none;
}
.btn:hover { background: var(--mortar); }
.btn:active { transform: translate(2px, 2px); box-shadow: inset 0 2px 0 var(--ink), 0 0 0 2px var(--ink), 2px 2px 0 2px rgba(13, 10, 20, .55); }
.btn--ember { background: var(--ember-deep); box-shadow: inset 0 2px 0 var(--ember), inset 0 -2px 0 var(--blood-dark), 0 0 0 2px var(--ink), 4px 4px 0 2px rgba(13, 10, 20, .55); }
.btn--ember:hover { background: #c81868; }
.btn--gilt { background: var(--gilt); color: var(--ink); box-shadow: inset 0 2px 0 #ffe08a, inset 0 -2px 0 var(--gilt-deep), 0 0 0 2px var(--ink), 4px 4px 0 2px rgba(13, 10, 20, .55); }
.btn--gilt:hover { background: #ffc94a; }
.btn--quiet { background: transparent; box-shadow: 0 0 0 2px var(--slate); color: inherit; }
.btn--quiet:hover { background: rgba(90, 80, 112, .25); }
.btn--sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; color: var(--slate); background: var(--night); box-shadow: 0 0 0 2px var(--mortar); transform: none; }
.folio .btn--quiet { box-shadow: 0 0 0 2px var(--ink-soft); }
.folio .btn--quiet:hover { background: rgba(13, 10, 20, .1); }
kbd { display: inline-block; min-width: 26px; padding: 2px 6px; text-align: center; font: inherit; font-size: .82em; font-weight: 600; line-height: 1.3;
  color: var(--bone); background: var(--ink); box-shadow: 0 0 0 2px var(--slate), 0 4px 0 0 var(--stone); margin: 0 2px 4px; }
.btn kbd { margin: 0 0 0 4px; box-shadow: 0 0 0 2px rgba(246, 239, 220, .5); background: rgba(13, 10, 20, .5); }

/* ---------- HOME ---------- */
.hero { padding: 6px 4px 30px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; }
.wordmark {
  position: relative; font-family: var(--f-mark); font-weight: 700; line-height: .86; letter-spacing: -.005em;
  font-size: clamp(64px, 15.5vw, 176px); color: var(--bone); margin-left: -.03em;
  text-shadow: .028em 0 0 var(--ember), -.028em 0 0 var(--glass), 0 0 .42em rgba(255, 46, 136, .5);
}
.wordmark::first-letter { color: var(--gilt); }
.tagline { margin-top: 14px; font-size: clamp(17px, 2.1vw, 23px); font-weight: 500; color: var(--glass); letter-spacing: .06em; word-spacing: .12em; }

.home-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(300px, 4fr); gap: var(--gap); align-items: start; }
.home-side { display: grid; gap: 18px; }

.writ { padding: 0 0 30px; }
.writ__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 28px; background: var(--ink); color: var(--gilt); font-weight: 600; letter-spacing: .04em; }
.writ__date { color: var(--vellum); font-weight: 500; }
.writ__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; padding: 26px 28px 22px; align-items: start; }
.writ__name { font-family: var(--f-black); font-weight: 400; font-size: clamp(38px, 4.6vw, 58px); line-height: 1; color: var(--ink); text-wrap: balance; }
.writ__sentence { margin-top: 16px; font-size: 20px; line-height: 1.4; font-weight: 500; max-width: 30ch; min-height: 2.8em; }
.writ__count { margin-top: 16px; color: var(--ink-soft); clear: both; }
.writ__count .num { display: inline-block; font-weight: 700; color: var(--bone); background: var(--blood); padding: 0 8px; margin-right: 4px; box-shadow: 0 0 0 2px var(--ink); }
.minimap { justify-self: end; }
.minimap canvas { display: block; width: 288px; height: 180px; background: var(--ink); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--gilt), 0 0 0 6px var(--ink), 6px 6px 0 6px rgba(13, 10, 20, .28); margin: 6px; }
.minimap figcaption { display: flex; gap: 18px; margin: 12px 6px 0; font-size: 14px; color: var(--ink-soft); }
.key::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; box-shadow: 0 0 0 2px var(--ink); }
.key--you::before { background: var(--glass); }
.key--foe::before { background: var(--ember); }
.writ__act { padding: 22px 28px 0; }

/* the one loud thing: a wax seal you break */
.seal-btn {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 22px; align-items: center;
  padding: 16px 28px 16px 16px; text-decoration: none; color: var(--bone); background: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ember), 0 0 0 2px var(--ink), 0 0 0 4px var(--gilt), 0 0 0 6px var(--ink), 8px 8px 0 6px rgba(13, 10, 20, .35), 0 0 36px rgba(255, 46, 136, .55);
  margin: 6px;
}
.seal-btn__seal { grid-row: 1 / span 2; width: 96px; height: 96px; display: block; filter: drop-shadow(0 0 12px rgba(255, 46, 136, .8)); transition: transform .12s steps(3); }
.seal-btn__label { align-self: end; font-family: var(--f-black); font-size: clamp(36px, 4.4vw, 56px); line-height: .95; letter-spacing: .01em; text-shadow: 2px 0 0 var(--ember), -2px 0 0 var(--glass); }
.seal-btn__sub { align-self: start; margin-top: 6px; color: var(--glass); font-weight: 500; letter-spacing: .04em; }
.seal-btn:hover { background: #1b0f22; box-shadow: inset 0 0 0 2px var(--ember), 0 0 0 2px var(--ink), 0 0 0 4px var(--gilt), 0 0 0 6px var(--ink), 8px 8px 0 6px rgba(13, 10, 20, .35), 0 0 60px rgba(255, 46, 136, .85); }
.seal-btn:hover .seal-btn__seal { transform: rotate(-8deg) scale(1.06); }
.seal-btn:active { transform: translate(4px, 4px); }
.seal-btn:focus-visible { outline: 4px solid var(--glass); outline-offset: 10px; }

.raven { display: grid; gap: 6px; justify-items: end; padding: 0 2px 4px; }
.raven__label { color: var(--vellum); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 14px; }
.raven__time { font-size: clamp(34px, 4.4vw, 56px); line-height: 1; font-weight: 700; color: var(--glass); text-shadow: 0 0 18px rgba(25, 211, 197, .55); }

.standing__body { display: grid; gap: 10px; }
.standing__big { font-size: 32px; font-weight: 700; line-height: 1; color: var(--bone); }
.standing__big--none { color: var(--vellum); font-family: var(--f-black); font-weight: 400; font-size: 34px; }
.standing__facts { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--vellum); }
.standing__facts b { color: var(--bone); font-weight: 600; }
.medal { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.medal::before { content: ''; width: 12px; height: 12px; transform: rotate(45deg); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px currentColor; background: currentColor; margin: 0 6px 0 4px; }
.medal--gold { color: var(--gilt); } .medal--silver { color: var(--steel); } .medal--bronze { color: #c9763a; } .medal--none { color: var(--slate); }
.folio .medal--gold { color: var(--gilt-deep); } .folio .medal--silver { color: var(--steel-dark); } .folio .medal--bronze { color: #9a4f1e; } .folio .medal--none { color: var(--ink-soft); }
.streak { display: flex; align-items: center; gap: 10px; padding-top: 10px; box-shadow: 0 -2px 0 var(--mortar); color: var(--vellum); }
.streak b { font-size: 22px; color: var(--ember); font-weight: 700; }

.top5 { display: grid; }
.row5 { display: grid; grid-template-columns: 26px 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 5px 0; box-shadow: 0 2px 0 rgba(61, 53, 81, .6); }
.row5:last-child { box-shadow: none; }
.row5__rank { color: var(--gilt); font-weight: 700; text-align: right; }
.row5__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bone); }
.row5__time { color: var(--glass); font-weight: 600; }
.row5.is-me .row5__name { color: var(--ember); }
.row5--open .row5__rank, .row5--open .row5__name, .row5--open .row5__time { color: var(--slate); font-weight: 500; }
.row5__slot { width: 32px; height: 32px; box-shadow: inset 0 0 0 2px var(--mortar); }
.portrait { display: block; background: var(--stone); box-shadow: 0 0 0 2px var(--ink); }
.empty { color: var(--vellum); padding: 6px 0; }

.controls { margin-top: var(--gap); }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px 28px; }
.legend > div { display: grid; gap: 6px; align-content: start; }
.legend dt { color: var(--vellum); font-size: 14px; font-weight: 500; }
.legend dd { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; min-height: 30px; color: var(--bone); }
.legend dd kbd { margin-bottom: 4px; }
.legend--ink dd { color: var(--ink); }
.legend--ink dt { color: var(--ink-soft); }
.legend--ink { margin: 14px 0; }

.doors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin: var(--gap) 4px 0; }
.door { display: grid; gap: 4px; padding: 14px 16px 16px; text-decoration: none; background: var(--stone);
  box-shadow: inset 0 2px 0 var(--slate), inset 0 -4px 0 var(--ink), 0 0 0 2px var(--ink), 4px 4px 0 2px rgba(13, 10, 20, .55); }
.door:hover { background: var(--mortar); }
.door:hover .door__name { color: var(--gilt); }
.door:active { transform: translate(2px, 2px); }
.door__name { font-family: var(--f-black); font-size: 30px; line-height: 1; color: var(--bone); }
.door__sub { color: var(--vellum); font-size: 14px; line-height: 1.3; }

/* ---------- footer ---------- */
.foot { width: 100%; max-width: calc(var(--page) + 40px); margin: 0 auto; padding: 8px 20px 32px; text-align: center; }
.foot .rule { margin: 0 0 18px; }
.foot__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 26px; }
.foot__links a { color: var(--vellum); text-underline-offset: 4px; padding: 6px 0; }
.foot__links a:hover { color: var(--glass); }
.foot__line { margin-top: 10px; color: var(--slate); font-size: 14px; }

/* ---------- PLAY ---------- */
body.is-play { height: 100vh; height: 100dvh; overflow: hidden; padding-bottom: 0; }
body.is-play .topbar, body.is-play .foot { display: none; }
body.is-play main { max-width: none; padding: 0; display: flex; min-height: 0; }
.view--play { flex: 1; padding: 0; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.view--play:fullscreen { background: var(--ink); }
.playbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(13, 10, 20, .9); box-shadow: 0 2px 0 var(--mortar); flex: none; position: relative; z-index: 3; }
.playbar__title { color: var(--gilt); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.playbar__title.is-practice { color: var(--glass); }
.playbar__gap { flex: 1; }
.stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
#rw-canvas { display: block; background: var(--ink); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--mortar), 0 0 80px rgba(255, 46, 136, .28), 0 0 160px rgba(25, 211, 197, .14); touch-action: none; }
#rw-canvas:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--glass), 0 0 80px rgba(255, 46, 136, .28); }
.stage__hint { display: none; position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: var(--slate); font-size: 14px; padding: 0 12px; }
@media (max-width: 760px) and (orientation: portrait) { .stage__hint { display: block; } }
.overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; background: rgba(13, 10, 20, .72); overflow: auto; }
.panel { width: min(100%, 560px); padding: 24px 26px 26px; }
.panel--narrow { width: min(100%, 380px); }
.panel__h { font-family: var(--f-black); font-weight: 400; font-size: 40px; line-height: 1; margin-bottom: 12px; }
.panel__stack { display: grid; gap: 14px; margin: 18px 6px 6px 0; }
.panel__btns { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; padding-right: 6px; }
.panel__hint { color: var(--ink-soft); font-size: 14px; margin-top: 10px; }
.panel__msg { min-height: 1.5em; margin-top: 10px; color: var(--blood-dark); font-weight: 600; }
.panel--clear { text-align: center; width: min(100%, 600px); }
.clear__kicker { color: var(--ink-soft); font-weight: 600; letter-spacing: .04em; }
.clear__time { font-family: var(--f-px); font-weight: 700; font-size: clamp(48px, 11vw, 84px); line-height: 1.05; color: var(--ink); text-shadow: 3px 0 0 rgba(255, 46, 136, .85), -3px 0 0 rgba(25, 211, 197, .85); }
.clear__medal { margin-top: 4px; font-size: 20px; display: flex; justify-content: center; }
.clear__flag { display: inline-block; margin-top: 12px; padding: 4px 14px; background: var(--ember-deep); color: var(--bone); font-weight: 700; letter-spacing: .08em; box-shadow: 0 0 0 2px var(--ink), 0 0 22px rgba(255, 46, 136, .7); transform: rotate(-2deg); }
.clear__facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0 0; box-shadow: 0 -2px 0 var(--gilt-deep), 0 2px 0 var(--gilt-deep); }
.clear__facts > div { padding: 10px 6px; }
.clear__facts > div + div { box-shadow: -2px 0 0 rgba(168, 111, 18, .45); }
.clear__facts dt { color: var(--ink-soft); font-size: 14px; }
.clear__facts dd { font-size: 26px; font-weight: 700; line-height: 1.1; }
.clear__weapons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.clear__weapons li { padding: 2px 10px; background: var(--ink); color: var(--bone); font-size: 14px; }
.clear__weapons b { color: var(--gilt); margin-left: 6px; }
.clear__par { margin-top: 12px; color: var(--ink-soft); font-size: 14px; }
.panel--clear .panel__btns { justify-content: center; }
.clear__share { margin-top: 16px; text-align: left; }
.clear__share label { display: block; font-size: 14px; color: var(--blood-dark); font-weight: 600; margin-bottom: 6px; }
textarea, .field { width: 100%; padding: 10px 12px; background: var(--bone); color: var(--ink); border: 0; box-shadow: inset 0 0 0 2px var(--ink); resize: vertical; border-radius: 0; }

/* ---------- RANKS ---------- */
#view-ranks { max-width: 900px; }
#view-ranks .note { max-width: none; }
.ranks-bar { display: flex; align-items: center; gap: 14px; margin: 0 4px 18px; }
.ranks-day { display: flex; flex-direction: column; flex: 1; min-width: 0; text-align: center; }
.ranks-day__no { font-family: var(--f-black); font-size: 30px; line-height: 1; color: var(--gilt); }
.ranks-day__date { color: var(--vellum); font-size: 14px; margin-top: 4px; }
.mine { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; margin: 0 4px 22px; padding: 12px 18px;
  background: var(--ink); box-shadow: inset 0 0 0 2px var(--ember), 0 0 0 2px var(--ink), 0 0 28px rgba(255, 46, 136, .4); }
.mine__label { grid-column: 1 / -1; color: var(--ember); font-size: 14px; font-weight: 600; letter-spacing: .06em; }
.mine__rank { font-size: 30px; font-weight: 700; color: var(--gilt); line-height: 1; min-width: 2ch; }
.mine__name { font-weight: 600; color: var(--bone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine__time { font-size: 24px; font-weight: 700; color: var(--glass); }
.mine__tries { color: var(--vellum); font-size: 14px; }
.mine--none { grid-template-columns: minmax(0, 1fr) auto; }
.mine--none p { color: var(--bone); }
.ranks-folio { padding: 8px 0 14px; }
.rk { width: 100%; border-collapse: collapse; }
.rk caption { text-align: left; padding: 12px 24px 8px; font-family: var(--f-black); font-size: 30px; line-height: 1; }
.rk th { text-align: left; font-size: 14px; font-weight: 600; color: var(--ink-soft); padding: 8px 10px; box-shadow: inset 0 -2px 0 var(--gilt-deep); white-space: nowrap; }
.rk td { padding: 6px 10px; vertical-align: middle; box-shadow: inset 0 -1px 0 rgba(13, 10, 20, .14); }
.rk th:first-child, .rk td:first-child { padding-left: 24px; width: 68px; }
.rk th:last-child, .rk td:last-child { padding-right: 24px; text-align: right; }
.rk .c-pt { width: 48px; } .rk .c-time { text-align: right; width: 130px; } .rk .c-rank { font-weight: 700; font-size: 18px; }
.rk .c-name { max-width: 0; width: 99%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rk .c-time { font-weight: 700; }
.rk tr.top1 .c-rank { color: var(--gilt-deep); } .rk tr.top2 .c-rank { color: var(--steel-dark); } .rk tr.top3 .c-rank { color: #9a4f1e; }
.rk tr.top1 td { background: rgba(242, 182, 50, .22); }
.rk tr.is-me td { background: var(--ink); color: var(--bone); box-shadow: none; }
.rk tr.is-me .c-rank, .rk tr.is-me .c-time { color: var(--ember); }
.rk tr.is-me td:first-child { box-shadow: inset 4px 0 0 var(--ember); }
.rk tbody tr:nth-child(10n) td { box-shadow: inset 0 -2px 0 rgba(168, 111, 18, .55); }
.state { padding: 40px 24px; text-align: center; display: grid; gap: 16px; justify-items: center; }
.state__h { font-family: var(--f-black); font-size: 34px; line-height: 1.05; max-width: 22ch; }
.state p { color: var(--ink-soft); max-width: 46ch; }

/* ---------- ARMORY ---------- */
.armory { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.bearer { padding: 22px 22px 24px; position: sticky; top: calc(var(--bar-h) + 20px); }
.bearer__stage { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bearer__cell { display: grid; justify-items: center; gap: 8px; padding: 16px 8px 10px; background: var(--ink); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--gilt-deep); margin: 4px;
  background-image: radial-gradient(70% 70% at 50% 40%, rgba(255, 46, 136, .35), transparent 70%); }
.bearer__cell + .bearer__cell { background-image: radial-gradient(70% 70% at 50% 40%, rgba(25, 211, 197, .28), transparent 70%); }
.bearer__cell canvas { width: 96px; height: 96px; display: block; }
.bearer__cell span { color: var(--vellum); font-size: 13px; }
.bearer__name { font-family: var(--f-black); font-size: 34px; line-height: 1; margin-top: 18px; overflow-wrap: anywhere; }
.bearer__wear { color: var(--ink-soft); margin-top: 6px; }
.bearer__blurb { margin-top: 10px; min-height: 3em; }
.callsign { margin-top: 18px; padding-top: 16px; box-shadow: 0 -2px 0 var(--gilt-deep); }
.callsign label { display: block; font-weight: 600; margin-bottom: 6px; }
.callsign__row { display: flex; gap: 12px; padding-right: 6px; }
.callsign__row .field { min-width: 0; flex: 1; min-height: 44px; }
.callsign__msg { min-height: 1.5em; margin-top: 8px; font-size: 14px; color: var(--ink-soft); }
.callsign__msg.is-bad { color: var(--blood-dark); font-weight: 600; }
.callsign__msg.is-good { color: #1d6b4c; font-weight: 600; }

.racks { display: grid; gap: 18px; }
.rack__h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rack__h h2 { font-family: var(--f-black); font-weight: 400; font-size: 32px; line-height: 1; color: var(--bone); }
.rack__h span { color: var(--vellum); font-size: 14px; }
.helms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pick { position: relative; display: grid; justify-items: center; align-content: start; gap: 6px; padding: 12px 6px 10px; border: 0; cursor: pointer; text-align: center;
  background: var(--stone); color: var(--bone); box-shadow: inset 0 2px 0 var(--slate), inset 0 -2px 0 var(--ink), 0 0 0 2px var(--ink); min-width: 0; }
.pick:hover { background: var(--mortar); }
.pick canvas { width: 64px; height: 64px; display: block; }
.pick__name { font-weight: 600; line-height: 1.15; }
.pick__hint { font-size: 13px; line-height: 1.25; color: var(--vellum); }
.pick[aria-checked="true"] .pick__hint { color: var(--ember); }
.pick[aria-checked="true"] { background: var(--ink); box-shadow: inset 0 0 0 2px var(--ember), 0 0 0 2px var(--ink), 0 0 0 4px var(--gilt), 0 0 24px rgba(255, 46, 136, .5); }
.pick[aria-checked="true"] .pick__name { color: var(--gilt); }
.pick.is-locked { background: var(--night); box-shadow: 0 0 0 2px var(--mortar); cursor: help; }
.pick.is-locked canvas { filter: grayscale(1) brightness(.7) contrast(1.1); }
.pick.is-locked .pick__name { color: #9186ab; }
.pick.is-locked::after { content: ''; position: absolute; top: 8px; right: 8px; width: 10px; height: 8px; background: var(--slate); box-shadow: 0 -4px 0 -2px var(--night), 0 -4px 0 0 var(--slate); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.swatch { padding: 10px 26px 10px 10px; grid-template-columns: 36px minmax(0, 1fr); justify-items: start; align-items: center; text-align: left; column-gap: 10px; }
.swatch i { grid-row: span 2; width: 36px; height: 36px; display: block; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .28), inset 0 -3px 0 rgba(0, 0, 0, .3), 0 0 0 2px var(--ink); }
.swatch.is-locked i { filter: grayscale(.55) brightness(.6); }
.swatch .pick__name { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.swatch .pick__hint { grid-column: 2; }

/* ---------- OPTIONS ---------- */
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.opt-group { padding: 20px 22px 22px; }
.opt-group h2 { font-family: var(--f-black); font-weight: 400; font-size: 32px; line-height: 1; color: var(--bone); margin-bottom: 14px; }
.opt { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 16px; padding: 10px 0; box-shadow: 0 -2px 0 rgba(61, 53, 81, .7); }
.opt:first-of-type { box-shadow: none; }
.opt__label { font-weight: 600; color: var(--bone); }
.opt__help { grid-column: 1 / -1; color: var(--vellum); font-size: 14px; margin-top: -2px; }
.opt--wide { grid-template-columns: 1fr; }
.opt__val { color: var(--glass); font-weight: 700; min-width: 4ch; text-align: right; }
.slider { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; }
input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 28px; background: transparent; cursor: pointer; margin: 0; min-width: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 8px; background: linear-gradient(90deg, var(--ember) var(--fill, 50%), var(--ink) var(--fill, 50%)); box-shadow: 0 0 0 2px var(--slate); }
input[type="range"]::-moz-range-track { height: 8px; background: linear-gradient(90deg, var(--ember) var(--fill, 50%), var(--ink) var(--fill, 50%)); box-shadow: 0 0 0 2px var(--slate); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 26px; margin-top: -9px; background: var(--gilt); box-shadow: inset 0 2px 0 #ffe08a, inset 0 -2px 0 var(--gilt-deep), 0 0 0 2px var(--ink); border-radius: 0; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 26px; border: 0; background: var(--gilt); box-shadow: inset 0 2px 0 #ffe08a, inset 0 -2px 0 var(--gilt-deep), 0 0 0 2px var(--ink); border-radius: 0; }
.switch { position: relative; width: 64px; height: 32px; border: 0; cursor: pointer; background: var(--ink); box-shadow: 0 0 0 2px var(--slate); padding: 0; }
.switch::before { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; background: var(--slate); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .2), inset 0 -2px 0 rgba(0, 0, 0, .35); transition: transform .1s steps(2); }
.switch[aria-checked="true"] { background: var(--ember-deep); box-shadow: 0 0 0 2px var(--ember), 0 0 16px rgba(255, 46, 136, .45); }
.switch[aria-checked="true"]::before { transform: translateX(32px); background: var(--bone); }
.seg { display: flex; flex-wrap: wrap; box-shadow: 0 0 0 2px var(--slate); background: var(--ink); }
.seg button { border: 0; background: transparent; padding: 7px 12px; min-height: 36px; cursor: pointer; color: var(--vellum); font-weight: 600; }
.seg button:hover { color: var(--bone); }
.seg button[aria-checked="true"] { background: var(--gilt); color: var(--ink); }
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; margin-top: 4px; }
.keyrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.keyrow span { color: var(--bone); font-weight: 600; }
.keybtn { min-width: 104px; min-height: 38px; padding: 4px 10px; border: 0; cursor: pointer; background: var(--ink); color: var(--bone); font-weight: 700;
  box-shadow: 0 0 0 2px var(--slate), 0 4px 0 0 var(--stone); }
.keybtn:hover { box-shadow: 0 0 0 2px var(--glass), 0 4px 0 0 var(--stone); }
.keybtn.is-listening { background: var(--glass); color: var(--ink); box-shadow: 0 0 0 2px var(--bone), 0 0 18px rgba(25, 211, 197, .7); }
.opt-msg { min-height: 1.5em; margin-top: 14px; color: var(--gilt); font-size: 14px; }
.opt-fixed { color: var(--vellum); font-size: 14px; margin-top: 10px; }
.opt-fixed:empty, .opt-msg:empty { min-height: 0; margin: 0; }
.opt-msg { margin-bottom: 0; }
.opt-reset { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 4px; }
.opt-reset p { color: var(--vellum); font-size: 14px; }

/* ---------- ARCHIVE ---------- */
.arch { padding: 8px 0 12px; }
.arch__row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; gap: 6px 18px; align-items: center; padding: 12px 24px; box-shadow: inset 0 -1px 0 rgba(13, 10, 20, .16); }
.arch__row:last-child { box-shadow: none; }
.arch__no { font-family: var(--f-black); font-size: 30px; line-height: 1; color: var(--ember-deep); }
.arch__name { font-weight: 700; font-size: 18px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arch__date { color: var(--ink-soft); font-size: 14px; }
.arch__mine { text-align: right; font-weight: 700; }
.arch__mine small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 14px; }
.arch__mine .medal { justify-content: flex-end; font-size: 14px; }
.tag { display: inline-block; padding: 1px 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; background: var(--glass); color: var(--ink); }

/* ---------- PROFILE ---------- */
.profile { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.idcard { padding: 22px; }
.idcard__top { display: flex; gap: 18px; align-items: center; }
.idcard__portrait { background: var(--ink); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--gilt-deep); margin: 4px; flex: none;
  background-image: radial-gradient(70% 70% at 50% 40%, rgba(255, 46, 136, .4), transparent 70%); }
.idcard__portrait canvas { display: block; width: 96px; height: 96px; }
.idcard__name { font-family: var(--f-black); font-size: 36px; line-height: 1; overflow-wrap: anywhere; }
.idcard__kind { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 1px 8px; font-size: 13px; font-weight: 700; letter-spacing: .04em; background: var(--ink); color: var(--bone); }
.badge--on { background: #1d6b4c; } .badge--local { background: var(--royal); }
.idcard__text { margin-top: 16px; }
.idcard .panel__btns { margin-top: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.stat { padding: 14px 14px 12px; background: rgba(13, 10, 20, .6); box-shadow: inset 0 0 0 2px var(--stone); min-width: 0; }
.stat dt { color: var(--vellum); font-size: 14px; }
.stat dd { font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--bone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat--hot dd { color: var(--ember); } .stat--cool dd { color: var(--glass); font-size: 22px; line-height: 1.46; }
.stat--word dd { font-family: var(--f-black); font-weight: 400; text-transform: capitalize; }
.prog { display: grid; gap: 14px; }
.prog__row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.prog__bar { height: 14px; background: var(--ink); box-shadow: 0 0 0 2px var(--slate); display: flex; gap: 2px; padding: 2px; }
.prog__bar i { flex: 1; background: var(--stone); }
.prog__bar i.on { background: var(--gilt); }
.prog__n { color: var(--bone); font-weight: 700; }
.prog__next { color: var(--vellum); font-size: 14px; margin-top: 4px; }
.col { display: grid; gap: 18px; }

/* ---------- prose pages ---------- */
.prose { padding: 30px 36px 34px; max-width: 820px; }
.prose h2 { font-family: var(--f-black); font-weight: 400; font-size: 34px; line-height: 1; margin: 28px 0 10px; color: var(--ink); }
.prose h2:first-child { margin-top: 0; }
.prose p { max-width: 66ch; }
.prose p + p { margin-top: 12px; }
.prose ul { display: grid; gap: 8px; max-width: 66ch; }
.prose li { padding-left: 22px; position: relative; }
.prose li::before { content: ''; position: absolute; left: 4px; top: .55em; width: 8px; height: 8px; background: var(--ember-deep); transform: rotate(45deg); }
.prose p:last-child { margin-top: 26px; }
.prose p:last-child:not(:has(.btn)) { margin-top: 12px; }

/* ---------- dialog + toasts ---------- */
.dlg { border: 0; padding: 12px; background: transparent; color: inherit; max-width: calc(100vw - 16px); overflow: visible; }
.dlg::backdrop { background: rgba(13, 10, 20, .8); }
.toasts { position: fixed; z-index: 85; left: 50%; bottom: calc(var(--tab-h) + 18px); transform: translateX(-50%); display: grid; gap: 10px; justify-items: center; width: min(92vw, 460px); pointer-events: none; }
.toast { padding: 10px 16px; background: var(--ink); color: var(--bone); box-shadow: inset 0 0 0 2px var(--glass), 0 0 0 2px var(--ink), 0 0 24px rgba(25, 211, 197, .5); font-weight: 500; text-align: center; animation: toast-in .18s steps(3) both; }
.toast--bad { box-shadow: inset 0 0 0 2px var(--ember), 0 0 0 2px var(--ink), 0 0 24px rgba(255, 46, 136, .5); }
.toast.is-out { opacity: 0; transition: opacity .25s; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 10px; background: var(--ink); text-align: center; }
.boot__seal { position: relative; width: 160px; height: 160px; filter: drop-shadow(0 0 26px rgba(255, 46, 136, .75)); animation: seal-pulse 1.4s ease-in-out infinite alternate; }
.boot__half { position: absolute; inset: 0; width: 160px; height: 160px; transition: transform .42s cubic-bezier(.2, .9, .3, 1), opacity .42s; }
.boot__half--l { clip-path: polygon(0 0, 54% 0, 44% 22%, 56% 40%, 42% 62%, 52% 82%, 46% 100%, 0 100%); }
.boot__half--r { clip-path: polygon(54% 0, 100% 0, 100% 100%, 46% 100%, 52% 82%, 42% 62%, 56% 40%, 44% 22%); }
.boot__word { font-family: var(--f-mark); font-weight: 700; font-size: 56px; line-height: 1; color: var(--bone); text-shadow: 3px 0 0 var(--ember), -3px 0 0 var(--glass); margin-top: 12px; }
.boot__line { color: var(--vellum); letter-spacing: .06em; }
.boot.is-broken .boot__seal { animation: none; }
.boot.is-broken .boot__half--l { transform: translate(-46px, 10px) rotate(-16deg); opacity: 0; }
.boot.is-broken .boot__half--r { transform: translate(46px, -6px) rotate(14deg); opacity: 0; }
.boot.is-broken { opacity: 0; transition: opacity .35s .3s; pointer-events: none; }
@keyframes seal-pulse { from { transform: scale(1); } to { transform: scale(1.05); } }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  /* QA-B10: between the phone layout and ~950 px the bar (brand + six links + chip) was wider than the page */
  .topbar { gap: 12px; padding: 0 12px; }
  .nav { gap: 0; min-width: 0; }
  .nav a { padding: 8px 8px; }
  .chip { min-width: 0; flex: 0 1 auto; max-width: 150px; }
  .home-grid { grid-template-columns: 1fr; }
  .home-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .armory, .profile { grid-template-columns: 1fr; }
  .bearer { position: static; }
  .options { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --gap: 18px; --tab-h: 58px; --bar-h: 52px; }
  body { font-size: 16px; }
  .topbar { gap: 12px; padding: 0 12px; justify-content: space-between; }
  .brand { font-size: 26px; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: var(--tab-h); gap: 0; background: rgba(13, 10, 20, .97); box-shadow: 0 -2px 0 var(--mortar); padding-bottom: env(safe-area-inset-bottom); }
  .nav a { flex: 1; display: grid; place-items: center; padding: 0 2px; font-size: 13px; min-width: 0; }
  .nav a[aria-current="page"] { box-shadow: none; }
  body.is-play .nav { display: none; }
  main { padding: 0 10px; }
  .view { padding: 22px 0 40px; }
  .hero { padding-bottom: 22px; }
  .home-side { grid-template-columns: 1fr; }
  .writ__head { padding: 10px 16px; }
  .writ { display: flex; flex-direction: column; padding-bottom: 20px; }
  .writ__body { display: contents; }
  .writ__text { padding: 20px 16px 18px; }
  .writ__act { order: 2; }
  .writ .rule { order: 3; margin-top: 22px; }
  .minimap { order: 4; padding: 16px 12px 0; }
  .hero { gap: 14px; }
  .raven { grid-auto-flow: column; align-items: baseline; justify-items: start; gap: 12px; }
  .raven__time { font-size: 26px; }
  .foot__links { gap: 4px 18px; }
  .minimap { justify-self: stretch; }
  .minimap canvas { width: calc(100% - 12px); height: auto; aspect-ratio: 8 / 5; }
  .writ__act { padding: 0 10px; }
  .rule { margin: 0 16px; }
  .seal-btn { column-gap: 14px; padding: 12px 14px 12px 10px; }
  .seal-btn__seal { width: 64px; height: 64px; }
  .seal-btn__label { font-size: clamp(30px, 9vw, 40px); }
  .seal-btn__sub { font-size: 14px; }
  .doors { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .doors .door:last-child { grid-column: 1 / -1; }
  .door__name { font-size: 26px; }
  .helms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
  .legend > div:last-child { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .keys { grid-template-columns: 1fr; }
  .rk th:first-child, .rk td:first-child { padding-left: 12px; width: 44px; }
  .rk th:last-child, .rk td:last-child { padding-right: 12px; }
  .rk td, .rk th { padding-left: 5px; padding-right: 5px; }
  .rk .c-time { width: auto; }
  .rk caption { padding: 10px 12px 6px; }
  .mine { grid-template-columns: auto auto minmax(0, 1fr) auto; padding: 10px 12px; gap: 10px; }
  .mine__tries { grid-column: 1 / -1; }
  .arch__row { grid-template-columns: 60px minmax(0, 1fr) auto; padding: 12px 14px; gap: 6px 12px; }
  .arch__no { font-size: 24px; }
  .arch__mine { grid-column: 2; text-align: left; }
  .arch__mine .medal { justify-content: flex-start; }
  .arch__act { grid-column: 3; grid-row: 1 / span 2; }
  .prose { padding: 22px 18px 26px; }
  .panel { padding: 20px 18px 22px; }
  .idcard__top { align-items: flex-start; }
  .playbar { padding: 4px 6px; gap: 6px; }
  .foot { padding-bottom: 20px; }
}
@media (max-width: 400px) {
  .nav a { font-size: 12px; letter-spacing: 0; }
  .chip__name { max-width: 96px; }
  .prog__row { grid-template-columns: 60px minmax(0, 1fr) auto; gap: 10px; }
}

/* ---------- reduced motion (system or the in-game option) ---------- */
@media (prefers-reduced-motion: reduce) {
  .ground, .boot__seal { animation: none !important; }
  .toast { animation: none; }
  .boot__half, .switch::before, .seal-btn__seal { transition: none !important; }
  .seal-btn:hover .seal-btn__seal { transform: none; }
}
html.rm .ground, html.rm .boot__seal { animation: none !important; }
html.rm .toast { animation: none; }
html.rm .boot__half, html.rm .switch::before, html.rm .seal-btn__seal { transition: none !important; }
html.rm .seal-btn:hover .seal-btn__seal { transform: none; }
