:root {
  --bg-top: #f7f1e5;
  --bg-bottom: #e3d2b4;
  --paper: rgba(255, 250, 241, 0.86);
  --paper-strong: rgba(255, 248, 236, 0.94);
  --ink: #1f1711;
  --muted: #705f4c;
  --line: rgba(81, 58, 34, 0.18);
  --line-strong: rgba(81, 58, 34, 0.34);
  --accent: #a8401e;
  --accent-strong: #7f2f15;
  --accent-soft: rgba(168, 64, 30, 0.12);
  --olive: #4c5a2d;
  --olive-soft: rgba(76, 90, 45, 0.14);
  --gold: #caa35d;
  --shadow: 0 18px 42px rgba(54, 34, 16, 0.16);
  --shadow-soft: 0 10px 24px rgba(54, 34, 16, 0.1);
  --radius: 22px;
  --radius-sm: 14px;
  --ui-font: "Avenir Next", "Segoe UI", sans-serif;
  --serif-font: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --mono-font: "SFMono-Regular", "Menlo", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 34%),
    radial-gradient(circle at top right, rgba(202, 163, 93, 0.22), transparent 28%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  font-family: var(--serif-font);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(97, 71, 43, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(97, 71, 43, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 92%);
}

button,
input,
select {
  font: inherit;
}

button,
select,
input {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.96);
  color: var(--ink);
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

button {
  cursor: pointer;
  padding: 0.78rem 1rem;
  font-family: var(--ui-font);
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 2px 0 rgba(74, 50, 26, 0.08);
}

button:hover:not(:disabled),
button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 8px 18px rgba(74, 50, 26, 0.12);
  outline: none;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

button.primary {
  border-color: rgba(127, 47, 21, 0.4);
  background: linear-gradient(180deg, #bd5632, var(--accent-strong));
  color: #fff7f2;
}

button.ghost {
  background: rgba(255, 253, 249, 0.72);
}

button.active {
  border-color: rgba(127, 47, 21, 0.44);
  background: rgba(168, 64, 30, 0.1);
  color: var(--accent-strong);
}

.ui-button-content {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.72rem;
  width: 100%;
  min-width: 0;
}

.ui-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.ui-button-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ui-button-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  min-width: 0;
  text-align: left;
}

.ui-button-label {
  display: block;
  line-height: 1.05;
}

.ui-button-meta {
  display: block;
  color: rgba(112, 95, 76, 0.82);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
}

button.primary .ui-button-meta {
  color: rgba(255, 247, 242, 0.78);
}

input,
select {
  width: 100%;
  padding: 0.82rem 0.95rem;
  font-family: var(--ui-font);
  font-size: 0.95rem;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(127, 47, 21, 0.42);
  box-shadow: 0 0 0 4px rgba(168, 64, 30, 0.08);
}

#app {
  width: min(1400px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

#app.app-game {
  width: min(1760px, calc(100vw - 12px));
  padding: 8px 0 12px;
}

.shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.shell.game-shell {
  gap: 0;
}

.shell.game-shell .masthead {
  display: none;
}

.shell.game-shell .human-check-box {
  display: none;
}

.shell.game-shell .layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.shell.game-shell .sidebar {
  display: none;
}

.shell.game-shell .stage {
  gap: 0;
}

.masthead,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(95, 68, 39, 0.14);
  background: linear-gradient(180deg, var(--paper-strong), var(--paper));
  box-shadow: var(--shadow);
}

.masthead {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: 28px;
}

.masthead::after,
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.28), transparent 44%);
}

.masthead h1,
.panel h2,
.panel h3 {
  margin: 0;
  font-weight: 700;
}

.masthead h1 {
  font-size: clamp(2.2rem, 5vw, 4.1rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.subhead,
.muted {
  color: var(--muted);
}

.subhead {
  max-width: 42rem;
  margin: 0.6rem 0 0;
  font-size: 1.08rem;
}

.eyebrow,
.label,
.tiny {
  font-family: var(--ui-font);
}

.eyebrow {
  margin-bottom: 0.7rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tiny {
  font-size: 0.83rem;
}

.mono {
  font-family: var(--mono-font);
  overflow-wrap: anywhere;
}

.mast-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(320px, 100%);
}

.status {
  min-height: 48px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 0.95rem;
}

.human-check-box {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 40;
  width: min(320px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow-soft);
}

.turnstile-slot {
  min-height: 70px;
}

.turnstile-slot iframe {
  max-width: 100%;
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.sidebar,
.stage {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel {
  border-radius: var(--radius);
  padding: 22px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.panel-head > * {
  min-width: 0;
}

.game-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.game-panel-head-title {
  min-width: 0;
  justify-self: start;
}

.game-panel-head-actions {
  justify-self: end;
}

.featured-clock {
  --featured-clock-border: rgba(127, 47, 21, 0.14);
  --featured-clock-shadow: 0 10px 20px rgba(127, 47, 21, 0.08);
  --featured-clock-value: rgba(51, 37, 26, 0.96);
  --featured-clock-bg-top: rgba(255, 250, 245, 0.98);
  --featured-clock-bg-bottom: rgba(248, 238, 228, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-width: 212px;
  padding: 12px 18px 13px;
  border-radius: 18px;
  border: 1px solid var(--featured-clock-border);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 68%),
    linear-gradient(180deg, var(--featured-clock-bg-top), var(--featured-clock-bg-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), var(--featured-clock-shadow);
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.featured-clock.running {
  border-color: rgba(127, 47, 21, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 16px 28px rgba(127, 47, 21, 0.12);
}

.featured-clock.untimed {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 68%),
    linear-gradient(180deg, rgba(247, 245, 242, 0.98), rgba(240, 235, 229, 0.96));
}

.featured-clock-empty {
  visibility: hidden;
}

.featured-clock-value {
  font-size: clamp(2rem, 3.1vw, 3rem);
  line-height: 0.82;
  letter-spacing: -0.04em;
  color: var(--featured-clock-value);
  transition: color 120ms ease;
}

.featured-clock.running .featured-clock-value {
  color: var(--featured-clock-value);
}

.room-stage-featured {
  flex-direction: column;
  gap: 0.22rem;
  min-width: 196px;
}

.featured-room-code {
  font-size: clamp(1.5rem, 2.3vw, 2.1rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: rgba(51, 37, 26, 0.94);
}

.title-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.title-block-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 14px;
  border: 1px solid rgba(127, 47, 21, 0.14);
  background:
    radial-gradient(circle at top left, rgba(202, 163, 93, 0.24), transparent 68%),
    rgba(168, 64, 30, 0.08);
  color: var(--accent-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.title-block-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.title-block-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.title-block-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.title-block-row h2,
.title-block-row h3 {
  min-width: 0;
}

.title-block-meta {
  line-height: 1.35;
}

.title-block-compact {
  gap: 10px;
}

.title-block-compact .title-block-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.title-block-compact .eyebrow {
  margin-bottom: 0.3rem;
}

.title-block-compact h2,
.title-block-compact h3 {
  font-size: 1.02rem;
}

.grid2,
.button-row,
.hero-strip,
.preview-row {
  display: grid;
  gap: 12px;
}

.grid2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.button-row {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.button-row > * {
  min-width: 0;
}

.button-row .wide,
button.wide {
  width: 100%;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.share-box,
.hero-chip,
.rules-note,
.action-card,
.hand-panel,
.summary,
.player-pill,
.pass-card,
.seat-row {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: var(--shadow-soft);
}

.share-box,
.summary,
.rules-note,
.action-card,
.hand-panel {
  border-radius: 18px;
  padding: 16px;
}

.shell.game-shell .action-card,
.shell.game-shell .hand-panel,
.shell.game-shell .summary {
  border-radius: 12px;
  padding: 10px;
}

.shell.game-shell .featured-clock {
  min-width: 186px;
  padding: 10px 16px 11px;
  border-radius: 14px;
}

.shell.game-shell .featured-clock-value {
  font-size: clamp(1.8rem, 2.6vw, 2.45rem);
}

.lobby-list,
.seat-list,
.seat-config-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.online-human-check-note {
  margin-top: 12px;
}

.lobby-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: var(--shadow-soft);
}

.room-code {
  font-size: 1.05rem;
  font-weight: 700;
}

.intro-panel p,
.rules-note p,
.summary p,
.wait-panel p {
  margin: 0.65rem 0 0;
  line-height: 1.45;
}

.wait-panel,
.game-panel {
  min-height: 420px;
}

.shell.game-shell .game-panel {
  min-height: 0;
  padding: 12px;
  border-radius: 16px;
}

.shell.game-shell .title-block {
  gap: 8px;
}

.shell.game-shell .title-block-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.shell.game-shell .title-block-icon svg {
  width: 16px;
  height: 16px;
}

.shell.game-shell .title-block-compact .title-block-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.shell.game-shell .title-block-compact h2,
.shell.game-shell .title-block-compact h3 {
  font-size: 0.94rem;
}

.shell.game-shell .title-block-meta {
  font-size: 0.68rem;
}

.shell.game-shell .ui-button-content {
  gap: 0.5rem;
}

.shell.game-shell .ui-button-icon {
  width: 15px;
  height: 15px;
}

.shell.game-shell .ui-button-meta {
  font-size: 0.62rem;
}

.shell.game-shell .inline-stat {
  gap: 0.32rem;
  padding: 0.2rem 0.44rem;
  font-size: 0.66rem;
}

.shell.game-shell .inline-stat-icon {
  width: 11px;
  height: 11px;
}

.shell.game-shell .choice-mark {
  width: 24px;
  height: 24px;
  border-radius: 8px;
}

.shell.game-shell .choice-mark svg {
  width: 13px;
  height: 13px;
}

.hero-strip {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 18px;
}

.hero-chip {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 14px 16px;
  border-radius: 18px;
  min-width: 0;
  background:
    radial-gradient(circle at top left, rgba(202, 163, 93, 0.14), transparent 42%),
    rgba(255, 255, 255, 0.54);
}

.hero-chip-wide {
  min-width: 0;
}

.hero-chip-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hero-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--accent-strong);
}

.hero-chip-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-chip-value {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.hero-chip-wide .hero-chip-value {
  font-size: 0.82rem;
  line-height: 1.4;
}

.inline-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(81, 58, 34, 0.12);
  background: rgba(118, 96, 70, 0.08);
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

.inline-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.inline-stat-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.waiting-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}

.seat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
}

.seat-open {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.38);
}

.seat-config-list {
  margin: 16px 0;
}

.share-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(202, 163, 93, 0.14), transparent 44%),
    rgba(255, 255, 255, 0.58);
}

.share-box-meta,
.seat-row-meta,
.lobby-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-box-url {
  padding: 0.8rem 0.95rem;
  border-radius: 16px;
  border: 1px dashed rgba(81, 58, 34, 0.2);
  background: rgba(255, 255, 255, 0.44);
  font-size: 0.82rem;
  line-height: 1.4;
}

.room-seat-note {
  margin-top: 16px;
}

.seat-config-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.46);
}

.seat-config-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.seat-config-name {
  font-weight: 700;
}

.seat-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 1.02rem;
  font-weight: 700;
}

.seat-copy,
.lobby-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.lobby-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.lobby-players {
  color: var(--muted);
  font-family: var(--ui-font);
  line-height: 1.35;
}

.seat-badge,
.seat-state {
  font-family: var(--ui-font);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.seat-badge {
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.seat-badge-bot {
  background: rgba(78, 120, 88, 0.14);
  color: #35543f;
}

.seat-state {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(118, 96, 70, 0.1);
  color: var(--muted);
}

.seat-state.connected {
  background: var(--olive-soft);
  color: var(--olive);
}

.seat-state.bot {
  background: rgba(78, 120, 88, 0.14);
  color: #35543f;
}

.seat-state.disconnected {
  background: rgba(168, 64, 30, 0.1);
  color: var(--accent-strong);
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.shell.game-shell .score-strip {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.game-stage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.shell.game-shell .game-stage-layout {
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 10px;
  margin-top: 8px;
}

.game-stage-layout > * {
  min-width: 0;
}

.player-pill {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 18px;
  padding: 14px;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.player-pill > * {
  position: relative;
  z-index: 1;
}

.player-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid var(--player-pill-alert-border, transparent);
  background: var(--player-pill-alert-bg, transparent);
  box-shadow: var(--player-pill-alert-shadow, none);
  opacity: var(--player-pill-alert-opacity, 0);
  pointer-events: none;
  transition:
    opacity 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.shell.game-shell .player-pill {
  border-radius: 12px;
  padding: 8px 10px;
}

.player-pill.active {
  border-color: rgba(127, 47, 21, 0.36);
  background: rgba(255, 246, 236, 0.95);
  transform: translateY(-1px);
}

.player-pill.running {
  box-shadow:
    inset 0 0 0 1px rgba(127, 47, 21, 0.18),
    0 12px 22px rgba(127, 47, 21, 0.12);
}

.player-top,
.player-bottom,
.hand-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.player-hand-row {
  margin-top: 0.36rem;
}

.player-top {
  align-items: baseline;
  font-size: 1rem;
  font-weight: 700;
}

.player-name {
  min-width: 0;
}

.seat-clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  border: 1px solid rgba(81, 58, 34, 0.12);
  background: rgba(118, 96, 70, 0.08);
  color: rgba(59, 43, 30, 0.9);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.shell.game-shell .player-top {
  font-size: 0.86rem;
}

.shell.game-shell .player-hand-row {
  margin-top: 0.22rem;
}

.shell.game-shell .seat-clock {
  padding: 0.12rem 0.38rem;
  font-size: 0.68rem;
}

.player-bottom {
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.5rem;
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 0.84rem;
}

.shell.game-shell .player-bottom {
  gap: 6px;
  margin-top: 0.26rem;
  font-size: 0.68rem;
}

.hidden-hand-strip {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  flex-wrap: wrap;
  width: 100%;
  min-height: 28px;
  padding: 4px 5px;
  border-radius: 10px;
}

.hidden-hand-card {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  min-width: 12px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(81, 58, 34, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(234, 223, 207, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 1px 2px rgba(81, 58, 34, 0.08);
}

.hidden-hand-gap {
  display: inline-flex;
  width: 12px;
  min-width: 12px;
  height: 22px;
  border-radius: 4px;
  border: 1px dashed rgba(127, 47, 21, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 250, 245, 0.34), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  opacity: 0.9;
}

.hidden-hand-card::before {
  content: "";
  position: absolute;
  inset: 2px 2px auto;
  height: 4px;
  border-radius: 999px;
  background: rgba(81, 58, 34, 0.12);
}

.hidden-hand-card.taken {
  border-color: rgba(76, 90, 45, 0.34);
  background:
    linear-gradient(180deg, rgba(244, 251, 233, 0.98), rgba(225, 240, 201, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 0 0 1px rgba(76, 90, 45, 0.14),
    0 0 12px rgba(76, 90, 45, 0.16);
}

.hidden-hand-card.taken::before {
  background: rgba(76, 90, 45, 0.34);
}

.hidden-hand-card.taken .hidden-hand-round {
  color: #374421;
}

.hidden-hand-round {
  position: relative;
  top: 2px;
  font-family: var(--ui-font);
  font-size: 0.48rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  color: rgba(81, 58, 34, 0.82);
}

.hidden-hand-empty {
  font-family: var(--ui-font);
  font-size: 0.7rem;
  color: rgba(112, 95, 76, 0.86);
}

.room-presence-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 28px;
}

.room-presence-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0.18rem 0.56rem;
  border-radius: 999px;
  border: 1px solid rgba(81, 58, 34, 0.14);
  background: rgba(118, 96, 70, 0.08);
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.room-presence-chip-connected,
.room-presence-chip-you {
  border-color: rgba(76, 90, 45, 0.24);
  background: rgba(76, 90, 45, 0.12);
  color: #44522a;
}

.room-presence-chip-disconnected {
  border-color: rgba(168, 64, 30, 0.24);
  background: rgba(168, 64, 30, 0.1);
  color: var(--accent-strong);
}

.room-presence-chip-bot {
  border-color: rgba(52, 97, 128, 0.2);
  background: rgba(52, 97, 128, 0.1);
  color: #2f5f82;
}

.room-presence-chip-open {
  border-style: dashed;
  border-color: rgba(127, 47, 21, 0.28);
  background: rgba(255, 255, 255, 0.18);
  color: var(--accent-strong);
}

.meta-chip,
.hand-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-width: 62px;
  padding: 0.16rem 0.46rem;
  border-radius: 999px;
  border: 1px solid rgba(81, 58, 34, 0.14);
  background: rgba(118, 96, 70, 0.08);
  color: var(--muted);
  box-shadow: none;
  font-weight: 700;
  line-height: 1.05;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

.meta-chip {
  min-height: 28px;
}

.shell.game-shell .meta-chip,
.shell.game-shell .hand-count-badge {
  min-width: 54px;
  padding: 0.12rem 0.36rem;
}

.shell.game-shell .hidden-hand-strip {
  min-height: 24px;
  padding: 3px 4px;
  gap: 1px;
}

.shell.game-shell .hidden-hand-card {
  width: 11px;
  min-width: 11px;
  height: 19px;
}

.shell.game-shell .hidden-hand-gap {
  width: 11px;
  min-width: 11px;
  height: 19px;
}

.shell.game-shell .hidden-hand-round {
  top: 2px;
  font-size: 0.42rem;
}

.meta-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.meta-chip-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.meta-chip-value {
  font-variant-numeric: tabular-nums;
}

.meta-chip-score {
  border-color: rgba(202, 163, 93, 0.28);
  background: rgba(202, 163, 93, 0.14);
  color: #6f4d1b;
}

.meta-chip-take {
  border-color: rgba(52, 97, 128, 0.24);
  background: rgba(52, 97, 128, 0.1);
  color: #2f5f82;
}

.meta-chip-capture {
  border-color: rgba(76, 90, 45, 0.24);
  background: rgba(76, 90, 45, 0.1);
  color: #44522a;
}

.meta-chip-muted {
  border-color: rgba(81, 58, 34, 0.12);
  background: rgba(118, 96, 70, 0.06);
  color: rgba(112, 95, 76, 0.86);
}

.meta-chip-ready {
  min-width: 28px;
  padding-inline: 0.24rem;
  border-color: rgba(76, 90, 45, 0.26);
  background: rgba(76, 90, 45, 0.12);
  color: #44522a;
  box-shadow: 0 0 12px rgba(76, 90, 45, 0.12);
}

.meta-chip-spent {
  min-width: 28px;
  padding-inline: 0.24rem;
  border-color: rgba(127, 47, 21, 0.16);
  background: rgba(81, 58, 34, 0.06);
  color: rgba(112, 95, 76, 0.86);
}

.meta-chip-status .meta-chip-icon {
  position: relative;
  width: 16px;
  height: 16px;
}

.meta-chip-status .meta-chip-icon::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.meta-chip-hand {
  color: var(--hand-count-color, currentColor);
  border-color: var(--hand-count-border, rgba(81, 58, 34, 0.14));
  background: var(--hand-count-bg, rgba(118, 96, 70, 0.08));
  box-shadow: var(--hand-count-shadow, none);
}

.meta-chip-hand .meta-chip-value,
.meta-chip-score .meta-chip-value {
  min-width: 1ch;
}

.shell.game-shell .meta-chip-icon {
  width: 13px;
  height: 13px;
}

.shell.game-shell .meta-chip-status .meta-chip-icon {
  width: 14px;
  height: 14px;
}

.shell.game-shell .meta-chip,
.shell.game-shell .hand-count-badge {
  min-height: 24px;
}

.shell.game-shell .meta-chip-ready,
.shell.game-shell .meta-chip-spent {
  min-width: 24px;
}

.meta-chip:hover,
.hand-count-badge:hover {
  transform: translateY(-1px);
}

.hand-count-badge {
  border: 1px solid var(--hand-count-border, rgba(81, 58, 34, 0.14));
  background: var(--hand-count-bg, rgba(118, 96, 70, 0.08));
  color: var(--hand-count-color, currentColor);
  box-shadow: var(--hand-count-shadow, none);
}

.player-last-action {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.42rem;
}

.shell.game-shell .player-last-action {
  gap: 0.22rem;
  margin-top: 0.24rem;
}

.player-last-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-last-label {
  color: var(--accent-strong);
}

.player-last-label,
.action-visual-label {
  font-family: var(--ui-font);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.player-last-copy {
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 0.74rem;
  line-height: 1.18;
}

.shell.game-shell .player-last-copy {
  font-size: 0.66rem;
}

.room-open-seat-pill {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.36);
}

.board {
  display: grid;
  gap: 18px;
}

.shell.game-shell .board {
  gap: 8px;
}

.move-log-panel {
  position: sticky;
  top: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(43, 33, 24, 0.96), rgba(28, 22, 18, 0.96)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 30%);
  box-shadow: var(--shadow-soft);
  color: #f6eee2;
}

.shell.game-shell .move-log-panel {
  top: 8px;
  border-radius: 16px;
  padding: 10px;
}

.move-log-panel .eyebrow,
.move-log-panel .muted {
  color: rgba(246, 238, 226, 0.72);
}

.move-log {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(72vh, 760px);
  overflow: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.shell.game-shell .move-log {
  margin-top: 8px;
  gap: 5px;
  max-height: min(calc(100vh - 96px), 900px);
}

.move-log-empty {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  color: rgba(246, 238, 226, 0.78);
  font-family: var(--ui-font);
  font-size: 0.9rem;
  text-align: center;
  padding: 16px;
}

.move-log-line {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shell.game-shell .move-log-line {
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 6px;
  padding: 6px 0;
}

.move-log-line.major {
  margin: 2px 0;
  padding: 10px 12px;
  border-radius: 18px;
  border-bottom-color: transparent;
  background: rgba(202, 163, 93, 0.14);
}

.shell.game-shell .move-log-line.major {
  padding: 6px 8px;
  border-radius: 12px;
}

.move-log-line:last-child {
  border-bottom: 0;
}

.move-log-round {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-height: 34px;
  padding: 0.28rem 0.4rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(246, 238, 226, 0.84);
  font-family: var(--ui-font);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.shell.game-shell .move-log-round {
  min-height: 30px;
  padding: 0.16rem 0.28rem;
  font-size: 0.7rem;
}

.move-log-turn {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

.shell.game-shell .move-log-turn {
  font-size: 0.56rem;
}

.move-log-copy {
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
  min-width: 0;
}

.shell.game-shell .move-log-copy {
  gap: 0.18rem;
}

.move-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.shell.game-shell .move-log-meta {
  gap: 5px;
}

.move-log-pill,
.move-log-action {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-family: var(--ui-font);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.shell.game-shell .move-log-pill,
.shell.game-shell .move-log-action {
  font-size: 0.64rem;
}

.move-log-pill {
  padding: 0.22rem 0.55rem;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 247, 236, 0.92);
}

.move-log-action {
  color: rgba(202, 163, 93, 0.94);
}

.action-visuals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.action-visual-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.action-visual-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.action-visual-label {
  color: var(--muted);
}

.action-visuals-player {
  gap: 4px 8px;
}

.action-visuals-log {
  gap: 4px 8px;
}

.action-visuals-log .action-visual-group.compact {
  gap: 0;
}

.action-visuals-log .action-visual-strip {
  gap: 3px;
}

.action-visuals-log .action-visual-label {
  color: rgba(246, 238, 226, 0.68);
}

.move-log-detail {
  color: rgba(246, 238, 226, 0.92);
  line-height: 1.3;
  font-size: 0.86rem;
}

.shell.game-shell .move-log-detail {
  line-height: 1.2;
  font-size: 0.74rem;
}

.board-center {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.42), transparent 58%),
    linear-gradient(180deg, rgba(104, 126, 70, 0.16), rgba(76, 90, 45, 0.24));
}

.shell.game-shell .board-center {
  padding: 10px;
  border-radius: 14px;
}

.center-caption {
  margin-bottom: 14px;
  color: #f5efe5;
  font-family: var(--ui-font);
  font-size: 0.93rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.shell.game-shell .center-caption {
  margin-bottom: 8px;
  font-size: 0.78rem;
}

.room-stage-hero-strip {
  margin-top: 0;
}

.room-board-note {
  margin-top: 14px;
}

.room-stage-card,
.room-stage-panel {
  min-height: 0;
}

.room-stage-button-row {
  margin-top: 16px;
}

.room-stage-error {
  margin-top: 12px;
}

.room-stage-link {
  margin-top: 10px;
}

.room-stage-note {
  margin-top: 12px;
  line-height: 1.42;
}

.room-rail-panel .panel-head {
  align-items: center;
}

.room-rail-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.room-rail-url {
  padding: 0.82rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(246, 238, 226, 0.9);
  font-size: 0.8rem;
  line-height: 1.35;
}

.room-step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.room-step:first-child {
  border-top: 0;
  padding-top: 0;
}

.room-step-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(246, 238, 226, 0.82);
  font-size: 0.78rem;
}

.room-step.active .room-step-marker {
  border-color: rgba(202, 163, 93, 0.38);
  background: rgba(202, 163, 93, 0.18);
  color: #fff4de;
}

.room-step.done .room-step-marker {
  border-color: rgba(76, 90, 45, 0.36);
  background: rgba(76, 90, 45, 0.2);
  color: #edf4de;
}

.room-step-copy {
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
}

.room-step-label {
  color: rgba(255, 247, 236, 0.92);
  font-family: var(--ui-font);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.room-step-detail {
  color: rgba(246, 238, 226, 0.8);
  font-size: 0.84rem;
  line-height: 1.32;
}

.active-set,
.mini-hand,
.hand {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.compact-hand {
  gap: 6px;
}

.active-set {
  min-height: 112px;
  align-items: center;
}

.active-set-interactive {
  gap: 14px;
}

.table-edge-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.table-edge-pick:hover,
.table-edge-pick:focus-visible,
.table-edge-pick.active {
  transform: translateY(-2px);
  box-shadow: none;
}

.table-edge-pick .card {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.58),
    0 12px 24px rgba(127, 47, 21, 0.18);
}

.table-edge-pick:hover .card,
.table-edge-pick:focus-visible .card,
.table-edge-pick.active .card {
  border-color: rgba(127, 47, 21, 0.46);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.74),
    0 16px 30px rgba(127, 47, 21, 0.22);
}

.table-edge-label {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0.22rem 0.56rem;
  border-radius: 999px;
  background: rgba(255, 249, 241, 0.86);
  color: var(--accent-strong);
  font-family: var(--ui-font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.table-edge-pick.active .table-edge-label {
  background: rgba(255, 243, 229, 0.96);
}

.empty-table,
.hand-hidden {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  width: 100%;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.86);
  font-family: var(--ui-font);
  background: rgba(255, 255, 255, 0.08);
}

.actions {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.shell.game-shell .actions {
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(216px, 1fr));
}

.action-card-hero {
  background:
    radial-gradient(circle at top left, rgba(202, 163, 93, 0.18), transparent 48%),
    rgba(255, 255, 255, 0.64);
}

.action-toolbar,
.action-copy {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.action-toolbar .title-block,
.hand-head .title-block,
.summary .title-block,
.rules-note .title-block,
.take-composer-head .title-block {
  width: 100%;
}

.action-card .title-block-meta,
.hand-panel .title-block-meta,
.summary .title-block-meta,
.rules-note .title-block-meta,
.take-composer-head .title-block-meta {
  flex-basis: 100%;
}

.action-toolbar + .move-choice-grid,
.action-copy + .move-choice-grid,
.action-toolbar + .scout-guide,
.action-toolbar + .scout-status-row,
.action-card .stack,
.action-card .button-row {
  margin-top: 14px;
}

.shell.game-shell .action-toolbar + .move-choice-grid,
.shell.game-shell .action-copy + .move-choice-grid,
.shell.game-shell .action-toolbar + .scout-guide,
.shell.game-shell .action-toolbar + .scout-status-row,
.shell.game-shell .action-card .stack,
.shell.game-shell .action-card .button-row {
  margin-top: 8px;
}

.action-card h3,
.hand-head h3 {
  margin-bottom: 0.25rem;
}

.shell.game-shell .action-card h3,
.shell.game-shell .hand-head h3 {
  font-size: 0.94rem;
}

.move-choice-title {
  font-family: var(--ui-font);
  font-size: 0.98rem;
  font-weight: 700;
}

.opening-choice-grid,
.move-choice-grid {
  display: grid;
  gap: 12px;
}

.opening-choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 14px;
}

.move-choice-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.shell.game-shell .move-choice-grid {
  gap: 6px;
}

.opening-choice,
.move-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  text-align: left;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
}

.opening-choice {
  width: 100%;
}

.move-choice {
  flex: 0 1 auto;
  width: fit-content;
  max-width: 100%;
}

.move-choice.hovering {
  border-color: rgba(127, 47, 21, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 249, 242, 0.96), rgba(255, 243, 229, 0.92));
  box-shadow:
    0 18px 30px rgba(127, 47, 21, 0.12),
    inset 0 0 0 1px rgba(127, 47, 21, 0.08);
}

.opening-choice.primary-choice {
  border-color: rgba(127, 47, 21, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.96), rgba(255, 245, 233, 0.92));
}

.opening-choice.selected-choice {
  border-color: rgba(127, 47, 21, 0.46);
  background:
    linear-gradient(180deg, rgba(255, 248, 238, 0.98), rgba(255, 238, 216, 0.95));
  box-shadow:
    0 18px 32px rgba(127, 47, 21, 0.14),
    inset 0 0 0 1px rgba(127, 47, 21, 0.12);
}

.opening-choice:disabled {
  cursor: default;
}

.opening-choice-head,
.move-choice-head {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.opening-choice-badge {
  align-self: flex-start;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(127, 47, 21, 0.12);
  color: var(--ink-strong);
  font-family: var(--ui-font);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.move-choice-head {
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.move-choice-heading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.choice-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(127, 47, 21, 0.12);
  background:
    radial-gradient(circle at top left, rgba(202, 163, 93, 0.18), transparent 68%),
    rgba(168, 64, 30, 0.06);
  color: var(--accent-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.choice-mark svg {
  display: block;
  width: 15px;
  height: 15px;
}

.choice-meta {
  flex: 0 0 auto;
}

.option-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: max-content;
  max-width: 100%;
}

.option-strip-opening {
  gap: 6px;
}

.move-choice-followup {
  background: rgba(249, 246, 240, 0.92);
}

.preview-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chips button {
  padding-inline: 0.85rem;
}

.hand-panel {
  padding-bottom: 18px;
}

.shell.game-shell .hand-panel {
  padding-bottom: 10px;
}

.hand-panel-scouting {
  background:
    radial-gradient(circle at top left, rgba(202, 163, 93, 0.12), transparent 44%),
    rgba(255, 255, 255, 0.64);
}

.take-composer-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(127, 47, 21, 0.12);
  background:
    radial-gradient(circle at top left, rgba(202, 163, 93, 0.12), transparent 42%),
    rgba(255, 251, 245, 0.82);
}

.shell.game-shell .take-composer-shell {
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 12px;
}

.take-composer-head,
.take-composer-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.take-composer-copy {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.take-composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.take-followup {
  padding-top: 4px;
}

.take-followup-empty {
  margin-top: 2px;
}

.hand-head {
  align-items: flex-start;
  margin-bottom: 12px;
}

.shell.game-shell .hand-head {
  margin-bottom: 6px;
}

.hand-card-slot {
  display: inline-flex;
  transition:
    transform 120ms ease,
    opacity 120ms ease;
}

.hand-card-slot.play-direct {
  cursor: pointer;
}

.hand-card-slot .card {
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    opacity 120ms ease,
    filter 120ms ease;
}

.hand-card-slot.playable .card {
  border-color: rgba(76, 90, 45, 0.38);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.68),
    0 12px 24px rgba(76, 90, 45, 0.14);
}

.hand-card-slot.play-direct .card {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 14px 26px rgba(76, 90, 45, 0.18);
}

.hand-card-slot.play-hovered {
  transform: translateY(-6px);
}

.hand-card-slot.play-hovered .card {
  border-color: rgba(127, 47, 21, 0.5);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.82),
    0 18px 32px rgba(127, 47, 21, 0.2);
}

.hand-card-slot.play-muted .card {
  opacity: 0.78;
  filter: saturate(0.88);
}

.hand-composer {
  align-items: flex-end;
  gap: 8px;
}

.insert-gap,
.insert-preview {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.insert-gap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-height: 94px;
  position: relative;
}

.insert-gap:hover,
.insert-gap:focus-visible,
.insert-preview:hover,
.insert-preview:focus-visible {
  transform: translateY(-2px);
  box-shadow: none;
}

.insert-gap-rail {
  position: relative;
  display: block;
  width: 14px;
  height: 74px;
  border-radius: 999px;
  border: 1px dashed rgba(127, 47, 21, 0.22);
  background:
    linear-gradient(180deg, rgba(202, 163, 93, 0.14), rgba(168, 64, 30, 0.12));
  transition:
    width 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.insert-gap-rail::after {
  content: "+";
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  color: var(--accent-strong);
  font-family: var(--ui-font);
  font-size: 0.88rem;
  font-weight: 700;
}

.insert-gap:hover .insert-gap-rail,
.insert-gap:focus-visible .insert-gap-rail {
  width: 18px;
  border-color: rgba(127, 47, 21, 0.42);
  box-shadow: 0 10px 20px rgba(127, 47, 21, 0.1);
}

.insert-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  position: relative;
}

.insert-preview-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.scout-preview-card {
  transform: rotate(-2deg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 16px 28px rgba(127, 47, 21, 0.18);
}

.insert-preview-copy {
  color: var(--accent-strong);
  font-family: var(--ui-font);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.insert-keep-button {
  min-width: 126px;
  padding-inline: 0.85rem;
}

.scout-status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.shell.game-shell .scout-status-row {
  gap: 8px;
  margin-top: 8px;
}

.scout-guide-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(168, 64, 30, 0.12);
  color: var(--accent-strong);
  font-family: var(--ui-font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scout-guide {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--line);
}

.waiting-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  justify-content: center;
}

.waiting-seat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.2rem;
}

.waiting-seat-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(101, 78, 51, 0.16);
  background: rgba(247, 241, 232, 0.94);
  color: var(--ink);
  font-family: var(--ui-font);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.card {
  --card-top-bg: rgba(255, 255, 255, 0.97);
  --card-bottom-bg: rgba(245, 235, 219, 0.96);
  --card-top-ink: var(--ink);
  --card-bottom-ink: var(--ink);
  --card-border: rgba(81, 58, 34, 0.18);
  position: relative;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 42px;
  height: 94px;
  padding: 10px 4px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background:
    linear-gradient(180deg, var(--card-top-bg) 0 50%, var(--card-bottom-bg) 50% 100%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), transparent 55%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 18px rgba(73, 50, 25, 0.14);
}

.shell.game-shell .card {
  width: 38px;
  height: 84px;
  padding: 8px 4px;
  border-radius: 14px;
}

.card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 10px;
  border: 1px dashed rgba(127, 47, 21, 0.16);
}

.shell.game-shell .card::before {
  inset: 4px;
  border-radius: 9px;
}

.card span {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  text-align: center;
  font-size: 1.34rem;
  font-weight: 700;
  line-height: 1;
}

.shell.game-shell .card span {
  font-size: 1.18rem;
}

.card-top {
  align-self: center;
  color: var(--card-top-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.card-bottom {
  align-self: center;
  color: var(--card-bottom-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.card.first,
.card.last {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 18px rgba(73, 50, 25, 0.14);
}

.card.compact {
  width: 26px;
  height: 58px;
  padding: 7px 2px;
  border-radius: 10px;
  justify-content: space-between;
  background:
    linear-gradient(180deg, var(--card-top-bg) 0 50%, var(--card-bottom-bg) 50% 100%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.52), transparent 52%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 4px 9px rgba(73, 50, 25, 0.08);
}

.card.compact::before {
  inset: 3px;
  border-radius: 7px;
  border-style: solid;
  border-color: rgba(127, 47, 21, 0.08);
}

.card.compact span {
  font-size: 0.78rem;
}

.shell.game-shell .card.compact {
  width: 23px;
  height: 50px;
  padding: 5px 2px;
  border-radius: 8px;
}

.shell.game-shell .card.compact::before {
  inset: 2px;
  border-radius: 5px;
}

.shell.game-shell .card.compact span {
  font-size: 0.72rem;
}

.card.mini {
  width: 20px;
  height: 44px;
  padding: 4px 1px;
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 3px 8px rgba(73, 50, 25, 0.08);
}

.card.mini::before {
  inset: 2px;
  border-radius: 5px;
  border-style: solid;
  border-color: rgba(127, 47, 21, 0.08);
}

.card.mini span {
  font-size: 0.62rem;
}

.shell.game-shell .card.mini {
  width: 18px;
  height: 40px;
  padding: 3px 1px;
  border-radius: 7px;
}

.shell.game-shell .card.mini::before {
  inset: 2px;
  border-radius: 4px;
}

.shell.game-shell .card.mini span {
  font-size: 0.56rem;
}

.card.log-mini {
  width: 18px;
  height: 34px;
  padding: 3px 1px;
  border-radius: 7px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 2px 5px rgba(73, 50, 25, 0.06);
}

.card.log-mini::before {
  inset: 2px;
  border-radius: 4px;
  border-style: solid;
  border-color: rgba(127, 47, 21, 0.08);
}

.card.log-mini span {
  font-size: 0.5rem;
}

.shell.game-shell .card.log-mini {
  width: 16px;
  height: 30px;
  padding: 2px 1px;
  border-radius: 6px;
}

.shell.game-shell .card.log-mini::before {
  inset: 1px;
  border-radius: 3px;
}

.shell.game-shell .card.log-mini span {
  font-size: 0.46rem;
}

.pass-overlay {
  margin-top: 18px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(31, 23, 17, 0.72);
}

.pass-card {
  max-width: 400px;
  margin: 0 auto;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 249, 241, 0.95), rgba(255, 244, 230, 0.93));
  text-align: center;
}

.timeout-takeover-overlay {
  background: rgba(72, 20, 14, 0.54);
}

.timeout-takeover-card {
  max-width: 460px;
  border: 1px solid rgba(173, 71, 46, 0.22);
  box-shadow: 0 22px 48px rgba(58, 20, 12, 0.16);
}

.timeout-takeover-actions {
  justify-content: center;
  margin-top: 16px;
}

.summary {
  margin-top: 18px;
}

.summary-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.summary-head,
.summary-row {
  display: grid;
  grid-template-columns: minmax(100px, 1.4fr) repeat(2, minmax(60px, 0.9fr)) minmax(70px, 0.9fr) minmax(70px, 0.9fr) minmax(70px, 0.9fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  font-family: var(--ui-font);
  font-size: 0.88rem;
}

.summary-head {
  color: var(--muted);
  background: rgba(118, 96, 70, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-row {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
}

.final-standings {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.final-head,
.final-row {
  display: grid;
  grid-template-columns: 68px minmax(120px, 1.7fr) minmax(110px, 1fr) minmax(70px, 0.8fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  font-family: var(--ui-font);
  font-size: 0.88rem;
}

.final-head {
  color: var(--muted);
  background: rgba(118, 96, 70, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.final-row {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.final-row.winner {
  border-color: rgba(71, 133, 89, 0.28);
  background: linear-gradient(180deg, rgba(244, 255, 246, 0.9), rgba(235, 248, 237, 0.84));
}

.final-row.timed-out {
  background: linear-gradient(180deg, rgba(255, 243, 239, 0.84), rgba(250, 236, 230, 0.78));
}

.placement-badge {
  width: 38px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(114, 88, 63, 0.16);
  background: rgba(255, 250, 244, 0.9);
}

.final-status {
  color: var(--muted-strong);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .layout,
  .waiting-layout,
  .game-stage-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .masthead {
    flex-direction: column;
  }

  .mast-actions {
    width: 100%;
  }

  .move-log-panel {
    position: static;
  }

  .room-stage-featured {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  #app {
    width: min(100vw - 18px, 1400px);
    padding-top: 12px;
  }

  .masthead,
  .panel {
    border-radius: 20px;
    padding: 18px;
  }

  .grid2,
  .button-row,
  .preview-row,
  .hero-strip,
  .actions,
  .opening-choice-grid,
  .move-choice-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-head,
  .game-panel-head,
  .hand-head,
  .action-toolbar,
  .action-copy,
  .take-composer-head,
  .take-composer-foot,
  .scout-status-row {
    flex-direction: column;
    align-items: stretch;
  }

  .game-panel-head {
    display: flex;
  }

  .game-panel-head-actions {
    justify-self: auto;
  }

  .featured-clock,
  .shell.game-shell .featured-clock {
    min-width: 0;
    width: 100%;
  }

  .lobby-row,
  .seat-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .player-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .player-bottom {
    justify-content: flex-start;
  }

  .room-step {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
  }

  .room-step-marker {
    width: 24px;
    height: 24px;
    font-size: 0.72rem;
  }

  .summary-head,
  .summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card {
    width: 38px;
    height: 84px;
  }

  .card span {
    font-size: 1.2rem;
  }

  .insert-gap {
    width: 18px;
    min-height: 84px;
  }

  .insert-gap-rail {
    height: 64px;
  }
}
