.sprint-commands {
  margin: 0 14px 16px;
  padding: 16px;
  background: var(--paint-ink);
  border: 1px solid var(--paint-forest);
  border-radius: 12px;
  color: var(--paint-teal-soft);
  font-size: 12px;
  line-height: 1.6;
}
.sprint-command-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.sprint-command-title span {
  color: var(--muted);
  font-size: 11px;
}
.sprint-commands p {
  margin: 10px 0;
}
.sprint-commands small,
.sprint-command-note {
  color: var(--muted);
  font-size: 10px;
}
.game-home {
  --home-accent: var(--paint-teal);
}
.home-sprint {
  --home-accent: var(--paint-violet);
}
.home-defense,
.home-robot {
  --home-accent: var(--paint-teal);
}
.home-bridge,
.home-knockoff {
  --home-accent: var(--paint-coral);
}
.home-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 28px 0 40px;
}
.home-intro h1 {
  font-size: clamp(32px, 4.8vw, 56px);
  line-height: 1.04;
  letter-spacing: -1.8px;
  max-width: 560px;
}
.home-intro > p {
  font-size: 17px;
  max-width: 510px;
  color: var(--paint-muted);
}
.home-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 22px 0;
}
.home-tags span {
  font-size: 11px;
  font-weight: 650;
  background: var(--paint-paper);
  border: 1px solid var(--paint-teal-soft);
  padding: 7px 9px;
  border-radius: 99px;
}
.home-art {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: 0 16px 45px color-mix(in srgb, var(--paint-ink) 7.06%, transparent);
  transform: rotate(2deg);
  background: var(--paint-paper);
}
.home-art svg {
  display: block;
  width: 100%;
  height: auto;
}
.home-art-caption {
  display: block;
  text-align: center;
  padding: 15px;
  background: color-mix(in srgb, var(--paint-white) 85.1%, transparent);
  color: var(--paint-muted);
  font-size: 12px;
  font-weight: 600;
}
.home-lessons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.home-lessons article {
  background: var(--paint-white);
  border: 1px solid var(--paint-teal-soft);
  border-radius: 20px;
  padding: 28px;
}
.home-step {
  display: block;
  font:
    600 10px ui-monospace,
    monospace;
  letter-spacing: 1.4px;
  color: var(--home-accent);
  margin-bottom: 18px;
}
.home-lessons h2,
.home-prompt h2,
.home-compete h2 {
  font-size: 23px;
}
.home-lessons p,
.home-compete p {
  font-size: 14px;
  color: var(--paint-muted);
  margin-bottom: 0;
}
.home-prompt {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 30px;
  align-items: center;
  margin: 30px 0;
  padding: 30px;
  background: var(--paint-paper);
  border-radius: 22px;
}
.home-prompt h2 {
  margin-top: 12px;
}
.home-prompt p {
  font-size: 14px;
  color: var(--paint-muted);
}
.home-prompt blockquote {
  margin: 0;
  padding: 23px;
  border-left: 3px solid var(--home-accent);
  background: var(--paint-white);
  border-radius: 0 14px 14px 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--paint-ink);
}
.home-prompt footer {
  margin-top: 14px;
  font-size: 11px;
  color: var(--paint-violet);
}
.home-compete {
  padding: 12px 4px 24px;
  max-width: 720px;
}
.home-compete h2 {
  margin-top: 12px;
}
.home-compete .link {
  display: inline-block;
  margin-top: 10px;
}
@media (max-width: 640px) {
  .home-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 18px 0 28px;
  }
  .home-art {
    transform: none;
    max-width: 460px;
  }
  .home-lessons,
  .home-prompt {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .home-lessons article,
  .home-prompt {
    padding: 21px;
  }
  .home-intro h1 {
    letter-spacing: -1px;
  }
  .home-intro .row {
    flex-wrap: wrap;
  }
  .home-intro .btn {
    padding: 11px 13px;
  }
  .home-art-caption {
    padding: 11px;
  }
  .home-prompt blockquote {
    padding: 17px;
  }
  .home-lessons h2,
  .home-prompt h2 {
    font-size: 21px;
  }
}
:root {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--paint-night);
  background: var(--paint-surface);
  font-synthesis: none;
  --accent: var(--paint-teal);
  --muted: var(--paint-violet);
  --border: var(--paint-wash);
  --green: var(--paint-teal);
  --coral: var(--paint-coral);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 0;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--paint-line);
  outline-offset: 3px;
}
header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: auto;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
}
.brand {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img {
  width: 32px;
  height: 32px;
}
.brand sup {
  font-size: 9px;
  letter-spacing: 1px;
  border: 1px solid var(--border);
  padding: 4px 5px;
  border-radius: 5px;
  color: var(--muted);
  margin-left: 3px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.status {
  font-size: 12px;
  color: var(--muted);
}
.status:before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--paint-subtle);
  border-radius: 50%;
  margin-right: 7px;
}
.avatar {
  width: 36px;
  height: 36px;
  background: var(--paint-paper);
  color: var(--accent);
  border-radius: 50%;
  font-weight: 700;
}
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 46px 24px 120px;
}
h1 {
  font-size: 42px;
  line-height: 1.12;
  letter-spacing: -1.6px;
  margin: 10px 0 16px;
}
h2 {
  font-size: 23px;
  letter-spacing: -0.65px;
  margin: 0;
}
h3 {
  font-size: 18px;
  letter-spacing: -0.4px;
  margin: 0 0 10px;
}
p {
  line-height: 1.6;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
}
.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 30px;
  align-items: center;
  margin-bottom: 44px;
}
.hero h1 {
  font-size: 60px;
  letter-spacing: -2.7px;
  max-width: 550px;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero p {
  color: var(--muted);
  font-size: 16px;
  max-width: 380px;
}
.hero-art {
  height: 260px;
  position: relative;
  display: grid;
  place-items: center;
  background: radial-gradient(
    ellipse,
    color-mix(in srgb, var(--paint-paper) 50.2%, transparent) 0,
    transparent 65%
  );
}
.floating-board {
  transform: rotate(-8deg);
  background: var(--paint-white);
  border: 1px solid var(--paint-teal-soft);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 20px 60px color-mix(in srgb, var(--paint-teal) 7.06%, transparent);
  width: 218px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.floating-board span {
  height: 49px;
  background: var(--paint-white);
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 600;
  color: var(--accent);
}
.floating-board span:nth-child(2n) {
  color: var(--coral);
}
.float-label {
  position: absolute;
  padding: 12px 16px;
  background: var(--paint-white);
  box-shadow: 0 8px 32px color-mix(in srgb, var(--paint-ink) 4.71%, transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
}
.float-label.one {
  left: 0;
  top: 18px;
  transform: rotate(-5deg);
}
.float-label.two {
  right: 0;
  bottom: 14px;
  transform: rotate(4deg);
}
.dot {
  color: var(--green);
  margin-right: 7px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 28px 0 18px;
}
.link {
  color: var(--accent);
  background: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 0;
}
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.game-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--paint-white);
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 26px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--paint-ink) 4.31%, transparent);
}
.game-card p {
  margin: 7px 0 15px;
  font-size: 13px;
  color: var(--muted);
  max-width: 250px;
}
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 7px;
  background: var(--paint-white);
  color: var(--accent);
  letter-spacing: 0.5px;
}
.tag.coral {
  color: var(--paint-coral);
  background: var(--paint-paper);
}
.game-icon {
  display: grid;
  gap: 5px;
  flex-shrink: 0;
}
.game-icon.ttt {
  grid-template-columns: repeat(3, 25px);
}
.game-icon.ttt span {
  height: 25px;
  background: var(--paint-white);
  border-radius: 5px;
  font-size: 21px;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 600;
}
.game-icon.c4 {
  grid-template-columns: repeat(4, 18px);
  padding: 8px;
  background: var(--paint-paper);
  border-radius: 9px;
}
.game-icon.c4 span {
  height: 18px;
  border-radius: 50%;
  background: var(--paint-coral-soft);
}
.game-icon.c4 span:nth-child(3n) {
  background: var(--coral);
}
.game-icon.c4 span:nth-child(4n) {
  background: var(--paint-water);
}
.arrow {
  color: var(--accent);
  font-size: 20px;
  margin-left: auto;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  border-top: 1px solid var(--border);
  padding-top: 26px;
  margin-top: 34px;
}
.steps b {
  font-size: 13px;
}
.steps p {
  font-size: 12px;
  color: var(--muted);
  margin: 7px 0;
}
.step-num {
  font-size: 11px;
  background: var(--paint-paper);
  color: var(--accent);
  padding: 5px 8px;
  border-radius: 6px;
  margin-right: 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--paint-white);
  font-weight: 650;
  font-size: 13px;
  transition: background 0.15s;
}
.btn:hover {
  background: var(--paint-teal);
}
.btn.secondary {
  background: var(--paint-white);
  border: 1px solid var(--border);
  color: var(--paint-forest);
}
.btn.secondary:hover {
  background: var(--paint-surface);
}
.btn.ghost {
  background: transparent;
  color: var(--muted);
}
.btn.danger {
  background: var(--paint-paper);
  color: var(--paint-coral);
}
.btn.full {
  width: 100%;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.spread {
  justify-content: space-between;
}
.panel {
  background: var(--paint-white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
}
.empty {
  text-align: center;
  padding: 55px 24px;
  border: 1px dashed var(--paint-teal-soft);
  border-radius: 18px;
  color: var(--muted);
}
.empty h3 {
  color: var(--paint-ink);
}
.empty p {
  font-size: 14px;
}
.empty .symbol {
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 18px;
}
.pillbar {
  display: flex;
  gap: 4px;
  background: var(--paint-wash);
  padding: 4px;
  border-radius: 10px;
  width: fit-content;
}
.pillbar button {
  padding: 9px 16px;
  font-size: 12px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}
.pillbar button.active {
  background: var(--paint-white);
  color: var(--paint-ink);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--paint-night-deep) 2.35%, transparent);
}
.layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 22px;
  align-items: start;
}
.editor label,
form label {
  display: block;
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 650;
}
input,
textarea,
select {
  border: 1px solid var(--paint-teal-soft);
  border-radius: 9px;
  padding: 12px;
  background: var(--paint-white);
  color: var(--paint-ink);
  width: 100%;
  font-size: 14px;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--paint-teal-soft);
  border-color: var(--accent);
}
textarea {
  resize: vertical;
  line-height: 1.7;
  min-height: 230px;
}
.editor .small {
  font-size: 11px;
}
.editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 20px;
}
.tip {
  font-size: 12px;
  padding: 14px 16px;
  background: var(--paint-white);
  border-radius: 10px;
  color: var(--paint-violet);
  line-height: 1.65;
}
.tip strong {
  color: var(--paint-muted);
}
.test-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.test-options label {
  margin-top: 14px;
}
.test-options select {
  font-size: 12px;
}
.notice {
  font-size: 12px;
  background: var(--paint-paper);
  color: var(--paint-amber);
  border: 1px solid var(--paint-coral-soft);
  border-radius: 10px;
  padding: 14px;
  line-height: 1.55;
  margin: 16px 0;
}
.strategy-card {
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--paint-white);
}
.strategy-card p {
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 61px;
}
.strategy-card .meta {
  font-size: 11px;
  color: var(--muted);
}
.history-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.history-row:last-child {
  border: 0;
}
.history-row .name {
  font-weight: 600;
  font-size: 13px;
}
.history-row .sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.history-row .result {
  margin-left: auto;
  font-size: 12px;
  white-space: nowrap;
}
.score {
  display: flex;
  gap: 18px;
  align-items: center;
}
.score strong {
  font-size: 25px;
  font-weight: 650;
}
.score span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.score .win strong {
  color: var(--green);
}
.score .loss strong {
  color: var(--coral);
}
.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 22px 0;
}
.versus {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}
.versus b {
  font-size: 14px;
}
.versus small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.versus .vs {
  border-radius: 50%;
  width: 30px;
  height: 30px;
  background: var(--paint-surface);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
}
.versus .right {
  text-align: right;
}
.arena {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
.board {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  aspect-ratio: 1;
  grid-template-columns: repeat(3, 1fr);
}
.cell {
  position: relative;
  background: var(--paint-paper);
  color: var(--muted);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 52px;
  font-weight: 450;
  padding: 0;
  min-width: 0;
  opacity: 1 !important;
  cursor: default;
}
.cell.p2 {
  color: var(--coral);
}
.cell small {
  position: absolute;
  bottom: 7px;
  left: 9px;
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
}
.cell.last {
  box-shadow: inset 0 0 0 2px var(--paint-line);
}
.cell.winning {
  background: var(--paint-paper);
  color: var(--green);
}
.board.c4 {
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  aspect-ratio: 7/6;
  background: var(--paint-paper);
  padding: 14px;
  max-width: 400px;
  border-radius: 15px;
}
.c4 .cell {
  border-radius: 50%;
  background: var(--paint-white);
  aspect-ratio: 1;
  font-size: 0;
}
.c4 .cell.p1 {
  background: var(--accent);
}
.c4 .cell.p2 {
  background: var(--coral);
}
.c4 .cell.last {
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--paint-ink) 31.37%, transparent);
}
.c4 .cell.winning {
  box-shadow: inset 0 0 0 4px var(--paint-sage);
}
.cell.playable {
  cursor: pointer;
}
.cell.playable:hover {
  background: var(--paint-teal-soft);
}
.col-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 5px 14px 10px;
  gap: 5px;
}
.col-labels button {
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  height: 30px;
  border-radius: 6px;
}
.col-labels button:not(:disabled):hover {
  background: var(--paint-paper);
}
.board-caption {
  text-align: center;
  margin: 15px 0;
  font-size: 12px;
  color: var(--muted);
}
.moves {
  height: 335px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  background: var(--paint-white);
}
.move {
  display: flex;
  text-align: left;
  width: 100%;
  background: none;
  gap: 12px;
  padding: 12px 9px;
  border-bottom: 1px solid var(--paint-paper);
  align-items: flex-start;
  border-radius: 6px;
}
.move.active {
  background: var(--paint-white);
}
.move.future {
  opacity: 0.38;
}
.move .index {
  color: var(--muted);
  font-size: 11px;
  width: 15px;
  padding-top: 2px;
}
.move .piece {
  font-size: 15px;
  font-weight: 700;
  width: 20px;
  color: var(--accent);
}
.move .piece.p2 {
  color: var(--coral);
}
.move b {
  font-size: 12px;
}
.move p {
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0 0;
  line-height: 1.55;
}
.replay-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
}
.replay-controls button {
  background: var(--paint-paper);
  color: var(--paint-muted);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 36px;
  min-height: 36px;
}
.replay-controls select {
  width: 75px;
  font-size: 11px;
  padding: 7px;
}
.game-strip {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin: 18px 0;
  padding-bottom: 6px;
}
.game-chip {
  flex-shrink: 0;
  background: var(--paint-white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 17px;
  color: var(--muted);
  font-size: 12px;
}
.game-chip.active {
  border-color: var(--accent);
  background: var(--paint-white);
  color: var(--accent);
}
.game-chip span {
  font-size: 10px;
  display: block;
  margin-top: 6px;
}
.details {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding-top: 15px;
  font-size: 12px;
}
.details summary {
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
}
.details p {
  white-space: pre-wrap;
}
.ranking {
  width: 100%;
  border-collapse: collapse;
}
.ranking th {
  text-align: left;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
}
.ranking td {
  padding: 20px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.ranking .rank {
  font-size: 18px;
  font-weight: 700;
  color: var(--muted);
  width: 50px;
}
.ranking .top {
  color: var(--accent);
}
.ranking small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.ranking .mine {
  background: var(--paint-white);
}
.rating {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.rank-rules {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin: 18px 0;
}
.loading {
  text-align: center;
  padding: 90px 20px;
  color: var(--muted);
}
nav {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  background: color-mix(in srgb, var(--paint-white) 96.08%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  padding: 7px;
  border-radius: 15px;
  box-shadow: 0 8px 30px color-mix(in srgb, var(--paint-ink) 4.71%, transparent);
  z-index: 15;
}
nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
nav a.active {
  color: var(--accent);
  background: var(--paint-white);
}
nav .nav-icon {
  font-size: 17px;
}
#toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 102px;
  max-width: 90vw;
  background: var(--paint-ink);
  color: var(--paint-white);
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 13px;
  z-index: 40;
  display: none;
  box-shadow: 0 4px 30px color-mix(in srgb, var(--paint-night-deep) 13.33%, transparent);
}
dialog {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 100px color-mix(in srgb, var(--paint-night) 18.82%, transparent);
}
dialog::backdrop {
  background: color-mix(in srgb, var(--paint-night) 37.65%, transparent);
  backdrop-filter: blur(5px);
}
dialog h2 {
  margin-bottom: 10px;
}
dialog p {
  font-size: 13px;
  color: var(--muted);
}
.modal-close {
  float: right;
  background: var(--paint-paper);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  color: var(--muted);
}
.error-text {
  color: var(--paint-coral);
  font-size: 12px;
}
.small {
  font-size: 12px;
}
.back {
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  gap: 8px;
  margin-bottom: 14px;
}
.live-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  background: var(--green);
  border-radius: 50%;
  margin-right: 7px;
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}
.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.overview-grid .board {
  max-width: 160px;
}
.overview-grid .cell {
  font-size: 25px;
  border-radius: 5px;
}
.overview-grid .cell small {
  display: none;
}
.overview-grid .c4 .cell {
  font-size: 0;
  border-radius: 50%;
}
.overview-grid .panel {
  padding: 16px;
}
.overview-grid .board-caption {
  margin-bottom: 0;
}
.banner-result {
  background: var(--paint-paper);
  border: 1px solid var(--paint-teal-soft);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 22px;
}
.banner-result h3 {
  color: var(--accent);
}
.install-note {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  margin-top: 34px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.layout.ranked-only {
  display: block;
  max-width: 760px;
  margin: 0 auto;
}
.ranked-only aside .panel {
  margin-top: 16px !important;
}

/* Minimal app shell; competition styles below remain unchanged. */
.simple-heading {
  margin-top: 0;
}
.simple-heading h1 {
  font-size: 30px;
  margin: 0;
}
.strategy-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}
.simple-strategy {
  background: var(--paint-white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.strategy-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  min-height: 76px;
}
.strategy-open strong {
  overflow-wrap: anywhere;
  min-width: 0;
}
.strategy-open .muted {
  font-size: 12px;
  white-space: nowrap;
}
.resume-link {
  display: block;
  padding: 0 22px 18px;
  color: var(--accent);
  font-size: 13px;
  min-height: 44px;
}
.quiet-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 28px 0;
}
.simple-editor {
  max-width: 720px;
  margin: auto;
}
.simple-editor label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 22px 0 8px;
}
.simple-editor textarea {
  min-height: 270px;
}
.editor-actions {
  margin-top: 22px;
}
.editor-actions .btn {
  flex: 1;
}
.editor-menu {
  position: relative;
  margin-left: auto;
}
.editor-menu summary {
  list-style: none;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--paint-white);
  border: 1px solid var(--border);
}
.editor-menu summary::-webkit-details-marker {
  display: none;
}
.editor-menu > div {
  position: absolute;
  right: 0;
  top: 50px;
  z-index: 10;
  min-width: 160px;
  padding: 6px;
  display: grid;
  background: var(--paint-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--paint-night) 7.06%, transparent);
}
.simple-ranking {
  margin-top: 24px;
}
.simple-ranking .ranking th:last-child {
  width: auto;
}
/* Shared piece geometry: identical marks in boards, legends and move history. */
.piece-mark {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  vertical-align: middle;
  color: var(--coral);
  --piece-stroke: 3px;
}
.piece-o {
  color: var(--accent);
}
.piece-o::before {
  content: '';
  position: absolute;
  inset: 8%;
  border: var(--piece-stroke) solid currentColor;
  border-radius: 50%;
}
.piece-x::before,
.piece-x::after {
  content: '';
  position: absolute;
  left: 45%;
  top: 0;
  width: var(--piece-stroke);
  height: 100%;
  border-radius: 4px;
  background: currentColor;
  transform: rotate(45deg);
}
.piece-x::after {
  transform: rotate(-45deg);
}
.piece-disc {
  border-radius: 50%;
  background: var(--coral);
  color: var(--paint-white);
  --piece-stroke: 2px;
}
.piece-disc.piece-o {
  background: var(--accent);
  color: var(--paint-white);
}
.piece-disc::before,
.piece-disc::after {
  inset: 25%;
}
.piece-disc.piece-x::before,
.piece-disc.piece-x::after {
  inset: auto;
  left: 46%;
  top: 23%;
  height: 54%;
  width: var(--piece-stroke);
}
.cell .piece-mark {
  width: 55%;
  height: 55%;
  --piece-stroke: 4px;
}
.cell.p1 {
  color: var(--coral);
}
.cell.p2 {
  color: var(--accent);
}
.cell.winning {
  background: var(--paint-paper);
}
.cell.winning.p1 {
  color: var(--coral);
}
.cell.winning.p2 {
  color: var(--accent);
}
.c4 .cell.p1 {
  background: var(--coral);
}
.c4 .cell.p2 {
  background: var(--accent);
}
.c4 .cell .piece-mark {
  width: 100%;
  height: 100%;
  --piece-stroke: 2px;
}
.overview-grid .cell .piece-mark {
  --piece-stroke: 3px;
}
.overview-grid .c4 .cell .piece-mark {
  --piece-stroke: 1.5px;
}
.piece-legend,
.first-move {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.piece-legend {
  justify-content: flex-start;
  flex-wrap: wrap;
  font-size: 13px;
  margin: 0 0 18px;
}
.piece-legend .muted {
  margin-left: 12px;
}
.first-move {
  font-size: 12px;
}
.first-move .piece-mark {
  width: 19px;
  height: 19px;
  --piece-stroke: 2px;
}
.move > .piece-mark {
  width: 20px;
  height: 20px;
  --piece-stroke: 2px;
}
.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin: 16px 0;
}
.review-actions .btn {
  flex: 1 1 130px;
}
/* Competition is a paced sequence: ladder, boards, then a saved result. */
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.competition-stage {
  max-width: 680px;
  margin: 12px auto;
  text-align: center;
}
.competition-stage h1 {
  font-size: 36px;
}
.competition-stage > p {
  font-size: 14px;
}
.ladder-viewport {
  max-height: 52vh;
  min-height: 90px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  background: var(--paint-paper);
  margin: 28px 0 18px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.animated-ladder {
  position: relative;
  text-align: left;
}
.ladder-row {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-width: 0;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--paint-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  transform: translateY(calc(var(--to) * 72px));
  animation: ladder-slide 1.2s cubic-bezier(0.22, 0.8, 0.25, 1) 0.25s both;
}
.ladder-rank {
  width: 27px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
}
.ladder-name {
  min-width: 0;
  flex: 1;
}
.ladder-name b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.ladder-name small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ladder-row.challenger {
  background: var(--paint-paper);
  border: 2px solid var(--accent);
  z-index: 2;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--paint-teal) 12.55%, transparent);
}
.challenger .ladder-rank {
  color: var(--accent);
}
.duel-row {
  animation:
    ladder-slide 1.2s cubic-bezier(0.22, 0.8, 0.25, 1) 0.25s both,
    duel-pulse 0.55s ease-in-out 1.45s 2;
}
.ladder-row .tag {
  font-size: 9px;
}
.stage-actions {
  justify-content: center;
}
.stage-caption {
  min-height: 22px;
}
.competition-result {
  max-width: 580px;
  text-align: center;
  margin: 35px auto;
  background: var(--paint-white);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 38px 26px;
  animation: result-in 0.35s ease-out;
}
.result-symbol {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  font-size: 40px;
  background: var(--paint-paper);
  color: var(--accent);
}
.competition-result.won .result-symbol {
  color: var(--green);
  background: var(--paint-paper);
}
.competition-result.lost .result-symbol {
  color: var(--paint-coral);
  background: var(--paint-paper);
}
.competition-result h1 {
  margin: 12px 0;
}
.result-score {
  justify-content: center;
  margin: 28px 0;
  gap: 40px;
}
.result-continue {
  min-width: 220px;
  margin-top: 16px;
}
.game-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  text-align: left;
  background: var(--paint-white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  color: inherit;
  transition:
    transform 0.2s,
    border-color 0.2s;
}
.game-tile:hover {
  border-color: var(--paint-line);
  transform: translateY(-2px);
}
.game-tile .board {
  pointer-events: none;
  max-width: 210px;
}
.game-tile .c4 {
  max-width: 260px;
}
.tile-heading b {
  font-size: 14px;
}
.tile-caption {
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
}
.game-tile > .link {
  text-align: center;
}
.overview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.detail-toolbar {
  margin-bottom: 18px;
}
.details .overview-grid {
  margin-top: 18px;
}
@keyframes ladder-slide {
  from {
    transform: translateY(calc(var(--from) * 72px));
  }
  to {
    transform: translateY(calc(var(--to) * 72px));
  }
}
@keyframes duel-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--paint-teal) 20%, transparent);
    border-color: var(--muted);
  }
  50% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--paint-teal) 20%, transparent);
    border-color: var(--accent);
    background: var(--paint-paper);
  }
}
@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ladder-row {
    animation: none;
    transform: translateY(calc(var(--to) * 72px));
  }
  .competition-result {
    animation: none;
  }
  .game-tile:hover {
    transform: none;
  }
}

.ladder-viewport {
  scroll-behavior: auto;
}
.ladder-row {
  animation-timing-function: ease-in-out;
}
.duel-row {
  animation-timing-function: ease-in-out, ease-in-out;
}

/* Responsive foundations: allow real content to wrap instead of clipping it. */
html {
  scroll-padding-bottom: 110px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
}
main {
  min-width: 0;
}
#nav:empty {
  display: none;
}
body:has(#nav:empty) main {
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}
html:has(#nav:empty) {
  scroll-padding-bottom: 32px;
}
#nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.editor-test {
  max-width: 800px;
  margin: 0 auto 28px;
  padding: 22px;
  background: var(--paint-white);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.editor-test [hidden] {
  display: none !important;
}
.test-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.test-heading h2 {
  margin-top: 6px;
}
.test-badge {
  font-size: 10px;
  letter-spacing: 1px;
  background: var(--paint-white);
  color: var(--accent);
  padding: 8px;
  border-radius: 8px;
  white-space: nowrap;
}
.test-description,
.test-footnote {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.test-scene {
  min-width: 0;
  margin: 18px 0;
}
.test-scene-ttt,
.test-scene-c4 {
  max-width: 390px;
  margin: 18px auto;
}
.test-scene .board {
  width: 100%;
}
.test-scene .cell:disabled {
  opacity: 1;
  cursor: default;
}
.test-scene > div,
.test-scene > section {
  min-width: 0;
}
.test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.test-actions [hidden] {
  display: none;
}
.test-status {
  white-space: pre-wrap;
  line-height: 1.6;
  margin-bottom: 0;
}
.test-history {
  font-size: 12px;
  margin-top: 12px;
}
.test-footnote {
  font-size: 11px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-bottom: 0;
}
.test-draft-note:empty {
  display: none;
}
@media (max-width: 600px) {
  .editor-test {
    padding: 14px;
    border-radius: 16px;
  }
  .test-badge {
    display: none;
  }
  .test-actions .btn {
    flex: 1 1 120px;
  }
  .test-heading h2 {
    font-size: 21px;
  }
}
h1,
h2,
h3,
p,
.name,
.small,
.tag,
.tile-caption,
.details {
  overflow-wrap: anywhere;
}
.hero > *,
.cards > *,
.layout > *,
.arena > *,
.row > *,
.section-head > *,
.match-header > *,
.game-card > div,
.move > div {
  min-width: 0;
}
.section-head,
.match-header {
  flex-wrap: wrap;
}
.section-head > div:first-child,
.match-header > div:first-child {
  flex: 1 1 230px;
}
.section-head > .btn,
.section-head > .tag {
  flex-shrink: 0;
}
.btn {
  white-space: normal;
  text-align: center;
  line-height: 1.4;
}
.tag {
  max-width: 100%;
  line-height: 1.4;
}
input,
textarea,
select {
  max-width: 100%;
}
.editor-footer {
  gap: 12px;
  flex-wrap: wrap;
}
.versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr);
}
.versus b,
.versus small {
  overflow-wrap: anywhere;
}
.history-row > div:not(.result) {
  min-width: 0;
  flex: 1;
}
.history-row .name,
.history-row .sub {
  overflow-wrap: anywhere;
}
.ranking {
  table-layout: fixed;
}
.ranking th:first-child {
  width: 64px;
}
.ranking th:last-child {
  width: 76px;
}
.ranking th.record {
  width: 110px;
}
.ranking td {
  overflow-wrap: anywhere;
}
.ranking td:nth-child(2) b {
  line-height: 1.45;
}
.ranking .tag {
  margin-top: 4px;
}
nav a {
  min-height: 48px;
}
.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.avatar,
.modal-close {
  min-width: 44px;
  min-height: 44px;
}
.link,
.back,
.details summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.replay-controls {
  flex-wrap: wrap;
}
.replay-controls button {
  min-width: 44px;
  min-height: 44px;
}
.replay-controls select {
  min-height: 44px;
}
.move {
  min-height: 44px;
}
.move .index,
.move .piece {
  flex-shrink: 0;
}
dialog {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
body:has(dialog[open]) {
  overflow: hidden;
}
.btn:focus-visible,
.cell:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--paint-line);
  outline-offset: 3px;
}
/* Phone shell: the document scrolls; only navigation is fixed. No fixed body or nested main scroller. */
@media (max-width: 760px) {
  :root {
    --nav-height: 72px;
    --page-gutter: 20px;
  }
  html {
    scroll-padding-top: 16px;
    scroll-padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 24px);
  }
  body {
    position: static;
    display: block;
    overflow: visible;
  }
  header {
    height: auto;
    min-height: 68px;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: calc(12px + env(safe-area-inset-top)) max(var(--page-gutter), env(safe-area-inset-right)) 12px
      max(var(--page-gutter), env(safe-area-inset-left));
    gap: 12px;
  }
  .brand {
    font-size: 23px;
    gap: 8px;
  }
  .brand sup {
    font-size: 8px;
    margin-left: 0;
  }
  .brand img {
    width: 30px;
    height: 30px;
  }
  .header-actions {
    gap: 8px;
    flex-shrink: 0;
  }
  .header-actions .status {
    display: none;
  }
  main {
    width: 100%;
    max-width: 600px;
    min-height: 0;
    margin: 0 auto;
    overflow: visible;
    padding: 28px max(var(--page-gutter), env(safe-area-inset-right))
      calc(var(--nav-height) + env(safe-area-inset-bottom) + 32px)
      max(var(--page-gutter), env(safe-area-inset-left));
  }
  nav {
    position: fixed;
    inset: auto 0 0;
    transform: none;
    width: 100%;
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    align-items: stretch;
    padding: 7px max(12px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--border);
    background: var(--paint-white);
    box-shadow: 0 -4px 20px color-mix(in srgb, var(--paint-ink) 3.14%, transparent);
    z-index: 30;
  }
  nav a {
    min-width: 0;
    padding: 6px 2px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    line-height: 1.2;
    border-radius: 12px;
    white-space: normal;
    text-align: center;
  }
  nav .nav-icon {
    font-size: 22px;
    line-height: 1;
  }
  .nav-label {
    display: block;
  }
  h1 {
    font-size: clamp(28px, 7.8vw, 36px);
    line-height: 1.16;
    letter-spacing: -1.1px;
    margin: 10px 0 14px;
  }
  h2 {
    font-size: 23px;
    line-height: 1.25;
  }
  h3 {
    line-height: 1.3;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-bottom: 32px;
  }
  .hero h1 {
    font-size: clamp(36px, 10vw, 46px);
    line-height: 1.12;
    letter-spacing: -1.6px;
    margin-top: 16px;
  }
  .hero p {
    font-size: 15px;
    max-width: 100%;
    line-height: 1.65;
  }
  .hero-art {
    display: none;
  }
  .hero .row {
    gap: 8px;
  }
  .hero .btn {
    flex: 1 1 auto;
  }
  .section-head {
    align-items: flex-start;
    gap: 12px;
    margin: 28px 0 18px;
  }
  .section-head > div:first-child {
    flex-basis: 100%;
  }
  .section-head h2 {
    font-size: 22px;
  }
  .section-head > .small {
    flex-basis: 100%;
  }
  .cards,
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .game-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 16px;
    align-items: center;
    padding: 20px 16px;
    gap: 14px;
  }
  .game-card h3 {
    font-size: 20px;
  }
  .game-card p {
    font-size: 14px;
    line-height: 1.55;
    margin: 8px 0 12px;
  }
  .game-card .tag {
    font-size: 9px;
    letter-spacing: 0.3px;
  }
  .game-card .arrow {
    font-size: 19px;
    margin: 0;
  }
  .game-icon.ttt {
    grid-template-columns: repeat(3, 18px);
    gap: 4px;
  }
  .game-icon.ttt span {
    height: 18px;
    font-size: 17px;
  }
  .game-icon.c4 {
    grid-template-columns: repeat(4, 10px);
    gap: 4px;
    padding: 6px;
  }
  .game-icon.c4 span {
    height: 10px;
  }
  .panel {
    padding: 20px;
    border-radius: 16px;
  }
  .strategy-card {
    padding: 20px;
  }
  .strategy-card h3 {
    font-size: 20px;
  }
  .strategy-card p {
    font-size: 14px;
    min-height: 0;
  }
  .btn {
    min-height: 46px;
    padding: 12px 16px;
    font-size: 14px;
  }
  .btn.ghost {
    padding-left: 10px;
    padding-right: 10px;
  }
  input,
  textarea,
  select,
  .test-options select {
    font-size: 16px;
    line-height: 1.5;
  }
  textarea {
    min-height: 240px;
    resize: vertical;
  }
  .editor label,
  form label {
    font-size: 13px;
  }
  .editor-footer .small {
    font-size: 12px;
  }
  .editor-footer .link {
    margin-left: auto;
  }
  .editor .row > .btn {
    flex: 1 1 auto;
  }
  .tip {
    font-size: 13px;
    padding: 14px;
    line-height: 1.6;
  }
  .pillbar {
    width: 100%;
    max-width: 100%;
    display: flex;
  }
  .pillbar button {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 13px;
    flex: 1;
    white-space: normal;
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin-top: 28px;
    padding-top: 24px;
  }
  .steps b {
    font-size: 14px;
  }
  .steps p {
    font-size: 13px;
    margin-left: 34px;
  }
  .hide-mobile {
    display: none;
  }
  .history-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .history-row .name {
    font-size: 14px;
  }
  .history-row .sub {
    font-size: 12px;
    line-height: 1.5;
  }
  .history-row .result {
    flex-basis: 100%;
    padding-left: 40px;
    margin: 0;
    font-size: 12px;
  }
  .ranking-panel {
    padding: 0 10px;
  }
  .ranking .record {
    display: none;
  }
  .ranking th,
  .ranking td {
    padding: 16px 6px;
  }
  .ranking th:first-child {
    width: 42px;
  }
  .ranking th:last-child {
    width: 48px;
  }
  .ranking th {
    font-size: 10px;
    letter-spacing: 0;
  }
  .ranking td {
    font-size: 13px;
  }
  .ranking small {
    font-size: 12px;
  }
  .ranking .rank {
    font-size: 18px;
  }
  .arena {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }
  .board {
    max-width: 340px;
  }
  .board.c4 {
    max-width: 400px;
    padding: 10px;
    gap: 5px;
  }
  .cell {
    font-size: clamp(32px, 12vw, 52px);
  }
  .moves {
    height: 280px;
    max-height: 45dvh;
    overscroll-behavior-y: auto;
  }
  .move p {
    font-size: 13px;
    line-height: 1.6;
  }
  .move b {
    font-size: 13px;
  }
  .board-caption {
    font-size: 13px;
  }
  .versus {
    gap: 10px;
    margin-bottom: 20px;
    align-items: start;
  }
  .versus b {
    font-size: 14px;
    line-height: 1.45;
  }
  .versus small {
    font-size: 12px;
    line-height: 1.45;
  }
  .match-header {
    margin: 16px 0;
    gap: 12px;
  }
  .match-header h2 {
    font-size: 25px;
    line-height: 1.3;
  }
  .match-header > div:first-child {
    flex-basis: 100%;
  }
  .match-actions {
    width: 100%;
  }
  .match-actions .btn {
    flex: 1 1 120px;
  }
  .detail-toolbar {
    align-items: flex-start;
    gap: 4px;
  }
  .detail-toolbar > .row {
    gap: 14px;
  }
  .detail-toolbar .link {
    font-size: 13px;
  }
  .replay-controls {
    gap: 6px;
  }
  .replay-controls button {
    flex: 1;
    padding: 8px 4px;
    min-width: 44px;
  }
  .replay-controls select {
    width: 65px;
    padding: 6px;
    font-size: 16px;
  }
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .game-tile {
    padding: 14px 10px;
    gap: 12px;
    min-width: 0;
  }
  .game-tile .board {
    gap: 5px;
  }
  .game-tile .c4 {
    padding: 6px;
    gap: 3px;
  }
  .game-tile .cell {
    font-size: 29px;
  }
  .game-tile .c4 .cell {
    font-size: 0;
  }
  .tile-heading {
    gap: 6px;
  }
  .tile-heading b {
    font-size: 12px;
  }
  .tile-heading .tag {
    font-size: 10px;
  }
  .tile-caption {
    font-size: 12px;
    line-height: 1.5;
  }
  .game-tile > .link {
    font-size: 12px;
    justify-content: center;
    min-height: 32px;
    padding: 0;
  }
  .competition-stage {
    margin: 8px auto;
  }
  .competition-stage h1 {
    font-size: clamp(28px, 7.8vw, 36px);
  }
  .competition-stage > p {
    font-size: 14px;
  }
  .ladder-row {
    gap: 8px;
    padding: 10px;
  }
  .ladder-row .tag {
    font-size: 8px;
    padding: 4px;
  }
  .ladder-viewport {
    padding: 8px;
    max-height: 42svh;
    margin: 24px 0 18px;
  }
  .stage-actions .btn {
    flex: 1 1 140px;
  }
  .stage-actions .link {
    flex-basis: 100%;
    justify-content: center;
  }
  .competition-result {
    margin: 12px auto;
    padding: 26px 20px;
    border-radius: 20px;
  }
  .result-symbol {
    margin-bottom: 18px;
  }
  .result-score {
    gap: 28px;
    margin: 24px 0;
  }
  .result-continue {
    width: 100%;
    min-width: 0;
  }
  .score strong {
    font-size: 25px;
  }
  dialog {
    padding: 24px 20px;
    max-height: calc(100dvh - 24px);
    width: calc(100% - 24px);
  }
  .modal-close {
    margin: -8px -6px 4px 8px;
  }
  .empty {
    padding: 36px 20px;
  }
  .loading {
    padding: 60px 20px;
  }
  #toast {
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 12px);
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  .install-note {
    line-height: 1.6;
    margin-top: 28px;
  }
}
@media (max-width: 359px) {
  :root {
    --page-gutter: 16px;
  }
  .overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .game-tile {
    padding: 20px;
  }
  .game-tile .board {
    max-width: 190px;
  }
  .game-card {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
  }
  .game-card .arrow {
    display: none;
  }
  .game-icon {
    transform: scale(0.78);
    transform-origin: left center;
  }
  .panel {
    padding: 16px;
  }
  .brand sup {
    display: none;
  }
}

/* Compact spacing without shrinking touch targets or safe-area clearance. */
header {
  height: 64px;
}
main {
  padding-top: 22px;
  padding-bottom: 100px;
}
.section-head,
.match-header {
  margin: 10px 0 12px;
  gap: 10px;
}
.simple-heading {
  margin-top: 0;
}
.back {
  margin-bottom: 2px;
}
.match-header p {
  margin: 6px 0 0;
}
.piece-legend {
  margin-bottom: 10px;
}
.panel {
  padding: 18px;
}
.strategy-list,
.simple-ranking {
  margin-top: 14px;
}
.strategy-open {
  padding: 16px;
  min-height: 60px;
}
.resume-link {
  padding: 0 16px 10px;
}
.quiet-empty {
  padding: 14px 0;
}
.simple-editor > p {
  margin: 0 0 8px;
}
.simple-editor label {
  margin: 14px 0 6px;
}
.simple-editor textarea {
  min-height: 190px;
}
.editor-actions {
  margin-top: 14px;
}
.game-tile {
  padding: 14px;
  gap: 8px;
}
.overview-grid {
  gap: 12px;
}
.game-tile > .link {
  min-height: 32px;
  padding: 0;
}
.board-caption {
  margin: 9px 0;
}
.versus {
  margin-bottom: 12px;
}
.detail-toolbar {
  margin-bottom: 10px;
}
.arena {
  gap: 18px;
}
.review-actions {
  margin: 10px 0;
}
.run-footer {
  margin-top: 12px;
}
.details {
  margin-top: 12px;
  padding-top: 10px;
}
.competition-stage {
  margin: 0 auto;
}
.competition-stage h1 {
  font-size: 28px;
  margin: 8px 0 12px;
}
.competition-stage > p {
  margin: 8px 0;
}
.ladder-viewport {
  margin: 12px 0;
  max-height: 40vh;
}
.competition-result {
  margin: 8px auto;
  padding: 22px;
}
.result-symbol {
  width: 48px;
  height: 48px;
  font-size: 28px;
  border-radius: 16px;
  margin-bottom: 12px;
}
.competition-result h1 {
  margin: 8px 0;
}
.competition-result p {
  margin: 10px 0;
}
.result-score {
  margin: 16px 0;
}
.result-continue {
  margin-top: 4px;
}
.ranking th,
.ranking td {
  padding-top: 13px;
  padding-bottom: 13px;
}
.ladder-columns {
  display: grid;
  grid-template-columns: 56fr 44fr;
  gap: 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  padding: 0 10px;
  margin: 8px 0;
}
.paired-stage .ladder-viewport {
  margin-top: 0;
  padding: 8px;
}
.paired-ladder .incumbent {
  left: 0;
  right: calc(44% + 6px);
}
.paired-ladder .challenger {
  left: calc(56% + 6px);
  right: 0;
}
.paired-ladder .ladder-row {
  gap: 6px;
  padding: 8px;
  height: 62px;
}
.paired-ladder .ladder-rank {
  font-size: 13px;
  width: 20px;
}
.paired-ladder .challenger .ladder-rank,
.paired-ladder .tag {
  display: none;
}
.paired-ladder .ladder-name b {
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 12px;
  line-height: 1.2;
}
.paired-ladder .ladder-name small {
  font-size: 10px;
  margin-top: 3px;
}
#network-dialog {
  max-width: 360px;
  padding: 24px;
}
#network-dialog h2 {
  font-size: 22px;
}
#network-dialog .row {
  margin-top: 18px;
}
#network-dialog .btn {
  flex: 1;
}
@media (max-width: 760px) {
  header {
    height: auto;
    min-height: 60px;
    padding-top: calc(8px + env(safe-area-inset-top));
    padding-bottom: 8px;
  }
  main {
    padding-top: 16px;
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 16px);
  }
  .section-head,
  .match-header {
    margin-top: 8px;
    margin-bottom: 12px;
  }
  .simple-heading {
    margin-top: 0;
  }
  .simple-heading h1 {
    font-size: 27px;
  }
  .panel {
    padding: 14px;
  }
  .simple-ranking {
    padding: 0 8px;
  }
  .game-tile {
    padding: 10px 8px;
    gap: 8px;
  }
  .game-tile .board {
    max-width: 180px;
  }
  .simple-editor textarea {
    min-height: 190px;
  }
  .arena {
    gap: 16px;
  }
  .competition-result {
    padding: 20px 16px;
  }
  .competition-stage h1 {
    font-size: 27px;
  }
  .ladder-viewport {
    max-height: 36svh;
    margin: 12px 0;
  }
  .stage-caption {
    min-height: 0;
  }
  .detail-toolbar {
    gap: 0;
  }
  .ranking th,
  .ranking td {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .loading {
    padding: 32px 16px;
  }
  .empty {
    padding: 24px 16px;
  }
}

/* Original iOS robot branding. */
.brand img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 9px;
  flex-shrink: 0;
}

/* Shared loading, Connect Four tokens and clear competition actions. */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 120px;
  padding: 32px 16px;
}
.loading::before {
  content: '';
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}
@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .loading::before {
    animation: none;
    border-color: var(--accent);
    opacity: 0.6;
  }
}
.piece-token {
  background: var(--paint-black);
  border-radius: 50%;
}
.piece-token.piece-o {
  background: var(--paint-coral);
}
.piece-token::before,
.piece-token::after {
  display: none;
}
.c4 .cell.p1 {
  background: var(--paint-black);
}
.c4 .cell.p2 {
  background: var(--paint-coral);
}
.btn[data-action='continue-round'] {
  background: var(--paint-teal);
  color: var(--paint-white);
}
.btn[data-action='continue-round']:hover {
  background: var(--paint-teal-dark);
}
.btn[data-action='review-games'] {
  background: var(--accent);
  color: var(--paint-white);
}
.btn[data-action='review-games']:hover {
  background: var(--paint-teal);
}
.btn[data-action='cancel'],
.btn[data-action='confirm-cancel'] {
  background: var(--paint-coral);
  color: var(--paint-white);
}
.btn[data-action='cancel']:hover,
.btn[data-action='confirm-cancel']:hover {
  background: var(--paint-coral);
}

.competition-result .result-continue {
  margin-bottom: 12px;
}
/* Go Fish: CSS card faces, concealed opponent hand, animated asks and catches. */
.pillbar {
  max-width: 100%;
  overflow-x: auto;
}
.pillbar button {
  white-space: nowrap;
}
.fish-rules {
  font-size: 13px;
  margin: 0 0 18px;
  color: var(--muted);
}
.fish-rules summary {
  cursor: pointer;
  color: var(--accent);
  padding: 8px 0;
}
.fish-rules p {
  margin: 8px 0;
}
.fish-table {
  --cw: 52px;
  --ch: 74px;
  background: radial-gradient(ellipse at 50% 40%, var(--paint-teal), var(--paint-night));
  border: 1px solid var(--paint-teal);
  border-radius: 22px;
  padding: 18px;
  color: var(--paint-white);
  min-width: 0;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--paint-white) 14.51%, transparent),
    0 10px 24px color-mix(in srgb, var(--paint-ink) 7.06%, transparent);
}
.fish-seat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 10px;
}
.fish-seat small {
  display: inline-block;
  font-size: 10px;
  color: var(--paint-line);
  margin-left: 6px;
}
.fish-seat b {
  padding: 5px 9px;
  background: color-mix(in srgb, var(--paint-white) 7.84%, transparent);
  border-radius: 20px;
  white-space: nowrap;
}
.fish-hand {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: var(--ch);
  padding: 4px 0 10px;
}
.fish-hidden {
  flex-wrap: nowrap;
  min-height: 48px;
  padding: 0 16px 6px;
}
.fish-hidden .card-back {
  width: 34px;
  height: 48px;
  margin-left: -10px;
  transform: rotate(calc((var(--i) - 3) * 3deg));
  transform-origin: bottom center;
}
.fish-hidden .card-back:first-child {
  margin-left: 0;
}
.playing-card,
.card-back {
  display: inline-flex;
  position: relative;
  width: var(--cw);
  height: var(--ch);
  border-radius: 7px;
  flex: 0 0 auto;
  box-shadow: 0 3px 6px color-mix(in srgb, var(--paint-night-deep) 25.1%, transparent);
}
.playing-card {
  color: var(--paint-night);
  background: linear-gradient(135deg, var(--paint-white), var(--paint-paper));
  border: 1px solid var(--paint-white);
  vertical-align: middle;
}
.playing-card.red-suit {
  color: var(--paint-coral);
}
.card-corner {
  position: absolute;
  top: 4px;
  left: 5px;
  line-height: 1;
  font-size: 15px;
  font-weight: 800;
  display: grid;
  text-align: center;
}
.card-corner small {
  font-size: 11px;
  margin-top: 2px;
}
.card-bottom {
  top: auto;
  left: auto;
  right: 5px;
  bottom: 4px;
  transform: rotate(180deg);
}
.card-pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 29px;
}
.card-back {
  align-items: center;
  justify-content: center;
  color: var(--paint-teal-soft);
  font-size: 23px;
  border: 3px solid var(--paint-teal-soft);
  background: repeating-linear-gradient(45deg, var(--paint-teal) 0 3px, var(--paint-teal) 3px 6px);
  outline: 1px solid color-mix(in srgb, var(--paint-white) 12.55%, transparent);
}
.fish-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin: 6px 0 12px;
}
.fish-stock {
  display: grid;
  justify-items: center;
  gap: 7px;
  transform: rotate(-5deg);
}
.fish-stock .card-back {
  box-shadow:
    3px 3px 0 var(--paint-water),
    6px 6px 0 var(--paint-muted);
}
.fish-stock small {
  font-size: 10px;
  color: var(--paint-line);
}
.fish-request {
  display: grid;
  text-align: center;
  gap: 3px;
  min-width: 88px;
}
.fish-request > span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--paint-line);
}
.fish-request > b {
  font-size: 38px;
  line-height: 1.1;
  color: var(--paint-white);
}
.fish-request small {
  font-size: 11px;
  color: var(--paint-line);
}
.fish-event {
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
  min-height: 32px;
  margin-bottom: 12px;
  color: var(--paint-teal-soft);
}
.fish-books {
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.fish-books:empty {
  display: none;
}
.fish-book {
  background: var(--paint-sand);
  color: var(--paint-black);
  border: 1px solid var(--paint-sand);
  border-radius: 5px;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 6px;
  box-shadow: 2px 2px 0 var(--paint-amber);
}
.fish-book small {
  font-size: 9px;
}
.fish-finished {
  text-align: center;
  padding: 9px;
  background: color-mix(in srgb, var(--paint-white) 9.41%, transparent);
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
}
.fish-player-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paint-teal-dark);
  display: inline-block;
  flex-shrink: 0;
}
.fish-player-dot.mine {
  background: var(--accent);
}
.fish-mini {
  --cw: 28px;
  --ch: 40px;
  padding: 11px;
  border-radius: 14px;
}
.fish-mini .card-corner {
  font-size: 10px;
  top: 3px;
  left: 3px;
}
.fish-mini .card-corner small {
  font-size: 8px;
}
.fish-mini .card-bottom {
  display: none;
}
.fish-mini .card-pip {
  font-size: 15px;
  transform: translate(2px, 5px);
}
.fish-mini .fish-hidden .card-back {
  width: 23px;
  height: 32px;
  border-width: 2px;
}
.fish-mini .fish-hand {
  gap: 4px;
}
.fish-mini .fish-seat {
  font-size: 10px;
  gap: 4px;
}
.fish-mini .fish-seat small {
  display: none;
}
.fish-mini .fish-seat b {
  padding: 3px 5px;
}
.fish-mini .fish-center {
  gap: 16px;
  margin: 2px 0 8px;
}
.fish-mini .fish-request {
  min-width: 45px;
}
.fish-mini .fish-request > b {
  font-size: 24px;
}
.fish-mini .fish-request > span {
  font-size: 8px;
  letter-spacing: 0;
}
.fish-mini .fish-event {
  font-size: 10px;
  min-height: 38px;
  margin-bottom: 6px;
}
.fish-mini .fish-book {
  font-size: 10px;
  padding: 2px 4px;
}
.fish-more {
  font-size: 11px;
  align-self: center;
}
.fish-mini .fish-finished {
  font-size: 10px;
}
.fish-arena {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
}
.fish-animate .card-arriving {
  animation: fish-draw 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.fish-animate .request-new {
  animation: fish-ask 0.5s ease-out both;
}
.fish-animate .book-new {
  animation: fish-book 0.7s ease-out both;
}
@keyframes fish-draw {
  from {
    opacity: 0;
    transform: translate(0, -65px) rotate(-15deg) scale(0.75);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fish-ask {
  from {
    opacity: 0.3;
    transform: translateY(-10px) scale(0.85);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fish-book {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  65% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@media (max-width: 700px) {
  .fish-arena {
    grid-template-columns: 1fr;
  }
  .fish-table {
    --cw: 43px;
    --ch: 62px;
    padding: 13px;
  }
  .fish-mini {
    --cw: 25px;
    --ch: 36px;
    padding: 9px;
  }
  .fish-mini .fish-center {
    gap: 10px;
  }
  .fish-mini .fish-request small {
    font-size: 9px;
  }
  .game-tile:has(.fish-table) {
    padding: 10px;
    gap: 9px;
  }
  .fish-arena .moves {
    height: 240px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fish-animate * {
    animation: none !important;
  }
}
/* One portal and one strategy competition flow for every game. */
.games-intro {
  padding: 5px 0 32px;
}
.games-intro h1 {
  font-size: clamp(36px, 5.3vw, 60px);
  max-width: 720px;
  letter-spacing: -2.3px;
  margin: 17px 0;
  line-height: 1.07;
}
.games-intro p {
  font-size: 15px;
  color: var(--muted);
  max-width: 580px;
  line-height: 1.75;
}
.games-intro .eyebrow {
  color: var(--paint-muted);
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.portal-game {
  display: block;
  overflow: hidden;
  background: var(--paint-white);
  border: 1px solid var(--paint-teal-soft);
  border-radius: 21px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.portal-game:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px color-mix(in srgb, var(--paint-ink) 6.27%, transparent);
}
.portal-art {
  position: relative;
  overflow: hidden;
}
.portal-art svg {
  display: block;
  width: 100%;
  height: auto;
}
.portal-number {
  position: absolute;
  top: 13px;
  left: 15px;
  font-size: 10px;
  font-weight: 750;
  background: color-mix(in srgb, var(--paint-white) 60%, transparent);
  border: 1px solid color-mix(in srgb, var(--paint-white) 66.67%, transparent);
  padding: 5px 8px;
  border-radius: 20px;
  color: var(--paint-muted);
}
.portal-copy {
  padding: 20px;
}
.portal-copy .eyebrow {
  font-size: 9px;
  letter-spacing: 1.6px;
  color: var(--muted);
}
.portal-copy h2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
  font-size: 23px;
  margin: 9px 0;
  color: var(--paint-ink);
}
.portal-copy h2 > span {
  font-size: 17px;
  color: var(--muted);
}
.portal-copy p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
  min-height: 43px;
  margin: 10px 0 19px;
}
.portal-play {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--paint-wash);
  padding-top: 14px;
  font-size: 11px;
  color: var(--paint-muted);
  font-weight: 650;
}
.portal-play > b {
  font-size: 16px;
}
.game-context {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  font-size: 12px;
  margin: 0 0 22px;
  color: var(--muted);
}
.game-context a {
  padding: 7px 0;
}
.game-context a:last-child {
  font-weight: 650;
  color: var(--paint-forest);
}
.game-hub-heading {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 35px;
}
.game-hub-heading h1 {
  font-size: 37px;
  margin: 8px 0 10px;
}
.game-hub-heading p {
  color: var(--muted);
  font-size: 13px;
  max-width: 530px;
  margin: 0;
}
.game-hub-heading > .btn {
  flex-shrink: 0;
}
.hub-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 12px;
}
.hub-section-head h2 {
  font-size: 19px;
}
.hub-section-head a {
  font-size: 12px;
  color: var(--paint-forest);
  font-weight: 650;
  padding: 10px 0;
}
.game-icon-scored {
  font-size: 36px;
  color: var(--paint-forest);
}
.scored-preview {
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--paint-teal-soft);
  border-radius: 14px;
  background: var(--paint-paper);
}
.scored-preview-art {
  display: block;
  height: 100px;
  overflow: hidden;
}
.scored-preview-art svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scored-preview-scores {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 12px 8px 9px;
  gap: 8px;
}
.scored-preview-scores > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.scored-preview-scores small {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.scored-preview-scores b {
  font-size: 28px;
  font-weight: 700;
  color: var(--paint-forest);
}
.scored-preview-scores .scored-preview-vs {
  font-size: 10px;
  font-weight: 750;
  color: var(--muted);
}
.scored-preview-caption {
  display: block;
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  padding: 0 8px 12px;
}
.scored-players {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.scored-players button {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 10px;
  text-align: left;
  padding: 16px 18px;
  background: var(--paint-white);
  border: 1px solid var(--paint-line);
  border-radius: 15px;
  color: var(--paint-forest);
  min-width: 0;
}
.scored-players button.selected {
  background: var(--paint-paper);
  border-color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--paint-subtle);
}
.scored-players button > span {
  font-size: 10px;
  color: var(--muted);
  grid-column: 1;
}
.scored-players button > b {
  grid-column: 1;
  font-size: 14px;
  margin-top: 6px;
  overflow-wrap: anywhere;
}
.scored-players button > strong {
  grid-column: 2;
  grid-row: 1/3;
  align-self: center;
  font-size: 25px;
  white-space: nowrap;
}
.scored-players button small {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
}
.scored-perspective {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 17px;
}
.scored-scene {
  min-width: 0;
}
.scored-wait {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px;
  margin-top: 12px;
  border-radius: 13px;
  background: var(--paint-paper);
  color: var(--muted);
  font-size: 12px;
}
.loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paint-subtle);
  animation: scored-breathe 1.4s ease-in-out infinite;
}
@keyframes scored-breathe {
  50% {
    opacity: 0.25;
  }
}
.scored-duel button:focus-visible {
  outline: 3px solid var(--paint-water);
  outline-offset: 3px;
}
@media (min-width: 768px) {
  body:has(.games-portal) main {
    max-width: 1240px;
  }
}
@media (max-width: 900px) {
  .games-grid {
    gap: 15px;
  }
  .portal-copy {
    padding: 17px;
  }
  .portal-copy h2 {
    font-size: 21px;
  }
  .portal-copy p {
    font-size: 11px;
    min-height: 57px;
  }
}
@media (max-width: 680px) {
  .games-intro {
    padding: 3px 0 24px;
  }
  .games-intro h1 {
    font-size: 36px;
    letter-spacing: -1.5px;
  }
  .games-intro p {
    font-size: 12px;
  }
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }
  .portal-game {
    border-radius: 15px;
  }
  .portal-copy {
    padding: 14px 12px;
  }
  .portal-copy h2 {
    font-size: 18px;
    line-height: 1.2;
  }
  .portal-copy h2 > span {
    font-size: 13px;
  }
  .portal-copy .eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .portal-copy p {
    min-height: 57px;
    font-size: 10px;
    line-height: 1.7;
    margin: 8px 0 12px;
  }
  .portal-play {
    font-size: 9px;
    padding-top: 10px;
  }
  .portal-play > b {
    font-size: 13px;
  }
  .portal-number {
    font-size: 8px;
    padding: 4px 6px;
    top: 8px;
    left: 9px;
  }
  .game-hub-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
    margin: 16px 0 30px;
  }
  .game-hub-heading h1 {
    font-size: 31px;
  }
  .game-hub-heading p {
    font-size: 12px;
  }
  .game-context {
    font-size: 11px;
    margin-bottom: 12px;
  }
  .hub-section-head h2 {
    font-size: 17px;
  }
  .hub-section-head a {
    font-size: 11px;
  }
  .scored-players {
    gap: 8px;
  }
  .scored-players button {
    padding: 12px 10px;
    column-gap: 6px;
  }
  .scored-players button > b {
    font-size: 12px;
  }
  .scored-players button > strong {
    font-size: 21px;
  }
  .scored-players button small {
    font-size: 8px;
    display: block;
  }
  .scored-perspective {
    font-size: 10px;
  }
  .scored-preview-art {
    height: 83px;
  }
  .scored-preview-scores b {
    font-size: 23px;
  }
}
@media (max-width: 360px) {
  .portal-copy h2 {
    font-size: 16px;
  }
  .portal-copy {
    padding: 12px 10px;
  }
  .portal-copy p {
    min-height: 68px;
  }
  .portal-play {
    font-size: 8px;
  }
  .scored-players button > b {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .portal-game {
    transition: none;
  }
  .portal-game:hover {
    transform: none;
  }
  .loading-dot {
    animation: none;
  }
}
.scored-image-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--paint-wash);
}

.fish-guidance {
  padding: 16px 4px;
  font-size: 13px;
  line-height: 1.55;
}
.fish-active-rule {
  padding: 12px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.fish-active-rule b,
.fish-active-rule span {
  display: block;
}
.fish-guidance summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
}
.fish-guidance ol {
  padding-left: 24px;
  margin: 6px 0 14px;
}
.fish-guidance li {
  padding: 7px 4px;
  overflow-wrap: anywhere;
}
.fish-rule-list li[aria-current] {
  background: var(--accent-soft);
  border-radius: 6px;
}
.fish-public-history ol {
  list-style: none;
  padding: 0;
  max-height: 220px;
  overflow: auto;
}
.fish-public-history li {
  border-bottom: 1px solid var(--border);
}
.fish-public-history li span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.fish-guidance summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
