.arcade-shell {
  max-width: 940px;
  width: calc(100% - 28px);
  margin: 30px auto 70px;
}
.arcade-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 70px;
  align-items: center;
}
.arcade-header nav {
  display: flex;
  gap: 20px;
  font-size: 0.85rem;
}
.arcade-shell h1 {
  font:
    600 clamp(2.5rem, 7vw, 4rem) / 1.05 Georgia,
    serif;
  letter-spacing: -0.05em;
  margin: 8px 0 16px;
}
.arcade-shell h2 {
  font:
    600 1.55rem Georgia,
    serif;
}
.muted {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.88rem;
}
.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}
.hub-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, #343528, #20251f);
  padding: 20px;
  color: var(--ink);
  text-align: left;
  min-height: 165px;
}
.hub-card:hover {
  border-color: var(--gold);
}
.game-symbol {
  display: block;
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 13px;
}
.hub-card p {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}
.arcade-tools {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0;
}
.arcade-tools select {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  max-width: 100%;
}
.board {
  --n: 6;
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  width: min(100%, 480px);
  aspect-ratio: 1;
  border: 2px solid #84704a;
  border-radius: 7px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  background: #19261f;
  position: relative;
  margin: 16px auto;
}
.board button {
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #b0b49c35;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(0.73rem, 3.4vw, 1.35rem);
  position: relative;
  touch-action: none;
}
.board button:focus-visible {
  outline-offset: -3px;
  z-index: 2;
}
.board button.selected {
  box-shadow: inset 0 0 0 3px var(--gold);
}
.board button.conflict {
  box-shadow: inset 0 0 0 3px #f3a091;
}
.board button.given {
  font-weight: 800;
  color: #f5d499;
  background: #b8a56d18;
}
.board button.box-right {
  border-right: 2px solid #c5b286;
}
.board button.box-bottom {
  border-bottom: 2px solid #c5b286;
}
.board .notes {
  font-size: 0.65rem;
  word-spacing: 4px;
  line-height: 1.25;
  color: #c8c6b1;
}
.task-card {
  max-width: 590px;
  margin: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.task-card h1 {
  font-size: 2.7rem;
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--gold-light);
  font: 650 0.75rem var(--mono);
  padding: 10px 0;
}
.palette {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
}
.palette button {
  min-width: 42px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #34372c;
  color: var(--ink);
  font-weight: 650;
}
.palette button[aria-pressed="true"] {
  background: var(--gold);
  color: #231e15;
}
.arcade-note {
  min-height: 24px;
  color: var(--gold-light);
  font-size: 0.85rem;
  line-height: 1.4;
}
.tile {
  display: grid;
  place-items: center;
  height: 100%;
  background: var(--tile-bg, #494938);
  font-weight: 750;
  font-size: clamp(1rem, 5vw, 2rem);
  border-radius: 4px;
  margin: 3px;
}
.line-segment {
  position: absolute;
  background: var(--color);
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
}
.line-segment.h {
  height: 8px;
  top: calc(50% - 4px);
  width: 50%;
}
.line-segment.v {
  width: 8px;
  left: calc(50% - 4px);
  height: 50%;
}
.terminal-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 70%;
  height: 70%;
  margin: auto;
  border: 2px solid var(--color);
  background: #1b241c;
  border-radius: 50%;
  color: var(--color);
  font-weight: 800;
}
.checkpoint {
  position: relative;
  z-index: 1;
  border-radius: 4px;
  padding: 3px 6px;
  background: #f1c980;
  color: #181b18;
  font-size: 0.8em;
}
.archive-status {
  display: flex;
  gap: 8px;
  align-items: center;
}
.result-score {
  font: 700 3rem var(--mono);
  color: var(--gold);
}
.prototype-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 28px;
  line-height: 1.5;
}
.practice-label {
  color: var(--gold);
  font: 700 0.72rem var(--mono);
  letter-spacing: 0.1em;
}
.board.snake-board {
  background: #293021;
}
.snake-board button.wall {
  background: repeating-linear-gradient(45deg, #745c3a 0 4px, #655033 4px 7px);
}
.snake-board button.body {
  background: #93b685;
  border-radius: 22%;
}
.snake-board button.head {
  background: #f0c475;
  border-radius: 28%;
}
.snake-board button.food {
  background: radial-gradient(circle, #f6a4a1 0 28%, transparent 32%);
}
.board.snake-board button {
  border-color: #b0b49c12;
}
.badge {
  font: 700 0.7rem var(--mono);
  color: var(--gold);
}
.summary-grid {
  display: flex;
  gap: 20px;
  margin: 15px 0;
}
.ranked-warning {
  background: #ddba7114;
  border-left: 2px solid var(--gold);
  padding: 12px;
  line-height: 1.5;
  font-size: 0.85rem;
}
.board.queens-board button {
  color: #fff9e7;
  text-shadow: 0 1px 2px #000;
  font-size: 1.6rem;
}
.arcade-shell details {
  margin-top: 15px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.arcade-shell summary {
  padding-block: 10px;
  cursor: pointer;
}
.end-screen {
  padding: 25px 0;
}
.button:disabled {
  opacity: 0.5;
}
.loading-error {
  color: #ffb9a9;
}
@media (max-width: 650px) {
  .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hub-card {
    padding: 15px;
    min-height: 150px;
  }
  .arcade-header nav {
    gap: 10px;
    font-size: 0.73rem;
  }
  .task-card {
    padding: 12px;
  }
  .arcade-shell {
    margin-top: 22px;
  }
  .board {
    max-width: 430px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
