:root {
  color-scheme: light;
  --paper: #f6f2e9;
  --sheet: #fffdf7;
  --ink: #233c33;
  --ink-deep: #1e322a;
  --muted: #665f50;
  --line: #ded5c3;
  --red: #a43f2b;
  --red-dark: #903421;
  --serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', 'Noto Serif CJK SC', serif;
  --sans: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background: radial-gradient(ellipse at 30% 4%, #faf7ef, transparent 68%); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #a75c37; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, p, ol { margin: 0; }

.masthead { background: #fbf8f0; border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1360px; min-height: 76px; margin: auto; padding: 10px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { text-decoration: none; color: var(--ink-deep); display: inline-flex; align-items: center; gap: 11px; flex: none; }
.brand-seal { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 7px 5px 6px 5px; background: #a64331; color: #fff8e7; border: 1px solid #913523; outline: 1px solid #f7dbb9; outline-offset: -5px; font: 700 26px/1 var(--serif); }
.brand strong { display: block; font: 800 23px/1.2 var(--serif); letter-spacing: .08em; }
.brand small { display: block; font-size: .75rem; color: var(--muted); letter-spacing: .14em; margin-top: 4px; }
.header-tools { display: flex; align-items: center; gap: 17px; }
.text-button, .progress-link { border: 0; background: transparent; color: var(--muted); padding: 7px 4px; font-size: .875rem; white-space: nowrap; }
.text-button:hover, .progress-link:hover { color: var(--red); }
.nav-icon { display: inline-grid; place-items: center; color: var(--red); margin-right: 6px; }
.question-icon { font: 700 11px/1 var(--sans); border: 1px solid currentColor; border-radius: 50%; width: 15px; height: 15px; vertical-align: 1px; }
.outline-button, .primary-button, .soft-button { border-radius: 7px; min-height: 41px; padding: 9px 14px; font-size: .875rem; font-weight: 700; border: 1px solid; }
.outline-button { color: var(--red); border-color: #c89478; background: #fff9ec; white-space: nowrap; }
.outline-button:hover { background: #f8ead9; }
.primary-button { background: var(--red); border-color: var(--red-dark); color: #fff9ec; box-shadow: 0 2px 0 #78301e; }
.primary-button:hover { background: var(--red-dark); }
.primary-button:active { transform: translateY(1px); box-shadow: 0 1px 0 #78301e; }
.soft-button { background: #fffdf7; border-color: #d9cdb9; color: var(--ink); }
.soft-button:hover { background: #f2ecde; }
.primary-button:disabled, .soft-button:disabled { background: #eee8da; border-color: #ded3bf; box-shadow: none; color: #6a6154; transform: none; }

.page-shell { max-width: 1360px; padding: 0 28px 26px; margin: auto; }
.section-bar { display: flex; justify-content: space-between; align-items: center; min-height: 54px; }
.section-name { display: flex; align-items: center; gap: 10px; }
.section-name h1 { font: 800 1.29rem/1.2 var(--serif); letter-spacing: .1em; }
.section-mark { width: 16px; height: 16px; border: 1px solid #a67e58; border-radius: 3px; display: grid; place-items: center; transform: rotate(45deg) scale(.8); }
.section-mark::before { content: ''; width: 7px; height: 7px; border: 1px solid #a67e58; }
.progress-link { color: #5c6252; }
.footprint-icon { margin-right: 7px; font-weight: 700; color: var(--red); }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 321px; gap: 22px; align-items: start; }
.board-area { min-width: 0; }
.board {
  display: grid;
  grid-template-columns: 1.12fr repeat(9, 1fr) 1.12fr;
  grid-template-rows: repeat(11, minmax(0, 1fr));
  aspect-ratio: 1.48;
  padding: 6px;
  gap: 3px;
  border: 1px solid #9f8b69;
  border-radius: 10px;
  background: #d5c5a7;
  box-shadow: 0 3px 0 #b7a17c, 0 7px 19px #6c53331a;
  isolation: isolate;
}
.board-art { grid-area: 2 / 2 / 11 / 11; position: relative; display: grid; place-items: center; overflow: hidden; background: #e5cfab url('shanshui.jpg') 52% 54% / cover no-repeat; border: 1px solid #9e9475; }
.board[data-layout='double'] {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(12, minmax(0, 1fr));
  background: #d8c8a8;
  aspect-ratio: 1.48;
}
.inner-track {
  grid-area: 2 / 2 / 12 / 12;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  margin: 9px;
  background: #9bac90;
  border: 1px solid #667f67;
  border-radius: 6px;
  box-shadow: 0 0 0 3px #e3d8bdbd;
}
.inner-track .board-art { grid-area: 2 / 2 / 8 / 8; }
.inner-track .tile-province { background: #f4f8ef; border-color: #a5b399; }
.inner-track .tile-province:hover, .inner-track .tile.is-owned { background: var(--region-wash); }
.inner-track .board-title { top: 21%; }
.inner-track .wordmark { font-size: clamp(1.7rem, 4.4vw, 3.95rem); }
.inner-track .art-note { bottom: 12px; left: 12px; }
.art-line { position: absolute; inset: 9px; border: 1px solid #f8edd69c; pointer-events: none; }
.board-title { position: absolute; top: 24%; left: 54%; transform: translateX(-50%); text-align: center; color: #20352c; width: 88%; }
.title-kicker { display: flex; align-items: center; justify-content: center; gap: 10px; color: #3c4f40; font-size: clamp(.68rem, 1.15vw, .9rem); letter-spacing: .22em; margin-bottom: 11px; }
.title-kicker span { width: 25px; height: 1px; background: #5d674b90; }
.wordmark { display: inline-block; position: relative; padding-left: .12em; font: 900 clamp(1.6rem, 5.15vw, 4.5rem)/1.12 var(--serif); letter-spacing: .11em; white-space: nowrap; text-shadow: 0 2px #f6e5bc80; }
.wordmark sup { display: inline-grid; place-items: center; position: absolute; top: -2px; right: -1.55em; width: 1.55em; height: 1.65em; font: 800 .23em/1 var(--serif); letter-spacing: 0; color: #fff2d8; outline: 1px solid #ffe0b8; outline-offset: -3px; background: #a3402b; border-radius: 2px; transform: rotate(6deg); text-shadow: none; }
.board-title p { font-family: var(--serif); font-weight: 700; color: #39483a; font-size: clamp(.65rem, 1.32vw, 1.05rem); margin-top: 15px; letter-spacing: .21em; text-shadow: 0 1px 3px #ffedc6; }
.art-note { position: absolute; left: 17px; bottom: 17px; font-size: .75rem; letter-spacing: .05em; color: #fff4da; background: #243d32e6; border: 1px solid #b9ad86; border-radius: 4px; padding: 6px 9px; }
.art-note span { display: inline-block; height: 6px; width: 6px; border: 1px solid #f6c492; transform: rotate(45deg); margin: 0 8px 2px 2px; }

.tile { position: relative; min-height: 0; min-width: 0; border: 1px solid #bcae90; background: var(--sheet); padding: 7px 3px 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.12; text-align: center; color: var(--ink-deep); }
.tile-province::before { content: ''; position: absolute; top: 0; inset-inline: 0; height: 3px; background: var(--region-color); }
.tile:hover { background: var(--region-wash, #f4e4ca); z-index: 2; border-color: var(--region-color, #976746); }
.tile:focus-visible { z-index: 4; outline-offset: -2px; }
.tile-name { font-size: .91rem; font-weight: 800; letter-spacing: .035em; white-space: nowrap; }
.tile-short { display: none; }
.tile-culture { font-size: .69rem; color: #5e5b50; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tile-cost { font-size: .66rem; color: var(--region-color); font-weight: 700; white-space: nowrap; }
.tile-special { background: #ecdfc4; padding-top: 3px; gap: 2px; border-color: #b3a17f; }
.tile-special .tile-name { font-family: var(--serif); font-weight: 800; }
.tile-icon { display: grid; place-items: center; color: #805039; width: 23px; height: 22px; border: 1px solid #aa8461; border-radius: 4px; font: 800 .9rem/1 var(--serif); }
.tile-start { background: #f1dfd2; }
.tile-start .tile-name, .tile-start .tile-icon { color: #8d3728; }
.tile-start .tile-icon { border-color: #a64d3f; }
.tile-transfer { background: #dce8d8; border-color: #6e8e77; color: #254c3b; }
.tile-transfer:hover { background: #c9dec9; border-color: #346951; }
.tile-transfer .tile-icon { background: #3b6b55; color: #fff9e8; border-color: #315d49; }
.tile-transfer .tile-culture { color: #305e48; }
.tile-mini-label { display: none; }
.board[data-layout='double'] .tile { padding: 4px 2px 1px; gap: 0; }
.board[data-layout='double'] .tile-name { font-size: .84rem; line-height: 1.08; }
.board[data-layout='double'] .tile-culture, .board[data-layout='double'] .tile-cost { font-size: .65rem; line-height: 1.04; }
.board[data-layout='double'] .tile-special { padding: 2px 0; }
.board[data-layout='double'] .tile-special .tile-name { font-size: .75rem; }
.board[data-layout='double'] .tile-icon { width: 19px; height: 17px; font-size: .74rem; }
.board[data-layout='double'] > .tile-special .tile-culture { display: none; }
.tile.is-current { box-shadow: inset 0 0 0 2px var(--marker-color); z-index: 1; }
.tile.is-owned { background: var(--region-wash); }
.board .tile.is-mine { background: #fff0c8; border-color: #865222; box-shadow: inset 0 0 0 2px #b76f30, 0 0 0 1px #fff8df; z-index: 3; }
.board .tile.is-moving { background: #fff1cf; box-shadow: 0 0 0 2px var(--marker-color), 0 0 0 4px #fff7df; z-index: 6; }
.board .tile.is-landing { z-index: 5; }
.board .tile.is-located { z-index: 7; }
.tile.is-landing::after, .tile.is-located::after { content: ''; position: absolute; inset: -3px; border: 2px solid #a4511d; border-radius: 4px; box-shadow: 0 0 0 2px #ffefae; pointer-events: none; }
.tile.is-landing::after { animation: landing-ring 1.45s ease-out 2; }
@keyframes landing-ring { from { box-shadow: 0 0 0 2px #ffefae; } to { box-shadow: 0 0 0 8px #ffefae00; } }
.tile-rent { color: var(--marker-owner); }
.markers { display: flex; flex-wrap: wrap; justify-content: flex-end; position: absolute; right: 0; bottom: 0; max-width: 40px; padding: 1px; pointer-events: none; }
.markers:empty { display: none; }
.token { border-radius: 50%; place-items: center; display: inline-grid; width: 18px; height: 18px; background: var(--token-color); color: white; border: 1px solid #fff7e9; box-shadow: 0 1px 2px #342b2570; font-size: .68rem; line-height: 1; font-weight: 800; }
.my-pawn, .moving-pawn, .tile-landing { position: absolute; pointer-events: none; }
.my-pawn { display: grid; place-items: center; inset-block-start: -6px; inset-inline-end: -4px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff7d5; background: #844715; color: #fff9eb; box-shadow: 0 1px 3px #51341974; font-size: .73rem; font-weight: 800; }
.moving-pawn { inset-block-start: 50%; inset-inline-start: 50%; transform: translate(-50%, -50%); z-index: 3; }
.moving-pawn .token { width: 32px; height: 32px; border-width: 2px; box-shadow: 0 0 0 3px #ffcf63, 0 2px 6px #35281ac2; font-size: .93rem; }
.tile-landing { inset-block-end: -7px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 2; padding: 2px 5px; border: 1px solid #ffe5aa; border-radius: 4px; background: #884319; color: #fff9e7; font-size: .65rem; font-weight: 700; white-space: nowrap; }
.marker-owned { position: absolute; bottom: 0; left: 0; padding: 2px 3px; border-top-right-radius: 4px; background: var(--marker-owner); color: #fff; font: 700 9px/1 var(--sans); }
.tile:has(.markers:not(:empty)) .tile-culture { opacity: .85; }
.legend { display: flex; flex-wrap: wrap; gap: 9px 18px; padding: 16px 2px 3px; font-size: .79rem; color: #5f5b4d; }
.legend-item { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.legend-color { width: 9px; height: 9px; border-radius: 2px; background: var(--region-color); }
.transfer-key { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 3px; background: #3b6b55; color: #fff9e8; font-size: .7rem; }
.track-key { color: #315d49; font-weight: 700; }

.sidebar { display: grid; gap: 14px; }
.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; padding: 15px 16px 16px; box-shadow: 0 2px 4px #5143260a; min-width: 0; }
.turn-panel { border-top: 3px solid #a64e3b; padding-top: 12px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 12px; }
.panel-heading h2 { font: 800 1.06rem/1.2 var(--serif); letter-spacing: .075em; white-space: nowrap; }
.round-pill { background: #f3e7da; color: #793e2c; border: 1px solid #ead8c6; padding: 4px 8px; white-space: nowrap; border-radius: 4px; font-size: .76rem; }
.turn-person { display: flex; align-items: center; gap: 9px; min-height: 40px; border-top: 1px solid #eae3d4; padding-top: 8px; }
.turn-person .token, .player-row .token { width: 32px; height: 32px; font-size: .97rem; flex: none; }
.person-name { font-weight: 800; color: var(--ink); }
.person-place { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.play-area { margin: 12px 0; padding: 12px 10px; border: 1px solid #e7ddca; border-radius: 6px; background: #f8f2e5; text-align: center; }
.dice { display: flex; justify-content: center; gap: 10px; margin-bottom: 9px; }
.die { width: 44px; height: 44px; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); place-items: center; padding: 6px; background: #fffdf7; color: var(--ink); border: 1px solid #d6c8ae; border-radius: 9px; box-shadow: 0 3px 0 #d7c7aa; }
.die:first-child { transform: rotate(-8deg); }
.die:last-child { transform: rotate(8deg); }
.die.rolling { animation: jiggle .23s infinite alternate ease-in-out; }
.die.rolling:last-child { animation-delay: -.12s; }
.die[data-value='0']::after { content: '?'; grid-area: 2 / 2; color: var(--muted); font-size: .9rem; font-weight: 800; line-height: 1; }
.pip { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.die[data-value='1'] .pip { background: var(--red); width: 7px; height: 7px; }
@keyframes jiggle { from { transform: rotate(-15deg) translateY(2px); } to { transform: rotate(14deg) translateY(-3px); } }
.turn-message { color: var(--muted); font-size: .88rem; line-height: 1.48; min-height: 1.3em; }
.turn-message strong { color: var(--ink); }
.message-detail { display: block; margin-top: 3px; font-size: .82rem; }
.quiz-option { display: block; width: 100%; text-align: left; margin-top: 6px; }
.turn-actions { display: flex; flex-wrap: wrap; gap: 8px; min-height: 41px; }
.turn-actions > button { flex: 1 1 auto; }
.turn-actions .quiz-option { flex-basis: 100%; }
.my-location { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 12px; padding: 7px 9px; border: 1px solid #d0a66c; border-radius: 6px; text-align: left; background: #fbefcf; color: #573619; }
.my-location:hover:not(:disabled) { background: #f4dfab; }
.my-location:disabled { cursor: default; background: #f3ede0; border-color: var(--line); color: var(--muted); }
.my-location-mark { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; background: #844715; color: #fff9eb; font-size: .76rem; font-weight: 800; }
.my-location:disabled .my-location-mark { background: #70695b; }
.my-location-copy { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 7px; min-width: 0; font-size: .78rem; }
.my-location-copy strong { font-size: .88rem; overflow-wrap: anywhere; }
.my-location-action { margin-inline-start: auto; font-size: .78rem; font-weight: 700; white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; }
.my-location:disabled .my-location-action { visibility: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.panel-meta { color: var(--muted); font-size: .76rem; }
.player-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 6px; border-top: 1px solid #eee6d7; }
.player-row.is-active { background: #f5efe3; border-radius: 5px; border-top-color: transparent; }
.player-row.is-bankrupt .token { filter: grayscale(1); }
.player-row.is-bankrupt .person-name { color: var(--muted); }
.player-row .person-name { font-size: .87rem; }
.balance { text-align: right; font-weight: 800; font-size: .89rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.balance small { display: block; font-size: .7rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
.negative { color: var(--red-dark); }
.small-button { font-size: .76rem; padding: 3px 0; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li { display: grid; grid-template-columns: 8px 1fr; align-items: start; gap: 7px; color: #595446; font-size: .82rem; line-height: 1.51; padding: 6px 0; border-top: 1px solid #eee6d7; }
.activity li::before { content: ''; width: 5px; height: 5px; margin-top: .57em; background: var(--marker-color, #a77d55); border-radius: 50%; }

dialog { width: min(580px, calc(100% - 24px)); max-height: min(86vh, 780px); background: var(--sheet); color: var(--ink); border: 1px solid #b8a789; border-top: 4px solid var(--red); border-radius: 11px; padding: 0; box-shadow: 0 20px 70px #29211765; }
dialog::backdrop { background: #24271fd0; }
.dialog-shell { padding: 24px 26px 27px; position: relative; }
.close-button { position: absolute; right: 13px; top: 12px; width: 36px; height: 36px; border: 1px solid #ded3bf; border-radius: 50%; background: #f6eee1; font-size: 24px; line-height: 1; color: #68523f; }
.close-button:hover { background: #ebddc6; }
#dialog-title { padding-right: 39px; font: 800 1.75rem/1.24 var(--serif); letter-spacing: .06em; }
.dialog-summary { color: var(--muted); line-height: 1.65; margin-top: 8px; }
.dialog-kicker { color: var(--red); font-size: .8rem; margin-bottom: 8px; letter-spacing: .1em; }
.dialog-fact { margin: 15px 0; padding: 15px; background: #f6f0e2; border-inline-start: 3px solid var(--region-color, #a64e3b); line-height: 1.72; }
.dialog-culture { display: block; font-weight: 800; margin-bottom: 3px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 19px; }
.property-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: 6px; }
.property-stats div { padding: 10px 8px; min-width: 0; }
.property-stats div + div { border-left: 1px solid var(--line); }
.property-stats dt { font-size: .76rem; color: var(--muted); }
.property-stats dd { font-size: .95rem; margin: 4px 0 0; color: var(--ink); font-weight: 800; }
.rules-list { margin: 14px 0 0; padding-left: 1.25em; color: #4d4c40; line-height: 1.65; }
.rules-list li + li { margin-top: .64em; }
.setup-form { margin-top: 16px; display: grid; gap: 12px; }
.field { display: grid; gap: 5px; font-size: .875rem; font-weight: 700; }
.field select, .almanac-search { width: 100%; border: 1px solid #c9b99d; background: #fffcf4; border-radius: 6px; min-height: 40px; padding: 6px 10px; font-size: .95rem; }
.field select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, #795e47 50%), linear-gradient(135deg, #795e47 50%, transparent 50%); background-size: 6px 6px; background-repeat: no-repeat; background-position: calc(100% - 16px) 16px, calc(100% - 10px) 16px; }
.almanac-search { margin: 13px 0; }
.almanac-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.almanac-tile { background: var(--region-wash); border: 1px solid #d9cdb7; border-inline-start: 3px solid var(--region-color); border-radius: 4px; padding: 8px 9px; width: 100%; text-align: left; min-height: 42px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 8px; }
.almanac-tile:hover { border-color: var(--region-color); }
.almanac-tile small { color: #4e5043; }
.visited { margin-left: auto; color: #285440; font-size: .8rem; }
.source-notes { margin-top: 16px; line-height: 1.6; color: var(--muted); font-size: .82rem; }
.source-notes a { color: #275a49; }
.ranking { margin-top: 14px; }
.ranking li { padding: 8px 0; border-top: 1px solid var(--line); }
.no-script { padding: 18px; color: var(--red); text-align: center; }

.lobby-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 350px); gap: 22px; align-items: start; margin-top: 26px; }
.lobby-art { position: relative; min-height: clamp(350px, 50vw, 550px); background: #e5cfab url('shanshui.jpg') 50% 56% / cover no-repeat; border: 1px solid #9f8b69; border-radius: 10px; box-shadow: 0 3px 0 #b7a17c; }
.lobby-art .art-line { border-radius: 5px; }
.lobby-title { color: #20352c; text-align: center; position: absolute; inset: 21% 7% auto 15%; }
.lobby-title h1 { display: inline-block; position: relative; white-space: nowrap; padding-left: .1em; font: 900 clamp(2rem, 5vw, 4.8rem)/1.19 var(--serif); letter-spacing: .1em; }
.lobby-title h1 sup { position: absolute; right: -1.4em; top: 1px; background: var(--red); color: #fff2d8; border-radius: 2px; padding: .26em; font-size: .24em; line-height: 1; letter-spacing: 0; outline: 1px solid #ffe0b8; outline-offset: -2px; transform: rotate(6deg); }
.lobby-title p { font-size: clamp(.8rem, 1.2vw, 1.05rem); color: #2c4738; text-shadow: 0 1px 4px #f5deb4; }
.lobby-title p:first-child { margin-bottom: 13px; font-weight: 700; }
.lobby-title p:last-child { margin-top: 16px; }
.lobby-panel { padding: 20px; border-top: 3px solid #a64e3b; }
.mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #eee7d8; border-radius: 8px; padding: 4px; }
.mode-switch button { padding: 9px 4px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 700; }
.mode-switch button[aria-pressed='true'] { background: var(--sheet); color: var(--red); border-color: #dac9ad; }
.field input, .share-field { width: 100%; border: 1px solid #c9b99d; background: #fffcf4; border-radius: 6px; min-height: 42px; padding: 7px 10px; font-size: .94rem; font-weight: 400; }
.room-kicker { font-size: .8rem; color: var(--muted); }
.room-code { font: 800 1.75rem/1.35 var(--sans); letter-spacing: .12em; overflow-wrap: anywhere; margin: 2px 0 9px; }
.room-roster { margin: 12px 0; padding: 0; list-style: none; }
.room-roster li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.room-roster .token { width: 24px; height: 24px; flex: none; }
.room-roster small { color: var(--muted); margin-left: auto; text-align: right; white-space: nowrap; }
.wide-button { width: 100%; }
.resume-seat { margin-bottom: 12px; }
.players-tools { display: flex; align-items: center; gap: 10px; }
.waiting-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.recovery-input { margin-top: 5px; font-family: ui-monospace, Consolas, monospace; }
.room-message { font-size: .84rem; margin-top: 9px; color: var(--red-dark); overflow-wrap: anywhere; }
.room-message:empty { display: none; }
.arena-tools { display: flex; align-items: center; gap: 12px; }
.arena-tools button { overflow-wrap: anywhere; }
#turn-clock { color: var(--red-dark); font-variant-numeric: tabular-nums; font-weight: 700; margin-left: 6px; white-space: nowrap; }
.person-name { overflow-wrap: anywhere; }

.match-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; grid-column: 1 / -1; }
.match-tools .soft-button { flex: 1 1 auto; min-height: 34px; padding: 5px 8px; font-size: .79rem; }
.match-tools .has-proposals { background: #f8e5d7; border-color: #b65b46; color: var(--red-dark); }
.team-badge { display: inline-block; padding: 2px 6px; border-radius: 4px; background: var(--team-wash); color: var(--team-color); font-size: .7rem; font-weight: 750; white-space: nowrap; }
.play-copy { margin: 8px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.mission-stops, .trade-inbox { display: grid; gap: 7px; margin: 12px 0; padding: 0; list-style: none; }
.mission-stops li, .trade-inbox li { padding: 9px 11px; background: #f7f1e4; border: 1px solid #ded1b9; border-radius: 6px; }
.mission-stops li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mission-stops small { display: block; margin-top: 2px; color: var(--muted); }
.mission-stamp { white-space: nowrap; font-size: .75rem; color: var(--muted); }
.mission-stamp.is-stamped { color: #35634f; font-weight: 750; }
.trade-inbox:empty { display: none; }
.trade-inbox p { margin: 3px 0 7px; overflow-wrap: anywhere; }
.trade-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.trade-actions button { min-height: 36px; padding: 5px 10px; }
.deck-link { margin-top: 10px; color: #386052; }
.journey-kit { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-column: 1 / -1; gap: 6px; margin-top: 8px; }
.journey-kit button { display: grid; gap: 1px; min-height: 47px; padding: 5px 9px; border: 1px solid #a9b59a; border-radius: 6px; background: #edf0e2; color: #274c3b; text-align: left; }
.journey-kit button:hover { background: #e2e9d6; }
.journey-kit span { font-size: .7rem; color: #526751; }
.journey-kit strong { font-size: .92rem; }
.journey-kit .can-claim { border-color: #b16d4b; background: #f9e9d7; color: #873d25; }
.tile.is-home { outline: 2px solid #55723d; outline-offset: -2px; }
.home-pin, .reservation-pin { position: absolute; inset-block-start: 2px; inset-inline-start: 2px; z-index: 2; min-width: 12px; padding: 1px 2px; border-radius: 3px; background: #496735; color: #fff9e9; font-size: .57rem; line-height: 1; }
.reservation-pin { inset-block-start: auto; inset-block-end: 1px; background: #805428; }
.skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 13px; align-items: stretch; }
.skill-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 1px solid #c8b792; border-radius: 8px; padding: 8px; background: #fbf2dd; box-shadow: inset 0 0 0 2px #fcf7e9; }
.skill-card[data-card-type='点名'], .skill-card[data-card-type='群扣'] { border-color: #bc8d72; }
.skill-card-top { display: flex; justify-content: space-between; padding: 0 3px; color: #536648; font-size: .72rem; font-weight: 750; letter-spacing: .05em; }
.skill-card[data-card-type='点名'] .skill-card-top, .skill-card[data-card-type='群扣'] .skill-card-top { color: #883d2d; }
.skill-art { width: min(100%, 145px); aspect-ratio: 1; align-self: center; border-radius: 50%; background: #efe2c9 url("card-art.jpg") no-repeat var(--art-x) var(--art-y) / 500% 400%; }
.skill-card h3 { margin: 1px 0 0; color: #294337; font-size: 1.02rem; text-align: center; }
.skill-card p { flex: 1 0 auto; margin: 0 0 3px; color: #554835; font-size: .83rem; line-height: 1.52; }
.skill-card button { width: 100%; min-height: 38px; padding: 5px 6px; font-size: .82rem; overflow-wrap: anywhere; }
.skill-use { display: grid; gap: 7px; }
.skill-option select { min-width: 0; }
.skill-unavailable { color: #6d604d; font-size: .73rem; text-align: center; }
.debt-list { display: grid; gap: 7px; list-style: none; padding: 0; }
.debt-list li { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 8px; border: 1px solid #d9c9a9; border-radius: 6px; background: #f9efdc; }
.debt-list small { display: block; color: var(--muted); }
.debt-list button { flex: none; }
@media (max-width: 410px) {
  .skill-grid { gap: 7px; }
  .skill-card { padding: 6px; }
  .home-pin, .reservation-pin { inset-inline-start: 0; min-width: 9px; font-size: .48rem; }
}

@media (max-width: 1100px) {
  .page-shell, .header-inner { padding-inline: 20px; }
  .game-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 15px; }
  .board { aspect-ratio: 1.29; }
  .board[data-layout='double'] { aspect-ratio: 1.24; }
  .tile-name { font-size: .82rem; }
  .board[data-layout='double'] .tile-special .tile-name { font-size: .71rem; }
  .tile-culture, .tile-cost { font-size: .62rem; }
  .wordmark { font-size: clamp(1.6rem, 4.95vw, 3.5rem); }
}
@media (max-width: 1030px) {
  .board[data-layout='double'] > .tile-province .tile-culture { display: none; }
}
@media (max-width: 850px) {
  .lobby-layout { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
  .lobby-art { min-height: clamp(190px, 43vw, 320px); }
  .lobby-title h1 { font-size: clamp(1.9rem, 7vw, 3.8rem); }
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: contents; }
  .turn-panel { grid-row: 1; display: grid; grid-template-columns: minmax(115px, 1fr) minmax(0, 1.35fr) minmax(116px, 1fr); gap: 8px 12px; align-items: center; padding: 9px 12px 11px; }
  .turn-panel .panel-heading { grid-column: 1 / -1; margin-bottom: 0; }
  .turn-panel .room-message { grid-column: 1 / -1; }
  .turn-panel .turn-person { border-top: 0; padding-top: 0; }
  .turn-panel .my-location { grid-column: 1 / -1; margin-top: 0; }
  .turn-panel .play-area { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px; text-align: left; }
  .turn-panel .dice { gap: 6px; margin-bottom: 0; }
  .turn-panel .die { width: 29px; height: 29px; padding: 3px; border-radius: 6px; }
  .turn-panel .pip { width: 4px; height: 4px; }
  .turn-panel .die[data-value='1'] .pip { width: 5px; height: 5px; }
  .turn-panel .turn-message { font-size: .76rem; }
  .turn-panel .message-detail { font-size: .73rem; }
  .board-area { grid-row: 2; }
  .board { aspect-ratio: 1.29; }
  .board[data-layout='double'] { aspect-ratio: 1.19; }
  .inner-track { margin: 6px; }
  .wordmark { font-size: clamp(1.7rem, 7vw, 3.8rem); }
  .tile { padding: 4px 1px 2px; gap: 0; }
  .tile-name { font-size: .8rem; }
  .tile-culture, .tile-cost { font-size: .62rem; }
  .tile-special { padding: 2px 0; }
  .tile-special .tile-name { font-size: .71rem; }
  .tile-special .tile-culture { display: none; }
  .tile-icon { width: 17px; height: 17px; font-size: .72rem; }
}
@media (max-width: 720px) {
  .tile-culture { display: none; }
}
@media (max-width: 560px) {
  .lobby-panel { padding: 15px; }
  .arena-tools { gap: 4px; }
  #arena-code { font-size: .7rem; }
  .header-inner { min-height: 62px; padding: 8px 9px; gap: 6px; }
  .page-shell { padding-inline: 9px; }
  .brand { gap: 6px; }
  .brand-seal { width: 32px; height: 32px; font-size: 19px; }
  .brand strong { font-size: .98rem; letter-spacing: 0; }
  .brand small { margin-top: 2px; font-size: .59rem; letter-spacing: .06em; }
  .header-tools { gap: 4px; }
  .header-tools button { font-size: .74rem; padding-inline: 4px; }
  .new-button { min-height: 33px; padding-block: 4px; }
  .new-button > span, .nav-icon { display: none; }
  .section-bar { min-height: 44px; }
  .section-name { gap: 5px; }
  .section-name h1 { font-size: 1.04rem; }
  .progress-link { font-size: .75rem; }
  .board { aspect-ratio: 1.04; gap: 1px; padding: 3px; border-radius: 6px; }
  .board[data-layout='double'] { aspect-ratio: 1.03; }
  .inner-track { margin: 4px; padding: 1px; gap: 1px; box-shadow: none; border-radius: 3px; }
  .inner-track .wordmark { font-size: clamp(1.25rem, 6.7vw, 2.2rem); }
  .inner-track .title-kicker { font-size: .64rem; letter-spacing: .12em; }
  .inner-track .board-title p { font-size: .61rem; white-space: nowrap; }
  .tile { padding: 3px 0 0; }
  .tile-name { font-size: .73rem; letter-spacing: 0; }
  .tile-full:has(+ .tile-short) { display: none; }
  .tile-short { display: inline; }
  .tile-province::before { height: 2px; }
  .tile-special { padding: 0; }
  .tile-special .tile-name, .tile-culture, .tile-cost { display: none; }
  .tile-icon { width: 19px; height: 19px; font-size: .74rem; }
  .board[data-layout='double'] .tile-transfer .tile-icon { width: 15px; height: 14px; font-size: .63rem; }
  .tile-transfer .tile-mini-label { display: block; font-weight: 700; font-size: .59rem; }
  .board[data-layout='double'] .tile-name { font-size: .66rem; }
  .board[data-layout='double'] .tile { padding: 3px 0 0; }
  .board[data-layout='double'] .tile-special { padding: 0; }
  .art-line { inset: 4px; }
  .board-title { top: 25%; }
  .title-kicker { margin-bottom: 7px; gap: 5px; }
  .title-kicker span { width: 14px; }
  .board-title p { margin-top: 8px; letter-spacing: .1em; }
  .art-note { display: none; }
  .markers { max-width: 30px; padding: 0; }
  .markers .token { width: 12px; height: 12px; font-size: .52rem; border-width: 1px; }
  .my-pawn { width: 17px; height: 17px; inset-block-start: -4px; inset-inline-end: -3px; border-width: 1px; font-size: .6rem; }
  .moving-pawn .token { width: 24px; height: 24px; font-size: .73rem; }
  .tile-landing { inset-block-end: -6px; padding: 1px 3px; font-size: .54rem; }
  .marker-owned { font-size: 7px; padding: 1px; }
  .legend { padding: 10px 1px 0; gap: 5px 12px; font-size: .72rem; }
  .legend-color { width: 7px; height: 7px; }
  .game-layout { gap: 12px; }
  .turn-panel { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 8px 10px; }
  .turn-panel .panel-heading, .turn-actions { grid-column: 1 / -1; margin-bottom: 0; }
  .turn-panel .turn-person { border: 0; padding-top: 5px; }
  .turn-panel .play-area { display: block; text-align: center; }
  .turn-panel .dice { margin-bottom: 5px; }
  .turn-panel .die { box-shadow: 0 2px 0 #d7c7aa; }
  .dialog-shell { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile.is-landing::after { animation: none; }
  .die.rolling { animation: none; }
  .primary-button:active { transform: none; }
}
