:root {
  color-scheme: dark;
  --bg: #121118;
  --surface: #1d1c28;
  --surface-2: #292736;
  --surface-inverse: #ffffff;
  --surface-inverse-hover: #eef0ff;
  --stage: #0b0a10;
  --field: #14131b;
  --text: #f6f1e7;
  --muted: #aaa5ba;
  --link: #a3b2ff;
  --line: #4b4862;
  --line-soft: #34324a;
  --field-line: #75718f;
  --shadow: #000000;
  --ink: #17151f;
  --primary: #3b4fd8;
  --primary-hover: #3343bd;
  --primary-light: #8ea0ff;
  --on-primary: #ffffff;
  --on-primary-muted: #e4e8ff;
  --on-primary-accent: var(--topaz-light);
  --ruby: #f0445c;
  --ruby-light: #ff8fa0;
  --topaz: #ffc531;
  --topaz-hover: #ffd564;
  --topaz-light: #ffe08a;
  --topaz-deep: #f29d1f;
  --emerald: #3fd6ad;
  --amethyst: #a78bfa;
  --on-gem: var(--ink);
  --kicker: var(--topaz);
  --positive: var(--emerald);
  --mixed: var(--topaz);
  --danger: #ff7a8f;
  --danger-soft: #3a1c26;
  --focus: #ffffff;
  --focus-inner: var(--ink);
  --text-xs: 0.8rem;
  --text-sm: 0.9rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.4rem;
  --text-2xl: 1.6rem;
  --text-3xl: 2rem;
  --text-heading: clamp(1.4rem, 3vw, 1.9rem);
  --text-title: clamp(1.8rem, 4vw, 2.6rem);
  --text-display: clamp(2rem, 5.2vw, 3.4rem);
  --text-inline: 0.86em;
  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --font-body: system-ui, -apple-system, "Segoe UI", "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans JP", "Hiragino Sans", "Malgun Gothic", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
  --border: 2px solid var(--line);
  --border-thin: 1.5px solid var(--line);
  --lift: 4px 4px 0 var(--shadow);
  --lift-sm: 2px 2px 0 var(--shadow);
  --page-width: 1120px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 0.2em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--kicker); }
code {
  font-family: var(--font-mono); font-size: var(--text-inline); overflow-wrap: anywhere;
  background: var(--surface-2); padding: 1px 5px; border-radius: var(--radius-xs);
}
pre {
  margin: 0 0 var(--space-3); padding: var(--space-3); overflow-x: auto;
  background: var(--surface-2); border-radius: var(--radius-sm);
}
pre code { padding: 0; overflow-wrap: normal; }
header, main, footer { width: min(var(--page-width), calc(100% - 32px)); margin-inline: auto; }
main { padding: var(--space-4) 0 var(--space-6); }
h1 {
  font-size: var(--text-display); line-height: 1.12; font-weight: 800;
  letter-spacing: -0.035em; margin: 0 0 var(--space-3); text-wrap: balance;
}
h2 { font-size: var(--text-xl); line-height: 1.3; font-weight: 800; margin: 0 0 var(--space-3); letter-spacing: -0.02em; }
h3 { font-size: var(--text-lg); line-height: 1.35; font-weight: 700; margin: 0 0 var(--space-2); }
p { margin: 0 0 var(--space-3); }
.kicker {
  color: var(--kicker); letter-spacing: 0.1em; text-transform: uppercase; font-size: var(--text-xs);
  font-weight: 800; margin: 0 0 var(--space-2);
}
.kicker:empty { display: none; }
.lede { font-size: var(--text-lg); color: var(--muted); max-width: 38rem; text-wrap: pretty; }
.meta { color: var(--muted); font-size: var(--text-sm); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.prose { max-width: 44rem; }
.prose li { margin-bottom: var(--space-2); }
.prose.legal h2 { margin-top: 1.6em; font-size: var(--text-lg); }
.prose.legal p, .prose.legal li { line-height: 1.65; }
.prose.legal .legal-meta { color: var(--muted); }
.spaced { margin-top: var(--space-3); }
.section { margin-top: var(--space-5); }
.section-head {
  display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; align-items: end;
  margin-bottom: var(--space-4);
}
.section-head h2 { margin: 0; font-size: var(--text-2xl); }
.section-head .more { font-weight: 700; font-size: var(--text-sm); text-decoration: none; white-space: nowrap; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5) var(--space-4); }
ul.plain { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: grid; gap: var(--space-2); }
ul.plain:empty { display: none; }
ul.plain li { padding: var(--space-2) 0; border-top: 1.5px solid var(--line-soft); }
ul.plain li:first-child { border-top: 0; padding-top: 0; }
ul.plain li form { display: inline-grid; margin-left: var(--space-2); }
/* Read out, not shown. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Skip link (SYB-101): off screen until a keyboard user tabs to it. */
.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10; padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--topaz); color: var(--on-gem); font-weight: 800; text-decoration: none;
}
.skip:focus { top: 12px; }
.skip:hover { color: var(--on-gem); }
@media (max-width: 720px) {
  main { padding-top: var(--space-2); }
  .split { grid-template-columns: 1fr; }
}

header { padding: 14px 0 6px; display: grid; gap: 12px; }
.topbar { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; }
.brand {
  display: flex; gap: 14px; align-items: center; color: var(--text); text-decoration: none;
  font-size: var(--text-xl); font-weight: 800; letter-spacing: -0.03em; margin-right: var(--space-2);
}
.brand:hover { color: var(--text); }
.gem {
  width: 16px; height: 16px; display: inline-block; margin-left: 4px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary) 60%);
  border: 2px solid var(--line);
  transform: rotate(45deg);
  box-shadow: 3px 3px 0 var(--topaz);
}
.gem.big { width: 34px; height: 34px; margin: 6px auto 14px; box-shadow: 6px 6px 0 var(--topaz); }
form.search { display: flex; gap: 0; flex: 1 1 220px; max-width: 460px; margin-right: auto; }
form.search input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: 0; padding: 6px 12px; }
form.search button {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; box-shadow: none; padding: 6px 14px;
  background: var(--surface-2); color: var(--text); font-weight: 600; white-space: nowrap;
}
form.search button:hover { background: var(--line-soft); color: var(--text); }
form.search button:active { transform: none; }
nav { display: flex; flex-wrap: wrap; gap: var(--space-1); align-items: center; }
header > nav {
  background: var(--surface); border: var(--border); border-radius: var(--radius-sm);
  padding: 5px; box-shadow: var(--lift-sm);
}
header > nav a {
  color: var(--text); text-decoration: none; padding: 5px 14px; border-radius: var(--radius-xs);
  font-size: var(--text-sm); font-weight: 700;
}
header > nav a:hover { color: var(--text); background: var(--surface-2); }
header > nav a[aria-current="page"] { background: var(--topaz); color: var(--on-gem); }
.langs { display: flex; font-size: var(--text-sm); }
footer .langs { display: none; }
.langs a { padding: 5px 7px; font-weight: 500; color: var(--muted); text-decoration: none; }
.langs a:hover { color: var(--text); }
.langs a[aria-current="true"] { color: var(--text); font-weight: 800; }
a.account {
  color: var(--text); text-decoration: none; font-weight: 700; font-size: var(--text-sm);
  padding: 5px 14px; border-radius: var(--radius-pill); background: var(--surface); border: var(--border);
  box-shadow: var(--lift-sm);
}
a.account:hover { background: var(--surface-2); color: var(--text); }
a.account[aria-current="page"] { background: var(--topaz); color: var(--on-gem); }
form.logout { display: inline-grid; }
/* The count of new results for a creator (SYB-108). */
a.news-count { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 0 8px; border-radius: var(--radius-pill); background: var(--topaz); color: var(--on-gem); font-weight: 800; text-decoration: none; }
footer {
  color: var(--muted); font-size: var(--text-sm); border-top: 2px solid var(--line-soft);
  padding: var(--space-4) 0 var(--space-5); display: flex; flex-wrap: wrap;
  gap: var(--space-2) var(--space-4); justify-content: space-between;
}
footer p { margin: 0; }
footer a { color: var(--muted); }
@media (max-width: 720px) {
  /* Header in one short row: brand, a search icon, the account. Languages move to the footer. */
  header { padding: 6px 0 0; gap: 8px; }
  .brand { font-size: var(--text-lg); gap: 10px; margin-right: auto; }
  header .langs { display: none; }
  footer .langs { display: flex; flex-wrap: wrap; margin-left: -7px; }
  form.search { flex: 0 0 44px; max-width: none; margin: 0; }
  form.search input {
    appearance: none; width: 44px; padding: 0; border-right: 2px solid var(--field-line);
    border-radius: var(--radius-sm); color: transparent; cursor: pointer;
    background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f6f1e7' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E") center / 22px no-repeat;
  }
  form.search input::placeholder { color: transparent; }
  form.search button { display: none; }
  /* Tapping the icon focuses the field, which opens it as a full row; it stays open while it holds a query. */
  form.search:focus-within, form.search:has(input:not(:placeholder-shown)) { flex-basis: 100%; order: 5; }
  form.search:focus-within input, form.search:has(input:not(:placeholder-shown)) input {
    width: 100%; padding: 6px 12px; color: var(--text); cursor: text; background-image: none;
    border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  }
  form.search:focus-within input::placeholder, form.search:has(input:not(:placeholder-shown)) input::placeholder { color: var(--muted); }
  form.search:focus-within button, form.search:has(input:not(:placeholder-shown)) button { display: block; }
  a.account:has(> span) {
    width: 44px; padding: 0; justify-content: center;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f6f1e7' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8.5' r='4'/%3E%3Cpath d='M4.5 20.5c1.2-4 4-6 7.5-6s6.3 2 7.5 6'/%3E%3C/svg%3E") center / 22px no-repeat;
  }
  /* Off screen but still read out: the nickname behind the account icon. */
  a.account > span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  header > nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 6px; }
  header > nav a { flex: none; white-space: nowrap; padding-inline: 12px; min-width: 44px; justify-content: center; }
  /* The count adds a fourth control to the phone header; tighter gaps keep it on one row. */
  .topbar:has(.news-count) { column-gap: 8px; }
}
@media (max-width: 720px), (pointer: coarse) {
  a.news-count { min-width: 44px; min-height: 44px; }
}

.error {
  color: var(--danger); border: 2px solid var(--danger); border-radius: var(--radius-sm);
  padding: 10px 14px; background: var(--danger-soft); font-weight: 600;
}
.note {
  border: var(--border); background: var(--topaz); color: var(--on-gem); padding: 10px 14px;
  border-radius: var(--radius-sm); font-weight: 600;
}
.note a { color: var(--on-gem); text-decoration: underline; }
.note a:hover { color: var(--on-gem); text-decoration-thickness: 3px; }
.lang-suggest {
  padding: 8px 14px; background: var(--surface-2);
  border: var(--border); border-radius: var(--radius-sm); font-size: var(--text-sm);
}
.lang-suggest p { margin: 0; }
.lang-suggest a { font-weight: 700; }
/* The share button's confirmation (SYB-119), a short note above the phone's pinned play bar. */
.share-status {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 30;
  width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--text); color: var(--on-gem); box-shadow: var(--lift); font-weight: 700; text-align: center;
}
.share-status:empty { padding: 0; box-shadow: none; }

.panel {
  background: var(--surface); border: var(--border); border-radius: var(--radius-md);
  padding: var(--space-4); box-shadow: var(--lift);
}
.panel > :last-child { margin-bottom: 0; }
.panel .panel {
  background: var(--surface-2); padding: var(--space-3); margin-bottom: var(--space-3);
  box-shadow: none; border-color: var(--line-soft);
}
.panel.narrow { max-width: 30rem; }
.panel:has(> form.stack) { max-width: 44rem; }
details.panel { box-shadow: none; border-color: var(--line-soft); }
details.panel > summary { cursor: pointer; font-weight: 700; color: var(--muted); }
details.panel > summary:hover { color: var(--text); }
details.panel[open] > summary { margin-bottom: var(--space-3); color: var(--text); }
details.panel form + h3 { margin-top: var(--space-4); }
/* A disclosure inside running text: the original of a translation, the scan details (SYB-38, SYB-100). */
details.original, details.safety-more { font-size: var(--text-sm); }
details.original { margin: 4px 0 8px; }
details.safety-more { margin-top: 4px; }
details.original summary, details.safety-more summary { cursor: pointer; color: var(--muted); }
@media (max-width: 720px) {
  .panel { padding: var(--space-3); }
}

.empty {
  border: 2px dashed var(--line-soft); border-radius: var(--radius-md); padding: var(--space-5) var(--space-3);
  text-align: center; color: var(--muted); margin: 0; font-weight: 600;
}
.empty .button { margin-top: var(--space-3); }

.button, button {
  display: inline-flex; align-items: center; justify-content: center; justify-self: start;
  background: var(--primary); color: var(--on-primary); text-decoration: none;
  border: var(--border); border-radius: var(--radius-sm); padding: 8px 18px;
  font: inherit; font-weight: 700; line-height: 1.4; cursor: pointer;
  box-shadow: var(--lift-sm);
  transition: transform 0.08s, box-shadow 0.08s, background-color 0.12s;
}
.button:hover, button:hover { background: var(--primary-hover); color: var(--on-primary); }
.button:active, button:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow); }
.button.secondary, button.secondary { background: var(--surface); color: var(--text); }
.button.secondary:hover, button.secondary:hover { background: var(--surface-2); color: var(--text); }
.button.large { padding: 12px 26px; font-size: var(--text-base); box-shadow: var(--lift); }
.button.large:active { transform: translate(4px, 4px); }
button.quiet {
  background: transparent; border: 0; box-shadow: none; color: var(--muted); padding: 2px 0;
  font-size: var(--text-sm); font-weight: 500; text-decoration: underline; text-underline-offset: 0.2em;
}
button.quiet:hover { background: transparent; color: var(--danger); }
button.quiet:active { transform: none; }
button.danger { background: var(--danger); color: var(--on-gem); }
button.danger:hover { background: var(--danger); color: var(--on-gem); filter: brightness(0.95); }

form { display: grid; gap: var(--space-3); margin: 0; }
label { display: grid; gap: 6px; font-size: var(--text-sm); font-weight: 700; }
label:has(> input[type="radio"]), label:has(> input[type="checkbox"]) {
  display: flex; gap: var(--space-2); align-items: center; font-weight: 500;
}
label .meta { font-weight: 400; }
input, textarea, select {
  font: inherit; font-weight: 400; color: var(--text); background: var(--field);
  border: 2px solid var(--field-line); border-radius: var(--radius-sm);
  padding: 8px 12px; width: 100%; min-width: 0;
}
input[type="radio"], input[type="checkbox"] {
  width: 1.1rem; height: 1.1rem; padding: 0; accent-color: var(--link); flex: none;
}
input[type="file"] { padding: 6px; color: var(--muted); font-size: var(--text-sm); }
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; color: var(--text); background: var(--surface-2);
  border: 2px solid var(--line); border-radius: var(--radius-xs); padding: 3px 12px;
  margin-right: 12px; cursor: pointer;
}
textarea { resize: vertical; min-height: 4.5rem; }
select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position: calc(100% - 19px) 55%, calc(100% - 13px) 55%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
fieldset {
  border: 2px solid var(--line-soft); border-radius: var(--radius-sm); margin: 0;
  padding: var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4);
}
legend { padding: 0 var(--space-2); color: var(--muted); font-size: var(--text-sm); font-weight: 700; }
form.stack { max-width: 40rem; }
form.filters {
  display: grid; grid-template-columns: minmax(0, 1fr) 140px 120px auto; gap: var(--space-2);
  align-items: end; flex: 1; max-width: 640px;
}
form.filters label { font-size: var(--text-xs); color: var(--muted); gap: 4px; }
form.filters button { justify-self: stretch; }
.field { display: grid; gap: 6px; }
.field > label { display: block; }
.field .hint { margin: 0; }
.req { color: var(--danger); }
@media (max-width: 720px) {
  form.filters { grid-template-columns: 1fr 1fr; max-width: none; flex-basis: 100%; }
  form.filters label:first-child { grid-column: 1 / -1; }
  form.filters button { grid-column: 1 / -1; }
}

.tag, .device-badge, .flag, .vote, .badge, .chip, button.chip, .tag-chips a { border-radius: var(--radius-pill); }
.tag, .device-badge, .vote, .badge, .chip, button.chip, .tag-chips a { border: var(--border-thin); }
.tag, .device-badge, .badge, .chip, button.chip, .tag-chips a { background: var(--surface-2); }
.tag, .device-badge, .badge { white-space: nowrap; }
.tag, .device-badge, .flag, .vote, .badge { font-size: var(--text-xs); }

.tag { display: inline-block; font-weight: 700; padding: 1px 9px; }
a.tag { color: var(--text); text-decoration: none; }
a.tag:hover { background: var(--topaz); color: var(--on-gem); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.tag.large { font-size: var(--text-sm); padding: 5px 14px; background: var(--surface); border-width: 2px; box-shadow: var(--lift-sm); }
.tag.large span { color: var(--muted); font-weight: 500; margin-left: 4px; }
.tag.large:hover span { color: var(--on-gem); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--space-3); }
.chip, button.chip, .tag-chips a {
  display: inline-flex; align-items: center; font-size: var(--text-sm); font-weight: 700; padding: 3px 13px;
  color: var(--text); text-decoration: none; box-shadow: none; line-height: 1.5;
}
.chip:hover, button.chip:hover, .tag-chips a:hover { background: var(--line-soft); color: var(--text); }
.chip[aria-current="true"], button.chip[aria-pressed="true"], .tag-chips a[aria-current="true"] { background: var(--topaz); color: var(--on-gem); border-color: var(--ink); }
/* The tag facet as one scrolling row above the results, once the sidebar no longer fits beside them. */
.tag-chips { display: none; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 6px 2px; margin: 0 0 var(--space-2); }
.tag-chips a { flex: none; gap: 6px; white-space: nowrap; }
.tag-chips a span { color: var(--muted); font-weight: 500; }
.tag-chips a[aria-current="true"] span { color: var(--on-gem); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 11px; font-weight: 600; }
/* A badge the reader must not miss: a status, an automatic warning (SYB-146), a rule, the operator, a new account's record (SYB-210). */
.badge.status, .badge.operator, .badge.warn, .badge.rule, .badge.ok, .badge.new-account { color: var(--on-gem); border-width: 2px; font-weight: 800; }
.badge.status, .badge.rule, .badge.new-account { background: var(--topaz); }
.badge.status.published, .badge.ok { background: var(--emerald); }
.badge.status.rejected, .badge.status.taken_down, .badge.status.locked, .badge.status.unlisted { background: var(--ruby); color: var(--on-gem); }
.badge.operator { background: var(--amethyst); }
.badge.warn { background: var(--ruby); }
.badge.news { background: var(--topaz); color: var(--on-gem); font-weight: 800; }
/* SYB-38: machine translation and invisible characters in user text. */
.badge.machine { background: var(--surface-2); font-weight: 700; }
mark.hidden-char { background: var(--ruby); color: var(--on-gem); padding: 0 2px; border-radius: var(--radius-xs); font-family: ui-monospace, monospace; font-size: var(--text-inline); unicode-bidi: isolate; }
.untrusted { white-space: pre-wrap; overflow-wrap: anywhere; border-left: 3px solid var(--line); padding-left: 8px; }

.flag {
  position: absolute; top: 10px; left: 10px; font-weight: 800; padding: 1px 9px;
  background: var(--topaz); color: var(--on-gem); border: 1.5px solid var(--ink);
}
.vote { font-weight: 800; padding: 1px 10px; color: var(--on-gem); }
.vote.up { background: var(--emerald); }
.vote.down { background: var(--ruby); color: var(--on-gem); }
/* Device badge (SYB-105): words, so it never rests on color alone. */
.device-badge { display: inline-block; font-weight: 800; padding: 1px 9px; color: var(--text); }
.device-badge.phone { background: var(--topaz); color: var(--on-gem); border-color: var(--ink); }
@media (max-width: 980px) {
  .tag-chips { display: flex; }
}

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-4); }
.shelf {
  display: grid; grid-auto-flow: column; grid-auto-columns: 230px; gap: var(--space-4);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  padding: 0 8px 10px 0;
}
.shelf > .card { scroll-snap-align: start; }
@media (max-width: 720px) { .shelf { grid-auto-columns: 68%; } }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: var(--border);
  border-radius: var(--radius-md); overflow: hidden; color: inherit; text-decoration: none;
  box-shadow: var(--lift); transition: transform 0.1s, box-shadow 0.1s;
}
.card:hover, .spot-main:hover { color: inherit; transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.card:active { transform: translate(2px, 2px); box-shadow: var(--lift-sm); }
.card .thumb {
  display: block; aspect-ratio: 16 / 10; width: 100%; object-fit: cover;
  border-bottom: var(--border); position: relative;
  background: var(--primary);
}
.card:nth-child(4n + 2) .thumb { background: var(--ruby); }
.card:nth-child(4n + 3) .thumb { background: var(--emerald); }
.card:nth-child(4n + 4) .thumb { background: var(--amethyst); }
/* A cover that is missing shows the gem. */
.card span.thumb::after, .thumb.placeholder::after, .capsule.placeholder::after {
  content: ""; position: absolute; inset: 0; margin: auto; aspect-ratio: 1;
  background: var(--topaz); border: 2px solid var(--ink); transform: rotate(45deg);
}
.card span.thumb::after { width: 34%; box-shadow: 5px 5px 0 var(--ink); }
.thumb.placeholder::after, .capsule.placeholder::after { height: 38%; box-shadow: 3px 3px 0 var(--ink); }
.thumb.placeholder, .capsule.placeholder { background: var(--primary); position: relative; display: block; }
.card h3 { margin: var(--space-3) var(--space-3) var(--space-2); font-size: var(--text-lg); font-weight: 800; }
.card p { margin: 0 var(--space-3); }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card .card-foot {
  display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); justify-content: space-between;
  margin: auto 0 0; padding: var(--space-3); padding-top: 14px;
  color: var(--muted); font-size: var(--text-xs);
}
.card .card-foot span { white-space: nowrap; }
.card { position: relative; }
.rating { font-weight: 800; white-space: nowrap; }
.rating.pos { color: var(--positive); }
.rating.mixed { color: var(--mixed); }
.rating.neg { color: var(--danger); }
.rating.none { color: var(--muted); font-weight: 500; }
.rating.big { font-size: var(--text-xl); }
.rating-count { color: var(--muted); font-weight: 500; }

.spotlight { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-3); }
.spotlight.solo { grid-template-columns: 1fr; }
.spot-main {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); color: inherit; text-decoration: none;
  background: var(--surface); border: var(--border); border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--lift); transition: transform 0.1s, box-shadow 0.1s;
}
.spot-main .thumb { width: 100%; height: 100%; min-height: 260px; object-fit: cover; border-right: var(--border); }
.spot-info { display: flex; flex-direction: column; gap: 12px; padding: var(--space-4); min-width: 0; }
.spot-title { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.spot-desc { color: var(--muted); }
.spot-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px var(--space-3); justify-content: space-between; font-size: var(--text-sm); color: var(--muted); }
.spot-side, .related { display: grid; gap: 10px; align-content: start; }
@media (max-width: 980px) {
  .spotlight { grid-template-columns: 1fr; }
  .spot-side { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 720px) {
  .spot-main { grid-template-columns: 1fr; }
  .spot-main .thumb { min-height: 0; aspect-ratio: 16 / 9; border-right: 0; border-bottom: var(--border); }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .card { box-shadow: 3px 3px 0 var(--shadow); }
  .card h3 { margin: 12px 12px 6px; font-size: var(--text-base); }
  .card p { margin-inline: 12px; }
  .card .card-foot { padding: 10px 12px 12px; }
}

.rows { display: grid; gap: 10px; }
.row {
  display: grid; grid-template-columns: 132px minmax(0, 1fr) auto 190px; gap: var(--space-3); align-items: center;
  color: inherit; text-decoration: none; background: var(--surface); border: var(--border);
  border-radius: var(--radius-sm); overflow: hidden; padding-right: var(--space-3);
  transition: transform 0.1s, box-shadow 0.1s;
}
.row.ranked { grid-template-columns: 34px 132px minmax(0, 1fr) auto 190px; padding-left: 10px; }
.row:hover { color: inherit; background: var(--surface-2); transform: translate(-1px, -1px); box-shadow: var(--lift-sm); }
.row .thumb { width: 132px; aspect-ratio: 16 / 10; object-fit: cover; border-right: var(--border); }
.row.ranked .thumb { border-left: var(--border); }
.rank { font-size: var(--text-lg); font-weight: 800; text-align: center; color: var(--topaz); }
.row-main { display: grid; gap: 6px; min-width: 0; }
.row-main strong { font-size: var(--text-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-rating { font-size: var(--text-sm); }
.row-side { display: grid; gap: 2px; text-align: right; color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
.split .row { grid-template-columns: 112px minmax(0, 1fr) auto; }
.split .row.ranked { grid-template-columns: 30px 112px minmax(0, 1fr) auto; }
.split .row .thumb { width: 112px; }
.split .row-side { display: none; }

.spot-item {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center;
  color: inherit; text-decoration: none; background: var(--surface); border: var(--border);
  border-radius: var(--radius-sm); overflow: hidden; padding-right: 12px;
}
.spot-item:hover { color: inherit; background: var(--surface-2); }
.spot-item .thumb { width: 112px; aspect-ratio: 16 / 10; object-fit: cover; border-right: var(--border); }
.spot-item > span { display: grid; gap: 2px; min-width: 0; font-size: var(--text-sm); }
.spot-item .meta { font-size: var(--text-xs); }
.related .spot-item { border-color: var(--line-soft); }
@media (max-width: 720px) {
  /* A phone row keeps the verdict and the play count on a line under the title. */
  .row, .split .row {
    grid-template-columns: 96px auto minmax(0, 1fr); grid-template-areas: "thumb main main" "thumb rating side";
    gap: 2px 12px; padding-right: 12px;
  }
  .row.ranked, .split .row.ranked {
    grid-template-columns: 24px 96px auto minmax(0, 1fr);
    grid-template-areas: "rank thumb main main" "rank thumb rating side"; padding-left: 8px;
  }
  .rank { grid-area: rank; }
  .row .thumb, .split .row .thumb { grid-area: thumb; width: 96px; aspect-ratio: auto; align-self: stretch; }
  .row-main { grid-area: main; gap: 4px; padding-top: 8px; }
  .row-rating, .row-side, .split .row-side { padding-bottom: 8px; font-size: var(--text-xs); }
  .row-rating { grid-area: rating; }
  .row-side, .split .row-side { grid-area: side; display: flex; gap: 6px; margin-left: -6px; text-align: left; white-space: normal; }
  .row-side > span:first-child { display: none; }
  .row-side > span:last-child::before { content: "· "; }
}

.hero {
  position: relative; overflow: hidden; background: var(--primary); color: var(--on-primary);
  border: var(--border); border-radius: var(--radius-lg); box-shadow: var(--lift);
  padding: clamp(24px, 5vw, 56px); padding-right: clamp(24px, 30vw, 380px);
}
.hero .kicker { color: var(--on-primary-accent); }
.hero .lede { color: var(--on-primary-muted); }
.hero .actions { margin-top: var(--space-4); }
.hero .button { background: var(--topaz); color: var(--on-gem); }
.hero .button:hover { background: var(--topaz-hover); color: var(--on-gem); }
.hero .button.secondary { background: var(--surface-inverse); color: var(--on-gem); }
.hero .button.secondary:hover { background: var(--surface-inverse-hover); color: var(--on-gem); }
.hero::before, .hero::after {
  content: ""; position: absolute; border: 2px solid var(--ink); transform: rotate(45deg);
}
.hero::before {
  width: 170px; height: 170px; right: 110px; top: 50%; margin-top: -105px;
  background: linear-gradient(135deg, var(--topaz-light), var(--topaz) 55%, var(--topaz-deep));
  box-shadow: 10px 10px 0 var(--ink);
}
.hero::after {
  width: 84px; height: 84px; right: 54px; bottom: 34px;
  background: linear-gradient(135deg, var(--ruby-light), var(--ruby) 60%);
  box-shadow: 6px 6px 0 var(--ink);
}
.hero.compact {
  display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-4); align-items: center;
  justify-content: space-between; padding: 22px 28px;
}
.hero.compact::before, .hero.compact::after { display: none; }
.hero.compact h1 { font-size: var(--text-heading); margin-bottom: 6px; }
.hero.compact .lede { font-size: var(--text-base); margin: 0; max-width: 40rem; }
.hero.compact .kicker { margin-bottom: 4px; }
.hero.compact .actions { margin: 0; }

.browse { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--space-4); align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); justify-content: space-between; align-items: center; margin-bottom: var(--space-3); }
.toolbar .chips { margin: 0; }
.browse-side { padding: var(--space-3) 18px; }
.browse-side h2 { font-size: var(--text-lg); }
.browse-side h3 { margin-top: var(--space-4); color: var(--muted); font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.08em; }
.browse-side form.filters { display: grid; grid-template-columns: 1fr; max-width: none; }
.browse-side form.filters label { font-size: var(--text-sm); }
ul.facet { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: 2px; }
ul.facet a {
  display: flex; justify-content: space-between; gap: var(--space-2); padding: 4px 10px; border-radius: var(--radius-xs);
  color: var(--text); text-decoration: none; font-size: var(--text-sm);
}
ul.facet a span { color: var(--muted); }
ul.facet a:hover { background: var(--surface-2); }
ul.facet a[aria-current="true"] { background: var(--topaz); color: var(--on-gem); font-weight: 700; }
ul.facet a[aria-current="true"] span { color: var(--on-gem); }

.login {
  max-width: 28rem; margin: var(--space-5) auto 0;
  display: grid; gap: var(--space-3); justify-items: stretch; text-align: center;
}
.login > * { margin: 0; }
.login h1 { font-size: var(--text-3xl); }
.login .lede { font-size: var(--text-base); }
.login form { text-align: left; }
.login form button, .login .button { justify-self: stretch; }
.login .actions { display: grid; }
@media (max-width: 980px) {
  .browse { grid-template-columns: 1fr; }
  .browse-main { min-width: 0; }
  .browse-side { display: none; }
}
@media (max-width: 860px) {
  .hero { padding-right: clamp(24px, 5vw, 56px); }
  .hero::before, .hero::after { display: none; }
}

.game-head { margin-bottom: var(--space-4); }
.game-head h1 { margin-top: 12px; }
.game-head .desc { font-size: var(--text-lg); max-width: 44rem; margin-bottom: var(--space-2); }
.game-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-4); align-items: start;
}
.game-main { min-width: 0; display: grid; gap: var(--space-4); }
.game-main > p { margin: 0; }
.game-side { display: grid; gap: var(--space-4); }
.game-side .panel { padding: var(--space-3) 18px; }
.stats { display: flex; gap: var(--space-4); margin: 0 0 var(--space-3); font-weight: 700; font-size: var(--text-sm); }
.stats:last-child { margin: 0; }
dl.facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px var(--space-3); font-size: var(--text-sm); }
dl.facts dt { color: var(--muted); white-space: nowrap; }
dl.facts dd { margin: 0; text-align: right; font-weight: 600; }
.panel.content-warnings { margin: var(--space-4) 0; }
.shots { display: flex; gap: 12px; overflow-x: auto; padding: 0 4px 6px 0; }
.shots img, .shots video {
  height: 150px; width: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-sm);
  background: var(--surface-2); border: var(--border); flex: none;
}
.crumbs { display: block; font-size: var(--text-sm); color: var(--muted); margin-bottom: var(--space-2); }
.crumbs a { color: var(--muted); }
.game-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: var(--text-title); }
.game-status { margin: 0; }
.game-top { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-4); align-items: start; }
.game-top.no-media { grid-template-columns: 1fr; }
.game-top.no-media .glance { display: grid; grid-template-columns: 300px minmax(0, 1fr); column-gap: var(--space-4); }
.game-top.no-media .glance .capsule { grid-row: span 4; }
.media-stage {
  aspect-ratio: 16 / 10; background: var(--stage); border: var(--border); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--lift); display: grid;
}
.media-stage img, .media-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.media-strip { display: flex; gap: 10px; overflow-x: auto; padding: 12px 4px 6px 0; }
.media-thumb {
  flex: none; width: 116px; aspect-ratio: 16 / 10; border: var(--border); border-radius: var(--radius-xs); overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center; text-decoration: none; opacity: 0.65;
}
.media-thumb:hover, .media-thumb:focus-visible, .media-thumb[aria-current="true"] { opacity: 1; }
.media-thumb[aria-current="true"] { border-color: var(--topaz); }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-video { font-size: var(--text-xs); font-weight: 700; color: var(--text); }
.glance { padding: var(--space-3); display: grid; gap: 12px; }
.glance > * { margin: 0; }
.glance .capsule { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); border: var(--border); }
.glance .desc { font-size: var(--text-sm); }
.playbox {
  display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-4); align-items: center; justify-content: space-between;
  background: var(--primary); color: var(--on-primary); border: var(--border); border-radius: var(--radius-md);
  box-shadow: var(--lift); padding: 18px var(--space-4); margin: var(--space-4) 0;
}
.playbox h2 { margin: 0 0 2px; font-size: var(--text-xl); }
.playbox p { margin: 0; color: var(--on-primary-muted); font-size: var(--text-sm); }
.playbox-side { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; }
.playbox .stats { margin: 0; color: var(--on-primary-muted); }
.playbox form { display: inline-grid; }
.playbox .button.large { background: var(--topaz); color: var(--on-gem); }
.playbox .button.large:hover { background: var(--topaz-hover); }
.game-side h2 { font-size: var(--text-base); }
/* The status card replaces the play bar while a game is not public (SYB-108). */
.status-card { margin: var(--space-4) 0; }
.status-card h2 { margin: 0 0 var(--space-2); font-size: var(--text-base); }
.status-card .badge.status { font-size: var(--text-sm); }
@media (max-width: 980px) {
  .game-top { grid-template-columns: 1fr; }
  .game-top:not(.no-media) .capsule { display: none; }
}
@media (max-width: 860px) {
  .game-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .game-top.no-media .glance { grid-template-columns: 1fr; }
  /*
   * The play box becomes a bar pinned to the bottom of the screen until the reader scrolls past
   * its place, so the first screen always offers a way to play. scroll-padding keeps a focused
   * control from scrolling in underneath it.
   */
  html:has(.playbox.ready) { scroll-padding-bottom: 96px; }
  .playbox.ready {
    position: sticky; bottom: 8px; z-index: 5; flex-wrap: nowrap; padding: 10px 12px; gap: 8px;
    margin-block: var(--space-3);
  }
  /* Off screen but still read out: the play box heading and counts. */
  .playbox.ready > div:first-child, .playbox.ready .stats {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .playbox.ready .playbox-side, .playbox.ready .actions { flex: 1; display: flex; flex-wrap: nowrap; gap: 8px; }
  .playbox.ready .actions > * { flex: 1 1 0; }
  .playbox.ready .actions > :last-child { flex-grow: 1.6; }
  .playbox.ready .actions .button, .playbox.ready .actions button { width: 100%; justify-content: center; text-align: center; padding-inline: 10px; }
}

.post-head { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-2); }
.post-head form { margin-left: auto; }
details.report-post { margin-left: auto; font-size: var(--text-sm); }
details.report-post > summary { cursor: pointer; color: var(--muted); text-decoration: underline; text-underline-offset: 0.2em; }
details.report-post > summary:hover { color: var(--danger); }
details.report-post[open] { flex-basis: 100%; }
details.report-post form { margin: var(--space-2) 0 0; max-width: 420px; }
.rating-summary { display: grid; grid-template-columns: auto 1fr; gap: 4px var(--space-3); align-items: baseline; margin-bottom: var(--space-3); }
progress.ratio {
  grid-column: 1 / -1; width: 100%; height: 10px; appearance: none; border: 1.5px solid var(--line);
  border-radius: var(--radius-pill); overflow: hidden; background: var(--ruby);
}
progress.ratio::-webkit-progress-bar { background: var(--ruby); }
progress.ratio::-webkit-progress-value { background: var(--emerald); }
progress.ratio::-moz-progress-bar { background: var(--emerald); }
.review {
  background: var(--surface-2); border: 1.5px solid var(--line-soft); border-left: 5px solid var(--emerald);
  border-radius: var(--radius-sm); padding: 14px var(--space-3); margin-bottom: 12px;
}
.review.down { border-left-color: var(--ruby); }
.review > p { margin: 0 0 10px; }
.review > :last-child { margin-bottom: 0; }
.review-foot { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; justify-content: space-between; }
.review-foot:empty { display: none; }
form.helpful { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; }
.review-form { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1.5px solid var(--line-soft); }
/* The reason is asked only while "not recommend" is picked. Without :has() it stays visible. */
.review-form:not(:has(input[name="recommend"][value="0"]:checked)) .review-reason { display: none; }
.review-reason .meta { flex-basis: 100%; margin: 0; }

iframe.play {
  display: block; width: 100%; height: min(72vh, 640px); border: var(--border);
  border-radius: var(--radius-md); background: var(--ink); box-shadow: var(--lift);
}
/* The game page starts nothing: a poster with one play button links to /play (SYB-104). */
.poster {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden;
  border: var(--border); border-radius: var(--radius-md); box-shadow: var(--lift); text-decoration: none;
  background: linear-gradient(135deg, var(--primary), var(--ink));
}
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster-play {
  position: relative; padding: 14px 30px; border-radius: var(--radius-pill); font-size: var(--text-xl); font-weight: 800;
  background: var(--topaz); color: var(--on-gem); border: var(--border); border-color: var(--ink); box-shadow: var(--lift);
}
.poster:hover .poster-play { background: var(--topaz-hover); }
/*
 * The play page: a bar (title, restart, fullscreen) over the frame. Fullscreen and the fill layer
 * (iPhone, where an element cannot go fullscreen) give the frame the whole screen.
 */
.player { display: grid; gap: 10px; }
.player-bar { display: flex; gap: var(--space-2) var(--space-3); align-items: center; justify-content: space-between; }
.player-bar h1 { margin: 0; min-width: 0; font-size: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bar h1 a { color: var(--text); text-decoration: none; }
.player-tools { display: flex; flex: none; gap: var(--space-2); }
.player-stage iframe.play { height: clamp(320px, calc(100svh - 250px), 760px); }
.player.filled, .player:fullscreen {
  position: fixed; inset: 0; z-index: 20; width: 100%; height: 100%; height: 100dvh; padding: 8px;
  background: var(--bg); grid-template-rows: auto minmax(0, 1fr); gap: 8px;
}
.player.filled .player-stage iframe.play, .player:fullscreen .player-stage iframe.play {
  height: 100%; border-radius: var(--radius-sm); box-shadow: none;
}
html:has(.player.filled) { overflow: hidden; }
.play-result .panel { margin-block: var(--space-3); }
.play-result h2 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.play-result dl { margin: 0; display: grid; grid-template-columns: auto auto; justify-content: start; gap: 4px var(--space-4); }
.play-result dt { color: var(--muted); }
.play-result dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.play-controls { margin-top: var(--space-3); display: grid; gap: 4px; }
.play-controls p { margin: 0; }
.keyboard-only, .landscape-hint { display: none; color: var(--muted); }
@media (hover: none) and (pointer: coarse) { .keyboard-only { display: block; } }
@media (pointer: coarse) and (orientation: portrait) { .landscape-hint { display: block; } }
.start-warning { max-width: 38rem; margin: var(--space-4) auto; }
.start-warning h1 { margin-top: var(--space-2); }
.after-play { margin-top: var(--space-4); }
.after-play h2 { margin-top: 0; }
.after-play h3 { margin: var(--space-4) 0 var(--space-2); }
@media (max-width: 720px) {
  iframe.play { height: min(70vh, 520px); }
  /* On a phone the bar and the frame are exactly one screen tall; app.js scrolls the page to them. */
  .player { height: 100svh; grid-template-rows: auto minmax(0, 1fr); gap: 6px; padding-block: 6px; }
  .player-stage, .player-stage iframe.play { height: 100%; }
  .player-bar h1 { font-size: var(--text-base); }
  .player-tools .button, .player-tools button { padding-inline: 12px; }
}
/* A frame the play origin refused (SYB-193): app.js put the reason in its place. No tools, and on
   a phone no screen-tall box around one line. */
.player.unsupported { height: auto; }
.player.unsupported .player-stage { height: auto; }
.player.unsupported .player-tools { display: none; }

.ranking { margin-block: var(--space-4); }
.ranking .section-head { margin-bottom: var(--space-2); }
.ranking .section-head h2 { font-size: var(--text-xl); }
.ranking-head h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* Five board names do not fit one line of a phone: the tabs wrap, so every board stays in sight. */
.rank-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px; margin-bottom: var(--space-2); }
.rank-tabs .chip { white-space: nowrap; }
table.rank-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.rank-table th, table.rank-table td { padding: var(--space-2); text-align: left; vertical-align: top; border-bottom: var(--border-thin); }
table.rank-table th { color: var(--muted); font-size: var(--text-xs); font-weight: 700; }
table.rank-table th:first-child, .rank-no { width: 3.2em; }
table.rank-table .rank-value { width: 8.5em; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-no { font-weight: 800; color: var(--topaz); font-variant-numeric: tabular-nums; }
.rank-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.rank-name { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.rank-name.hidden-name { color: var(--muted); font-weight: 500; }
.rank-me { color: var(--topaz); font-weight: 800; white-space: nowrap; }
.rank-sub { display: flex; flex-wrap: wrap; gap: 2px var(--space-2); font-size: var(--text-xs); }
.rank-sub details.report-post { margin-left: 0; font-size: var(--text-xs); }
table.rank-table tr.me td { background: var(--surface-2); }
.rank-gap td { text-align: center; color: var(--muted); border-bottom: 0; padding-block: var(--space-1); }
.play-rank { color: var(--topaz); font-weight: 800; white-space: nowrap; }
.play-result .play-signin { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: 0; color: var(--text); }
@media (max-width: 720px) {
  table.rank-table th, table.rank-table td { padding-inline: var(--space-1); }
  table.rank-table th:first-child, .rank-no { width: 2.4em; }
  table.rank-table .rank-value { width: 6.4em; }
}

.profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-4); align-items: center; }
.profile-head h1 { font-size: var(--text-title); margin-bottom: 4px; }
.profile-main > :last-child { margin-bottom: 0; }
.settings > .panel { max-width: 44rem; }
.avatar {
  width: 96px; height: 96px; display: grid; place-items: center; font-size: var(--text-3xl); font-weight: 800;
  background: var(--amethyst); color: var(--on-gem); border: var(--border); border-color: var(--ink);
  border-radius: var(--radius-md); box-shadow: var(--lift-sm);
}
.stat-row { display: flex; gap: var(--space-2); }
.stat {
  display: grid; justify-items: center; min-width: 76px; padding: 10px 12px; background: var(--surface-2);
  border: 1.5px solid var(--line-soft); border-radius: var(--radius-sm);
}
.stat strong { font-size: var(--text-xl); line-height: 1.2; }
.stat span { font-size: var(--text-xs); color: var(--muted); }
@media (max-width: 980px) {
  .profile-head { grid-template-columns: auto minmax(0, 1fr); }
  .stat-row { grid-column: 1 / -1; flex-wrap: wrap; }
}
@media (max-width: 720px) {
  /* Four tiles wrapped three and one on a phone. Two rows of two fill the panel evenly. */
  .profile-head .stat-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .avatar { width: 64px; height: 64px; font-size: var(--text-2xl); }
}

/* Upload form (SYB-107): numbered steps, only the chosen kind's fields, a cover preview. */
form.upload-form:has(input[name="kind"][value="external"]:checked) .when-hosted,
form.upload-form:has(input[name="kind"][value="hosted"]:checked) .when-external { display: none; }
form.upload-form:not(:has(input[name="fanGame"]:checked)) .when-fan { display: none; }
form.upload-form fieldset.step { display: grid; gap: var(--space-3); padding: var(--space-3); }
form.upload-form fieldset.step > legend { color: var(--text); font-size: var(--text-base); font-weight: 800; }
fieldset.kinds .hint { flex-basis: 100%; margin: 0; }
fieldset.device-fields { display: grid; gap: var(--space-3); }
fieldset.device-fields > .meta { margin: 0; }
.cover-preview { display: grid; gap: var(--space-2); }
.preview-label { margin: 0; font-size: var(--text-sm); font-weight: 700; }
.preview-shapes {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3); align-items: start;
}
.preview-shapes figure { margin: 0; display: grid; gap: 6px; }
.preview-card { box-shadow: var(--lift-sm); padding-bottom: var(--space-3); }
.preview-card:hover, .preview-card:active { transform: none; box-shadow: var(--lift-sm); }
.preview-wide {
  aspect-ratio: 16 / 9; border: var(--border); border-radius: var(--radius-sm); background: var(--primary); overflow: hidden;
}
.preview-wide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-preview .preview-shapes [hidden] { display: none; }
.rules-step ul.rules { margin: 0 0 var(--space-2); }

/* Scoreboards (SYB-134): five rows of the upload and new-version forms, and the tables. */
fieldset.scoreboards { display: grid; gap: var(--space-3); }
.panel.scoreboard-review { margin: var(--space-4) 0; }
fieldset.scoreboards > p { margin: 0; }
fieldset.scoreboard { display: grid; gap: var(--space-3); }
.scoreboard-names, .scoreboard-pair {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--space-2) var(--space-3);
}
.scoreboard-names > .hint, .scoreboard-pair > .hint { grid-column: 1 / -1; margin: 0; }
details.scoreboard-more > summary { cursor: pointer; font-weight: 700; padding: var(--space-1) 0; }
details.scoreboard-more[open] { display: grid; gap: var(--space-3); }
.table-scroll { overflow-x: auto; max-width: 100%; }
table.scoreboard-table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
table.scoreboard-table th, table.scoreboard-table td {
  text-align: left; vertical-align: top; padding: var(--space-1) var(--space-2); border-bottom: var(--border-thin);
}
table.scoreboard-table th { color: var(--muted); white-space: nowrap; }
table.scoreboard-table code { white-space: nowrap; }
table.scoreboard-table tr.changed td:last-child { color: var(--kicker); font-weight: 700; }
/* The SDK test under a preview (SYB-135). */
.sdk-test { margin-block: var(--space-3); }
.sdk-test h3 { margin: var(--space-4) 0 var(--space-2); }
.sdk-test dl.facts dt { color: var(--text); }
.sdk-events { margin: 0; font-size: var(--text-sm); }

/* The creator dashboard (SYB-108). */
.submission { margin: 0 0 var(--space-2); overflow-wrap: anywhere; }
.review-notes { margin: 0 0 var(--space-2); }
.review-notes blockquote { margin: 4px 0 0; }
.rejection-reason { margin: 0 0 var(--space-2); overflow-wrap: anywhere; }
ul.checklist li { margin: 0 0 var(--space-2); }
.creator-games { display: grid; gap: var(--space-3); }
.creator-game { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.creator-game h2 { margin: 0; font-size: var(--text-lg); }
.creator-game .status-card { margin: var(--space-2) 0; padding: var(--space-3); }
.creator-cover .thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); }
.timeline ol { margin: var(--space-2) 0 0; display: grid; gap: var(--space-2); }
.panel.friends { max-width: 44rem; }
.friends .invite-link { width: 100%; }
.friends .members { display: grid; gap: var(--space-2); margin: 0 0 var(--space-3); }
.friends .members li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); overflow-wrap: anywhere; }
.friends .members form { margin-left: auto; }

/* The review queue: the scan's verdict and findings, the cover, the checks before approving. */
.decision {
  display: inline-block; font-size: var(--text-xl); font-weight: 800; margin: var(--space-2) 0 var(--space-3);
  padding: 4px 16px; border: var(--border); border-radius: var(--radius-sm); color: var(--on-gem);
}
.decision.reject { background: var(--ruby); color: var(--on-gem); }
.decision.manual_review { background: var(--topaz); }
.decision.auto_approve { background: var(--emerald); }
ul.findings { padding-left: 1.1rem; }
ul.findings li { margin-bottom: var(--space-2); }
.review-cover {
  display: block; width: min(100%, 480px); aspect-ratio: 16 / 9; object-fit: cover;
  border: var(--border); border-radius: var(--radius-sm);
}
.review-checks { display: grid; gap: var(--space-1); margin: 0 0 var(--space-2); }
.review-checks .check-group { margin: var(--space-1) 0 0; font-weight: 700; }
.review-checks label { display: flex; gap: 8px; align-items: flex-start; }
@media (max-width: 720px) {
  .creator-game { grid-template-columns: minmax(0, 1fr); }
  /* Each board becomes a list of its fields, named by the cell's column. */
  table.scoreboard-table thead { display: none; }
  table.scoreboard-table tr { display: grid; gap: var(--space-1); padding: var(--space-2) 0; border-bottom: var(--border-thin); }
  table.scoreboard-table td {
    display: grid; grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr); gap: var(--space-2); padding: 0; border: 0;
  }
  table.scoreboard-table td::before { content: attr(data-label); color: var(--muted); font-weight: 700; }
  table.scoreboard-table td > code { justify-self: start; }
}

/* Touch targets (SYB-101): at least 44px tall on phones and other touch screens. */
@media (max-width: 720px), (pointer: coarse) {
  .button, button, .chip, .tag-chips a, a.account, header > nav a, .langs a, ul.facet a, a.tag, .brand, .section-head .more,
  select, input:not([type="radio"], [type="checkbox"]) { min-height: 44px; }
  a.account, header > nav a, .langs a, a.tag, .section-head .more { display: inline-flex; align-items: center; }
  details.panel > summary { padding-block: 9px; }
  .langs a, .chip, .tag-chips a { min-width: 44px; justify-content: center; }
  label:has(> input[type="radio"]), label:has(> input[type="checkbox"]) { min-height: 44px; }
  button.quiet { padding-inline: 6px; }
}
/*
 * Focus (SYB-101): a light ring around a dark one, so one of the two shows on any surface: the
 * dark page, the blue hero and play bar, the yellow note and buttons. Last and doubled in
 * specificity so component shadows (.button.large, .card:hover) do not replace the inner ring.
 */
:root :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-inner); }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}