/* 首页已并入 B 海克斯交互 + D 中国版棋盘的唯一正式入口。 */

body[data-view="home"] { overflow: hidden; }
body[data-texture="off"] .page-grain { display: none; }

.home-screen {
  position: fixed;
  inset: 0;
  z-index: 55;
  isolation: isolate;
  min-height: 100svh;
  padding: clamp(66px, 8vh, 84px) 24px clamp(28px, 4vh, 42px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(26px, 3.6vh, 38px);
  overflow: auto;
  background:
    radial-gradient(circle at 50% 44%, rgba(38, 114, 85, .2) 0%, rgba(18, 68, 51, .1) 36%, rgba(8, 36, 28, 0) 68%),
    linear-gradient(180deg, var(--bg-main) 0%, #0a2d23 72%, var(--bg-deep) 100%);
}

.home-screen[hidden],
.home-panel[hidden] { display: none !important; }

.home-screen button:focus-visible,
.home-screen input:focus-visible,
.home-screen select:focus-visible {
  outline: 2px solid rgba(213, 177, 96, .72);
  outline-offset: 3px;
}

.home-frame {
  position: fixed;
  inset: 14px;
  z-index: 1;
  pointer-events: none;
  border: 1px solid rgba(213, 177, 96, .25);
}

.home-frame > i { position: absolute; width: 30px; height: 30px; }
.home-frame > i::before,
.home-frame > i::after { content: ""; position: absolute; background: rgba(213, 177, 96, .5); }
.home-frame > i::before { width: 24px; height: 1px; top: 7px; left: 0; }
.home-frame > i::after { width: 1px; height: 24px; top: 0; left: 7px; }
.home-frame > i:nth-child(1) { left: -1px; top: -1px; }
.home-frame > i:nth-child(2) { right: -1px; top: -1px; transform: rotate(90deg); }
.home-frame > i:nth-child(3) { right: -1px; bottom: -1px; transform: rotate(180deg); }
.home-frame > i:nth-child(4) { left: -1px; bottom: -1px; transform: rotate(270deg); }

.home-studio {
  position: fixed;
  top: 36px;
  left: 42px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--gold-muted);
  font: 500 10px/1 var(--font-mono);
  letter-spacing: .3em;
  opacity: .78;
}

.home-studio svg { width: 34px; height: 34px; }
.home-studio svg path:first-child { fill: rgba(8, 36, 28, .58); stroke: var(--gold-muted); stroke-width: 1.25; }
.home-studio svg path:last-child { fill: var(--gold-muted); }

.home-settings-trigger {
  position: fixed;
  top: 34px;
  right: 42px;
  z-index: 4;
  min-height: 40px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  border: 1px solid rgba(213, 177, 96, .24);
  background: rgba(8, 36, 28, .2);
  font-size: 12px;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.home-settings-trigger svg { width: 19px; height: 19px; }
.home-settings-trigger svg circle,
.home-settings-trigger svg path { fill: none; stroke: var(--gold-muted); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.home-settings-trigger:hover { color: var(--text-primary); border-color: var(--gold-line); background: rgba(27, 91, 69, .34); }
.home-settings-trigger:active { transform: translateY(1px); }

.home-atlas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.home-atlas::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 0 34%, rgba(8, 36, 28, .06) 60%, rgba(8, 36, 28, .24) 100%),
    linear-gradient(180deg, rgba(8, 36, 28, 0), rgba(8, 36, 28, .16));
}

.home-atlas svg { width: 100%; height: 100%; display: block; }
.home-atlas .atlas-hexes { stroke: rgba(213, 177, 96, .11); stroke-width: 1; fill: none; opacity: .34; }
.home-atlas .atlas-terrain path {
  fill: rgba(8, 36, 28, .34);
  stroke: rgba(213, 177, 96, .08);
  stroke-width: 1.2;
  opacity: .5;
}
.home-atlas .atlas-routes path {
  fill: none;
  stroke: rgba(213, 177, 96, .42);
  stroke-width: 1.4;
  stroke-dasharray: 6 9;
  marker-end: url(#homeRouteArrow);
  opacity: .5;
  animation: homeRouteDrift 34s linear infinite;
}
.home-atlas .atlas-routes path:nth-child(2) { animation-duration: 44s; animation-direction: reverse; opacity: .35; }
.home-atlas .atlas-routes path:nth-child(3) { animation-duration: 52s; opacity: .28; }
.home-atlas .atlas-nodes circle { fill: var(--gold-main); stroke: rgba(213, 177, 96, .35); stroke-width: 8; opacity: .58; }
.home-atlas .atlas-plane { fill: var(--gold-main); opacity: .42; }
.home-atlas .atlas-stamp path { fill: rgba(8, 28, 19, .46); stroke: rgba(212, 168, 78, .26); stroke-width: 1.5; }
.home-atlas .atlas-stamp text { fill: rgba(212, 168, 78, .4); font: 600 13px var(--font-mono); text-anchor: middle; letter-spacing: .08em; }
.home-atlas .landmark-cell { fill: rgba(7, 25, 17, .46); stroke: rgba(212, 168, 78, .32); stroke-width: 1.5; }
.home-atlas .landmark-icon { fill: none; stroke: rgba(212, 168, 78, .42); stroke-width: 2; }
body[data-route-motion="off"] .home-atlas .atlas-routes path { animation: none; }

.home-copy {
  position: relative;
  z-index: 2;
  width: min(850px, 100%);
  display: grid;
  justify-items: center;
  text-align: center;
}

.home-mark {
  width: 88px;
  height: 88px;
  margin: 0 0 clamp(14px, 2vh, 19px);
  filter: drop-shadow(0 0 10px rgba(213, 177, 96, .12));
}
.home-mark svg { width: 100%; height: 100%; }
.home-mark path:first-child { fill: none; stroke: var(--gold-main); stroke-width: 1.25; }
.home-mark path:last-child { fill: var(--gold-main); opacity: .9; }

.home-copy h1 {
  margin: 0;
  color: var(--text-primary);
  font: 500 clamp(56px, 5vw, 82px)/1.05 var(--font-serif);
  letter-spacing: -.045em;
  text-shadow: 0 2px 1px rgba(0, 0, 0, .18);
}

.home-english-title {
  margin-top: 13px;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: var(--gold-main);
  font: 600 16px/1 var(--font-mono);
  letter-spacing: .34em;
}
.home-english-title i { width: 62px; height: 1px; background: linear-gradient(90deg, transparent, rgba(213, 177, 96, .58)); }
.home-english-title i:last-child { transform: scaleX(-1); }
.home-copy > p {
  margin: clamp(18px, 2.5vh, 25px) 0 0;
  color: var(--text-secondary);
  font: 500 15px/1.5 var(--font-serif);
  letter-spacing: .06em;
}

.home-menu-shell {
  position: relative;
  z-index: 2;
  width: min(620px, 100%);
  min-height: 0;
  padding: 18px;
  color: var(--text-primary);
  border: 1px solid rgba(213, 177, 96, .28);
  background: rgba(12, 54, 41, .82);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18), inset 0 0 0 5px rgba(213, 177, 96, .035);
  clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
}
.home-menu-shell::before {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border: 1px solid rgba(213, 177, 96, .08);
  clip-path: inherit;
}
.home-panel { position: relative; z-index: 1; }

.home-screen:not([data-panel="main"]) {
  align-content: center;
  gap: 0;
}
.home-screen:not([data-panel="main"]) .home-copy { display: none; }
.home-screen:not([data-panel="main"]) .home-settings-trigger { opacity: 0; pointer-events: none; }
.home-screen:not([data-panel="main"]) .home-menu-shell {
  width: min(700px, 100%);
  max-height: min(660px, 76svh);
  overflow: auto;
}
.home-screen[data-panel="rules"] .home-menu-shell { width: min(820px, 100%); }

.home-main-actions { display: grid; gap: 10px; }
.home-primary-action,
.home-secondary-action {
  width: 100%;
  min-height: 72px;
  padding: 0 26px;
  display: grid;
  grid-template-columns: 42px 1fr 18px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: transform var(--dur-fast) ease, border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.home-primary-action span,
.home-secondary-action span { display: grid; gap: 5px; }
.home-primary-action b,
.home-secondary-action b { font: 600 20px/1.1 var(--font-serif); letter-spacing: .08em; }
.home-primary-action small,
.home-secondary-action small { font-size: 12px; font-weight: 500; letter-spacing: .08em; }
.home-primary-action em,
.home-secondary-action em { font: normal 24px/1 var(--font-serif); }

.home-menu-icon { width: 28px; height: 28px; display: grid; place-items: center; color: currentColor; }
.home-menu-icon svg { width: 22px; height: 22px; overflow: visible; }
.home-menu-icon svg path,
.home-menu-icon svg circle { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.home-primary-action .home-menu-icon svg path { fill: currentColor; stroke: none; }

.home-primary-action {
  color: #211a0d;
  background: linear-gradient(180deg, #ddbf78, var(--gold-main));
  border: 1px solid #e2c887;
  box-shadow: inset 0 1px rgba(255, 255, 255, .3), 0 6px 20px rgba(0, 0, 0, .12);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
}
.home-primary-action small { color: rgba(33, 26, 13, .62); }
.home-primary-action:hover { transform: translateY(-1px); filter: brightness(1.04); }
.home-primary-action:active { transform: translateY(1px); }

.home-secondary-action {
  min-height: 58px;
  color: #e4ddcc;
  background: rgba(8, 28, 19, .54);
  border: 1px solid rgba(212, 168, 78, .55);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
}
.home-secondary-action small { color: #8f8878; }
.home-secondary-action em { color: var(--brass); }
.home-secondary-action:hover { transform: translateY(-1px); border-color: rgba(240, 201, 106, .8); background: rgba(16, 43, 30, .72); }

.home-utility-nav { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.home-utility-nav button {
  min-height: 52px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 28px 1fr 14px;
  align-items: center;
  color: var(--text-secondary);
  background: rgba(8, 36, 28, .22);
  border: 1px solid rgba(213, 177, 96, .28);
  cursor: pointer;
  font: 500 16px/1 var(--font-serif);
  letter-spacing: .05em;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, background var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.home-utility-nav span { text-align: left; }
.home-utility-nav .home-menu-icon { width: 24px; height: 24px; color: var(--gold-muted); }
.home-utility-nav .home-menu-icon svg { width: 20px; height: 20px; }
.home-utility-nav button:hover { color: var(--text-primary); border-color: rgba(213, 177, 96, .55); background: rgba(27, 91, 69, .38); transform: translateY(-1px); }
.home-utility-nav button:active { transform: translateY(1px); }
.home-utility-nav em { color: rgba(213, 177, 96, .52); font: normal 15px/1 var(--font-mono); }

.home-info-panel > header {
  min-height: 56px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.home-info-panel > header > button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  background: rgba(8, 36, 28, .2);
  border: 1px solid rgba(213, 177, 96, .22);
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.home-info-panel > header > button:hover { color: var(--gold-main); border-color: var(--gold-line); background: rgba(27, 91, 69, .34); }
.home-info-panel > header span { display: grid; gap: 4px; }
.home-info-panel > header small { color: var(--gold-muted); font: 10px/1 var(--font-mono); letter-spacing: .14em; }
.home-info-panel > header b { color: var(--text-primary); font: 600 30px/1.15 var(--font-serif); }

.home-rule-list { margin: 0; padding: 2px 0 0; display: grid; list-style: none; }
.home-rule-list[hidden] { display: none; }
.home-rule-list li {
  position: relative;
  min-height: 84px;
  padding: 7px 0 17px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}
.home-rule-list li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 45px;
  bottom: -4px;
  border-left: 1px dashed rgba(213, 177, 96, .36);
}
.home-rule-list li > i {
  width: 44px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--gold-main);
  background: var(--gold-soft);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  font: normal 10px/1 var(--font-mono);
  letter-spacing: .04em;
}
.home-rule-list span { display: grid; gap: 5px; }
.home-rule-list b { color: var(--text-primary); font: 600 17px/1.3 var(--font-serif); }
.home-rule-list small { color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; }
.home-rarity-list article {
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(240, 232, 212, .1);
}
.home-rarity-list span { display: grid; gap: 4px; }
.home-rarity-list b { color: var(--text-primary); font-size: 14px; }
.home-rarity-list small { color: var(--text-muted); font-size: 12px; }

.home-info-lead { margin: 0 0 16px; color: var(--text-secondary); font-size: 14px; line-height: 1.65; }

.home-panel-tabs {
  width: max-content;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 1fr);
  gap: 0;
  margin: 0 0 20px;
  padding: 3px;
  border: 1px solid rgba(213, 177, 96, .24);
  background: rgba(8, 36, 28, .26);
}
.home-panel-tabs button {
  min-height: 40px;
  padding: 0 16px;
  color: var(--text-secondary);
  border: 0;
  background: transparent;
  font: 500 14px/1 var(--font-serif);
}
.home-panel-tabs button.selected {
  color: var(--bg-deep);
  background: var(--gold-main);
}

.home-augment-library {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: min(420px, 50svh);
  padding-right: 4px;
  overflow: auto;
}
.home-augment-item {
  min-height: 102px;
  padding: 13px 14px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid rgba(240, 232, 212, .12);
  background: rgba(8, 36, 28, .34);
}
.home-augment-item > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.home-augment-item h3 { margin: 0; color: var(--text-primary); font: 600 15px/1.15 var(--font-serif); }
.home-augment-item header span { color: var(--text-muted); font: 500 9px/1 var(--font-mono); letter-spacing: .08em; }
.home-augment-item p { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.home-augment-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.home-augment-tags i {
  padding: 3px 6px;
  color: var(--text-muted);
  border: 1px solid rgba(240, 232, 212, .12);
  font: normal 8px/1 var(--font-mono);
}
.home-augment-item[data-rarity="gold"] { border-color: rgba(212, 168, 78, .34); }
.home-augment-item[data-rarity="prismatic"] { border-color: rgba(182, 175, 219, .42); }
.home-rarity-list { display: grid; }
.home-rarity-list article > i { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(255, 255, 255, .03); }
.home-rarity-list article > i.silver { background: var(--silver); }
.home-rarity-list article > i.gold { background: var(--brass); }
.home-rarity-list article > i.prismatic { background: linear-gradient(135deg, #e7dff0, #9bc7db 48%, #d3aee0); }
.home-rarity-list em { color: var(--ink-3); font: normal 9px/1 var(--font-mono); }

.home-setting-list { display: grid; }
.home-setting-list label {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(240, 232, 212, .12);
  cursor: pointer;
}
.home-setting-list label > span { display: grid; gap: 6px; }
.home-setting-list b { color: var(--text-primary); font-size: 15px; }
.home-setting-list small { color: var(--text-muted); font-size: 12px; }
.home-setting-list input[type="checkbox"] {
  position: relative;
  width: 42px;
  height: 22px;
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid rgba(212, 168, 78, .46);
  background: rgba(4, 19, 12, .68);
  cursor: pointer;
}
.home-setting-list input[type="checkbox"]::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  top: 3px;
  left: 4px;
  background: #867451;
  transition: transform var(--dur-fast) ease, background var(--dur-fast) ease;
}
.home-setting-list input[type="checkbox"]:checked { background: rgba(212, 168, 78, .14); }
.home-setting-list input[type="checkbox"]:checked::after { transform: translateX(18px); background: #e4b959; }
.home-setting-field input[type="text"],
.home-setting-field select {
  width: min(180px, 42vw);
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid rgba(212, 168, 78, .34);
  background: rgba(4, 18, 12, .62);
  font: 500 11px/1 var(--font-serif);
}

body[data-contrast="high"] .home-menu-shell,
body[data-contrast="high"] .entry-sheet { border-color: var(--brass-hi); }
body[data-contrast="high"] .home-screen small,
body[data-contrast="high"] .game-entry small { color: #d9d1c0; }
body[data-contrast="high"] .home-utility-nav button,
body[data-contrast="high"][data-view="ready"] .seat { border-color: rgba(240, 201, 106, .58); }
.home-screen button:disabled { cursor: not-allowed; filter: grayscale(.45); opacity: .48; }

/* 开局流程：模式 → 联机方式 → 直接入桌 */
.game-entry {
  background:
    radial-gradient(circle at 42% 38%, rgba(38, 114, 85, .18), transparent 40%),
    linear-gradient(180deg, var(--bg-main) 0%, #0a2d23 72%, var(--bg-deep) 100%);
}
.entry-sheet { min-height: 640px; }
.entry-config {
  position: relative;
  justify-content: flex-start;
  padding: 34px 42px 38px;
  overflow: hidden;
}
.entry-nav-row {
  min-height: 34px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.entry-nav-row .entry-home-back { margin: 0; }
.entry-progress { display: flex; align-items: center; gap: 6px; }
.entry-progress i { width: 22px; height: 2px; background: rgba(240, 232, 212, .15); }
.entry-progress i.active { background: var(--brass); }

.entry-view { min-height: 500px; display: flex; flex-direction: column; }
.entry-view[hidden] { display: none; }
.entry-view h2 { margin: 2px 0 0; color: var(--ink); font: 650 30px/1.16 var(--font-serif); letter-spacing: -.025em; }
.entry-view-copy { margin: 12px 0 26px; color: var(--ink-3); font-size: 11px; line-height: 1.7; }
.entry-mode-grid { display: grid; gap: 10px; }
.entry-mode-card {
  width: 100%;
  min-height: 92px;
  padding: 14px 17px;
  display: grid;
  grid-template-columns: 44px 1fr 18px;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(240, 232, 212, .025);
  text-align: left;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.entry-mode-card:hover { transform: translateY(-1px); border-color: rgba(212, 168, 78, .6); background: rgba(212, 168, 78, .07); }
.entry-mode-card > span:nth-child(2) { display: grid; gap: 5px; }
.entry-mode-card strong { font: 600 17px/1.1 var(--font-serif); }
.entry-mode-card small { color: var(--ink-3); font-size: 10px; line-height: 1.4; }
.entry-mode-card em { color: var(--brass); font: normal 22px/1 var(--font-serif); }
.entry-create-room { margin-bottom: 20px; }

.entry-join-form {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.entry-join-form > label { display: block; margin-bottom: 8px; color: var(--ink-2); font: 600 12px/1 var(--font-serif); }
.entry-join-form > div { display: grid; grid-template-columns: 1fr auto; }
.entry-join-form input {
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-radius: 9px 0 0 9px;
  background: rgba(4, 18, 12, .5);
  font: 600 14px/1 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.entry-join-form button { min-width: 76px; color: #211807; border: 1px solid var(--brass); border-radius: 0 9px 9px 0; background: var(--brass); }
.entry-join-form > small { display: block; margin-top: 7px; color: var(--ink-3); font-size: 9px; }
.entry-join-form.has-error input { border-color: #c36c5a; }
.entry-join-form.has-error > small { color: #e09986; }

/* 麻将式准备：棋盘始终是当前页面，席位直接钉在桌边 */
.ready-seat-actions { display: none; }
.table-ready-panel[hidden],
.table-ready-countdown[hidden],
.ready-room-code[hidden],
.ready-primary[hidden] { display: none; }

body[data-view="ready"] .table { position: relative; }
body[data-view="ready"] .round-badge,
body[data-view="ready"] #logToggle,
body[data-view="ready"] #augmentDemo { display: none; }
body[data-view="ready"] .turn-banner {
  border-color: rgba(127, 173, 138, .48);
  background: rgba(88, 135, 98, .12);
  color: #c4d9c7;
}
body[data-view="ready"] .turn-banner .led { background: #9ac4a2; box-shadow: 0 0 8px rgba(154, 196, 162, .72); }
body[data-view="ready"] .board-wrap { filter: saturate(.86) brightness(.86); }
body[data-view="ready"] .seat {
  min-width: 148px;
  opacity: 1;
  border-color: rgba(240, 232, 212, .26);
}
body[data-view="ready"] .seat[data-ready-state="ai"],
body[data-view="ready"] .seat[data-ready-state="human"] { border-color: rgba(126, 170, 137, .48); }
body[data-view="ready"] .seat[data-ready-state="empty"] { border-style: dashed; }
body[data-view="ready"] .seat[data-ready-state="closed"] { border-style: dashed; opacity: .45; }
body[data-view="ready"] .seat-progress { display: none; }
body[data-view="ready"] .seat-traits span { color: var(--ink-2); }
body[data-view="ready"] .ready-seat-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}
body[data-view="ready"] .seat-top .ready-seat-actions { margin-left: 2px; }
.ready-seat-actions button,
.ready-room-code button,
.ready-rule-row button {
  min-height: 25px;
  padding: 0 8px;
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(4, 18, 12, .58);
  font-size: 8.5px;
}
.ready-seat-actions button:hover,
.ready-room-code button:hover,
.ready-rule-row button:hover { color: var(--brass-hi); border-color: var(--brass-deep); }
.ready-stamp {
  padding: 4px 8px;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 600 8px/1 var(--font-mono);
  letter-spacing: .1em;
}
.ready-stamp.is-ready { color: #b9d1bd; border-color: rgba(124, 170, 135, .45); }

body[data-view="ready"] .player-tray {
  grid-template-columns: minmax(220px, 1fr);
  min-height: 78px;
}
body[data-view="ready"] .player-tray > :not(.me-block) { display: none; }
body[data-view="ready"] .me-block {
  width: min(340px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-self: center;
}
body[data-view="ready"] .me-block .me-avatar { grid-row: 1 / 3; }
body[data-view="ready"] .me-block .me-progress { display: none; }
body[data-view="ready"] .me-block .ready-seat-actions { grid-column: 3; grid-row: 1 / 3; }

.table-ready-panel {
  position: absolute;
  z-index: 14;
  width: min(350px, calc(100% - 44px));
  padding: 18px;
  color: var(--ink);
  border: 1px solid rgba(212, 168, 78, .48);
  border-radius: 14px;
  background: rgba(7, 27, 18, .91);
  box-shadow: 0 24px 70px rgba(2, 12, 8, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(12px);
}
.table-ready-panel header { display: grid; gap: 5px; }
.table-ready-panel header small { color: var(--brass); font: 600 8px/1 var(--font-mono); letter-spacing: .18em; }
.table-ready-panel h2 { margin: 0; font: 650 24px/1.2 var(--font-serif); letter-spacing: -.02em; }
.table-ready-panel > p { min-height: 18px; margin: 10px 0 12px; color: var(--ink-3); font-size: 9.5px; line-height: 1.55; }
.ready-room-code,
.ready-rule-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.ready-room-code > span,
.ready-rule-row > span { display: grid; gap: 4px; }
.ready-room-code small,
.ready-rule-row small { color: var(--ink-3); font-size: 8px; }
.ready-room-code b { font: 600 14px/1 var(--font-mono); letter-spacing: .13em; }
.ready-rule-row b { color: var(--ink-2); font-size: 9px; }
.ready-primary {
  width: 100%;
  min-height: 54px;
  margin-top: 10px;
  padding: 8px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #211807;
  border: 1px solid var(--brass-deep);
  border-radius: 9px;
  background: linear-gradient(180deg, var(--brass), #b68c42);
}
.ready-primary span { font: 750 15px/1 var(--font-serif); letter-spacing: .06em; }
.ready-primary small { max-width: 19ch; font: 600 8px/1.35 var(--font-mono); text-align: right; opacity: .7; }
.ready-primary:disabled { cursor: not-allowed; filter: grayscale(.6); opacity: .5; }
.ready-primary.ready-toggle { justify-content: center; color: var(--brass-hi); background: rgba(212, 168, 78, .1); }
.ready-primary.ready-toggle.ready { color: #b9d1bd; border-color: rgba(124, 170, 135, .55); background: rgba(77, 122, 87, .18); }

.table-ready-countdown {
  position: absolute;
  inset: 18%;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--ink);
  border: 1px solid rgba(212, 168, 78, .55);
  border-radius: 18px;
  background: rgba(5, 22, 14, .94);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .5);
}
.table-ready-countdown span { color: var(--brass); font: 600 9px/1 var(--font-mono); letter-spacing: .2em; }
.table-ready-countdown b { font: 500 76px/1 var(--font-serif); }
.table-ready-countdown small { color: var(--ink-3); font-size: 9px; }

.entry-home-back {
  width: max-content;
  margin: 0 0 25px;
  padding: 8px 11px;
  color: var(--ink-3);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 10px;
  letter-spacing: .06em;
}
.entry-home-back:hover { color: var(--brass-hi); border-color: rgba(212, 168, 78, .44); }

@keyframes homeRouteDrift { to { stroke-dashoffset: -180; } }

@media (max-height: 760px) and (min-width: 621px) {
  .home-screen { gap: 30px; padding-top: 18px; padding-bottom: 18px; }
  .home-mark { width: 72px; height: 72px; margin-bottom: 10px; }
  .home-copy h1 { font-size: 62px; }
  .home-english-title { margin-top: 9px; font-size: 15px; }
  .home-copy > p { margin-top: 12px; font-size: 13px; }
  .home-menu-shell { min-height: 0; padding-top: 20px; padding-bottom: 22px; }
  .home-primary-action { min-height: 58px; }
  .home-utility-nav { margin-top: 8px; }
  .home-utility-nav button { min-height: 38px; }
  .home-studio { top: 28px; }
}

@media (min-width: 901px) and (max-width: 1180px) {
  body[data-view="ready"] .arena {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      ". top ."
      "left board right";
    gap: 6px 12px;
  }
  body[data-view="ready"] .seat-left { grid-area: left; }
  body[data-view="ready"] .seat-right { grid-area: right; }
  body[data-view="ready"] .seat-side { flex-direction: column; text-align: center; }
  body[data-view="ready"] .board-wrap { width: min(calc(100dvh - 230px), 100%, 720px); }
}

@media (max-width: 900px) {
  body[data-view="ready"] .arena {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
      "top top"
      "left right"
      "board board";
    gap: 6px;
    align-content: start;
    align-items: start;
  }
  body[data-view="ready"] .seat-top { grid-area: top; }
  body[data-view="ready"] .seat-left { grid-area: left; }
  body[data-view="ready"] .seat-right { grid-area: right; }
  body[data-view="ready"] .board-stage { grid-area: board; }
  body[data-view="ready"] .seat-side { flex-direction: row; text-align: left; }
  body[data-view="ready"] .seat-side .seat-name { text-align: left; }
  body[data-view="ready"] .player-tray > :not(.me-block) { display: none; }
  body[data-view="ready"] .me-block { display: grid; }
}

@media (max-width: 620px) {
  .home-screen {
    min-height: 100svh;
    padding: 82px 18px calc(22px + env(safe-area-inset-bottom));
    gap: 27px;
  }
  .home-frame { inset: 8px; }
  .home-frame > i { transform: scale(.82); transform-origin: top left; }
  .home-frame > i:nth-child(2) { transform: rotate(90deg) scale(.82); }
  .home-frame > i:nth-child(3) { transform: rotate(180deg) scale(.82); }
  .home-frame > i:nth-child(4) { transform: rotate(270deg) scale(.82); }
  .home-studio { top: 22px; left: 22px; gap: 9px; font-size: 8px; letter-spacing: .22em; }
  .home-studio svg { width: 32px; height: 32px; }
  .home-settings-trigger { top: 20px; right: 20px; width: 40px; min-height: 40px; padding: 0; justify-content: center; }
  .home-settings-trigger > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .home-atlas svg { width: 180%; transform: translateX(-22%); }
  .home-atlas .atlas-hexes { opacity: .24; }
  .home-atlas .atlas-stamp { display: none; }
  .home-mark { width: 70px; height: 70px; margin-bottom: 12px; }
  .home-copy h1 { font-size: clamp(46px, 13vw, 58px); }
  .home-english-title { margin-top: 10px; gap: 11px; font-size: 13px; letter-spacing: .28em; }
  .home-english-title i { width: 32px; }
  .home-copy > p { margin-top: 15px; font-size: 13px; }
  .home-menu-shell { width: min(420px, 100%); min-height: 0; padding: 18px 17px 20px; }
  .home-primary-action { min-height: 66px; padding: 0 18px; }
  .home-primary-action,
  .home-utility-nav button { grid-template-columns: 26px minmax(0, 1fr) 10px; }
  .home-primary-action b,
  .home-secondary-action b { font-size: 17px; }
  .home-utility-nav { margin-top: 8px; gap: 7px; }
  .home-utility-nav button { min-height: 48px; padding: 0 12px; font-size: 14px; letter-spacing: .03em; }
  .home-utility-nav button > span { white-space: nowrap; }
  .home-panel-tabs { width: 100%; grid-auto-columns: minmax(0, 1fr); }
  .home-info-panel > header b { font-size: 25px; }
  .home-rule-list li { min-height: 82px; grid-template-columns: 42px minmax(0, 1fr); gap: 13px; }
  .home-rule-list li > i { width: 40px; height: 35px; }
  .home-rule-list li:not(:last-child)::after { left: 20px; top: 42px; }
  .home-rule-list b { font-size: 15px; }
  .home-rule-list small { font-size: 12.5px; }
  .home-augment-library { grid-template-columns: 1fr; }
  .entry-intro { min-height: 190px; padding: 22px 20px 18px; }
  .entry-mark { width: 40px; height: 40px; margin: 14px 0 10px; }
  .entry-intro h1 { font-size: 32px; }
  .entry-intro > p { margin-bottom: 8px; }
  .entry-rule-line { display: none; }
  .entry-config { padding: 24px 20px 28px; }
  .entry-nav-row { margin-bottom: 22px; }
  .entry-view { min-height: 0; }
  .entry-view h2 { font-size: 25px; }
  body[data-view="ready"] .table-top { grid-template-columns: minmax(0, 1fr) auto; }
  body[data-view="ready"] .turn-banner { grid-column: 1 / 3; }
  body[data-view="ready"] .arena {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
      "top top"
      "left right"
      "board board";
    gap: 6px;
    padding: 6px 10px 0;
  }
  body[data-view="ready"] .seat-top { grid-area: top; }
  body[data-view="ready"] .seat-left { grid-area: left; }
  body[data-view="ready"] .seat-right { grid-area: right; }
  body[data-view="ready"] .board-stage { grid-area: board; }
  body[data-view="ready"] .seat {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 7px 8px;
    gap: 6px;
  }
  body[data-view="ready"] .seat-side { flex-direction: row; text-align: left; }
  body[data-view="ready"] .seat-side .seat-name { text-align: left; }
  body[data-view="ready"] .seat-avatar { width: 26px; height: 26px; }
  body[data-view="ready"] .seat-traits,
  body[data-view="ready"] .seat-state { display: none; }
  body[data-view="ready"] .ready-seat-actions { margin-left: auto; }
  body[data-view="ready"] .ready-seat-actions button { min-height: 23px; padding: 0 6px; font-size: 7.5px; }
  body[data-view="ready"] .board-wrap { width: min(calc(100vw - 20px), 520px); }
  body[data-view="ready"] .player-tray { min-height: 66px; margin: 5px 10px 8px; padding: 7px 10px; }
  body[data-view="ready"] .me-block { grid-template-columns: auto minmax(0, 1fr) auto; }
  body[data-view="ready"] .me-avatar { width: 34px; height: 34px; }
  .table-ready-panel { width: min(318px, calc(100% - 34px)); padding: 14px; }
  .table-ready-panel h2 { font-size: 20px; }
  .table-ready-panel > p { margin: 8px 0 9px; }
  .ready-room-code, .ready-rule-row { min-height: 42px; padding: 6px 0; }
  .ready-primary { min-height: 48px; margin-top: 8px; }
  .table-ready-countdown { inset: 16%; }
}

@media (prefers-reduced-motion: reduce) {
  .home-atlas .atlas-routes path { animation: none; }
  .home-screen *, .home-screen *::before, .home-screen *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
