/* Ink & Amber craft pass — visual authority: approved generated dashboard and chess screen.
   Only visual roles live here; legacy board behavior and all platform routes stay intact. */
@font-face {
  font-family: AtelierSerif;
  src: url("/assets/atelier-serif-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: AtelierSerif;
  src: url("/assets/atelier-serif-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  --c-canvas: #242520;
  --c-shell: #2f2d27;
  --c-surface: #37362e;
  --c-surface-low: #302f29;
  --c-surface-high: #414035;
  --c-field: #292923;
  --c-text: #f0e5c9;
  --c-secondary: #c8bda2;
  --c-muted: #b3a88f;
  --c-bronze: #817253;
  --c-divider: #5b5543;
  --c-outline: #948468;
  --c-gold: #e8c079;
  --c-gold-mid: #d5ad65;
  --c-gold-shadow: #b98a43;
  --c-on-gold: #382b18;
  --c-link: #efd095;
  --c-selected: #59492c;
  --c-red: #aa4532;
  --c-success: #92af7a;
  --c-error: #efb79d;
  --f-display: AtelierSerif, "Noto Serif SC", "Songti SC", "SimSun", serif;
  --f-ui: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --r-surface: 10px;
  --r-control: 7px;
  --motion-ui: 160ms;
  --ease-ui: cubic-bezier(0.2, 0.75, 0.3, 1);
  --paper: var(--c-canvas);
  --white: var(--c-surface-low);
  --ink: var(--c-text);
  --body: var(--c-secondary);
  --muted: var(--c-muted);
  --line: var(--c-divider);
  --green: var(--c-gold-mid);
  --green-dark: var(--c-gold-shadow);
  --sage: var(--c-surface);
  --gold: var(--c-gold);
  --red: var(--c-red);
  --ui: var(--f-ui);
  color-scheme: dark;
}
html {
  scroll-padding-top: 105px;
  scrollbar-width: thin;
  scrollbar-color: var(--c-bronze) var(--c-canvas);
}
body {
  background: var(--c-canvas);
  color: var(--c-text);
  font: 15px/1.65 var(--f-ui);
  font-synthesis: none;
}
::selection {
  background: var(--c-selected);
  color: var(--c-text);
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--c-canvas);
}
::-webkit-scrollbar-thumb {
  background: var(--c-bronze);
  border: 2px solid var(--c-canvas);
  border-radius: 8px;
}
button,
input,
textarea,
select {
  font-family: var(--f-ui);
}
input,
textarea {
  caret-color: var(--c-gold);
}
input::placeholder,
textarea::placeholder {
  color: var(--c-muted);
  opacity: 1;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 4px;
}
button:disabled {
  opacity: 0.45;
  filter: saturate(0.35);
  cursor: not-allowed;
}
a {
  text-underline-offset: 0.2em;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}
.site-header {
  height: 84px;
  background: var(--c-shell);
  border-bottom: 1px solid var(--c-bronze);
  isolation: isolate;
}
.site-header:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.4;
  background: url("/assets/ink-header.webp") no-repeat 58% 50%;
  background-size: auto 100%;
  pointer-events: none;
}
.header-inner {
  padding: 0 32px;
  gap: 24px;
}
.brand {
  font-family: var(--f-display);
  font-size: 32px;
  letter-spacing: 1px;
  gap: 15px;
  line-height: 1.4;
  color: var(--c-text);
}
.brand > span:not(.brand-seal) {
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand small {
  margin: 0;
  padding-left: 20px;
  border-left: 1px solid var(--c-bronze);
  font: 13px/1.5 var(--f-ui);
  letter-spacing: 1.2px;
  color: var(--c-secondary);
  white-space: nowrap;
}
.brand-seal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 48px;
  border-radius: 4px;
  background: #893b2c;
  color: #e5b48a;
  border: 1px solid #b86445;
  font:
    35px/1 "KaiTi",
    serif;
  box-shadow:
    inset 0 0 0 3px #893b2c,
    inset 0 0 0 4px #b767465e;
  transform: rotate(-1deg);
}
.connection {
  font-size: 12px;
  color: var(--c-secondary);
  gap: 8px;
}
.connection .status-dot {
  background: var(--c-success);
}
.portal-user {
  font-size: 13px;
  gap: 11px;
  color: var(--c-text);
}
.portal-user button {
  font-size: 13px;
  min-height: 44px;
  padding: 8px 0;
  color: var(--c-link);
}
.portal-avatar {
  width: 35px;
  height: 35px;
  color: var(--c-text);
  background: #675d47;
  font: 20px var(--f-display);
}
.sidebar {
  top: 84px;
  width: 200px;
  padding: 29px 12px 24px;
  gap: 9px;
  border-right: 1px solid var(--c-bronze);
  background: var(--c-shell);
  isolation: isolate;
}
.sidebar:after {
  content: "";
  position: absolute;
  bottom: 105px;
  left: 0;
  width: 100%;
  height: 350px;
  background: url("/assets/ink-mountains.webp") center bottom/cover no-repeat;
  opacity: 0.18;
  z-index: -1;
  pointer-events: none;
  mask-image: linear-gradient(transparent, #000 45%, #000);
}
.sidebar button {
  min-height: 52px;
  font-size: 15px;
  letter-spacing: 0.2px;
  color: var(--c-secondary);
  padding: 13px 17px;
  gap: 13px;
  border-radius: 4px;
  transition:
    background var(--motion-ui),
    color var(--motion-ui);
}
.sidebar button svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.65;
}
.sidebar button:hover {
  background: var(--c-surface);
  color: var(--c-text);
}
.sidebar button.active {
  background: linear-gradient(105deg, #785e32, #594c33);
  color: #f7e6bc;
  box-shadow: inset 2px 0 var(--c-gold);
}
.sidebar button.active svg {
  color: var(--c-gold);
}
.sidebar .nav-divider {
  border-color: var(--c-divider);
}
.workspace {
  width: auto;
  max-width: 1400px;
  margin: 0 0 0 200px;
  padding: 28px 32px 32px;
}
.portal-title {
  margin-bottom: 27px;
  gap: 24px;
  align-items: center;
}
.portal-title h1 {
  font: 600 34px/1.45 var(--f-display);
  letter-spacing: 0.8px;
  color: var(--c-text);
}
.portal-title p {
  font-size: 14px;
  line-height: 1.8;
  margin-top: 7px;
  color: var(--c-secondary);
}
.portal-title .badge {
  font-size: 12px;
  line-height: 1.6;
  padding: 7px 12px;
  color: var(--c-secondary);
  border-color: var(--c-divider);
  background: var(--c-surface-low);
}
.portal-grid {
  grid-template-columns: 1.82fr 1fr;
  gap: 24px;
  min-width: 0;
}
.surface {
  position: relative;
  background: linear-gradient(
    118deg,
    #3b3a31 0%,
    var(--c-surface) 46%,
    #33332b
  );
  border: 1px solid var(--c-bronze);
  border-radius: var(--r-surface);
  padding: 26px;
  box-shadow: none;
  min-width: 0;
}
.surface h2 {
  font: 600 24px/1.4 var(--f-display);
  margin: 0 0 13px;
  color: var(--c-text);
  letter-spacing: 0.35px;
}
.surface h3 {
  font: 600 17px/1.5 var(--f-ui);
  color: var(--c-text);
}
.surface p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--c-secondary);
  max-width: 68ch;
}
.surface h2 > svg {
  width: 22px;
  height: 22px;
  vertical-align: -3px;
  stroke: var(--c-gold-mid);
  margin-right: 8px;
}
.surface .button-row {
  gap: 12px;
  margin-top: 21px;
}
.button {
  min-height: 44px;
  padding: 11px 18px;
  gap: 9px;
  border-radius: var(--r-control);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.1px;
  transition:
    background var(--motion-ui),
    border-color var(--motion-ui),
    color var(--motion-ui),
    box-shadow var(--motion-ui);
}
.button svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}
.button.primary {
  color: var(--c-on-gold);
  background: linear-gradient(180deg, #edca87 0%, #e2b968 48%, #d4a559 100%);
  border: 1px solid #e5bf77;
  box-shadow:
    inset 0 1px 0 #f6dfad,
    0 2px 3px #1717102b;
}
.button.primary:hover {
  background: linear-gradient(180deg, #f4d699, #e9c17c 70%, #d8ad65);
  border-color: #f1cf8e;
  box-shadow:
    inset 0 1px 0 #fff1c6,
    0 3px 7px #17171030;
}
.button.primary:active {
  background: var(--c-gold-mid);
  box-shadow: inset 0 1px 3px #5b3e1630;
}
.button.secondary {
  background: transparent;
  color: var(--c-text);
  border: 1px solid var(--c-outline);
  box-shadow: none;
}
.button.secondary:hover {
  background: var(--c-surface-high);
  border-color: var(--c-gold-mid);
  color: var(--c-text);
}
.button.secondary:active {
  background: var(--c-selected);
}
.text-link {
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-link);
  min-height: 36px;
  gap: 7px;
  transition: color var(--motion-ui);
}
.text-link:hover {
  color: var(--c-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.hero-surface {
  min-height: 272px;
  padding: 29px 30px;
  overflow: hidden;
  background: #3b3b32;
  isolation: isolate;
}
.hero-surface > div {
  position: static;
  max-width: none;
  z-index: 2;
}
.hero-surface h2 {
  position: relative;
  z-index: 2;
  font-size: 32px;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
  max-width: 420px;
}
.hero-surface p {
  position: relative;
  z-index: 2;
  max-width: min(390px, 60%);
  line-height: 1.75;
}
.hero-surface .button-row {
  position: relative;
  z-index: 2;
  margin-top: 21px;
}
.hero-art {
  right: 0;
  top: 0;
  width: 49%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
  opacity: 1;
  filter: saturate(0.92) contrast(1.03);
  mask-image: linear-gradient(90deg, transparent 0%, #000 35%);
}
.hero-surface:after {
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    #3b3b32 0%,
    #3b3b32 33%,
    #3b3b326b 58%,
    transparent 86%
  );
  pointer-events: none;
}
.chips {
  position: relative;
  z-index: 2;
  gap: 7px;
  margin-top: 19px;
  max-width: 420px;
}
.chip {
  font-size: 12px;
  line-height: 1.5;
  color: var(--c-secondary);
  border: 1px solid #7f7456;
  background: #34332bb3;
  padding: 2px 8px;
  border-radius: 20px;
}
.hero-link {
  position: absolute !important;
  right: 24px;
  bottom: 16px;
  z-index: 2 !important;
  margin: 0;
  min-height: 32px;
  color: var(--c-link);
  background: #25261ee0;
  padding: 4px 9px;
  border-radius: 4px;
}
.daily-surface {
  min-height: 272px;
  padding: 29px 28px;
  isolation: isolate;
  overflow: hidden;
  gap: 0;
}
.daily-surface:before {
  content: "";
  position: absolute;
  inset: 0 0 0 40%;
  background: url("/assets/ink-mountains.webp") right 40% / cover no-repeat;
  opacity: 0.32;
  z-index: -1;
  mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.daily-surface h2 {
  font-size: 31px;
  margin-bottom: 20px;
}
.daily-surface .button {
  margin-top: auto;
  align-self: flex-start;
  min-width: 156px;
}
.daily-surface p {
  font-size: 14px;
  position: relative;
}
.pill-group {
  gap: 10px;
  margin-bottom: 16px;
  position: relative;
}
.pill-group button {
  font-size: 15px;
  line-height: 1.3;
  min-height: 39px;
  min-width: 62px;
  padding: 8px 17px;
  color: var(--c-secondary);
  border-color: var(--c-outline);
  background: #35342c99;
}
.pill-group button:hover {
  border-color: var(--c-gold);
}
.pill-group button.active {
  color: var(--c-on-gold);
  background: linear-gradient(#e6be77, #d4ac66);
  border-color: var(--c-gold-mid);
}
.section-heading {
  font: 600 23px/1.5 var(--f-display);
  letter-spacing: 0.4px;
  gap: 18px;
  margin: 26px 0 16px;
  color: var(--c-text);
}
.section-heading:after {
  background: var(--c-divider);
}
.theme-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.theme-tile {
  min-width: 0;
  min-height: 134px;
  padding: 15px;
  gap: 16px;
  border-radius: 8px;
  border: 1px solid var(--c-bronze);
  background: linear-gradient(120deg, #3d3c33, var(--c-surface));
  transition:
    border-color var(--motion-ui),
    background var(--motion-ui);
}
.theme-tile:hover {
  background: var(--c-surface-high);
  border-color: var(--c-gold-mid);
}
.theme-tile > span:last-child {
  flex: 1;
  min-width: 0;
}
.theme-tile h3 {
  font: 600 19px/1.4 var(--f-display);
  letter-spacing: 0.2px;
  color: var(--c-text);
  margin: 0 0 8px;
}
.theme-tile p {
  font-size: 12px;
  line-height: 1.65;
  color: var(--c-secondary);
}
.theme-tile .tile-arrow {
  display: block;
  margin-top: 6px;
  text-align: right;
  color: var(--c-gold-mid);
}
.tile-arrow svg {
  width: 18px;
  height: 15px;
}
.theme-preview {
  position: relative;
  flex: 0 0 72px;
  width: 72px;
  height: 84px;
  border: 3px solid #a88453;
  border-radius: 3px;
  background: #dfbf8d;
  box-shadow: inset 0 0 0 1px #f0d4a5;
  overflow: hidden;
}
.theme-preview svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: none;
}
.theme-preview .preview-grid {
  stroke: #80603a;
  stroke-width: 2;
  opacity: 0.7;
  fill: none;
}
.theme-preview .preview-piece {
  fill: #f2dfb6;
  stroke: #ab8550;
  stroke-width: 2;
}
.theme-preview .preview-character {
  fill: #302b21;
  font-family: "KaiTi", serif;
  font-size: 43px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}
.theme-preview .red-character {
  fill: #a6452f;
}
.dashboard-bottom {
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 22px;
}
.dashboard-bottom > .surface {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  gap: 3px 20px;
  min-height: 172px;
  padding: 22px 25px;
  align-items: center;
}
.dashboard-bottom h2 {
  grid-column: 1/-1;
  font-size: 22px;
  margin-bottom: 7px;
}
.dashboard-bottom .empty-state {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  color: var(--c-secondary);
  font-size: 13px;
  line-height: 1.75;
}
.dashboard-bottom .empty-state svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  stroke: var(--c-muted);
  margin: 0;
}
.dashboard-bottom > .surface > .button {
  grid-row: 2;
  grid-column: 2;
  align-self: center;
  font-size: 13px;
  min-height: 43px;
  padding: 9px 15px;
}
.dashboard-bottom .portal-row {
  grid-column: 1/-1;
}
.dashboard-bottom > .surface > p {
  grid-column: 1;
}
.theory-strip {
  margin-top: 22px;
  padding: 17px 25px;
  gap: 20px;
  min-height: 78px;
}
.theory-strip strong {
  font: 600 19px/1.5 var(--f-display);
  letter-spacing: 0.3px;
  color: var(--c-text);
}
.theory-strip p {
  font-size: 12px;
  color: var(--c-secondary);
  margin-top: 3px;
}
.theory-strip .text-link {
  font-size: 13px;
  white-space: nowrap;
}
/* Reading and interaction surfaces share one typography/contrast system. */
.portal-form {
  gap: 17px;
}
.portal-form label {
  font-size: 14px;
  line-height: 1.55;
  color: var(--c-secondary);
  gap: 8px;
}
.portal-form input,
.portal-form select,
.portal-form textarea,
.portal-input {
  font-size: 14px;
  line-height: 1.65;
  min-height: 44px;
  padding: 10px 13px;
  background: var(--c-field);
  border: 1px solid var(--c-outline);
  color: var(--c-text);
  border-radius: var(--r-control);
}
.portal-form input:focus,
.portal-form textarea:focus,
.portal-form select:focus,
.portal-input:focus {
  border-color: var(--c-gold);
}
.portal-form .field-note,
.field-note,
.subdued,
.sync-state {
  font-size: 12px;
  line-height: 1.85;
  color: var(--c-muted);
}
.subheading {
  font-size: 14px;
  color: var(--c-secondary);
  line-height: 1.8;
}
.portal-card-list {
  gap: 15px;
}
.portal-row {
  gap: 18px;
  padding: 18px 20px;
  background: var(--c-surface);
  border-color: var(--c-bronze);
  border-radius: 8px;
}
.portal-row h3 {
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-text);
  margin-bottom: 5px;
}
.portal-row p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--c-secondary);
}
.portal-row .button {
  font-size: 13px;
  min-height: 42px;
  padding: 10px 15px;
}
.row-tag {
  font-size: 12px;
  color: var(--c-link);
  border-color: var(--c-bronze);
  padding: 4px 8px;
  background: var(--c-surface-low);
}
.row-note {
  font-size: 12px;
  color: var(--c-secondary);
}
.training-tabs {
  gap: 9px;
  margin: 24px 0 20px;
}
.training-tabs button {
  font-size: 14px;
  min-height: 43px;
  border-color: var(--c-outline);
  color: var(--c-secondary);
  border-radius: var(--r-control);
  background: var(--c-surface-low);
  padding: 9px 17px;
}
.training-tabs button:hover {
  border-color: var(--c-gold-mid);
  background: var(--c-surface);
}
.training-tabs button.active {
  background: var(--c-selected);
  color: var(--c-text);
  border-color: var(--c-gold-mid);
}
.topic-grid {
  gap: 19px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.topic-card {
  background: var(--c-surface);
  border-color: var(--c-bronze);
  padding: 23px;
  border-radius: var(--r-surface);
}
.topic-card h3 {
  font: 600 21px/1.5 var(--f-display);
  letter-spacing: 0.2px;
  margin-bottom: 12px;
}
.topic-card p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--c-secondary);
}
.topic-card .button {
  margin-top: 20px;
}
.topic-category {
  font-size: 12px;
  color: var(--c-link);
  letter-spacing: 0.4px;
}
.stats-grid {
  gap: 17px;
  margin-bottom: 24px;
}
.stat-box {
  background: var(--c-surface);
  border-color: var(--c-bronze);
  padding: 24px;
  border-radius: var(--r-surface);
}
.stat-box b {
  font: 600 32px/1.2 var(--f-display);
  font-variant-numeric: tabular-nums;
  color: var(--c-link);
}
.stat-box p {
  font-size: 13px;
  color: var(--c-secondary);
  margin-top: 10px;
}
.study-bars {
  border-color: var(--c-bronze);
}
.study-day {
  background: var(--c-gold-mid);
}
.study-day span,
.study-day em {
  font-size: 12px;
  color: var(--c-secondary);
  font-variant-numeric: tabular-nums;
}
.progress-track {
  background: var(--c-field);
}
.progress-track i {
  background: var(--c-gold-mid);
}
.platform-table {
  font-size: 14px;
  color: var(--c-secondary);
  font-variant-numeric: tabular-nums;
}
.platform-table th,
.platform-table td {
  border-color: var(--c-divider);
  padding: 13px 12px;
}
.platform-table th {
  font-size: 12px;
  color: var(--c-link);
  background: var(--c-surface-low);
}
.notice {
  background: #49402c;
  border-color: var(--c-bronze);
  color: var(--c-text);
  font-size: 13px;
  line-height: 1.85;
  padding: 13px 16px;
  border-radius: var(--r-control);
}
.room-code {
  color: var(--c-gold);
  font-size: 31px;
  font-variant-numeric: tabular-nums;
}
.fact-chip {
  font-size: 12px;
  color: var(--c-link);
  border-color: var(--c-bronze);
  padding: 5px 8px;
}
.bound-principle {
  font-size: 12px;
  line-height: 1.6;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--c-link);
  background: #49402c;
  border-color: var(--c-bronze);
  margin: 6px 5px 0 0;
}
.bound-principle:hover {
  color: var(--c-text);
  border-color: var(--c-gold-mid);
  background: var(--c-selected);
}
.thinking-note {
  font-size: 13px;
  color: var(--c-secondary);
}
.danger-button {
  color: var(--c-error);
  border-color: #a47658;
}
.platform-dialog,
.settings-dialog,
.result-dialog {
  background: var(--c-surface-low);
  border: 1px solid var(--c-bronze);
  color: var(--c-text);
  box-shadow: 0 22px 65px #15171085;
  border-radius: 13px;
  padding: 29px;
}
.platform-dialog::backdrop,
.settings-dialog::backdrop,
.result-dialog::backdrop {
  background: #181a14bb;
  backdrop-filter: blur(3px);
}
.platform-dialog h2,
.dialog-header h2,
.result-dialog h2 {
  font: 600 27px/1.4 var(--f-display);
  color: var(--c-text);
  letter-spacing: 0.4px;
}
.dialog-intro,
.platform-dialog .dialog-intro,
.result-dialog p {
  font-size: 14px;
  line-height: 1.9;
  color: var(--c-secondary);
}
.platform-dialog .field-note {
  font-size: 12px;
  color: var(--c-muted);
}
.dialog-head button,
.icon-button {
  color: var(--c-secondary);
  min-width: 38px;
  min-height: 38px;
}
fieldset legend {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}
fieldset label > span {
  background: var(--c-surface);
  color: var(--c-secondary);
  border-color: var(--c-outline);
  padding: 13px;
}
fieldset b {
  font-size: 14px;
  color: var(--c-text);
}
fieldset small {
  font-size: 12px;
  color: var(--c-secondary);
  margin-top: 5px;
}
fieldset label:has(input:checked) > span {
  background: var(--c-selected);
  border-color: var(--c-gold-mid);
  box-shadow: none;
}
.difficulty-options label > span,
.quota-options label > span {
  font-size: 13px;
  min-height: 42px;
}
.result-seal {
  background: var(--c-selected);
  border-color: var(--c-bronze);
  color: var(--c-gold);
}
.result-actions .button {
  font-size: 14px;
}
.toast {
  font-size: 14px;
  line-height: 1.6;
  background: #58482e;
  color: var(--c-text);
  border-color: var(--c-gold-mid);
  box-shadow: 0 8px 24px #15171040;
  border-radius: 8px;
  padding: 12px 18px;
}
.collection-tag {
  font-size: 12px;
  color: var(--c-secondary);
  border-color: var(--c-bronze);
  padding: 7px 11px;
}
.library-item,
.move-card {
  background: var(--c-surface-low);
  border-color: var(--c-bronze);
}
.library-item {
  padding: 20px 23px;
}
.library-symbol {
  background: var(--c-selected);
  color: var(--c-link);
  font-family: var(--f-display);
}
.library-info h2 {
  font-size: 17px;
  color: var(--c-text);
}
.library-info p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--c-secondary);
}
.library-result {
  font-size: 12px;
  background: var(--c-selected);
  color: var(--c-text);
}
.library-empty {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-bronze);
}
.library-empty h2 {
  font: 600 24px/1.5 var(--f-display);
}
.library-empty p {
  font-size: 14px;
  color: var(--c-secondary);
}
.section-note {
  font-size: 13px;
  line-height: 1.9;
  color: var(--c-secondary);
}
/* Board remains a playable instrument, not a photographic background. */
.page-heading {
  margin-bottom: 16px;
  gap: 24px;
}
.page-heading h1 {
  font: 600 29px/1.4 var(--f-display);
  color: var(--c-text);
  letter-spacing: 0.5px;
}
.page-heading p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--c-secondary);
  margin-top: 5px;
}
.board-section {
  min-width: 0;
  max-width: none;
}
.board-caption {
  margin: 0 3px 10px;
}
.caption-tag {
  font-size: 13px;
  color: var(--c-secondary);
  letter-spacing: 0.3px;
}
.round-label {
  font-size: 12px;
  color: var(--c-secondary);
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}
.player-row {
  gap: 11px;
  padding: 0 3px;
}
.player-info strong {
  font-size: 15px;
  line-height: 1.45;
  color: var(--c-text);
}
.player-info > span {
  font-size: 12px;
  line-height: 1.55;
  color: var(--c-secondary);
}
.player-status {
  font-size: 12px;
  color: var(--c-secondary);
  letter-spacing: 0.2px;
}
.avatar {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  border: 1px solid var(--c-bronze);
  background: #67563a;
  color: var(--c-link);
  font:
    21px "KaiTi",
    serif;
}
.self-avatar {
  background: #7b3b2d;
  color: #f0d3b0;
}
.small-tag {
  font-size: 10px;
  color: var(--c-secondary);
  border-color: var(--c-bronze);
  background: var(--c-surface);
}
.board-frame {
  padding: 13px;
  border-radius: 5px;
  background: linear-gradient(
    120deg,
    #a47a42,
    #d7ab6c 26%,
    #b0834d 72%,
    #947042
  );
  border: 1px solid #c69e62;
  box-shadow: 0 8px 18px #14170e40;
}
.board-frame:before {
  inset: 5px;
  border-radius: 3px;
  border-color: #f0d29775;
}
.board-inner {
  background: #d6ae75 url("/assets/wood-grain.webp") repeat;
  background-size: 80px 68px;
  border: 1px solid #9e743f;
  border-radius: 1px;
}
.board-inner:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, #f3d49c22, transparent 38%, #9362340c);
  z-index: 0;
  pointer-events: none;
}
.board-lines path,
.board-lines rect {
  stroke: #6d4e2a !important;
  opacity: 0.7 !important;
  stroke-width: 1.15;
}
.board-lines g {
  fill: #5c4326 !important;
  opacity: 1 !important;
}
.piece {
  border: 1px solid #b69561;
  background: radial-gradient(
    circle at 29% 20%,
    #f8eaca,
    #e7d2ab 63%,
    #cfb27f 88%
  );
  color: #292b22;
  box-shadow:
    0 3px 0 #9b7845,
    0 5px 6px #6a492830,
    inset 0 1px 1px #fff1d8;
  font-weight: 700;
}
.piece:before {
  border: 1px solid #ab8b5863;
  inset: 8%;
}
.piece.red {
  color: #a1412b;
}
.piece.red:before {
  border-color: #a1503652;
}
.piece.selected {
  box-shadow:
    0 0 0 2px #edc368,
    0 3px 0 #9b7845,
    0 7px 8px #6a492845;
}
.legal-marker:after {
  background: #9b7730;
  box-shadow: 0 0 0 5px #9b773014;
}
.legal-marker.capture:after {
  background: none;
  border-color: #d0a343;
}
.last-marker:after {
  border-color: #9b7a3970;
  background: #a8843617;
}
.turn-badge {
  font-size: 12px;
  line-height: 1.5;
  padding: 6px 10px;
  background: var(--c-selected);
  color: var(--c-text);
  border: 1px solid var(--c-bronze);
  border-radius: 20px;
}
.turn-badge .status-dot {
  background: var(--c-gold);
}
.turn-badge.busy,
.turn-badge.reviewing {
  background: var(--c-surface);
  color: var(--c-secondary);
}
.player-row.self {
  margin-top: 14px;
}
.board-toolbar {
  border-color: var(--c-divider);
  margin-top: 15px;
  padding-top: 9px;
}
.tool-button {
  font-size: 13px;
  color: var(--c-secondary);
  gap: 7px;
  min-height: 38px;
  padding: 6px 3px;
}
.tool-button:hover {
  color: var(--c-link);
}
.tool-button svg {
  width: 18px;
  height: 18px;
}
.toolbar-group {
  gap: 19px;
}
.board-footnote {
  font-size: 12px;
  line-height: 1.6;
  color: var(--c-muted);
  margin-top: 10px;
}
.side-rail {
  gap: 19px;
  padding-top: 0;
}
.coach-card {
  background: linear-gradient(130deg, #3a392e, #303129);
  border-color: var(--c-bronze);
  padding: 23px;
  border-radius: var(--r-surface);
  box-shadow: none;
}
.coach-head h2 {
  font-size: 18px;
  line-height: 1.5;
  color: var(--c-text);
}
.coach-head p {
  font-size: 12px;
  color: var(--c-secondary);
  margin-top: 3px;
}
.coach-label {
  font-size: 12px;
  padding: 3px 6px;
  color: var(--c-secondary);
  border-color: var(--c-divider);
}
.coach-icon {
  width: 38px;
  height: 38px;
  background: var(--c-selected);
  color: var(--c-gold);
  border-color: var(--c-bronze);
  border-radius: 8px;
}
.quota-row {
  font-size: 13px;
  color: var(--c-secondary);
  padding: 18px 0;
  border-color: var(--c-divider);
  margin-bottom: 19px;
  gap: 10px;
}
.quota-display {
  gap: 7px;
}
.quota-display i {
  width: 10px;
  height: 10px;
  background: var(--c-gold-mid);
}
.quota-display i.used {
  background: #6c5c3e;
}
.quota-display strong {
  font-size: 19px;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
  margin-left: 10px;
}
.quota-display strong span {
  font-size: 12px;
  color: var(--c-muted);
}
.section-kicker {
  font-size: 12px;
  color: var(--c-secondary);
  letter-spacing: 0.3px;
}
.coach-content {
  min-height: 136px;
}
.coach-content h3 {
  font: 600 24px/1.5 var(--f-display);
  color: var(--c-text);
  letter-spacing: 0.3px;
  margin: 10px 0;
}
.coach-content p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--c-secondary);
}
.coach-content .coach-meta {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 12px;
  line-height: 1.6;
  gap: 8px;
}
.coach-content .analysis-tag {
  background: var(--c-surface-high);
  color: var(--c-secondary);
  padding: 4px 7px;
}
.coach-content .wdl-caption {
  font-size: 12px;
  color: var(--c-muted);
  line-height: 1.75;
  margin-top: 8px;
}
.hint-button {
  background: transparent;
  color: var(--c-link);
  border: 1px solid var(--c-outline);
  font-size: 14px;
  min-height: 45px;
  margin-top: 15px;
  box-shadow: none;
}
.hint-button:hover {
  background: var(--c-selected);
  border-color: var(--c-gold-mid);
}
.apply-hint {
  min-height: 44px;
  margin-top: 10px;
  font-size: 14px;
  background: linear-gradient(180deg, #edca87, #e2b968 48%, #d4a559) !important;
  color: var(--c-on-gold) !important;
  border-color: var(--c-gold-mid);
}
.honest-note {
  font-size: 12px;
  color: var(--c-muted);
  line-height: 1.8;
  margin-top: 12px;
}
.card-heading {
  padding: 19px 21px 15px;
}
.card-heading h2 {
  font-size: 16px;
  color: var(--c-text);
}
.muted {
  font-size: 12px;
  color: var(--c-muted);
}
.move-columns {
  background: var(--c-surface);
  border-color: var(--c-divider);
  font-size: 12px;
  color: var(--c-secondary);
  padding: 9px 20px;
}
.move-list {
  height: 170px;
  scrollbar-color: var(--c-bronze) var(--c-surface-low);
}
.move-row {
  grid-template-columns: 45px 1fr 1fr;
  min-height: 38px;
  font-size: 14px;
}
.move-number {
  font-size: 13px;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}
.move-cell,
.move-cell.red {
  font-size: 14px;
  color: var(--c-secondary);
  padding: 7px 8px;
}
.move-cell.active {
  background: var(--c-selected);
  color: var(--c-text);
}
.move-cell:hover {
  background: var(--c-surface-high);
}
.empty-moves p {
  font-size: 14px;
  color: var(--c-secondary);
}
.empty-moves span {
  font-size: 12px;
  color: var(--c-muted);
}
.empty-moves svg {
  color: var(--c-muted);
}
.replay-controls,
.move-footer {
  border-color: var(--c-divider);
}
.replay-controls {
  padding: 10px 18px;
}
.replay-controls button {
  width: 30px;
  height: 30px;
  font-size: 16px;
  color: var(--c-secondary);
}
.replay-controls button:hover {
  background: var(--c-selected);
  color: var(--c-text);
}
.replay-controls span {
  font-size: 12px;
  color: var(--c-secondary);
}
.move-footer {
  padding: 12px 20px;
}
.move-footer button {
  font-size: 12px;
  color: var(--c-link);
  min-height: 28px;
}
.move-footer > span {
  font-size: 12px;
  color: var(--c-muted);
}
.learning-note {
  gap: 11px;
  padding: 1px 3px;
}
.learning-note strong {
  font-size: 13px;
  color: var(--c-secondary);
  font-weight: 500;
}
.learning-note p {
  font-size: 12px;
  color: var(--c-muted);
  line-height: 1.8;
}
.learning-icon {
  color: var(--c-muted);
}
#sessionBanner:empty {
  display: none;
}
.side-rail #sessionBanner .training-session {
  display: flex;
  gap: 10px;
  padding: 17px;
  margin: 0;
  border-color: var(--c-bronze);
  background: var(--c-surface-low);
  border-radius: var(--r-surface);
}
.side-rail #sessionBanner .training-session > div {
  width: 100%;
}
.training-session h3 {
  font: 600 17px/1.5 var(--f-ui);
  color: var(--c-text);
}
.training-session p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--c-secondary);
  margin-top: 4px;
}
.side-rail #sessionBanner .button {
  font-size: 12px;
  min-height: 38px;
  padding: 8px 10px;
  margin: 0;
  flex: 1;
}
.side-rail #sessionBanner .notice {
  margin-top: 9px;
  font-size: 12px;
}
@media (min-width: 1001px) {
  body:has(#gameView:not([hidden])) .workspace {
    max-width: 1260px;
    padding-top: 23px;
  }
  body:has(#gameView:not([hidden])) .game-grid {
    grid-template-columns: minmax(0, 580px) 355px;
    gap: 26px;
    justify-content: start;
  }
  body:has(#gameView:not([hidden])) .board-section {
    max-width: none;
  }
  body:has(#gameView:not([hidden])) .page-heading {
    margin-bottom: 18px;
  }
  body:has(#gameView:not([hidden])) .page-heading h1 {
    font-size: 27px;
  }
  body:has(#gameView:not([hidden])) .player-row.opponent {
    margin-bottom: 10px;
  }
  body:has(#gameView:not([hidden])) .piece {
    font-size: 35px;
  }
}
@media (min-width: 1001px) and (max-height: 900px) {
  body:has(#gameView:not([hidden])) .workspace {
    padding-top: 18px;
  }
  body:has(#gameView:not([hidden])) .game-grid {
    grid-template-columns: minmax(0, 510px) 345px;
    gap: 24px;
  }
  body:has(#gameView:not([hidden])) .page-heading p {
    display: none;
  }
  body:has(#gameView:not([hidden])) .piece {
    font-size: 31px;
  }
  .coach-card {
    padding: 20px;
  }
  .coach-content {
    min-height: 120px;
  }
  .side-rail {
    gap: 16px;
  }
}
@media (max-width: 1280px) {
  .sidebar {
    width: 176px;
    padding: 25px 10px;
  }
  .sidebar button {
    padding: 12px 13px;
    font-size: 14px;
    gap: 11px;
  }
  .workspace {
    margin-left: 176px;
    padding: 26px 24px;
  }
  .header-inner {
    padding: 0 25px;
  }
  .brand {
    font-size: 29px;
  }
  .brand small {
    font-size: 12px;
    gap: 18px;
    padding-left: 16px;
  }
  .brand > span:not(.brand-seal) {
    gap: 18px;
  }
  .portal-title h1 {
    font-size: 31px;
  }
  .portal-title p {
    font-size: 14px;
  }
  .portal-grid {
    gap: 19px;
  }
  .hero-surface {
    padding: 27px 25px;
    min-height: 272px;
  }
  .hero-surface h2 {
    font-size: 29px;
  }
  .hero-surface p {
    max-width: 63%;
  }
  .hero-link {
    font-size: 12px;
    right: 18px;
    bottom: 13px;
  }
  .daily-surface {
    padding: 27px 22px;
  }
  .daily-surface h2 {
    font-size: 27px;
  }
  .pill-group button {
    min-width: 54px;
    padding: 7px 12px;
    font-size: 14px;
  }
  .theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .theme-tile {
    min-height: 125px;
    padding: 16px 19px;
  }
  .theme-tile h3 {
    font-size: 20px;
  }
  .theme-tile p {
    font-size: 13px;
  }
  .theme-preview {
    width: 76px;
    flex-basis: 76px;
    height: 87px;
  }
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body:has(#gameView:not([hidden])) .game-grid {
    grid-template-columns: minmax(0, 1fr) 305px;
    gap: 22px;
  }
  .coach-head h2 {
    font-size: 16px;
  }
  .coach-label {
    display: none;
  }
  .coach-content h3 {
    font-size: 22px;
  }
  .coach-card {
    padding: 20px;
  }
  .hint-button {
    padding: 10px 12px;
    font-size: 13px;
  }
  .quota-row {
    font-size: 12px;
  }
  .board-frame {
    padding: 11px;
  }
  .move-list {
    height: 150px;
  }
  .move-footer {
    padding: 11px 16px;
  }
  .move-footer > span {
    font-size: 12px;
  }
  .dashboard-bottom > .surface {
    gap: 6px 12px;
    padding: 22px;
  }
  .dashboard-bottom .empty-state {
    flex-direction: column;
    align-items: start;
    gap: 9px;
  }
}
@media (max-width: 1000px) {
  .sidebar {
    width: 78px;
    padding: 20px 6px;
    gap: 8px;
  }
  .sidebar button {
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    padding: 10px 2px;
    min-height: 68px;
    text-align: center;
  }
  .sidebar button svg {
    width: 21px;
    height: 21px;
  }
  .workspace {
    margin-left: 78px;
    padding: 25px 23px;
  }
  .connection {
    display: none;
  }
  .brand {
    font-size: 29px;
  }
  .portal-user {
    margin-left: auto;
  }
  .hero-surface p {
    max-width: 65%;
  }
  .hero-surface h2 {
    font-size: 27px;
  }
  .chips {
    gap: 5px;
  }
  .chip {
    font-size: 12px;
    padding: 2px 6px;
  }
  .hero-link {
    position: relative !important;
    margin-top: 14px;
    right: auto;
    bottom: auto;
    background: transparent;
    padding: 0;
    font-size: 12px;
  }
  .portal-grid {
    grid-template-columns: 1fr;
    gap: 17px;
  }
  .hero-surface {
    min-height: 260px;
  }
  .daily-surface {
    min-height: 160px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 20px;
    padding: 24px;
  }
  .daily-surface h2 {
    font-size: 26px;
    margin: 0;
    grid-column: 1;
    grid-row: 1;
  }
  .daily-surface .pill-group {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }
  .daily-surface p {
    grid-column: 1;
    grid-row: 2;
    font-size: 14px;
  }
  .daily-surface .button {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    align-self: center;
  }
  .dashboard-bottom {
    gap: 17px;
  }
  .dashboard-bottom > .surface {
    min-height: 182px;
    display: flex;
    flex-wrap: wrap;
    align-content: start;
    gap: 11px;
  }
  .dashboard-bottom h2 {
    width: 100%;
    font-size: 21px;
    margin: 0;
  }
  .dashboard-bottom .empty-state {
    font-size: 13px;
    gap: 10px;
    padding: 4px 0;
    flex-direction: row;
  }
  .dashboard-bottom .empty-state svg {
    width: 30px;
    height: 30px;
  }
  .dashboard-bottom > .surface > .button {
    min-height: 43px;
    margin-left: auto;
    padding: 10px 14px;
  }
  .game-grid,
  body:has(#gameView:not([hidden])) .game-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .board-section {
    max-width: none;
  }
  .side-rail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  .learning-note,
  .side-rail #sessionBanner {
    grid-column: 1/-1;
  }
  #sessionBanner:not(:empty) {
    margin-bottom: 18px;
  }
  #sessionBanner .training-session {
    padding: 16px;
    gap: 11px;
    margin: 0;
    font-size: 14px;
    background: var(--c-surface);
    border-color: var(--c-bronze);
  }
  .training-session .button {
    font-size: 12px;
    min-height: 42px;
    padding: 9px 12px;
    margin: 0;
  }
  .piece {
    font-size: clamp(26px, 4vw, 39px);
  }
  .coach-label {
    display: inline-block;
  }
  .coach-content {
    min-height: 130px;
  }
  .tool-button {
    font-size: 13px;
  }
  .learning-note {
    display: flex;
  }
}
@media (max-width: 640px) {
  html {
    scroll-padding-top: 80px;
  }
  .site-header {
    height: 67px;
  }
  .header-inner {
    padding: 0 15px;
    gap: 9px;
    flex-wrap: nowrap;
  }
  .brand {
    font-size: 23px;
    gap: 10px;
    letter-spacing: 0.5px;
    flex-shrink: 1;
  }
  .brand > span:not(.brand-seal) {
    display: block;
    gap: 0;
    min-width: 0;
  }
  .brand-seal {
    width: 34px;
    height: 37px;
    flex-shrink: 0;
    font-size: 27px;
  }
  .brand small {
    border: 0;
    padding: 0;
    margin-top: 3px;
    font-size: 10px;
    letter-spacing: 0.8px;
    line-height: 1.4;
  }
  .portal-user {
    gap: 8px;
    font-size: 12px;
    flex-shrink: 0;
  }
  .portal-user > span:not(.portal-avatar) {
    display: none;
  }
  .portal-avatar {
    width: 28px;
    height: 28px;
    font-size: 17px;
  }
  .portal-user button {
    font-size: 12px;
    min-height: 44px;
    white-space: nowrap;
  }
  .sidebar {
    top: auto;
    height: calc(67px + env(safe-area-inset-bottom));
    padding: 3px 0 env(safe-area-inset-bottom);
    gap: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    flex-direction: row;
    background: var(--c-shell);
    border-top: 1px solid var(--c-bronze);
    border-right: 0;
    box-shadow: 0 -3px 10px #16181024;
  }
  .sidebar:after {
    display: none;
  }
  .sidebar button {
    min-height: 59px;
    font-size: 11px;
    line-height: 1.5;
    padding: 6px 0;
    gap: 4px;
    flex: 1;
    border-radius: 0;
    color: var(--c-secondary);
  }
  .sidebar button svg {
    width: 20px;
    height: 20px;
  }
  .sidebar button.active {
    background: var(--c-selected);
    box-shadow: inset 0 2px var(--c-gold);
  }
  .sidebar .nav-spacer,
  .sidebar .nav-divider,
  .sidebar .secondary-nav {
    display: none;
  }
  .workspace {
    margin: 0;
    padding: 24px 17px calc(100px + env(safe-area-inset-bottom));
    max-width: none;
  }
  .portal-title {
    gap: 12px;
    margin-bottom: 22px;
    align-items: flex-start;
  }
  .portal-title h1 {
    font-size: 28px;
    line-height: 1.4;
    letter-spacing: 0.3px;
  }
  .portal-title p {
    font-size: 13px;
    line-height: 1.8;
    max-width: none;
    margin-top: 9px;
  }
  .portal-title .badge {
    display: none;
  }
  .portal-grid {
    gap: 17px;
  }
  .surface {
    padding: 21px;
    border-radius: 9px;
  }
  .surface h2 {
    font-size: 23px;
  }
  .surface p {
    font-size: 14px;
    line-height: 1.8;
  }
  .hero-surface {
    padding: 25px 22px;
    min-height: 294px;
  }
  .hero-surface h2 {
    font-size: 28px;
    max-width: none;
    margin-bottom: 13px;
    letter-spacing: 0.3px;
  }
  .hero-surface p {
    font-size: 14px;
    max-width: 95%;
    line-height: 1.75;
  }
  .hero-art {
    width: 55%;
    opacity: 0.42;
    mask-image: linear-gradient(90deg, transparent, #000 35%);
  }
  .hero-surface:after {
    background: linear-gradient(90deg, #3b3b32, transparent 90%);
  }
  .hero-surface .button-row {
    gap: 9px;
    margin-top: 21px;
  }
  .hero-surface .button {
    font-size: 13px;
    min-height: 44px;
    padding: 11px 13px;
  }
  .chips {
    gap: 6px;
    margin-top: 18px;
    max-width: none;
  }
  .chip {
    font-size: 12px;
    line-height: 1.5;
    padding: 2px 6px;
  }
  .hero-link {
    font-size: 13px;
    min-height: 40px;
    margin-top: 12px;
    color: var(--c-link);
  }
  .daily-surface {
    min-height: 240px;
    display: flex;
    padding: 23px;
    gap: 0;
  }
  .daily-surface h2 {
    font-size: 28px;
    margin-bottom: 17px;
  }
  .daily-surface .pill-group {
    margin: 0 0 15px;
    gap: 10px;
  }
  .pill-group button {
    min-height: 43px;
    font-size: 15px;
    min-width: 62px;
    padding: 8px 18px;
  }
  .daily-surface p {
    font-size: 14px;
  }
  .daily-surface .button {
    margin-top: 19px;
    min-height: 44px;
    width: 100%;
  }
  .daily-surface:before {
    inset: 0 0 0 30%;
    opacity: 0.24;
  }
  .section-heading {
    font-size: 22px;
    line-height: 1.5;
    margin: 25px 0 15px;
    gap: 12px;
  }
  .theme-grid {
    gap: 12px;
  }
  .theme-tile {
    min-height: 162px;
    padding: 13px;
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
  }
  .theme-preview {
    width: 62px;
    height: 72px;
    flex-basis: auto;
    flex-shrink: 0;
    border-width: 2px;
  }
  .theme-tile h3 {
    font-size: 18px;
    line-height: 1.4;
    margin: 0 0 6px;
    letter-spacing: 0;
  }
  .theme-tile p {
    font-size: 12px;
    line-height: 1.7;
  }
  .theme-tile .tile-arrow {
    position: absolute;
    right: 12px;
    top: 43px;
    margin: 0;
  }
  .dashboard-bottom {
    grid-template-columns: 1fr;
    gap: 17px;
    margin-top: 19px;
  }
  .dashboard-bottom > .surface {
    min-height: 172px;
    padding: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }
  .dashboard-bottom h2 {
    font-size: 22px;
  }
  .dashboard-bottom .empty-state {
    font-size: 13px;
    line-height: 1.8;
    flex-direction: column;
    align-items: start;
    padding: 3px 0;
    gap: 8px;
  }
  .dashboard-bottom .empty-state svg {
    width: 30px;
    height: 30px;
  }
  .dashboard-bottom > .surface > .button {
    font-size: 13px;
    min-height: 44px;
    padding: 10px 13px;
    margin: 0;
  }
  .theory-strip {
    margin-top: 19px;
    padding: 20px 22px;
    min-height: 108px;
    gap: 8px;
    align-items: flex-start;
    flex-direction: column;
  }
  .theory-strip strong {
    font-size: 21px;
  }
  .theory-strip p {
    font-size: 12px;
    line-height: 1.8;
  }
  .theory-strip .text-link {
    font-size: 13px;
    min-height: 38px;
  }
  .inline-fields {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .portal-row {
    padding: 17px;
    gap: 12px;
    align-items: center;
  }
  .portal-row .button {
    font-size: 12px;
    min-height: 44px;
    padding: 9px 12px;
  }
  .portal-row h3 {
    font-size: 15px;
  }
  .portal-row p {
    font-size: 12px;
    line-height: 1.8;
  }
  .row-tag {
    font-size: 12px;
    padding: 3px 6px;
  }
  .topic-grid {
    grid-template-columns: 1fr;
    gap: 17px;
  }
  .topic-card {
    padding: 22px;
  }
  .topic-card h3 {
    font-size: 23px;
  }
  .topic-card p {
    font-size: 14px;
  }
  .training-tabs {
    gap: 8px;
    margin: 20px 0 18px;
  }
  .training-tabs button {
    min-height: 44px;
    font-size: 13px;
    padding: 10px 13px;
  }
  .stats-grid {
    gap: 9px;
  }
  .stat-box {
    padding: 17px 12px;
  }
  .stat-box b {
    font-size: 27px;
  }
  .stat-box p {
    font-size: 12px;
    line-height: 1.7;
    margin-top: 8px;
  }
  .portal-form label {
    font-size: 14px;
  }
  .portal-form input,
  .portal-form select,
  .portal-form textarea,
  .portal-input {
    font-size: 14px;
    min-height: 46px;
  }
  .button {
    font-size: 14px;
    min-height: 44px;
    padding: 11px 15px;
  }
  .platform-dialog,
  .settings-dialog,
  .result-dialog {
    padding: 24px 21px;
    border-radius: 12px;
  }
  .platform-dialog h2,
  .dialog-header h2,
  .result-dialog h2 {
    font-size: 25px;
    line-height: 1.5;
  }
  .dialog-head button,
  .icon-button {
    min-height: 44px;
    min-width: 44px;
  }
  .page-heading {
    gap: 12px;
    margin-bottom: 19px;
  }
  .page-heading h1 {
    font-size: 25px;
  }
  .page-heading p {
    font-size: 12px;
    margin-top: 7px;
    max-width: 240px;
  }
  .page-heading > .button {
    font-size: 12px;
    min-height: 44px;
    padding: 10px 12px;
  }
  .board-caption {
    margin: 0 3px 13px;
  }
  .caption-tag {
    font-size: 12px;
  }
  .round-label {
    font-size: 12px;
  }
  .board-frame {
    padding: 9px;
  }
  .board-inner {
    background-size: 64px 54px;
  }
  .piece {
    font-size: clamp(22px, 6.25vw, 33px);
  }
  .player-row {
    gap: 9px;
  }
  .avatar {
    width: 33px;
    height: 33px;
    font-size: 20px;
  }
  .player-info strong {
    font-size: 13px;
  }
  .player-info > span {
    font-size: 12px;
  }
  .player-row.opponent {
    margin-bottom: 13px;
  }
  .player-row.self {
    margin-top: 17px;
  }
  .turn-badge {
    font-size: 12px;
    line-height: 1.5;
    padding: 6px 9px;
  }
  .player-status {
    font-size: 12px;
  }
  .board-toolbar {
    margin-top: 17px;
    padding-top: 9px;
    gap: 7px;
  }
  .toolbar-group {
    gap: 10px;
  }
  .tool-button {
    min-height: 44px;
    font-size: 12px;
    gap: 5px;
    padding: 7px 2px;
  }
  .tool-button svg {
    width: 16px;
    height: 16px;
  }
  .board-footnote {
    font-size: 12px;
    margin-top: 10px;
    line-height: 1.7;
  }
  .side-rail {
    grid-template-columns: 1fr;
    gap: 19px;
  }
  .coach-card {
    padding: 23px;
  }
  .coach-head h2 {
    font-size: 18px;
  }
  .coach-head p {
    font-size: 12px;
  }
  .coach-label {
    display: none;
  }
  .coach-content h3 {
    font-size: 25px;
  }
  .coach-content p {
    font-size: 14px;
    line-height: 1.9;
  }
  .coach-content {
    min-height: 0;
    margin-bottom: 13px;
  }
  .hint-button {
    font-size: 14px;
    min-height: 46px;
    margin-top: 14px;
  }
  .apply-hint {
    font-size: 14px;
    min-height: 44px;
  }
  .honest-note {
    font-size: 12px;
  }
  .quota-row {
    font-size: 13px;
  }
  .quota-display strong {
    font-size: 20px;
  }
  .move-list {
    height: 190px;
  }
  .move-row {
    min-height: 40px;
  }
  .move-cell {
    font-size: 14px;
  }
  .move-footer {
    padding: 12px 18px;
  }
  .replay-controls button {
    width: 39px;
    height: 44px;
  }
  .replay-controls span {
    font-size: 12px;
  }
  .bound-principle {
    min-height: 39px;
    font-size: 12px;
    padding: 8px 11px;
  }
  #sessionBanner .training-session {
    padding: 17px;
    font-size: 13px;
    gap: 9px;
  }
  .training-session h3 {
    font-size: 16px;
  }
  .training-session p {
    font-size: 12px;
  }
  .training-session .button {
    min-height: 44px;
    flex: 1;
    font-size: 12px;
  }
  .toast {
    font-size: 13px;
    bottom: 84px;
    padding: 11px 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
/* Panel headings are navigational landmarks, not metadata. */
.coach-head h2,
.card-heading h2 {
  font-size: 20px;
  line-height: 1.45;
  font-weight: 600;
}
@media (max-width: 1280px) {
  .coach-head h2 {
    font-size: 20px;
  }
  .coach-label {
    display: none;
  }
  .coach-head {
    gap: 9px;
  }
  .coach-icon {
    width: 32px;
    height: 35px;
    flex-shrink: 0;
  }
  .coach-head p {
    font-size: 12px;
  }
}
@media (max-width: 640px) {
  .coach-head h2,
  .card-heading h2 {
    font-size: 20px;
  }
  .coach-icon {
    width: 36px;
    height: 36px;
  }
  .theme-preview {
    width: 60px;
    height: 72px;
  }
}

.board-inner {
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.small-tag {
  font-size: 11px;
}
.red-text {
  color: var(--c-error);
}
fieldset label:has(input:checked) .red-text {
  color: #f0baa0;
}
.waiting-dot {
  animation: none;
}
.brand small {
  font-size: 12px;
}
@media (max-width: 640px) {
  .brand small {
    font-size: 11px;
    letter-spacing: 0.3px;
  }
}

@media (min-width: 1281px) {
  .portal-title {
    margin-bottom: 24px;
  }
  .section-heading {
    margin-top: 23px;
  }
  .theme-grid {
    gap: 16px;
  }
  .theory-strip {
    min-height: 76px;
    padding-block: 15px;
  }
  .dashboard-bottom {
    margin-top: 20px;
  }
}
