.opening-screen {
  overflow: auto;
  padding-block: 16px;
}
.opening-screen.closed, [hidden] { display: none !important; }
.opening-card { margin: auto; }
.frame-inlay {
  position: absolute;
  z-index: 2;
  inset: 3px;
  border: 1px solid #c5a36a62;
  box-shadow: 0 0 0 1px #2b19159e;
  color: #d7b175;
  pointer-events: none;
}
.opening-card .frame-inlay { inset: 7px; opacity: .76; }
.frame-inlay i {
  position: absolute;
  width: clamp(18px, 3vw, 34px);
  aspect-ratio: 1;
  background:
    linear-gradient(90deg, currentColor, transparent) left top / 100% 1px,
    linear-gradient(currentColor, transparent) left top / 1px 100%,
    linear-gradient(90deg, #b38c56, transparent) left 3px top 3px / 76% 1px,
    linear-gradient(#b38c56, transparent) left 3px top 3px / 1px 76%;
  background-repeat: no-repeat;
}
.frame-inlay i::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 4px;
  height: 4px;
  border: 1px solid currentColor;
  rotate: 45deg;
  background: #34251b;
}
.frame-inlay i:nth-child(1) { inset: 0 auto auto 0; }
.frame-inlay i:nth-child(2) { inset: 0 0 auto auto; rotate: 90deg; }
.frame-inlay i:nth-child(3) { inset: auto 0 0 auto; rotate: 180deg; }
.frame-inlay i:nth-child(4) { inset: auto auto 0 0; rotate: 270deg; }
.opening-card :is(.kicker, .eyebrow), .game-bar .maker small { font-size: .75rem; }
.game-bar .maker strong { font-size: .8125rem; }
.game-bar :is(.en-title, .title span) { font-size: .8125rem; }
.game-bar .bar-actions { gap: clamp(.375rem, 1.2vw, 1rem); }
.game-bar .bar-actions button {
  min-height: 44px;
  padding-inline: .25rem;
  font-size: .875rem;
  letter-spacing: .045em;
}
.game-bar #music-button[aria-pressed="true"] { color: #f1d49b; }
.setup-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.25rem), 1fr));
  gap: .75rem;
}
.setup-options .opening-level { margin-top: 8px; }
.opening-level + .opening-level { margin-top: 12px; }
.opening-level {
  display: grid;
  min-width: 0;
  gap: .375rem;
  color: #c7bca6;
  font-size: .875rem;
  line-height: 1.35;
  letter-spacing: .055em;
}
.opening-level select {
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: .5rem 1.75rem .5rem .625rem;
  border: 1px solid #766b56;
  border-radius: 4px;
  background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%;
  background-size: 5px 5px;
  font-size: 1rem;
  line-height: 1.3;
}
.opening-card :is(.opening-copy, .opening-intro), .setup-note { font-size: 1rem; }
.setup-note { margin: 8px 0 12px; color: #c7bca6; line-height: 1.45; }
.setup-links { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.setup-links button { width: auto; margin: 0; padding-inline: 8px; }
.opening-card :is(.primary, .begin-button) { font-size: 1.0625rem; }
.quiet, .quiet-button { color: #c2b8a5; font-size: 1rem; }
.setup-links a, .dialog-home {
  color: #d9c89f;
  font-size: 1rem;
  padding: 10px 4px;
  text-underline-offset: 4px;
}
.dialog-home { display: inline-block; }
.panel-controls a, .control-grid a {
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  min-height: 40px;
  border: 1px solid #554f43;
  font-size: 1rem;
  color: #ddd4c2;
  text-decoration: none;
}
.panel-controls a:hover, .control-grid a:hover { background: #25241e; color: #fff; }
.play-guide { display: grid; gap: 0; margin: 18px 0 10px; }
.play-guide section { padding: 14px 0; border-top: 1px solid #988e7038; }
.play-guide h3 { margin: 0 0 5px; color: #e7c888; font-size: 1rem; }
.play-guide p { margin: 0; color: #dad3c5; font-size: 1rem; line-height: 1.55; }
.piece-guide h3, .rule-columns h3 { font-size: 1rem; }
.piece-guide p, .rule-columns p { color: #c2b8a8; font-size: 1rem; }
.match-panel :is(.eyebrow, .section-label) { font-size: .875rem; letter-spacing: .08em; }
.match-panel :is(.ruleset, .rule-note) { color: #aca391; font-size: .8125rem; }
.turn-block p, .score-row span, .score-row b, .fan-list div, .payment-line { font-size: 1rem; }
.notes-head, .ledger-head { gap: .375rem .625rem; flex-wrap: wrap; }
.notes-head > span:last-child, .ledger-head > span:last-child { color: #bdb19f; font-size: .875rem; }
.hand-notes ol, .move-ledger li, .fan-samples span, .player-copy :is(span, strong) { font-size: .875rem; }
.fan-samples span { gap: .375rem; }
.move-ledger li::before, .thinking, .check-banner span { font-size: .8125rem; }
.move-ledger li::before, .move-ledger li.empty-ledger { color: #bdb19f; }
.toast { font-size: .875rem; }
.setup-confirm { width: min(470px, calc(100% - 30px)); }
.setup-confirm h2 { margin: 0 0 10px; }
.setup-confirm p { margin: 0 0 22px; color: #d1c8b8; line-height: 1.5; }
.setup-confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.setup-confirm-actions button {
  flex: 1 1 135px;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid #bca27a;
  border-radius: 4px;
  color: #f2eada;
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.setup-confirm-actions #confirm-setup { background: #9e3d32; border-color: #df8d75; }
.setup-confirm-actions button:hover { filter: brightness(1.18); }
@media (max-width: 40.625rem) {
  .opening-card { padding: 1.5rem 1.25rem; }
  .game-bar .maker-copy { display: none; }
}
@media (max-width: 24rem) {
  .game-bar .bar-actions { gap: .25rem; }
  .game-bar .bar-actions button { padding-inline: .125rem; }
}
.board-frame {
  background:
    repeating-linear-gradient(4deg, #e9ae7517 0 1px, transparent 1px 7px),
    linear-gradient(142deg, #6c3d28, #412518 48%, #6a3c26);
}
.board { container-type: inline-size; }
.board::before {
  content: "";
  position: absolute;
  inset: 45.05% 5.4%;
  background:
    radial-gradient(ellipse at 50% 100%, transparent 42%, #754b3436 44% 48%, transparent 50% 61%, #754b342f 63% 67%, transparent 69%) 0 100% / 42px 64% repeat-x,
    linear-gradient(#90573533, #f5dea05c 68%, #9c583a38);
  pointer-events: none;
}
.board .point.has-piece {
  width: 9.7%;
  border: 0;
  font-size: 6.35cqw;
  background: linear-gradient(154deg, #e0ac66, #926036 81%);
  box-shadow: 0 .4cqw 0 #6c4128, 0 .72cqw 1cqw #45261186;
  text-shadow: none;
}
.board .point .piece-carving {
  position: absolute;
  display: grid;
  place-items: center;
  inset: 0 0 6%;
  border-radius: 50%;
  font-family: "Jade Lettering", "Kaiti SC", "STKaiti", "Songti SC", serif;
  font-weight: 700;
  line-height: 1;
  background:
    radial-gradient(ellipse at 34% 22%, #ffe7b48c, transparent 63%),
    repeating-linear-gradient(174deg, #84552815 0 1px, transparent 1.5px 4px),
    linear-gradient(146deg, #f5ce8b 12%, #d4a76a 78%, #bb8e55);
  box-shadow: inset 0 1px #fff1c5ad, inset 0 -1px #68452485;
  text-shadow: 0 -.034em .014em #33211594, 0 .039em .019em #fff2c4d4;
  pointer-events: none;
}
.piece-carving::after {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  border: 1px solid #6f492a7d;
  box-shadow: 0 1px #ffe4a9a6;
}
.board .point.has-piece.black { color: #21282b; }
.board .point.has-piece.red { color: #9d2621; }
.board .point.has-piece.selected {
  box-shadow: 0 .65cqw 0 #6c4128, 0 .82cqw 1.1cqw #42230dad, 0 0 0 2px #9e2d24, 0 0 0 4px #f4d992;
}
.river, .portrait, .piece-guide article b {
  font-family: "Jade Lettering", "Kaiti SC", "STKaiti", "Songti SC", serif;
}
.point.just-moved { animation: piece-slide .42s cubic-bezier(.22,.8,.28,1); }
.point.capture-move::before { animation: capture-mark .38s ease-out .30s both; }
.score-dialog[open], .result-dialog[open] { animation: result-in .32s ease-out both; }
@keyframes result-in {
  from { opacity: .35; translate: 0 8px; scale: .98; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}
@keyframes capture-mark {
  from { box-shadow: 0 0 0 4px #b235248c; }
  to { box-shadow: 0 0 0 7px #b2352400; }
}
@keyframes piece-slide {
  from { translate: var(--move-x) var(--move-y); filter: brightness(1.13); }
  to { translate: 0 0; filter: brightness(1); }
}
@media (prefers-reduced-motion: reduce) {
  .point.just-moved, .point.capture-move::before,
  .score-dialog[open], .result-dialog[open] { animation: none; }
}
