/* The launcher's look: a menu you move through, dark and quiet, made to be heard as much as seen.
   One item is current at a time; the current item carries the accent, never colour alone, and a
   keyboard focus ring sits on top of that. */

:root {
  color-scheme: dark;
  --bg: #0f0f0e;
  --panel: #171715;
  --panel-raised: #22221e;
  --line: #34342f;
  --ink: #ece9e2;
  --ink-soft: #b9b5aa;
  --accent: #ffb454;
  --accent-ink: #241703;
  --accent-soft: #4a3408;
  --focus: #7fd1ff;
  --radius: 14px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

/* A field told to hide must actually go: a rule that sets a display would otherwise beat the
   hidden attribute, and an account form would show every way of proving a character at once
   instead of the ones that game offers. */
[hidden] {
  display: none !important;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(60rem 40rem at 80% -10%, #1d1b16 0%, var(--bg) 55%) no-repeat, var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding: 0 var(--gutter) 4rem;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: .7rem 1rem;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  transition: top .15s ease;
}
.skip:focus { top: 1rem; }

a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: #ffd9a6; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

.top, main, footer { max-width: 64rem; margin-inline: auto; }
.top { padding-block: clamp(1.6rem, 5vw, 3rem) 1.25rem; }

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 .6rem;
  color: var(--ink-soft);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.mark {
  width: .8rem; height: .8rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 .28rem rgba(255, 180, 84, .18);
}

h1 {
  margin: 0 0 .5rem;
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -.02em;
}

.lead {
  margin: 0;
  max-width: 52ch;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.sound-toggle {
  margin-top: 1rem;
  transition: color .12s ease, border-color .12s ease;
  padding: .45rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink-soft);
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
}
.sound-toggle:hover { color: var(--ink); border-color: #4b4b44; }
.sound-toggle[aria-pressed="false"] { color: var(--accent); border-color: var(--accent-soft); }

.view { display: block; }
.view[hidden] { display: none; }

.panes {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.help {
  margin: .5rem 0 1rem;
  max-width: 54ch;
  color: var(--ink-soft);
  font-size: .92rem;
}

/* --- The menu --- */

.menu {
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  max-height: min(62vh, 34rem);
  overflow-y: auto;
  padding: .45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overscroll-behavior: contain;
}

.item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  flex: none;
  width: 100%;
  padding: .8rem 1rem .8rem 1.1rem;
  border: 0;
  border-left: 4px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}

.item:hover { background: var(--panel-raised); }

.item.is-current {
  background: var(--accent);
  border-left-color: #fff;
  color: var(--accent-ink);
  box-shadow: 0 6px 18px -10px rgba(255, 180, 84, .55);
}

.item-name { font-size: 1.12rem; font-weight: 650; line-height: 1.25; }

.item-sub { font-size: .9rem; color: var(--ink-soft); }
.item.is-current .item-sub { color: var(--accent-soft); }

.item:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* --- The chosen game, in the panel beside the menu --- */

.details {
  position: sticky;
  top: 1rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-raised), var(--panel));
}

.details-name { margin: 0; font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.details-tagline { margin: .3rem 0 0; color: var(--accent); font-weight: 600; }
.details-status:not(:empty) { padding-top: .75rem; border-top: 1px solid var(--line); }
.details-text { margin: .6rem 0 0; color: var(--ink); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .85rem 0 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: .15rem .6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: .8rem;
}

.details-status { margin: .85rem 0 0; color: var(--ink-soft); font-size: .92rem; }
.details-meta { margin: .45rem 0 0; color: var(--ink-soft); font-size: .88rem; }
.details-desktop { margin: .45rem 0 0; color: var(--ink-soft); font-size: .88rem; }
.details-notes { margin: .45rem 0 0; color: var(--ink-soft); font-size: .88rem; }
.details-last { margin: .45rem 0 0; color: var(--ink-soft); font-size: .88rem; }

/* --- The account area --- */

.account-stage {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-raised), var(--panel));
  min-height: 12rem;
}

.account-stage h3 {
  margin: 0 0 .5rem;
  font-size: 1.3rem;
  line-height: 1.2;
}
.account-stage h3:focus { outline: none; }
.account-stage h4 {
  margin: 1.35rem 0 .45rem;
  color: var(--accent);
  font-size: 1rem;
}
.account-stage h4:first-child { margin-top: 0; }

.account-text { margin: .5rem 0; max-width: 62ch; }
.account-hint { margin: .3rem 0 0; color: var(--ink-soft); font-size: .88rem; }
.account-handle { margin: .1rem 0 .6rem; color: var(--ink-soft); font-size: .92rem; }

.account-form {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  margin-top: 1rem;
}

.account-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.account-stage .account-card { margin-top: 1rem; }

.account-card-line { margin: .35rem 0 0; }

.account-field { display: flex; flex-direction: column; gap: .35rem; }
.account-label { color: var(--ink); font-size: .94rem; font-weight: 600; }

.account-field input,
.account-field select,
.account-field textarea {
  width: 100%;
  padding: .6rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #121210;
  color: var(--ink);
  font: inherit;
}

.account-password { display: flex; gap: .5rem; align-items: stretch; }
.account-password input { flex: 1; }

.account-show {
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-raised);
  color: var(--ink-soft);
  font: inherit;
  font-size: .84rem;
  cursor: pointer;
}
.account-show:hover { color: var(--ink); }

.account-primary,
.account-quiet {
  padding: .62rem 1rem;
  border-radius: 10px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.account-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.account-primary:hover { background: #ffc97f; }

.account-quiet {
  border: 1px solid var(--line);
  background: var(--panel-raised);
  color: var(--ink);
}
.account-quiet:hover { border-color: #4b4b44; }

.account-primary:disabled,
.account-quiet:disabled { opacity: .55; cursor: default; }

.account-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .35rem; }

.account-check {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin: .25rem 0;
  color: var(--ink-soft);
  font-size: .92rem;
}
.account-check input { margin-top: .3rem; }

.account-error {
  margin: .5rem 0 0;
  padding: .6rem .75rem;
  border: 1px solid #7d3434;
  border-radius: 10px;
  background: #2a1414;
  color: #ffd4d4;
}
.account-error:empty { display: none; }

.account-stats {
  display: grid;
  gap: .75rem;
  margin: 1rem 0;
  padding: 0;
}
.account-stats div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--line);
}
.account-stats dt { color: var(--ink-soft); }
.account-stats dd { margin: 0; text-align: right; }

.account-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  margin: .5rem 0 0;
  padding: 0;
  list-style: none;
}

.account-person {
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #141412;
}
.account-person-name { margin: 0; font-size: 1rem; }
.account-person-status { margin: .2rem 0 0; color: var(--ink-soft); font-size: .9rem; }

.account-codes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: .45rem;
  margin: .75rem 0;
  padding: .75rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  list-style: none;
}

.account-ptt {
  width: 100%;
  margin: .6rem 0;
  padding: .9rem 1rem;
  touch-action: none;
  user-select: none;
}

/* --- The little games --- */

.arcade-stage {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-raised), var(--panel));
}
.arcade-stage h3 { margin: 0 0 .4rem; font-size: 1.2rem; }

.arcade-status { margin: .5rem 0 0; min-height: 3.2em; }

.arcade-form {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  margin-top: .9rem;
}

.arcade-input {
  width: 8.5rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}
.arcade-input.arcade-letter { width: 4.5rem; text-align: center; }

.arcade-letters {
  margin: .6rem 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem;
  letter-spacing: .1em;
}

.arcade-round { margin: .35rem 0 0; color: var(--ink-soft); font-size: .88rem; }

.arcade-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: .9rem 0 0; }

.arcade-canvas {
  display: block;
  width: 100%;
  height: auto;
  margin-top: .9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #141412;
}
.arcade-canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.online-total {
  margin: .7rem 0 0;
  color: var(--ink-soft);
  font-size: .93rem;
}

.voice-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-top: .8rem;
  padding: .55rem .9rem;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: .9rem;
}
.voice-bar[hidden] { display: none; }
.voice-bar p { margin: 0; }
.voice-bar .sound-toggle { margin-top: 0; }

/* --- One game --- */

#gameHead {
  margin: 0 0 .35rem;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.15;
}
#gameHead:focus { outline: none; }

.meta, .status {
  margin: .25rem 0 0;
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: .94rem;
}
.status { margin-bottom: 1rem; }

#gameMenu { max-width: 44rem; margin-top: .75rem; }
#gameView .help { margin-top: 1rem; }

/* --- Patch notes --- */

.notes-actions { margin: 0 0 1.25rem; }

.back {
  padding: .6rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.back:hover { background: var(--panel-raised); }

.notes { max-width: 70ch; }
.notes h3 {
  margin: 1.6rem 0 .45rem;
  font-size: 1.05rem;
  color: var(--accent);
}
.notes h3:first-child { margin-top: 0; }
.notes ul { margin: 0; padding-left: 1.15rem; }
.notes li { margin: .4rem 0; }

.muted, .loading { color: var(--ink-soft); }

.noscript {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: .9rem;
}

@media (max-width: 56rem) {
  .panes { grid-template-columns: minmax(0, 1fr); }
  .menu { max-height: none; }
  .details { order: -1; position: static; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media (forced-colors: active) {
  .item.is-current { outline: 3px solid Highlight; }
  .menu, .details, .back, .sound-toggle { border: 1px solid CanvasText; }
  .mark { background: CanvasText; }
}
