:root {
  color-scheme: light;
  --ink: #211f1a;
  --muted: #6b6258;
  --paper: #f7f1e4;
  --panel: #fffaf0;
  --line: #d9cbb6;
  --red: #9d2f25;
  --teal: #1f6f6b;
  --green: #58773c;
  --gold: #c48a2a;
  --blue: #315f8d;
  --shadow: 0 16px 40px rgba(61, 40, 21, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #efe0c8 0%, #f8f0e0 52%, #e6dac3 100%);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  transform: translateY(0) scale(1);
  transition:
    transform 0.12s ease,
    filter 0.12s ease,
    box-shadow 0.12s ease,
    opacity 0.12s ease;
  will-change: transform;
}

button:not(:disabled):active {
  transform: translateY(2px) scale(0.97);
  filter: brightness(0.96);
}

button:disabled {
  transform: none;
  will-change: auto;
}

.hidden {
  display: none !important;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.setup-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  min-height: calc(100vh - 44px);
  align-items: stretch;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 580px;
  border: 1px solid rgba(73, 45, 22, 0.16);
  background: #d1ad73;
}

.hero-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(33, 31, 26, 0.74), rgba(33, 31, 26, 0.22) 52%, rgba(33, 31, 26, 0));
}

.hero-copy {
  position: absolute;
  z-index: 1;
  left: clamp(26px, 6vw, 80px);
  bottom: clamp(28px, 8vh, 92px);
  max-width: 560px;
  color: #fff7e8;
}

.hero-copy h1 {
  margin: 8px 0 12px;
  font-size: clamp(44px, 7vw, 92px);
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  margin: 0;
  max-width: 460px;
  line-height: 1.8;
  font-size: 18px;
}

.eyebrow {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f7c86e;
}

.setup-panel,
.side-panel,
.board-panel,
.log-panel,
.result-view,
dialog {
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.92);
  box-shadow: var(--shadow);
}

.setup-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 28px;
}

.auth-panel h2 {
  margin: 6px 0 0;
  font-size: 30px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  justify-content: center;
  gap: 12px;
}

.auth-actions .ghost-button {
  min-height: 52px;
  font-size: 17px;
}

.security-question-display {
  min-height: 44px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(255, 253, 247, 0.72);
  color: var(--muted);
  font-weight: 800;
}

.security-question-display.loaded {
  color: var(--ink);
  background: #fffef9;
}

.admin-view {
  min-height: calc(100vh - 44px);
  display: grid;
  align-items: start;
}

.admin-panel {
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow);
  padding: 20px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
  align-items: end;
  margin: 16px 0 4px;
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  background: #fffdf7;
}

.admin-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(217, 203, 182, 0.78);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #ece0ca;
  font-weight: 900;
}

.admin-table code {
  font-family: "Consolas", "SFMono-Regular", monospace;
  color: var(--muted);
  word-break: break-all;
}

.auth-message {
  min-height: 26px;
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.auth-message.error {
  color: var(--red);
}

.auth-message.success {
  color: var(--green);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

select,
input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fffef9;
  color: var(--ink);
}

.primary-button,
.phase-button,
.ghost-button,
.icon-button {
  border: 0;
  border-radius: 6px;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 800;
  box-shadow: 0 4px 0 rgba(73, 45, 22, 0.12);
}

.primary-button:not(:disabled):active,
.phase-button:not(:disabled):active,
.ghost-button:not(:disabled):active,
.icon-button:not(:disabled):active,
.mini-button:not(:disabled):active,
.choice-card:not(:disabled):active {
  box-shadow: 0 1px 0 rgba(73, 45, 22, 0.14);
}

.primary-button {
  background: var(--red);
  color: #fffaf0;
}

.phase-button {
  background: #ece0ca;
  color: var(--ink);
}

.phase-button:disabled,
.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.ghost-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.icon-button {
  width: 42px;
  padding: 0;
  background: #ede0c9;
  color: var(--ink);
  font-size: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.topbar h2 {
  margin: 4px 0 0;
  font-size: 32px;
}

.players-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.player-chip {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 250, 240, 0.78);
}

.player-chip.active {
  border-color: var(--red);
  box-shadow: inset 0 0 0 2px rgba(157, 47, 37, 0.1);
}

.player-chip img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 50%;
}

.player-chip strong,
.player-chip span {
  display: block;
}

.player-chip span {
  color: var(--muted);
  font-size: 12px;
}

.play-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
}

.side-panel,
.board-panel,
.log-panel {
  padding: 16px;
}

.board-stack {
  display: grid;
  gap: 14px;
}

.board-area {
  border: 1px solid rgba(217, 203, 182, 0.78);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 247, 0.54);
}

.active-player-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
}

.active-player-card img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.active-player-card h3,
.section-title h3 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.15;
}

.notice-board {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.notice-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.notice-event-name {
  min-height: 22px;
  color: #8d3b20;
  font-size: 16px;
  font-weight: 900;
}

.notice-content {
  min-height: 78px;
  border: 1px dashed rgba(107, 98, 88, 0.42);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 253, 247, 0.72);
  color: var(--ink);
  line-height: 1.45;
  white-space: pre-wrap;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.stat-grid div {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fffdf7;
  overflow: hidden;
}

.stat-grid span,
.section-title span,
.hint {
  color: var(--muted);
  font-size: 12px;
}

.stat-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.cash-stat {
  grid-column: 1 / -1;
  border-color: rgba(196, 138, 42, 0.42) !important;
  background: linear-gradient(135deg, #fff8df 0%, #fffdf7 58%, #f3e2bd 100%) !important;
}

.cash-stat span {
  font-size: 13px;
  font-weight: 800;
  color: #8f5e12;
}

.cash-stat strong {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  line-height: 1;
  color: #8d3b20;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.68);
}

.cash-stat #cashStat {
  position: relative;
  color: #8d3b20;
  font-size: 60px;
  font-weight: 900;
  line-height: 1;
}

.cash-coin {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 3px solid #8d5a13;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #fff2a0 0 12%, transparent 13%),
    radial-gradient(circle, #e7b83c 0 54%, #b87517 55% 100%);
  box-shadow:
    inset 0 0 0 3px rgba(255, 238, 142, 0.58),
    0 3px 0 rgba(89, 49, 9, 0.18);
}

.cash-coin::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 3px;
  background: #fff8df;
  box-shadow: inset 0 0 0 2px #8d5a13;
}

.cash-stat #cashStat.cash-bump {
  animation: cash-pop 0.42s ease-out;
}

.cash-stat #cashStat.cash-bump::after {
  content: attr(data-delta);
  position: absolute;
  left: calc(100% + 10px);
  top: 6px;
  min-width: 42px;
  color: var(--green);
  font-size: 20px;
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
  animation: cash-float 0.82s ease-out forwards;
}

.cash-stat #cashStat.cash-bump[data-direction="down"]::after {
  color: var(--red);
}

@keyframes cash-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.14);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes cash-float {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.88);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(1);
  }
}

.phase-stack {
  display: grid;
  gap: 10px;
}

.current-phase-label {
  min-height: 32px;
  display: grid;
  place-items: center;
  color: #5b3921;
  font-size: 20px;
  font-weight: 900;
}

.phase-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.phase-row .phase-button {
  width: 100%;
  padding-inline: 8px;
}

.phase-stack .phase-button,
.phase-stack .ghost-button,
.phase-stack .primary-button {
  min-height: 50px;
  font-size: 18px;
}

.hint {
  margin: 12px 0 0;
  line-height: 1.7;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.land-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.shop-market-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.market-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fffdf7;
}

.market-card img {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: cover;
}

.market-card div {
  padding: 8px 10px 10px;
}

.market-card strong,
.market-card span {
  display: block;
}

.market-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.land-tile {
  position: relative;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #e8d4b4;
}

.land-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(74, 74, 70, 0.44);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.land-tile.land-built::after {
  opacity: 0;
}

.land-tile img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  display: block;
  filter: grayscale(1) saturate(0.45) brightness(0.92);
}

.land-tile.land-built img {
  filter: none;
}

.land-body {
  position: relative;
  z-index: 1;
  padding: 10px;
}

.land-body h4 {
  margin: 0 0 4px;
}

.land-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.land-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.mini-button {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fffaf0;
  min-height: 30px;
  padding: 0 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(73, 45, 22, 0.1);
}

.danger-button {
  border-color: rgba(157, 47, 37, 0.38);
  background: rgba(157, 47, 37, 0.1);
  color: var(--red);
}

.content-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.content-grid > section {
  border: 1px solid var(--line);
  padding: 14px;
  background: rgba(255, 250, 240, 0.72);
}

.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.prep-stack-list {
  position: relative;
  display: block;
  min-height: 178px;
  padding: 10px 12px 18px;
}

.prep-stack-card {
  position: absolute;
  left: calc(14px + var(--stack-index) * 8px);
  top: calc(18px + var(--stack-index) * 6px);
  z-index: calc(20 - var(--stack-index));
  width: min(156px, calc(100% - 66px));
  min-height: 132px;
  transform: translateY(calc(var(--stack-index) * 2px)) rotate(calc((var(--stack-index) - 2) * 0.45deg));
  box-shadow:
    0 10px 16px rgba(61, 40, 21, 0.14),
    -1px 1px 0 rgba(217, 203, 182, 0.9),
    -2px 2px 0 rgba(236, 224, 202, 0.95);
}

.prep-stack-count {
  position: absolute;
  right: 10px;
  top: 18px;
  z-index: 50;
  border: 1px solid rgba(196, 138, 42, 0.36);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255, 253, 247, 0.9);
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
}

.empty-stack-card {
  position: absolute;
  left: 14px;
  top: 18px;
  display: grid;
  place-items: center;
  width: min(156px, calc(100% - 66px));
  height: 132px;
  border: 2px dashed rgba(107, 98, 88, 0.42);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.48);
  color: rgba(107, 98, 88, 0.58);
  font-size: 18px;
  font-weight: 900;
}

.stack-empty-hint {
  position: absolute;
  left: 14px;
  top: 158px;
  margin: 0;
}

.kitchen-title {
  margin-top: 18px;
}

.game-card {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fffdf7;
}

.game-card img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  display: block;
}

.facedown-stack-list .prep-stack-card {
  left: calc(14px + var(--stack-index) * 4px);
  top: calc(18px + var(--stack-index) * 3px);
  transform: translateY(calc(var(--stack-index) * 1px)) rotate(calc((var(--stack-index) - 2) * 0.22deg));
}

.menu-back-card {
  min-height: 132px;
}

.menu-back-card img {
  height: 132px;
  object-fit: cover;
}

.game-card .card-body {
  padding: 8px 10px 10px;
}

.game-card h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.game-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.customer-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, 260px);
  column-gap: 14px;
  row-gap: 24px;
  align-items: stretch;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.customer-list .game-card {
  position: relative;
  min-height: 260px;
  height: 100%;
  cursor: pointer;
}

.customer-list .game-card img,
.customer-list .card-back {
  height: 166px;
}

.customer-list .game-card .card-body {
  padding: 10px 12px 12px;
}

.customer-list .game-card h4 {
  text-align: center;
  font-size: 20px;
  line-height: 1.2;
}

.customer-list .game-card p {
  text-align: center;
  font-size: 14px;
  line-height: 1.55;
}

.customer-list[data-size="6"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, 232px);
}

.customer-list[data-size="6"] .game-card {
  min-height: 232px;
}

.customer-list[data-size="6"] .game-card img,
.customer-list[data-size="6"] .card-back {
  height: 142px;
}

.customer-list[data-size="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 292px;
}

.customer-list[data-size="2"] .game-card {
  min-height: 292px;
}

.customer-list[data-size="2"] .game-card img,
.customer-list[data-size="2"] .card-back {
  height: 194px;
}

.customer-list .game-card.selected {
  border-color: var(--gold);
  box-shadow:
    0 0 0 3px rgba(196, 138, 42, 0.42),
    0 12px 22px rgba(99, 58, 18, 0.22),
    inset 0 0 0 2px rgba(255, 246, 190, 0.76);
}

.customer-list .game-card.selected::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 243, 167, 0.22), transparent 42%);
  pointer-events: none;
  z-index: 2;
}

.customer-list .game-card:not(.front-customer):not(.facedown-card) {
  cursor: default;
}

.facedown-card {
  cursor: default;
}

.customer-tip-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 1px;
  min-width: 56px;
  min-height: 30px;
  height: 30px;
  padding: 0 6px 0 4px;
  border: 1px solid rgba(127, 74, 14, 0.38);
  border-radius: 999px;
  background: rgba(255, 250, 230, 0.94);
  box-shadow: 0 4px 10px rgba(61, 40, 21, 0.18);
}

.shop-income-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 56px;
  min-height: 30px;
  height: 30px;
  padding: 0 6px 0 4px;
  border: 1px solid rgba(127, 74, 14, 0.38);
  border-radius: 999px;
  background: rgba(255, 250, 230, 0.94);
  box-shadow: 0 4px 10px rgba(61, 40, 21, 0.18);
}

.shop-income-badge-dice,
.shop-income-badge-dish,
.shop-income-badge-house,
.shop-income-badge-menu-plus {
  min-width: 64px;
}

.customer-tip-badge img {
  width: 26px;
  height: 20px;
  object-fit: contain;
}

.shop-income-badge img {
  width: 26px;
  height: 20px;
  object-fit: contain;
}

.shop-income-badge-dish img {
  width: 28px;
  height: 22px;
}

.shop-income-badge-menu-plus {
  min-width: 78px;
}

.shop-income-badge-dice {
  justify-content: center;
  min-width: 42px;
  padding: 0 6px;
}

.shop-income-badge-dice:has(strong) {
  min-width: 84px;
  justify-content: flex-start;
}

.shop-income-badge-dice img {
  width: 28px;
  height: 22px;
}

.shop-income-badge-dice img + img {
  margin-left: 2px;
}

.shop-income-badge-house img {
  width: 27px;
  height: 21px;
}

.customer-tip-badge strong {
  color: #8d3b20;
  font-size: 14px;
  line-height: 1;
}

.shop-income-badge strong {
  color: #8d3b20;
  font-size: 14px;
  line-height: 1;
}

.card-back {
  display: grid;
  place-items: center;
  height: 72px;
  background:
    linear-gradient(135deg, rgba(157, 47, 37, 0.16) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(135deg, transparent 75%, rgba(31, 111, 107, 0.16) 75%) 0 0 / 18px 18px,
    #efe2ce;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.log-panel {
  margin-top: 14px;
}

.log-panel ol {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  margin: 0;
  padding-left: 20px;
}

.log-panel li {
  color: var(--muted);
  line-height: 1.5;
}

.log-money {
  color: var(--red);
  font-weight: 900;
}

.log-money-paid {
  color: var(--green);
}

.log-shop {
  color: var(--ink);
  font-weight: 900;
}

.log-event {
  color: #8d3b20;
  font-weight: 900;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  border-radius: 8px;
}

dialog::backdrop {
  background: rgba(31, 27, 22, 0.46);
}

dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

dialog h3 {
  margin: 0;
}

.dialog-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding: 14px;
}

.dialog-content.reserve-shop-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.reserve-shop-grid .choice-card {
  min-height: 220px;
}

.choice-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 4px 0 rgba(73, 45, 22, 0.1);
}

.choice-card:disabled {
  opacity: 0.48;
}

.choice-card img {
  display: block;
  width: 100%;
  height: 88px;
  object-fit: cover;
}

.choice-card div {
  padding: 10px;
}

.choice-card strong,
.choice-card span {
  display: block;
}

.choice-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.event-dialog {
  width: min(500px, calc(100vw - 28px));
  border: 1px solid rgba(196, 138, 42, 0.52);
  overflow: visible;
}

.event-dialog::backdrop {
  background:
    radial-gradient(circle at 50% 34%, rgba(196, 138, 42, 0.24), transparent 34%),
    rgba(31, 27, 22, 0.58);
}

.event-panel {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 26px 28px 24px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(157, 47, 37, 0.12), transparent 30%),
    linear-gradient(225deg, rgba(31, 111, 107, 0.12), transparent 32%),
    linear-gradient(180deg, #fff8df 0%, #fffdf7 62%, #f0dfbc 100%);
  box-shadow: 0 22px 60px rgba(48, 29, 17, 0.32);
  text-align: center;
  animation: event-dialog-in 0.42s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.event-dialog.event-closing .event-panel {
  animation: event-dialog-out 0.24s ease-in both;
}

.event-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(196, 138, 42, 0.42);
  border-radius: 6px;
  pointer-events: none;
}

.event-type {
  margin: 0;
  color: #8d3b20;
  font-size: 13px;
  font-weight: 900;
}

.event-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 32px;
}

.event-text {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.7;
}

.event-panel button {
  justify-self: center;
  min-width: 148px;
  margin-top: 4px;
}

@keyframes event-dialog-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes event-dialog-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }
}

.dice-dialog {
  width: min(420px, calc(100vw - 28px));
}

.dice-panel {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 18px;
  perspective: 800px;
  perspective-origin: 50% 38%;
}

.dice-panel header {
  width: calc(100% + 36px);
  margin: -18px -18px 0;
}

.dice-stage {
  position: relative;
  width: 210px;
  height: 210px;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
}

.dice-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: 108px;
  height: 22px;
  border-radius: 50%;
  background: rgba(33, 31, 26, 0.24);
  filter: blur(14px);
  transform: translateX(-50%) rotateX(72deg);
  pointer-events: none;
}

.dice-cube {
  position: relative;
  width: 136px;
  height: 136px;
  transform-style: preserve-3d;
  transform: rotateX(-24deg) rotateY(30deg) rotateX(90deg) rotateY(0deg) rotateZ(0deg);
  transition: transform 2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.dice-cube .face {
  position: absolute;
  inset: 0;
  width: 136px;
  height: 136px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.98) 0 42%, rgba(255, 255, 255, 0) 66%),
    linear-gradient(90deg, rgba(116, 91, 60, 0.1) 0 9%, rgba(255, 255, 255, 0.5) 16%, rgba(255, 255, 255, 0) 26%, rgba(255, 255, 255, 0) 74%, rgba(255, 255, 255, 0.46) 84%, rgba(116, 91, 60, 0.1) 100%),
    linear-gradient(180deg, rgba(116, 91, 60, 0.08) 0 9%, rgba(255, 255, 255, 0.48) 16%, rgba(255, 255, 255, 0) 27%, rgba(255, 255, 255, 0) 73%, rgba(255, 255, 255, 0.38) 84%, rgba(116, 91, 60, 0.12) 100%),
    radial-gradient(circle at 0 0, rgba(92, 72, 48, 0.1) 0 12%, rgba(92, 72, 48, 0) 30%),
    radial-gradient(circle at 100% 0, rgba(92, 72, 48, 0.09) 0 12%, rgba(92, 72, 48, 0) 30%),
    radial-gradient(circle at 0 100%, rgba(92, 72, 48, 0.09) 0 12%, rgba(92, 72, 48, 0) 31%),
    radial-gradient(circle at 100% 100%, rgba(92, 72, 48, 0.13) 0 13%, rgba(92, 72, 48, 0) 32%),
    linear-gradient(145deg, #fffdf8 0%, #f6efe6 58%, #e8ddcf 100%);
  border: 0;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow:
    inset 0 0 14px rgba(82, 62, 40, 0.08),
    inset 10px 10px 17px rgba(255, 255, 255, 0.72),
    inset -11px -11px 18px rgba(75, 56, 36, 0.1);
  backface-visibility: hidden;
}

.dice-cube .row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.dice-cube .dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin: 6px;
  background: #252525;
  box-shadow:
    inset 0 0 7px rgba(0, 0, 0, 0.48),
    0 1px 1px rgba(255, 255, 255, 0.35);
}

.dice-cube .red-dot {
  background: #d92722;
  box-shadow:
    inset 4px 0 9px rgba(125, 0, 0, 0.42),
    0 1px 1px rgba(255, 255, 255, 0.38);
}

.dice-cube .hide-dot {
  visibility: hidden;
}

.dice-cube .front {
  transform: translateZ(68.7px);
}

.dice-cube .back {
  transform: rotateY(180deg) translateZ(68.7px);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.86) 0 42%, rgba(255, 255, 255, 0) 66%),
    linear-gradient(90deg, rgba(116, 91, 60, 0.1) 0 9%, rgba(255, 255, 255, 0.4) 17%, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, 0.36) 84%, rgba(116, 91, 60, 0.1) 100%),
    linear-gradient(180deg, rgba(116, 91, 60, 0.08) 0 9%, rgba(255, 255, 255, 0.38) 17%, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, 0.32) 84%, rgba(116, 91, 60, 0.1) 100%),
    radial-gradient(circle at 100% 100%, rgba(80, 60, 40, 0.12) 0 13%, rgba(80, 60, 40, 0) 32%),
    linear-gradient(145deg, #f7efe5 0%, #e3d5c5 100%);
}

.dice-cube .top {
  transform: rotateX(90deg) translateZ(68.7px);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.96) 0 42%, rgba(255, 255, 255, 0) 66%),
    linear-gradient(90deg, rgba(116, 91, 60, 0.08) 0 9%, rgba(255, 255, 255, 0.44) 17%, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, 0.38) 84%, rgba(116, 91, 60, 0.08) 100%),
    linear-gradient(180deg, rgba(116, 91, 60, 0.07) 0 9%, rgba(255, 255, 255, 0.45) 17%, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, 0.34) 84%, rgba(116, 91, 60, 0.09) 100%),
    radial-gradient(circle at 100% 100%, rgba(82, 62, 40, 0.1) 0 13%, rgba(82, 62, 40, 0) 32%),
    linear-gradient(145deg, #fffdf8 0%, #eadfce 100%);
}

.dice-cube .bottom {
  transform: rotateX(-90deg) translateZ(68.7px);
}

.dice-cube .left {
  transform: rotateY(-90deg) translateZ(68.7px);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.84) 0 40%, rgba(255, 255, 255, 0) 66%),
    linear-gradient(90deg, rgba(116, 91, 60, 0.1) 0 9%, rgba(255, 255, 255, 0.34) 17%, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, 0.3) 84%, rgba(116, 91, 60, 0.11) 100%),
    linear-gradient(180deg, rgba(116, 91, 60, 0.08) 0 9%, rgba(255, 255, 255, 0.34) 17%, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, 0.28) 84%, rgba(116, 91, 60, 0.1) 100%),
    radial-gradient(circle at 100% 100%, rgba(80, 60, 40, 0.13) 0 13%, rgba(80, 60, 40, 0) 32%),
    linear-gradient(145deg, #f4eadf 0%, #ddcfbf 100%);
}

.dice-cube .right {
  transform: rotateY(90deg) translateZ(68.7px);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.88) 0 40%, rgba(255, 255, 255, 0) 66%),
    linear-gradient(90deg, rgba(116, 91, 60, 0.1) 0 9%, rgba(255, 255, 255, 0.36) 17%, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, 0.32) 84%, rgba(116, 91, 60, 0.1) 100%),
    linear-gradient(180deg, rgba(116, 91, 60, 0.08) 0 9%, rgba(255, 255, 255, 0.36) 17%, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, 0.3) 84%, rgba(116, 91, 60, 0.1) 100%),
    radial-gradient(circle at 100% 100%, rgba(80, 60, 40, 0.12) 0 13%, rgba(80, 60, 40, 0) 32%),
    linear-gradient(145deg, #f7efe5 0%, #dfd1c1 100%);
}

.dice-message {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}

.result-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
  align-items: center;
  min-height: calc(100vh - 44px);
  padding: 24px;
}

.result-view > img {
  width: 100%;
  height: min(680px, calc(100vh - 92px));
  object-fit: cover;
}

.result-view h2 {
  margin: 8px 0 18px;
  font-size: 42px;
}

.score-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fffdf7;
}

@media (max-width: 980px) {
  .setup-view,
  .play-layout,
  .result-view {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 420px;
  }

  .land-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-market-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .shell {
    padding: 12px;
  }

  .land-grid,
  .shop-market-strip,
  .card-list,
  .dialog-content {
    grid-template-columns: 1fr;
  }

  .dialog-content.reserve-shop-grid {
    grid-template-columns: 1fr;
  }

  .customer-list {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 250px);
  }

  .customer-list .game-card {
    min-height: 250px;
  }

  .customer-list .game-card img,
  .customer-list .card-back {
    height: 156px;
  }

  .prep-stack-count {
    left: auto;
    right: 12px;
    top: 10px;
  }

  .topbar {
    align-items: flex-start;
  }
}
