/* Canonical club theme. Functional layout lives in style.css; all visual tokens and readable type live here. */
:root {
  --red: #b92d28;
  --red-dark: #85231f;
  --gold: #bd913e;
  --gold-light: #edd59a;
  --cream: #fffdf8;
  --paper: #f7f1e5;
  --ink: #443831;
  --muted: #7b7063;
  --line: #decdb0;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Arial, Helvetica, sans-serif;
}
body {
  font: 15px/1.5 var(--sans);
  color: var(--ink);
  background-color: var(--paper);
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
}
button,
input,
textarea,
select {
  font-family: var(--sans);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline-color: var(--gold);
}
.topline {
  background: var(--red-dark);
  color: #f7e6c3;
  font-size: 12px;
  padding-block: 8px;
}
.on-air-dot {
  background: var(--gold-light);
  box-shadow: none;
}
header {
  background: var(--cream);
  color: var(--red-dark);
  border-bottom: 3px double var(--gold);
  padding: 22px 5%;
  gap: 20px;
}
header:after {
  background: #d2af672b;
}
.brand {
  font: 27px var(--serif);
  color: var(--red-dark);
}
.brand-seal {
  font: 29px serif;
  color: var(--gold-light);
  background: var(--red);
  border: 3px double var(--gold-light);
  border-radius: 6px 9px 5px 7px;
  transform: rotate(-4deg);
}
.brand small {
  font: 10px var(--sans);
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 6px;
}
nav {
  gap: 22px;
}
nav button {
  font-size: 14px;
  color: var(--muted);
  padding: 10px 0;
}
nav button.nav-active {
  color: var(--red);
  border-bottom-color: var(--red);
}
.login-button {
  background: transparent;
  color: var(--red-dark);
  border: 1px solid var(--gold);
  border-radius: 5px;
  font-size: 14px;
  padding: 10px 15px;
  max-width: 210px;
  overflow-wrap: anywhere;
}
.outline {
  font-size: 14px;
  color: var(--red);
  border-color: var(--gold);
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.8px;
  color: #96723c;
}
.welcome {
  padding: 30px 0;
}
.welcome .eyebrow {
  font-size: 12px;
  letter-spacing: 0.8px;
  color: #96723c;
}
.welcome h1 {
  font: 38px/1.2 var(--serif);
  color: var(--red-dark);
  margin: 11px 0;
}
.welcome p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
}
.hello-spark {
  color: var(--gold);
}
.doctor-mark > span {
  font: italic 19px var(--serif);
  color: #b86b48;
}
.room {
  grid-template-columns: 190px minmax(0, 1fr) 315px;
  gap: 29px;
}
.membership {
  background: #fffaf0;
  border-color: #cfb582;
  border-radius: 3px 5px 7px 3px;
  box-shadow: 2px 4px #b7924a12;
}
.membership:before {
  border-color: #d3b97c55;
}
.membership:after {
  background: #d6b46e;
}
.membership-top {
  font-size: 11px;
  color: #907b5b;
  letter-spacing: 0;
}
.profile-avatar {
  background: var(--red);
  color: #fbeaca;
  border-color: var(--gold-light);
  box-shadow: none;
}
.membership h2 {
  font: 22px var(--serif);
  color: #683d2b;
}
.membership p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}
.membership > button {
  font-size: 13px;
  color: var(--red);
  border-color: var(--line);
}
.rating-mini strong {
  font: 32px var(--serif);
  color: var(--red-dark);
}
.rating-mini div > span {
  font-size: 11px;
  color: #8b7c65;
  line-height: 1.6;
  letter-spacing: 0;
}
.rating-stamp {
  border-color: var(--red);
  color: var(--red);
}
.club-note .handwritten-note {
  font: italic 24px/1.35 var(--serif);
  color: var(--red-dark);
}
.club-note p {
  font-size: 13px;
  color: var(--muted);
}
.club-note > span {
  font-size: 10px;
  color: #9d8969;
}
.vinyl-disc {
  background: repeating-radial-gradient(circle, #552f27 0 4px, #6d3b2f 4px 5px, #552f27 5px 8px);
  box-shadow: 3px 4px #c7a96a30;
}
.vinyl-disc span {
  background: var(--gold-light);
  border-color: #d9b569;
  color: var(--red);
}
.vinyl-disc:after {
  border-color: var(--gold);
}
.player-icon {
  background: var(--red-dark);
  color: var(--gold-light);
  border-color: var(--gold);
}
.player-icon.you {
  background: #fff4d9;
  color: #8c5b2d;
}
.player strong {
  font-size: 15px;
  color: #624031;
}
.player small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.clock {
  font: 700 25px var(--sans);
  font-variant-numeric: tabular-nums;
  color: #786043;
  background: #eadeca;
  min-width: 94px;
  padding: 8px 12px;
  border-radius: 6px;
}
.clock.ticking {
  background: #fffaf0;
  border-color: var(--gold);
  box-shadow: 0 2px #c3a768;
}
.clock.low {
  color: var(--red);
}
.board-toolbar {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  min-height: 43px;
}
.board-toolbar button {
  color: #957746;
}
.board-toolbar #sound.sound-on {
  color: var(--red);
}
.review-strip {
  border-color: var(--line);
  padding: 8px 0;
}
.review-strip > span {
  font-size: 12px;
  color: #8c7250;
}
.review-strip button {
  min-width: 35px;
  height: 33px;
  background: #fbf6e9;
  color: #9c7136;
  border: 1px solid #e3d3b2;
  border-radius: 4px;
}
.review-strip button:hover {
  background: #f1e4c7;
}
.coord {
  font: 10px var(--sans);
  color: #a1774c;
}
.dark .coord {
  color: #f9ddae;
}
.play-card {
  padding: 24px 21px 20px;
  background: var(--cream);
  border-color: #dec7a2;
  border-radius: 5px 8px 6px 9px;
  box-shadow: 3px 5px #d2b57818;
}
.play-card:before {
  background: #d6b67988;
}
.card-label {
  font-size: 11px;
  letter-spacing: 0.6px;
  color: #957e59;
}
.card-label b {
  color: var(--red);
}
.play-card h2 {
  font: 28px var(--serif);
  color: var(--red-dark);
  margin: 19px 0;
}
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  background: #f3eadb;
  border: 0;
  border-radius: 5px;
  padding: 4px;
}
.mode-tabs button {
  font-size: 12px;
  line-height: 1.4;
  min-height: 44px;
  padding: 10px 3px;
  white-space: normal;
  color: #88745b;
  border: 0;
  border-radius: 3px;
}
.mode-tabs button.selected {
  color: #fff8e7;
  background: var(--red);
  box-shadow: 0 1px #87221d30;
}
.resume-game {
  background: #fff8e8;
  color: #965b34;
  border-color: #cfad6d;
  border-left-color: var(--red);
  font-size: 12px;
  border-radius: 3px;
  padding: 12px;
  line-height: 1.6;
}
.control-label {
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #8e7758;
}
.controls button {
  border-color: #e5d5b6;
  background: #fff9ed;
  border-radius: 4px;
  padding: 12px 3px;
  color: #836748;
}
.controls b {
  font: 25px var(--serif);
}
.controls b span {
  font-size: 15px;
}
.controls small {
  font-size: 12px;
  color: #9a825e;
}
.controls .selected {
  background: #fff0e8;
  border: 1px solid var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}
.controls .selected b,
.controls .selected small {
  color: var(--red);
}
.classical {
  font-size: 12px;
  border-color: var(--line);
  color: #8e7858;
}
.classical b {
  color: #855f32;
}
.primary {
  font-size: 15px;
  line-height: 1.5;
  background: linear-gradient(#ce4939, #b62b25);
  border-color: #9a2921;
  color: #fff5dc;
  box-shadow:
    inset 0 1px #e67d58,
    0 3px #8d381b35;
  border-radius: 4px 6px 3px 5px;
  padding: 15px;
}
.primary:hover {
  background: var(--red);
}
.queue-note {
  font-size: 12px;
  line-height: 1.7;
  color: #8c775a;
}
.bot-settings label {
  font-size: 13px;
  color: #836c50;
  margin: 14px 0 7px;
}
.bot-settings select {
  font: 13px var(--sans);
  background: #fffaf0;
  border-color: #d9c7a5;
  color: #735638;
  border-radius: 4px;
  padding: 12px 8px;
}
.bot-settings p {
  font-size: 12px;
  line-height: 1.7;
  color: #8e7a5f;
}
.game-actions button {
  font-size: 12px;
  padding: 10px;
  color: #8e4d35;
}
.score-card {
  border-color: var(--line);
  background: transparent;
  padding: 20px 2px 15px;
}
#moves {
  font: 14px/1.7 var(--sans);
  grid-template-columns: 30px 1fr 1fr;
  max-height: 200px;
  gap: 4px 5px;
  color: var(--muted);
}
.move-number {
  font-size: 12px;
  color: #9c8667;
}
.move-step {
  font: 14px var(--sans);
  color: #785436;
  padding: 7px 9px;
  border-radius: 3px;
}
.move-step:hover {
  background: #f0e4c9;
}
.move-step.selected {
  color: #7c4823;
  background: #eddbb4;
}
.study-actions,
.analysis-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.study-actions {
  border-color: var(--line);
  padding-top: 13px;
}
.analysis-tools {
  margin-top: 9px;
}
.study-actions button,
.analysis-tools button {
  font-size: 12px;
  min-height: 37px;
  padding: 9px 10px;
  color: #8c5f2c;
  background: #fffaed;
  border: 1px solid #d9c296;
  border-radius: 4px;
}
.study-actions button:hover,
.analysis-tools button:hover {
  background: #f5e6c5;
}
.hint-note {
  font-size: 13px;
  line-height: 1.8;
  color: #916432;
}
.sq.hint-from {
  box-shadow: inset 0 0 0 3px #b9943e;
}
.sq.hint-to {
  box-shadow: inset 0 0 0 4px #f1cd69;
}
.puzzle-link strong {
  font-size: 14px;
}
.puzzle-link small {
  font-size: 12px;
  color: #96815d;
}
.puzzle-link,
.puzzle-link b {
  color: var(--red);
}
.variation-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid #c5a466;
  background: #fff4d8;
  margin-top: 19px;
  border-radius: 4px;
  font-size: 12px;
  color: #8b602d;
}
.variation-bar > span {
  flex: 1;
  min-width: 150px;
}
.variation-bar button {
  background: none;
  border: 0;
  border-bottom: 1px solid var(--red);
  color: var(--red);
  font-size: 12px;
  padding: 5px 0;
}
.bottom-strip {
  border-color: var(--line);
}
.bottom-strip > span {
  color: var(--gold);
}
.bottom-strip p {
  font-size: 13px;
  color: #8b7759;
  letter-spacing: 0.4px;
}
.bottom-strip button {
  font-size: 13px;
  color: var(--red);
}
footer {
  font-size: 12px;
  color: #938368;
}
footer > span:first-child {
  font: 20px var(--serif);
  color: var(--red-dark);
}
footer small {
  font: 11px var(--sans);
}
dialog {
  max-width: 660px;
  background: var(--cream);
  color: var(--ink);
  border: 4px double #c7a565;
  border-radius: 5px 8px 6px 5px;
  padding: 33px;
}
dialog h2 {
  font: 29px var(--serif);
  color: var(--red-dark);
}
#content {
  font-size: 14px;
  line-height: 1.8;
}
#content p {
  color: var(--muted);
}
#close {
  color: var(--red);
}
label {
  font-size: 13px;
  margin: 13px 0 6px;
}
input,
textarea {
  font: 15px/1.6 var(--sans);
  background: #fffcf5;
  border-color: #cbb487;
  color: var(--ink);
  border-radius: 3px;
}
.form-error {
  font-size: 13px;
  line-height: 1.6;
  color: #b83025;
}
.form-switch,
.logout {
  font-size: 13px;
  color: var(--red);
}
.muted {
  font-size: 12px;
  color: var(--muted);
}
.toast {
  font-size: 14px;
  line-height: 1.6;
  color: #fff0cf;
  background: #8d3327;
  border-radius: 5px;
}
.import-tabs {
  display: flex;
  gap: 9px;
  margin-bottom: 18px;
}
.import-tabs button,
.leader-tabs button {
  font-size: 14px;
  color: #8c673a;
  border: 1px solid #cbb285;
  padding: 10px 14px;
  background: none;
  border-radius: 3px;
}
.import-tabs .selected,
.leader-tabs .selected {
  color: var(--red);
  border-color: var(--red);
  background: #fff2e9;
}
.notation-input {
  font:
    14px/1.7 Consolas,
    'Courier New',
    monospace;
  min-height: 220px;
}
.import-help {
  font-size: 13px;
  line-height: 1.7;
}
.pgn-file-label {
  margin-top: 18px;
}
#pgn-file {
  font-size: 13px;
  padding: 8px;
  border: 0;
  background: none;
}
.library-label {
  font: 21px var(--serif);
  color: var(--red-dark);
  border-color: var(--line);
}
.library-list > a,
.library-list > button {
  font-size: 14px;
  padding: 16px 0;
  color: #785437;
  border-color: var(--line);
}
.library-list small {
  font-size: 12px;
  color: var(--muted);
}
.library-list b {
  font-size: 12px;
  color: #9d7334;
}
.library-list p {
  font-size: 14px;
}
.profile-banner {
  background: var(--red);
  border-color: #8b251f;
  border-radius: 4px;
  box-shadow:
    0 4px #8a291e,
    inset 0 0 0 6px var(--red),
    inset 0 0 0 7px #e4bc7770;
}
.profile-banner-top {
  font-size: 11px;
  color: #f0d3a2;
  letter-spacing: 1px;
}
.profile-banner-top > span:first-child {
  font-size: 21px;
  color: #f0d3a2;
}
.profile-banner-top small {
  font: 11px var(--sans);
  letter-spacing: 1px;
}
.public-avatar {
  background: #a62a23;
  border-color: #e3c280;
  color: #f7dfac;
}
.profile-kicker {
  font-size: 11px;
  letter-spacing: 1px;
  color: #efc79d;
}
.identity-text h1 {
  font: 44px/1.2 var(--serif);
  color: #fff2d4;
}
.identity-text p {
  font-size: 14px;
  color: #f0cfa8;
}
.banner-calligraphy {
  color: #f3d4a2;
}
.profile-banner-bottom {
  border-color: #e3b77770;
}
.profile-banner-bottom > p {
  font-size: 14px;
  line-height: 1.9;
  color: #ffe4c6;
}
.profile-banner-bottom button {
  font-size: 12px;
  color: #fff0cc;
  border-color: #e4b87c;
  background: none;
  border-radius: 3px;
  padding: 10px 12px;
}
.profile-section-title > span,
.ledger-symbol {
  color: var(--red);
}
.profile-section-title h2 {
  font: 24px var(--serif);
  color: #683d2b;
}
.profile-section-title > small {
  font-size: 11px;
  color: #9d8158;
  letter-spacing: 0.4px;
}
.total-played {
  font: 65px var(--serif);
  color: var(--red-dark);
}
.small-caption {
  font-size: 13px;
  color: var(--muted);
}
.result-breakdown {
  font-size: 14px;
}
.result-breakdown dt {
  color: var(--muted);
}
.results-track .win,
.win-dot {
  background: #b38b3b;
}
.results-track .draw,
.draw-dot {
  background: #d5c5a5;
}
.results-track .loss,
.loss-dot {
  background: #b53a2e;
}
.win-percent strong {
  font: 29px var(--serif);
}
.win-percent span {
  font-size: 13px;
  color: var(--muted);
}
.profile-side-note p {
  font-size: 13px;
  color: #9c8765;
}
.ledger-name {
  font-size: 15px;
}
.ledger-rating strong {
  font: 36px var(--serif);
}
.ledger-rating sup {
  font: 12px var(--sans);
}
.ledger-rating small,
.rating-footnote {
  font-size: 12px;
  color: var(--muted);
}
.history-filters button {
  font-size: 14px;
  color: #967b55;
}
.history-filters .selected {
  color: var(--red);
}
.game-log-head {
  font-size: 12px;
}
.game-log-row {
  font-size: 14px;
}
.opponent-emblem {
  color: var(--red);
}
.opponent-link small,
.log-control small {
  font-size: 12px;
  color: var(--muted);
}
.log-control {
  font-size: 14px;
}
.log-result {
  font-size: 13px;
}
.log-result.win {
  color: #997228;
}
.log-result.draw {
  color: #97815d;
}
.log-result.loss {
  color: #b43b2d;
}
.game-log-row time {
  font-size: 12px;
  color: #8e7657;
}
.history-empty h3 {
  font: 23px var(--serif);
}
.history-empty p,
.history-empty a {
  font-size: 14px;
}
.history-pagination {
  font-size: 12px;
}
.history-pagination button {
  font-size: 14px;
}
.community-footer {
  font-size: 12px;
}
.community-footer a {
  font: 19px var(--serif);
  color: var(--red-dark);
}
.avatar-options button {
  color: var(--red);
  border-color: #ceb182;
}
.avatar-options button.selected {
  border-color: var(--red);
  background: #f5dfb52b;
}
.avatar-options small {
  font-size: 12px;
}
.breadcrumbs {
  font-size: 13px;
}
.directory-heading h1 {
  font: 39px var(--serif);
  color: var(--red-dark);
}
.directory-heading p {
  font-size: 15px;
  color: var(--muted);
}
.directory-seal {
  background: var(--red);
  color: var(--gold-light);
  border-color: #deb76c;
}
.directory-avatar {
  color: var(--red);
  border-color: #ccb080;
}
#player-search label {
  font-size: 13px;
  color: var(--muted);
}
#player-search input {
  background: #fffaf0;
}
#player-search button {
  font-size: 14px;
  background: var(--red);
  border-color: var(--red);
  color: #fff4d7;
}
.directory-player strong {
  font: 23px var(--serif);
}
.directory-player small {
  font-size: 13px;
  color: var(--muted);
}
.directory-games {
  font: 25px var(--serif);
}
.directory-caption {
  font-size: 13px;
  color: var(--muted);
}
.directory-arrow {
  color: var(--red);
}
@media (max-width: 1250px) {
  header nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .room {
    grid-template-columns: 160px minmax(0, 1fr) 300px;
    gap: 22px;
  }
  .membership {
    padding: 20px 13px;
  }
  .play-card {
    padding: 24px 18px;
  }
  .membership h2 {
    font-size: 21px;
  }
  .ledger-rating strong {
    font-size: 32px;
  }
}
@media (max-width: 960px) {
  .room {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 25px;
  }
  .left-column {
    display: none;
  }
  .doctor-mark {
    margin-right: 0;
  }
  .game-log-head,
  .game-log-row {
    grid-template-columns: minmax(110px, 1fr) 65px 100px;
  }
  .game-log-head > span:last-child,
  .game-log-row time {
    display: none;
  }
}
@media (max-width: 760px) {
  header {
    padding: 17px 5%;
    gap: 17px;
  }
  .brand {
    font-size: 24px;
  }
  .brand small {
    font-size: 9px;
    letter-spacing: 0.5px;
  }
  .login-button {
    font-size: 12px;
    max-width: 120px;
    padding: 10px 12px;
  }
  header nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px 14px;
  }
  nav button {
    font-size: 13px;
    text-align: left;
    white-space: normal;
    padding: 10px 0;
  }
  .topline {
    font-size: 11px;
  }
  .topline > span:last-child {
    display: none;
  }
  main {
    padding: 0 5%;
  }
  .welcome {
    padding: 25px 0;
    gap: 10px;
  }
  .welcome h1 {
    font-size: 31px;
  }
  .welcome p {
    font-size: 14px;
    line-height: 1.6;
    max-width: 250px;
  }
  .welcome .eyebrow {
    font-size: 10px;
  }
  .hello-spark {
    font-size: 23px;
  }
  .doctor-mark {
    width: 83px;
    min-width: 83px;
    height: 96px;
  }
  .doctor-mark svg {
    width: 83px;
    height: 85px;
  }
  .doctor-mark > span {
    font-size: 16px;
    bottom: -2px;
    right: -2px;
  }
  .room {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .right-column {
    display: grid;
    gap: 22px;
  }
  .play-card {
    padding: 25px;
  }
  .play-card h2 {
    font-size: 30px;
  }
  .mode-tabs button {
    font-size: 14px;
    min-height: 46px;
    padding: 11px 5px;
  }
  .bot-settings label {
    font-size: 14px;
  }
  .bot-settings select {
    font-size: 14px;
    padding: 13px 9px;
  }
  .controls b {
    font-size: 28px;
  }
  .controls small {
    font-size: 13px;
  }
  .score-card {
    margin-top: 0;
  }
  #moves {
    max-height: 220px;
  }
  .move-step {
    font-size: 16px;
    padding: 9px;
  }
  .study-actions button,
  .analysis-tools button {
    font-size: 13px;
    padding: 11px;
  }
  .hint-note {
    font-size: 14px;
  }
  .coord {
    font-size: 9px;
  }
  .player strong {
    font-size: 14px;
  }
  .player small {
    font-size: 12px;
    max-width: 180px;
  }
  .clock {
    font-size: 24px;
    min-width: 85px;
  }
  .review-strip {
    gap: 5px;
  }
  .review-strip button {
    min-width: 32px;
  }
  .review-strip > span {
    font-size: 11px;
  }
  .board-toolbar {
    font-size: 12px;
  }
  .bottom-strip p {
    font-size: 12px;
  }
  .bottom-strip button {
    display: none;
  }
  footer {
    font-size: 11px;
  }
  footer > span:first-child {
    font-size: 18px;
  }
  dialog {
    padding: 27px 22px;
  }
  dialog h2 {
    font-size: 27px;
  }
  .notation-input {
    font-size: 13px;
    min-height: 230px;
  }
  .profile-banner-top > span:first-child {
    font-size: 18px;
  }
  .profile-banner-top > span:last-child {
    font-size: 10px;
  }
  .identity-text h1 {
    font-size: 29px;
  }
  .identity-text p {
    font-size: 12px;
  }
  .profile-kicker {
    font-size: 10px;
  }
  .profile-banner-bottom > p {
    font-size: 13px;
  }
  .profile-banner-bottom button {
    font-size: 12px;
  }
  .profile-section-title h2 {
    font-size: 23px;
  }
  .profile-section-title > small {
    font-size: 10px;
  }
  .ledger-name {
    font-size: 13px;
  }
  .ledger-rating strong {
    font-size: 27px;
  }
  .ledger-rating small {
    font-size: 11px;
  }
  .rating-footnote {
    font-size: 12px;
  }
  .history-filters button {
    font-size: 13px;
  }
  .game-log-head,
  .game-log-row {
    grid-template-columns: minmax(100px, 1fr) 60px 90px;
    gap: 8px;
  }
  .game-log-row {
    font-size: 13px;
  }
  .game-log-head {
    font-size: 11px;
  }
  .opponent-link small,
  .log-control small {
    font-size: 11px;
  }
  .log-result {
    font-size: 12px;
  }
  .history-empty h3 {
    font-size: 22px;
  }
  .history-empty p {
    font-size: 13px;
  }
  .community-footer {
    font-size: 11px;
  }
  .community-footer a {
    font-size: 17px;
  }
  .avatar-options small {
    font-size: 11px;
  }
  .breadcrumbs {
    font-size: 12px;
  }
  .directory-heading h1 {
    font-size: 31px;
  }
  .directory-heading p {
    font-size: 14px;
  }
  .directory-player strong {
    font-size: 19px;
  }
  .directory-player small {
    font-size: 12px;
  }
  .directory-games {
    font-size: 22px;
  }
  .directory-caption {
    font-size: 12px;
  }
}
/* Keep the masthead on two deliberate rows instead of squeezing the wordmark. */
.brand {
  white-space: nowrap;
  flex-shrink: 0;
}
.brand > span:last-child {
  white-space: nowrap;
}
@media (max-width: 1250px) {
  header {
    flex-wrap: wrap;
  }
  header nav {
    flex-basis: 100%;
    flex-shrink: 0;
  }
}
@media (max-width: 760px) {
  .login-button {
    max-width: 100px;
  }
  .brand {
    font-size: 23px;
  }
}
.friend-game {
  width: 100%;
  padding: 12px 8px;
  margin-top: 14px;
  color: var(--red);
  border: 1px dashed #c7a466;
  border-radius: 4px;
  background: #fffaf0;
  font-size: 13px;
  line-height: 1.5;
}
.friend-game:hover {
  background: #f8ebd1;
}
.postgame {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 17px;
}
.postgame h3 {
  font: 24px var(--serif);
  color: var(--red-dark);
  margin: 0;
}
.postgame .primary {
  margin-top: 12px;
  font-size: 14px;
}
.postgame p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.postgame-review {
  font-size: 13px;
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.game-actions {
  flex-wrap: wrap;
}
.game-actions button {
  flex: 1 1 45%;
}
.invitation-card {
  max-width: 780px;
  margin: 40px auto 65px;
  padding: 38px;
  background: var(--cream);
  border: 1px solid #c8a563;
  border-radius: 6px;
  box-shadow: 0 5px 0 #b9954320;
}
.invitation-stamp {
  font: 40px serif;
  color: var(--red);
  float: right;
  border: 2px double var(--gold);
  padding: 2px 7px;
  transform: rotate(5deg);
}
.invitation-card h1 {
  font: 34px/1.3 var(--serif);
  color: var(--red-dark);
  margin: 20px 0;
  overflow-wrap: anywhere;
}
.invitation-card p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
}
.invite-details {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.invite-details span {
  border: 1px solid var(--line);
  padding: 7px 12px;
  color: #976b33;
  font-size: 13px;
  background: #fff8e8;
}
.invitation-card input {
  font:
    13px Consolas,
    monospace;
}
.invite-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 15px;
}
.invite-buttons .primary {
  width: auto;
  margin-top: 0;
}
.invite-buttons .outline {
  border: 1px solid var(--gold);
  padding: 14px;
  background: none;
  color: var(--red);
  border-radius: 4px;
  font-size: 13px;
}
#friend-form select {
  width: 100%;
  padding: 12px;
  border: 1px solid #cdb68b;
  color: var(--ink);
  background: #fffaf0;
  font: 14px var(--sans);
  border-radius: 3px;
}
#decline-draw {
  flex-basis: 100%;
  color: #96764a;
}
@media (max-width: 760px) {
  .invitation-card {
    padding: 26px 22px;
    margin-top: 25px;
  }
  .invitation-card h1 {
    font-size: 29px;
  }
  .invite-details {
    gap: 8px;
  }
  .invite-details span {
    font-size: 12px;
    padding: 6px 9px;
  }
  .invitation-card input {
    font-size: 12px;
  }
  .invite-buttons {
    align-items: stretch;
    flex-direction: column;
  }
  .invite-buttons .primary {
    width: 100%;
  }
}
.premove-setting {
  font-size: 12px;
  line-height: 1.6;
  color: #916a39;
  margin: 17px 0 0;
  display: block;
  cursor: pointer;
}
.premove-setting input {
  width: 16px;
  height: 16px;
  margin: 0 5px 0 0;
  vertical-align: middle;
  accent-color: var(--red);
}
.premove-setting small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 0 23px;
}
.premove-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 11px 12px;
  border: 1px solid #caa453;
  background: #fff1cf;
  color: #936323;
  border-radius: 4px;
  font-size: 12px;
}
.premove-bar button {
  color: var(--red);
  background: none;
  border: 0;
  padding: 5px;
  white-space: nowrap;
}
.sq.premove-from {
  box-shadow: inset 0 0 0 3px #c59c34;
}
.sq.premove-to {
  box-shadow:
    inset 0 0 0 4px #efce64,
    inset 0 0 0 6px #93672770;
}

/* A result should be unmistakable, with the final board still a click away. */
.result-card {
  margin: 0 0 22px;
  border: 2px solid #b79346;
  border-radius: 7px 12px 7px 9px;
  background: #fffaf0;
  overflow: hidden;
  box-shadow: 0 4px 0 #b7934625;
}
.result-surface {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid #d6bd86;
}
.result-symbol {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border: 2px solid #ac852c;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 34px;
  color: #9c2923;
  background: #f9edcd;
}
.result-surface h2 {
  font-family: Georgia, serif;
  font-size: 30px;
  margin: 7px 0;
  color: #8f2923;
}
.result-surface p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}
.result-score {
  font:
    26px Georgia,
    serif;
  margin-left: auto;
  white-space: nowrap;
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
}
.result-actions button {
  border: 0;
  background: transparent;
  color: #962b26;
  padding: 9px;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.finish-dialog {
  width: min(520px, calc(100% - 32px));
  max-height: 90dvh;
  overflow: auto;
  padding: 0;
  border: 3px solid #b7954b;
  border-radius: 12px 18px 11px 15px;
  background: #fffcf4;
  box-shadow: 0 18px 90px #2a120d70;
  color: #4d3028;
}
.finish-dialog::backdrop {
  background: #271b17b8;
  backdrop-filter: blur(3px);
}
.finish-close {
  position: absolute;
  right: 14px;
  top: 9px;
  font-size: 30px;
  border: 0;
  background: transparent;
  color: #7c332a;
  width: 44px;
  height: 44px;
}
.finish-surface {
  padding: 38px 30px 16px;
  text-align: center;
  background: radial-gradient(ellipse at top, #f5e5b7 0%, transparent 70%);
}
.finish-surface .result-symbol {
  margin: 0 auto 22px;
  width: 84px;
  height: 84px;
  font-size: 49px;
  transform: rotate(-5deg);
}
.finish-surface h2 {
  font:
    42px Georgia,
    serif;
  color: #9b2e25;
  margin: 18px 0;
}
.finish-score {
  display: block;
  font:
    38px Georgia,
    serif;
  color: #976e22;
  letter-spacing: 5px;
  margin: 14px 0;
}
.finish-surface p {
  font-size: 17px;
  line-height: 1.7;
}
.finish-message {
  color: #796d5b;
}
.finish-actions {
  display: grid;
  gap: 12px;
  padding: 0 30px 30px;
}
.finish-actions button {
  min-height: 48px;
  font-size: 16px;
}
[data-tone='loss'] .result-symbol {
  color: #5e5b53;
  background: #f0ebe0;
}
[data-tone='draw'] .result-symbol {
  color: #6b5a29;
}
#engine-status {
  font-size: 13px;
  color: #8c2d25;
  line-height: 1.65;
}
#opening-status {
  font-size: 13px;
  line-height: 1.65;
  color: #79654b;
}
.academy-heading {
  display: flex;
  align-items: center;
  gap: 30px;
  margin: 35px 0 45px;
}
.academy-heading h1 {
  font:
    52px Georgia,
    serif;
  color: #972d27;
  margin: 12px 0;
}
.academy-heading p {
  line-height: 1.8;
  font-size: 18px;
}
.academy-seal {
  border: 3px double #b12927;
  color: #a42e28;
  padding: 20px;
  font:
    56px Georgia,
    serif;
  transform: rotate(-6deg);
  border-radius: 10px;
}
.academy-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  margin-bottom: 60px;
}
.academy-list {
  background: #fffaf0;
  padding: 24px;
  border: 1px solid #c8b88e;
  border-radius: 8px 13px 7px 10px;
}
.academy-list h2 {
  font:
    26px Georgia,
    serif;
  color: #8f2923;
  margin: 12px 0;
}
.academy-list p {
  font-size: 14px;
  line-height: 1.6;
}
.academy-list button {
  text-align: left;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e4d9bf;
  padding: 17px 0;
  color: #63442f;
  background: transparent;
}
.academy-list button:hover,
.academy-list button:focus-visible {
  color: #af2925;
  background: #f7ecd4;
}
.academy-list button span {
  display: block;
  font-size: 12px;
  margin-bottom: 7px;
  color: #977950;
}
.academy-list button strong {
  font-size: 16px;
  font-weight: normal;
  line-height: 1.5;
}
.academy-workspace {
  position: sticky;
  top: 24px;
  min-width: 0;
}
.academy-workspace h2 {
  font:
    32px Georgia,
    serif;
  color: #8f2923;
  margin: 12px 0;
}
#academy-prompt {
  font-size: 17px;
  line-height: 1.7;
  min-height: 58px;
}
.academy-frame {
  width: min(100%, 600px);
  box-sizing: border-box;
  margin: 18px 0;
}
#academy-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  isolation: isolate;
  touch-action: none;
}
.academy-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 600px;
  gap: 8px;
  padding: 12px 0;
}
.academy-controls button {
  background: #f6ecd5;
  color: #962d25;
  border: 1px solid #c6a963;
  min-width: 42px;
  height: 40px;
  font-size: 25px;
}
.academy-controls span {
  text-align: center;
  font-size: 15px;
}
.academy-feedback {
  min-height: 50px;
  font-size: 17px;
  color: #8c2d25;
  line-height: 1.7;
}
.academy-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.academy-buttons button {
  font-size: 15px;
}
.academy-footnote {
  font-size: 14px;
  line-height: 1.8;
  color: #7b6b53;
  margin-top: 25px;
}
@media (max-width: 800px) {
  .academy-layout {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .academy-workspace {
    position: static;
    grid-row: 1;
  }
  .academy-list {
    max-height: 350px;
    overflow: auto;
  }
  .academy-heading h1 {
    font-size: 38px;
  }
  .academy-heading {
    gap: 16px;
  }
  .academy-seal {
    padding: 12px;
    font-size: 38px;
  }
  .result-surface {
    gap: 12px;
    padding: 16px;
    flex-wrap: wrap;
  }
  .result-surface h2 {
    font-size: 25px;
  }
  .result-score {
    margin-left: 0;
  }
  .finish-surface h2 {
    font-size: 34px;
  }
}

.coach-panel {
  border: 1px solid #c8ac6c;
  background: #fffaf0;
  border-radius: 5px 9px 6px 7px;
  padding: 16px;
  margin-top: 12px;
}
.coach-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.coach-heading strong {
  color: #922a25;
  font:
    23px Georgia,
    serif;
  white-space: nowrap;
}
.coach-heading span {
  color: #867457;
  font-size: 11px;
  text-align: right;
  line-height: 1.6;
}
.coach-meter {
  margin: 14px 0;
  background: #6a3128;
  border: 1px solid #ab905b;
  height: 10px;
  border-radius: 3px;
  overflow: hidden;
}
.coach-meter span {
  display: block;
  background: #fff4d4;
  height: 100%;
  transition: width 0.3s;
}
#coach-line {
  font-size: 16px;
  color: #5c3b2a;
  line-height: 1.9;
  margin: 10px 0;
}
.coach-panel small {
  display: block;
  font-size: 12px;
  color: #867457;
  line-height: 1.7;
}
#academy-board {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.finish-rating {
  font-weight: bold;
  color: #8d6424;
}
#result-rating {
  display: block;
  margin-top: 9px;
  color: #8d6424;
  font-size: 14px;
  line-height: 1.6;
}
.engine-credits {
  background: none;
  border: 0;
  font-size: 12px;
  color: #85745c;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 6px;
}

.game-report {
  background: #fffaf0;
  border: 1px solid #cfb97d;
  border-radius: 8px 12px 6px 9px;
  padding: 20px;
}
#report-summary {
  font-size: 15px;
  line-height: 1.7;
  color: #8c2c24;
}
#report-rows {
  max-height: 380px;
  overflow: auto;
}
.report-row {
  display: flex;
  width: 100%;
  padding: 14px 0;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid #e1d5b9;
  color: #65452e;
}
.report-row:hover {
  background: #f5ebd4;
}
.report-row span {
  font-size: 15px;
}
.report-row small {
  display: block;
  font-size: 11px;
  margin-top: 6px;
  line-height: 1.6;
}
.report-grade {
  text-align: right;
  color: #796b4e;
}
.report-grade.inaccuracy {
  color: #9f7829;
}
.report-grade.mistake {
  color: #af5627;
}
.report-grade.blunder {
  color: #aa2424;
}
.report-disclaimer {
  font-size: 12px;
  line-height: 1.8;
  color: #877453;
  margin: 18px 0 0;
}
#report-cancel {
  background: none;
  border: 0;
  color: #9d2c25;
  text-decoration: underline;
}

.academy-buttons .outline,
.finish-actions .outline {
  background: #fff9ed;
  border: 1px solid #bd9d52;
  border-radius: 4px 6px 3px 5px;
  padding: 12px 18px;
  color: #942d25;
}
.academy-controls button:disabled {
  opacity: 0.4;
}

/* Keep lesson controls reachable on laptop screens shorter than the study board. */
.academy-workspace {
  position: static;
}
/* Compact playing room: board and immediate actions come before settings. */
.menu-toggle {
  display: none;
}
#game-page .welcome {
  padding-block: 12px;
}
#game-page .welcome h1 {
  font-size: 28px;
  margin-block: 0;
}
#game-page .welcome p {
  margin-block: 4px;
}
#game-page .welcome .eyebrow {
  display: none;
}
#game-page .doctor-mark {
  transform: scale(0.7);
  height: 72px;
}
#game-page.playing .welcome {
  display: none;
}
#game-page.playing .room {
  padding-top: 10px;
}
#game-settings {
  padding: 14px 18px;
}
#game-settings summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--red-dark);
  font-weight: bold;
}
#game-settings summary::before {
  content: '＋';
}
#game-settings[open] summary::before {
  content: '−';
}
#game-settings:not([open]) > :not(summary) {
  display: none;
}
#play {
  width: 100%;
  max-width: min(580px, max(280px, calc(100dvh - 380px)));
  justify-self: center;
}
#play .board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 4px 0;
}
#play .board-toolbar > #status {
  flex: 1 0 100%;
  padding: 2px 0;
}
#play .board-toolbar button,
#play .review-strip button {
  min-width: 44px;
  min-height: 44px;
}
#play .board-toolbar #hint {
  margin-right: auto;
  font-size: 14px;
  padding-inline: 10px;
}
#play .player {
  margin-bottom: 4px;
  min-height: 48px;
  padding-block: 4px;
}
#play .player.bottom {
  margin-top: 4px;
}
#play .board-frame {
  padding: 10px;
}
#play .review-strip {
  margin-top: 4px;
}
#play .hint-note:empty {
  display: none;
}
.local-library-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.local-library-row > button:first-child {
  flex: 1;
  min-width: 0;
}
.local-library-row > button {
  min-height: 44px;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
select:focus-visible {
  outline: 3px solid var(--red-dark);
  outline-offset: 3px;
}
@media (min-width: 961px) {
  header {
    padding-block: 10px;
  }
  .room {
    grid-template-columns: minmax(140px, 190px) minmax(0, 1fr) minmax(240px, 300px);
    gap: 20px;
  }
}
@media (max-width: 960px) {
  .topline {
    display: none;
  }
  header {
    padding: 8px 4%;
    gap: 8px;
    flex-wrap: wrap;
  }
  header .brand {
    font-size: 21px;
    margin-right: auto;
  }
  header .brand small {
    display: none;
  }
  header .brand-seal {
    width: 34px;
    height: 36px;
    font-size: 23px;
  }
  .menu-toggle {
    display: block;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--line);
    padding-inline: 8px;
  }
  header .login-button {
    min-height: 44px;
    max-width: 105px;
    padding: 8px;
  }
  header nav {
    display: none;
    order: 4;
    width: 100%;
  }
  header nav.menu-open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
  }
  header nav button {
    min-height: 44px;
    padding: 8px;
    white-space: normal;
    text-align: left;
  }
  #game-page {
    padding-inline: 4%;
  }
  #game-page .room {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  #play {
    max-width: min(580px, max(280px, calc(100dvh - 280px)));
  }
  #game-page .right-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
  }
  .right-column .score-card {
    order: -2;
    margin-top: 0;
  }
  .right-column .game-report {
    order: -1;
  }
  #game-page .welcome {
    padding-block: 8px;
  }
  #game-page .welcome h1 {
    font-size: 23px;
  }
  #game-page .welcome p {
    font-size: 13px;
    line-height: 1.3;
  }
  #game-page .welcome .doctor-mark {
    display: none;
  }
}
@media (max-width: 400px) {
  header {
    gap: 5px;
  }
  header .brand {
    font-size: 18px;
  }
  header .brand-seal {
    display: none;
  }
}

.practice-dashboard {
  margin: 0 0 35px;
  padding: 25px;
  background: #fff9ec;
  border: 1px solid #ccb37a;
  border-radius: 8px 13px 6px 10px;
}
.practice-dashboard h2 {
  font:
    27px Georgia,
    serif;
  color: #922b25;
  line-height: 1.5;
  margin: 12px 0;
}
.practice-dashboard p {
  line-height: 1.7;
  font-size: 15px;
  color: #806c50;
}
#academy-meter {
  display: block;
  width: 100%;
  height: 14px;
  margin: 18px 0 24px;
  accent-color: #b92d28;
}
.practice-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}
.academy-list .practice-filters button {
  width: auto;
  border: 1px solid #c9b379;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 4px;
}
.practice-filters button[aria-pressed='true'] {
  background: #a82e28;
  color: #fff7e9;
}
@media (max-width: 600px) {
  .practice-dashboard {
    padding: 18px;
  }
  .practice-dashboard h2 {
    font-size: 23px;
  }
  .practice-dashboard .academy-buttons {
    flex-direction: column;
  }
}

.mate-marker {
  position: absolute;
  top: 3%;
  right: 3%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 40%;
  height: 40%;
  border-radius: 50%;
  background: #fff4d5;
  color: #a32320;
  border: 2px solid #b58d32;
  box-shadow: 0 2px 5px #3d170f60;
  font:
    bold clamp(10px, 3.4cqw, 25px) / 1 Georgia,
    serif;
  pointer-events: none;
}

.mate-marker[hidden] {
  display: none;
}

#board {
  container-type: inline-size;
}

/* DJ Doctor stays at the table, including active games and small screens. */
#game-page .welcome {
  gap: 16px;
  align-items: center;
}
#game-page.playing .welcome {
  display: flex;
  padding-block: 4px;
}
#game-page.playing .welcome h1 {
  font-size: 22px;
}
#game-page.playing .welcome p {
  display: none;
}
#game-page .welcome .doctor-mark {
  display: block;
  position: relative;
  flex: none;
  width: 86px;
  min-width: 86px;
  height: 84px;
  margin: 0;
  transform: none;
}
#game-page .doctor-mark svg {
  width: 86px;
  height: 72px;
}
#game-page .doctor-mark > span {
  font-size: 14px;
  right: 0;
  bottom: 0;
}
@media (max-width: 800px) {
  #game-page .welcome .doctor-mark {
    width: 58px;
    min-width: 58px;
    height: 62px;
  }
  #game-page .doctor-mark svg {
    width: 58px;
    height: 50px;
  }
  #game-page .doctor-mark > span {
    font-size: 11px;
  }
  #game-page.playing .welcome h1 {
    font-size: 20px;
  }
}

#game-page.lobby #play,
#game-page.lobby .left-column,
#game-page.lobby .score-card,
#game-page.lobby .game-report {
  display: none;
}
#game-page.lobby .room {
  display: block;
  max-width: 760px;
  margin: 0 auto;
}
#game-page.lobby .right-column {
  width: 100%;
  display: block;
}
#game-page.lobby .puzzle-link {
  margin-top: 20px;
}
#game-page.lobby .welcome {
  padding-block: 28px;
}
.room-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
}
.room-heading a {
  color: #982b26;
  font-size: 15px;
}
.room-heading strong {
  font:
    22px Georgia,
    serif;
  color: #932c25;
}
#game-page.game-room > .welcome,
#game-page.game-room .left-column {
  display: none;
}
#game-page.game-room .room {
  grid-template-columns: minmax(0, 1fr) 310px;
  max-width: 1080px;
  margin: auto;
}
#game-page.game-room #play {
  max-width: min(640px, max(280px, calc(100dvh - 290px)));
}
#game-page.game-room .mode-tabs,
#game-page.game-room #friend-game {
  display: none;
}
@media (max-width: 800px) {
  #game-page.game-room .room {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  #game-page.game-room .right-column {
    width: 100%;
  }
  .room-heading {
    gap: 10px;
  }
  .room-heading strong {
    font-size: 16px;
  }
  .room-heading img {
    width: 46px;
    height: 43px;
  }
  #game-page.game-room #play {
    max-width: min(100%, max(280px, calc(100dvh - 280px)));
  }
}

#game-page.game-room #resume-practice {
  display: none;
}

#moves.empty-score {
  display: block;
}
