:root {
  color-scheme: dark;
  --bg: #13121c;
  --panel: #211c30;
  --text: #f5f0fa;
  --muted: #b9afc9;
  --accent: #d7b4ff;
  --line: #ffffff19;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100svh;
  margin: 0;
  background: radial-gradient(ellipse at 50% 0,#34244266,transparent 65%),var(--bg);
  color: var(--text);
  font-family: "Segoe UI",system-ui,sans-serif;
  line-height: 1.5;
}

button,a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  opacity: .4;
  cursor: default;
}

button:focus-visible,a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

a {
  color: inherit;
  text-decoration: none;
}

.game-shell {
  max-width: 620px;
  margin: auto;
  padding: 20px 28px;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 25px;
}

.game-header a {
  padding: 7px 0;
}

.edition {
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #a697bb;
}

.game-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 17px;
}

.eyebrow {
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 5px;
}

h1 {
  margin: 0;
  font-size: 35px;
  letter-spacing: -1.3px;
  font-weight: 700;
}

h1 span {
  color: var(--accent);
}

.round-button {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  border: 1px solid #ffffff30;
  background: #ffffff06;
  color: var(--text);
  font-weight: 700;
}

.hud {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin: 0 0 14px;
  padding: 13px 20px;
  background: #ffffff04;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.hud div {
  text-align: center;
  min-width: 60px;
}

.hud span {
  font-size: 8px;
  letter-spacing: 1.3px;
  color: var(--muted);
  display: block;
}

.hud b {
  font-size: 25px;
  font-weight: 550;
  line-height: 1.3;
  display: block;
  font-variant-numeric: tabular-nums;
}

.stage {
  position: relative;
  container-type: size;
  border: 1px solid #bfa0e82b;
  border-radius: 17px;
  overflow: hidden;
  background: var(--panel);
  aspect-ratio: 600/660;
  max-height: 67vh;
  min-height: 280px;
  display: flex;
  justify-content: center;
}

.stage canvas {
  height: 100%;
  width: 100%;
  object-fit: contain;
  display: block;
  touch-action: none;
  user-select: none;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(#1e182dee,#1e182ddc);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  overflow-y: auto;
  padding: 28px;
  text-align: center;
}

.overlay[hidden] {
  display: none;
}

.overlay-symbol {
  font-size: 54px;
  line-height: 1.2;
  color: var(--accent);
  margin-bottom: 18px;
}

.overlay h2 {
  font-size: 32px;
  letter-spacing: -1px;
  margin: 8px 0 12px;
  line-height: 1.2;
}

.overlay>p:not(.eyebrow) {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  margin: 0 0 20px;
  max-width: 300px;
}

.overlay .overlay-note {
  font-size: 9px!important;
  letter-spacing: .5px;
  margin: 16px 0 0!important;
}

.primary {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #261c32;
  padding: 13px 18px;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.overlay .primary {
  min-width: 210px;
}

.action-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.action-row .primary {
  flex: 1;
}

.secondary {
  border: 1px solid #ffffff26;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  padding: 11px 15px;
  font-size: 11px;
}

.secondary:hover {
  background: #ffffff08;
}

.status {
  min-height: 30px;
  margin: 12px 0 7px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

.game-footer {
  border-top: 1px solid var(--line);
  padding: 13px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
  color: #a195b3;
}

@media(max-width:480px) {
  .game-shell {
    padding: 12px 18px;
  }
  .game-header {
    margin-bottom: 17px;
  }
  .game-title {
    margin-bottom: 12px;
  }
  h1 {
    font-size: 29px;
  }
  .hud {
    padding: 10px 14px;
    margin-bottom: 11px;
  }
  .hud b {
    font-size: 23px;
  }
  .hud span {
    font-size: 7px;
  }
  .stage {
    max-height: 57vh;
    border-radius: 13px;
  }
  .overlay {
    padding: 18px;
  }
  .overlay-symbol {
    font-size: 40px;
    margin-bottom: 12px;
  }
  .overlay h2 {
    font-size: 28px;
  }
  .overlay>p:not(.eyebrow) {
    font-size: 11px;
  }
  .game-footer {
    font-size: 8px;
  }
  .status {
    font-size: 10px;
  }
  .action-row {
    margin-top: 11px;
  }
}

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

:root {
  --bg: #11221c;
  --panel: #1d3e2e;
  --text: #f1f3e7;
  --muted: #b6c6b6;
  --accent: #d0e7a6;
  --line: #d7eccc20;
}

body {
  background: radial-gradient(ellipse at 50% 0,#3b684044,transparent 65%),var(--bg);
}

.edition,.game-footer {
  color: #a2b8a4;
}

.stage {
  aspect-ratio: 1;
  min-height: 270px;
  border-color: #b5d69f44;
  max-height: 62vh;
}

.overlay {
  background: linear-gradient(#153426ee,#153426dc);
}

.primary {
  color: #244228;
}

.aim-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 14px;
}

.aim-controls label {
  font-size: 10px;
  color: var(--muted);
}

.aim-controls output {
  float: right;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.aim-controls input {
  display: block;
  width: 100%;
  margin: 8px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
  height: 17px;
}

.aim-controls input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.scorecard {
  display: grid;
  grid-template-columns: repeat(6,1fr);
  gap: 10px;
  width: 100%;
  margin: 0 0 18px;
}

.scorecard[hidden] {
  display: none;
}

.scorecard div {
  padding: 8px 4px;
  border: 1px solid #ffffff22;
  border-radius: 6px;
}

.scorecard span,.scorecard small {
  font-size: 7px;
  color: var(--muted);
  display: block;
}

.scorecard b {
  font-size: 20px;
}

.game-footer {
  font-size: 8px;
}

.game-footer span:last-child {
  white-space: nowrap;
}

@media(max-width:480px) {
  .stage {
    max-height: 49vh;
  }
  .aim-controls {
    margin-top: 11px;
    gap: 18px;
  }
  .game-footer {
    font-size: 7px;
  }
  .overlay h2 {
    font-size: 25px;
  }
  .scorecard {
    gap: 5px;
  }
  .scorecard div {
    padding: 5px 2px;
  }
  .scorecard b {
    font-size: 17px;
  }
}


/* Fit the board and controls in the portal's responsive game frame. */
.game-shell {
  padding: 14px 18px;
}
.game-title {
  margin-bottom: 10px;
  padding-right: 38px;
  gap: 8px;
}
.round-button { flex-shrink: 0; }
.round-button svg { pointer-events: none; }
h1 {
  font-size: 28px;
  line-height: 1.2;
}
.hud {
  padding: 8px 14px;
  margin-bottom: 10px;
}
.hud b {
  font-size: 23px;
}
.stage {
  height: min(calc(100svh - 302px), calc((100vw - 28px) * 1));
  min-height: 300px;
  max-height: none;
  aspect-ratio: auto;
}
.action-row {
  margin-top: 10px;
}
.status {
  min-height: 17px;
  margin: 8px 0 0;
}
@media(max-width:480px) {
  .game-shell { padding: 12px; }
  .overlay h2 { font-size: 24px; }
}

/* Keep the start, pause and scorecard screens readable on shorter boards. */
@container (max-height: 420px) {
  .overlay { padding: 16px; }
  .overlay-symbol, .overlay .overlay-note { display: none; }
  .overlay h2 { font-size: 22px; margin: 8px 0; }
  .overlay > p:not(.eyebrow) { margin-bottom: 12px; }
  .scorecard { margin-bottom: 12px; }
}
