:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #0b1014;
  color: #f7f1e5;
  --panel: #141b21;
  --line: #3d4548;
  --muted: #b9c2c2;
  --accent: #f3c47e;
}
:root[data-skin="seal"] { --accent: #a2e1d8; }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
main { width: min(1160px, 100% - 38px); margin: 0 auto; padding-bottom: 28px; }
button { font: inherit; color: inherit; min-height: 44px; cursor: pointer; }
button:focus-visible { outline: 2px solid #ffe6b8; outline-offset: 3px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 11px 0; }
.brand { margin: 0; font-size: .7rem; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; white-space: nowrap; }
.brand span, em { color: var(--accent); }
nav { display: flex; gap: 5px; }
nav button { border: 1px solid transparent; border-radius: 7px; background: transparent; padding: 0 10px; font-size: .8rem; }
nav button[aria-pressed="true"] { border-color: #66543d; color: var(--accent); background: #271f19; }
.intro { margin: clamp(18px, 4vw, 35px) 0 17px; }
h1, h2, h3 { font-family: Georgia, serif; font-weight: 400; }
h1 { margin: 0; font-size: clamp(2.65rem, 7vw, 5.8rem); letter-spacing: -.055em; line-height: .98; }
.intro p { color: var(--muted); line-height: 1.5; margin: 8px 0 0; max-width: 56ch; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 28%); gap: 15px; align-items: start; }
.round, .board { overflow: hidden; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.controls { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 9px 16px; padding: 11px 13px 0; }
.stat span { display: block; color: var(--muted); font-size: .72rem; }
.stat strong { display: block; font-size: clamp(1.36rem, 5vw, 1.85rem); line-height: 1.12; font-variant-numeric: tabular-nums; }
.stat small { font-size: .56em; color: var(--muted); margin-left: 2px; }
.primary { background: var(--accent); border: 1px solid var(--accent); color: #16140f; border-radius: 7px; font-size: .83rem; font-weight: 700; padding: 6px 11px; }
.primary:disabled { background: #323536; border-color: #484b4b; color: #e1ded5; opacity: .78; cursor: default; }
progress { display: block; grid-column: 1 / -1; width: 100%; height: 5px; appearance: none; border: 0; background: #313b41; border-radius: 10px; overflow: hidden; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #313b41; }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
iframe { display: block; width: 100%; height: 450px; border: 0; background: #0d1216; margin-top: 5px; }
.scene-wrap { position: relative; }
#start {
  position: absolute; inset: 0; display: grid; place-items: center; width: 100%;
  border: 0; padding: 12px; background: #08101329; touch-action: manipulation;
}
#start:focus-visible { outline-offset: -5px; }
#start:disabled { cursor: default; }
.start-card {
  display: grid; gap: 3px; min-width: 150px; padding: 12px 22px;
  border: 1px solid var(--accent); border-radius: 9px; background: #141b21f5;
  color: #f7f1e5; font-size: 1.12rem; font-weight: 750;
}
#start:not(:disabled):hover .start-card { background: #202932; }
#start-duration { color: var(--accent); font-size: .78rem; font-weight: 650; }
#status { margin: 0; color: var(--muted); font-size: .79rem; line-height: 1.35; text-align: right; }
.board { padding: 14px; }
.board h2 { margin: 0; font-size: 1.4rem; letter-spacing: -.025em; }
.board p { color: var(--muted); font-size: .85rem; line-height: 1.45; }
.board ol { padding: 0; margin: 6px 0 0; list-style-position: inside; }
.board li { padding: 8px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.board li span { display: inline-block; vertical-align: top; max-width: calc(100% - 56px); overflow-wrap: anywhere; color: #f7f1e5; padding-left: 6px; }
.board li strong { float: right; color: var(--accent); }
#result { margin-bottom: 14px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
#post-score { display: grid; gap: 6px; justify-items: start; }
#post-score label { font-size: .84rem; font-weight: 700; }
#post-score label span { color: var(--muted); font-weight: 400; }
#nickname {
  width: 100%; min-height: 44px; padding: 7px 10px; font: inherit;
  color: inherit; background: #10161b; border: 1px solid #667170; border-radius: 7px;
}
#nickname:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#nickname[aria-invalid="true"] { border-color: #ffb29d; }
#post-score #nickname-hint { margin: 1px 0 4px; font-size: .76rem; }
#save-status:empty { display: none; }
.intro .shared-target, .board .shared-target {
  width: fit-content; padding: 6px 10px; margin: 9px 0;
  border-left: 2px solid var(--accent); color: var(--accent); background: var(--panel); font-weight: 650;
}
.score-share { margin: 10px 0 14px; }
.score-share button, #save {
  padding: 6px 11px; border: 1px solid var(--accent); border-radius: 7px;
  background: #10161b; color: var(--accent); font-size: .83rem; font-weight: 700;
}
.score-share button:hover, #save:hover { background: #242c30; }
#save { border-color: var(--line); color: inherit; }
#save:disabled { opacity: .62; cursor: default; }
#again { width: 100%; min-height: 51px; font-size: 1rem; }
#share-options { margin: 10px 0; }
#share-options label { display: block; margin-bottom: 5px; font-size: .8rem; }
#share-message {
  display: block; width: 100%; margin-bottom: 7px; padding: 8px; border: 1px solid #667170;
  border-radius: 7px; background: #10161b; color: inherit; font: inherit; resize: vertical;
}
#share-note:empty { display: none; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.result-actions a {
  border: 1px solid var(--line); border-radius: 7px; background: #10161b;
  color: inherit; padding: 8px 11px; font-size: .8rem; text-decoration: none;
}
.result-actions #play-next {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; min-height: 52px;
  flex: 1 1 auto; align-items: center; border-color: var(--accent);
}
#play-next span:first-child { color: var(--muted); font-size: .72rem; }
#play-next strong { grid-column: 1; color: var(--accent); }
#play-next .next-arrow { grid-column: 2; grid-row: 1 / 3; color: var(--accent); }
#play-next:hover { background: #242c30; }
#play-next:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 735px) {
  main { width: min(100% - 20px, 600px); }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .intro p { font-size: .91rem; }
  iframe { height: 370px; }
}
@media (max-width: 360px) {
  .controls { column-gap: 9px; }
  nav button { padding-inline: 6px; }
  .primary { padding-inline: 7px; font-size: .77rem; }
}
