/* Premium UI refresh inspired by polished Chinese game/product UI: luminous, clean, readable. */

:root {
  --app-bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dbe4f0;
  --text-main: #0f172a;
  --text-sub: #64748b;
  --brand: #2f6bff;
  --brand-dark: #174bd6;
  --accent-cyan: #38bdf8;
  --accent-violet: #8b5cf6;
  --gold: #f59e0b;
  --shadow-soft: 0 24px 70px #15213d18;
  --shadow-card: 0 12px 34px #15213d12;
}

body {
  min-height: 100vh;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background:
    radial-gradient(circle at 16% 6%, #b8d8ff 0 18%, transparent 34%),
    radial-gradient(circle at 88% 10%, #f6d58b 0 12%, transparent 28%),
    radial-gradient(circle at 74% 88%, #c4b5fd 0 13%, transparent 30%),
    linear-gradient(135deg, #f8fbff, #edf4ff 45%, #fff8ee);
  color: var(--text-main);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, #ffffff55 1px, transparent 1px),
    linear-gradient(#ffffff55 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 20%, #000 0 38%, transparent 72%);
}

button {
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 14px 30px #2f6bff2e;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px #2f6bff38;
  filter: brightness(1.04);
}

button:active {
  transform: translateY(0) scale(.99);
  box-shadow: 0 7px 16px #2f6bff28;
}

.secondary-button {
  background: linear-gradient(135deg, #f6b43b, #e07f16);
  box-shadow: 0 14px 30px #f59e0b2e;
}

.small-button,
.tab-button,
.asset-mortgage-button,
.asset-trade-button,
.asset-sell-button {
  box-shadow: none;
}

.start-screen::before,
.hero-card::before,
.hero-card::after,
.board-center::before,
.board-center::after {
  display: none;
}

.start-screen {
  padding: 28px;
}

.hero-card {
  width: min(1240px, 100%);
  position: relative;
  overflow: hidden;
  text-align: left;
  padding: 34px;
  border-radius: 36px;
  border: 1px solid #ffffffcc;
  background:
    linear-gradient(145deg, #ffffffee, #f8fbffdd),
    radial-gradient(circle at 88% 14%, #93c5fd55, transparent 32%);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
}

.hero-headline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-kicker {
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
}

.hero-status-pills,
.table-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-status-pills span,
.table-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #dbeafe;
  background: #ffffffd8;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
}

.table-chip.primary {
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  border-color: #93c5fd;
}

.hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 430px);
  gap: 28px;
  align-items: center;
  margin-top: 20px;
}

.hero-copy h1 {
  margin: 12px 0;
  font-size: clamp(44px, 7vw, 82px);
  line-height: .94;
  letter-spacing: -0.06em;
  background: linear-gradient(135deg, #0f172a, #1d4ed8 52%, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy p {
  max-width: 640px;
  margin: 0;
  color: #475569;
  font-size: 18px;
  line-height: 1.8;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-tags span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #dbeafe;
  color: #1e40af;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px #1d4ed80e;
}

.hero-feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.hero-feature-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 14px 28px #0f172a0a;
}

.hero-feature-card strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
  margin-bottom: 6px;
}

.hero-feature-card span {
  color: #64748b;
  font-size: 13px;
  line-height: 1.7;
}

.hero-icon,
.center-logo,
.player-token-inline,
.tile-detail-icon,
.draw-card-icon {
  filter: none;
  text-shadow: none;
}

.hero-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(145deg, #eff6ff, #ffffff);
  border: 1px solid #dbeafe;
  box-shadow: 0 16px 34px #1d4ed81a;
}

.hero-showcase {
  position: relative;
  min-height: 390px;
  border-radius: 34px;
  background: radial-gradient(circle at 50% 50%, #ffffff, #dbeafe 52%, #bfdbfe);
  border: 1px solid #ffffffcc;
  box-shadow: inset 0 0 0 1px #ffffffaa, 0 28px 70px #1d4ed826;
  overflow: hidden;
}

.showcase-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #ffffff6b 1px, transparent 1px),
    linear-gradient(#ffffff6b 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .5;
}

.showcase-orbit {
  position: absolute;
  inset: 54px;
  border-radius: 50%;
  border: 1px dashed #60a5fa88;
  animation: orbit-spin 16s linear infinite;
}

.showcase-dice,
.showcase-token,
.showcase-card,
.showcase-chip {
  position: absolute;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 950;
  box-shadow: 0 24px 54px #0f172a28;
}

.showcase-dice {
  left: 50%;
  top: 50%;
  width: 104px;
  height: 104px;
  border-radius: 28px;
  transform: translate(-50%, -50%) rotate(-10deg);
  background: linear-gradient(145deg, #ffffff, #e0f2fe);
  color: #174bd6;
  font-size: 54px;
}

.showcase-token {
  right: 54px;
  bottom: 48px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(145deg, #22c55e, #16a34a);
  font-size: 36px;
  color: white;
}

.showcase-card {
  width: 110px;
  height: 148px;
  border-radius: 22px;
  color: #0f172a;
  border: 1px solid #ffffffaa;
  line-height: 1.5;
}

.showcase-card strong {
  font-size: 42px;
}

.showcase-chip {
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  color: #0f172a;
  background: #ffffffd9;
  border: 1px solid #ffffffaa;
}

.chip-a {
  left: 38px;
  bottom: 34px;
}

.chip-b {
  right: 128px;
  top: 152px;
}

.card-a {
  left: 44px;
  top: 56px;
  transform: rotate(-12deg);
  background: linear-gradient(145deg, #fff7ed, #f6b43b);
}

.card-b {
  right: 50px;
  top: 42px;
  transform: rotate(11deg);
  background: linear-gradient(145deg, #f5f3ff, #8b5cf6);
  color: white;
}

@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.start-config-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.config-section {
  padding: 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffffd8, #f8fbffcc);
  border: 1px solid #e2e8f0;
  box-shadow: 0 14px 28px #0f172a0a;
}

.config-section-head {
  margin-bottom: 12px;
}

.config-section-head strong {
  display: block;
  font-size: 15px;
  color: #0f172a;
}

.config-section-head span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
}

.player-select {
  justify-content: flex-start;
  margin: 0;
  padding: 0;
  border-radius: 18px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.player-select label {
  border: 1px solid #e2e8f0;
  box-shadow: none;
}

.single-line-select label {
  width: 100%;
  justify-content: flex-start;
}

.hero-actions {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.hero-actions button {
  min-height: 58px;
}

.left-panel,
.right-panel {
  min-width: 0;
}

.right-panel-shell {
  display: grid;
  gap: 12px;
}

.game-screen {
  width: min(100vw, 1480px);
  margin: 0 auto;
  grid-template-columns: minmax(840px, 1fr) 370px;
  gap: 8px;
  padding: 6px 8px;
  align-items: start;
  justify-content: stretch;
}

.tile {
  padding: 5px;
  border-radius: 16px;
  border: 1px solid #ffffffd8;
  background: linear-gradient(180deg, #ffffffea, #f3f7ffdc);
  box-shadow: 0 9px 18px #0f172a14, inset 0 1px 0 #ffffff;
}

.tile.empty {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.tile .tile-icon {
  position: absolute;
  left: 5px;
  top: 5px;
  right: auto;
  width: 18px;
  height: 18px;
  margin: 0;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #ffffffe0;
  box-shadow: 0 3px 8px #0f172a10;
  font-size: 11px;
  opacity: .92;
}

.tile-name {
  font-weight: 900;
  line-height: 1.2;
  color: #0f172a;
}

.tile-info {
  color: #64748b;
  line-height: 1.25;
}

.tile.land {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--district, #e2e8f0) 14%, #ffffff), #ffffffee),
    #ffffff;
}

.tile.station {
  background: linear-gradient(145deg, #e0f2fe, #bae6fd);
}

.tile.utility {
  background: linear-gradient(145deg, #dbeafe, #bfdbfe);
}

.tile.chance {
  background: radial-gradient(circle at 50% 22%, #fff7ed, #fef3c7 48%, #f59e0b);
}

.tile.fate {
  background: radial-gradient(circle at 50% 22%, #faf5ff, #ede9fe 48%, #8b5cf6);
}

.tile.rest {
  background: radial-gradient(circle at 50% 30%, #fef9c3, #ecfccb 55%, #84cc16);
}

.tile.start {
  background: linear-gradient(145deg, #dcfce7, #86efac);
}

.tile.tax {
  background: repeating-linear-gradient(135deg, #fee2e2 0 10px, #ffe4e6 10px 20px);
}

.owner-badge,
.mortgage-badge,
.monopoly-badge,
.danger-badge,
.jackpot-badge {
  z-index: 2;
}

.player-seat-card {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 28px #0f172a10;
  padding: 16px;
}

.player-seat-card.player-leading {
  background: linear-gradient(180deg, #fffdf0, #ffffff);
}

.player-seat-card.player-danger {
  background: linear-gradient(180deg, #fff7f8, #ffffff);
}

.player-seat-card.player-critical {
  background: linear-gradient(180deg, #fff1f2, #ffffff);
}

.player-card-head {
  align-items: center;
  gap: 12px;
}

.player-avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #eef4ff);
  box-shadow: 0 10px 22px #0f172a12;
}

.player-rank-badge {
  top: -6px;
  right: -8px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 999px;
  background: linear-gradient(145deg, #fff7ed, #fbbf24);
  color: #7c2d12;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px #f59e0b30;
}

.cash-meter {
  margin-top: 2px;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.cash-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.cash-meter.warn i {
  background: linear-gradient(90deg, #f59e0b, #ea580c);
}

.cash-meter.danger i {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.player-status-card #players {
  display: grid;
  gap: 6px;
}

.player-status-row {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 14px #0f172a0b;
  overflow: hidden;
}

.player-status-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.player-status-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.player-status-left > div {
  min-width: 0;
}

.player-status-left strong,
.player-status-left small,
.player-status-sub span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.player-status-left strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.2;
}

.player-status-left small {
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.player-status-chip {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 #ffffff55, 0 5px 10px #0f172a16;
}

.player-status-chip.p1 { background: linear-gradient(135deg, #ef4444, #dc2626); }
.player-status-chip.p2 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.player-status-chip.p3 { background: linear-gradient(135deg, #22c55e, #16a34a); }
.player-status-chip.p4 { background: linear-gradient(135deg, #a855f7, #7c3aed); }

.player-status-money {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
}

.player-status-sub {
  display: grid;
  grid-template-columns: 1.4fr .7fr .7fr .8fr;
  gap: 5px;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
}

.player-status-row .cash-meter {
  margin-top: 0;
  height: 7px;
}

.title-row h1 {
  margin-bottom: 6px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: 420px;
}

.top-actions .small-button {
  min-width: 78px;
  padding: 9px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffffee, #eef4ffde);
  border: 1px solid #dbe4f0;
  color: #334155;
  font-weight: 900;
  box-shadow: 0 8px 18px #0f172a10;
}

.top-actions .small-button:hover {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: #0f172a;
  box-shadow: 0 12px 24px #0f172a12;
}

.top-actions #restartButton {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 24px #ef444430;
}

.subtitle {
  color: #64748b;
}

.board-wrap {
  position: relative;
  isolation: isolate;
  width: min(840px, calc(100vh - 76px), 100%);
  max-width: min(840px, 100%);
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  margin: 0 auto;
}

.board-stage-wrap {
  padding: 5px;
  border-radius: 28px;
  background: linear-gradient(145deg, #fff9efcc, #fff4d6a8 45%, #ffffffd4);
  border: 1px solid #ffffffcc;
  box-shadow: 0 20px 44px #c97d1018;
}

.board-stage-glow {
  position: absolute;
  inset: 10px;
  border-radius: 32px;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 45%, #fff8dc 0, #ffd97755 32%, transparent 70%),
    linear-gradient(135deg, #ffffff44, transparent 35%, #ffffff20 70%, transparent 100%);
  filter: blur(4px);
}

.board-wrap::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 34px;
  background: radial-gradient(circle at 50% 50%, #ffffff24, transparent 62%);
  pointer-events: none;
  z-index: 0;
}

.board-center {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, #ffffff, #f5f9ff 34%, #dbeafe 68%, #c7d8ff 100%);
  border: 1px solid #ffffffd6;
  box-shadow: inset 0 0 0 1px #ffffffaa, 0 22px 54px #1d4ed824;
}

.center-ring {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px dashed #93c5fd;
  opacity: .72;
}

.center-orbit {
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  border: 1px solid #ffffff88;
  pointer-events: none;
}

.center-orbit.orbit-a {
  inset: 28px;
  opacity: .7;
}

.center-orbit.orbit-b {
  inset: 46px;
  opacity: .42;
}

.center-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #ffffffea;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
}

.board-center h2 {
  margin-bottom: 10px;
  font-size: 34px;
  letter-spacing: -.03em;
  color: #0f172a;
}

.center-copy {
  max-width: 280px;
  margin: 0 auto;
  color: #475569;
  font-size: 16px;
  line-height: 1.8;
}

.center-subcopy {
  margin-top: 10px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
}

.center-mini-stats {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.center-mini-stats div {
  padding: 8px 6px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffffd8, #f7fbffca);
  border: 1px solid #dbeafe;
  box-shadow: 0 8px 16px #0f172a0a;
}

.center-mini-stats strong {
  display: block;
  font-size: 10px;
  color: #0f172a;
}

.center-mini-stats span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: #64748b;
}

.featured-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  backdrop-filter: blur(14px);
  border: 1px solid #ffffffd8;
  box-shadow: 0 10px 22px #0f172a0c;
}

.hud-primary-card {
  background: linear-gradient(180deg, #eef6ff, #ffffff);
}

.hud-secondary-card {
  background: linear-gradient(180deg, #f8faff, #ffffff);
}

.featured-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #ffffff38, transparent 26%);
}

.warm-card {
  background: linear-gradient(180deg, #fff8ef, #ffffff);
}

.soft-card {
  background: linear-gradient(180deg, #f7f8ff, #ffffff);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.card h2 {
  margin-bottom: 8px;
}

.card-kicker {
  font-size: 9px;
  font-weight: 900;
  color: #64748b;
  letter-spacing: .1em;
}

.card-pill {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.card-pill.blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.card-pill.gold {
  background: #fef3c7;
  color: #b45309;
}

.card-pill.violet {
  background: #ede9fe;
  color: #6d28d9;
}

.data-tabs {
  padding: 8px;
  border-radius: 22px;
  background: #ffffffb8;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 24px #0f172a0a;
}

.tab-button {
  border-radius: 16px;
  font-weight: 900;
}

.tab-button.active {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
}

.board-error {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid #fecaca;
  background: linear-gradient(145deg, #fff1f2, #ffffff);
  color: #991b1b;
  text-align: center;
  font-weight: 900;
}

.startup-error {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
  color: #0f172a;
}

@media (max-width: 1120px) {
  .hero-main,
  .hero-feature-strip,
  .start-config-panel {
    grid-template-columns: 1fr;
    width: min(100vw - 12px, 980px);
  }

  .game-screen {
    width: min(100vw - 16px, 760px);
    grid-template-columns: 1fr;
  }

  .board-wrap {
    width: min(620px, calc(100vh - 120px), 100%);
    max-width: min(620px, 100%);
  }

  .hero-showcase {
    min-height: 320px;
  }
}

@media (max-width: 720px) {
  .hero-card {
    padding: 22px;
  }

  .hero-copy h1 {
    font-size: 46px;
  }

  .hero-showcase {
    min-height: 280px;
  }

  .center-mini-stats,
  .hero-status-pills,
  .table-chip-row {
    grid-template-columns: 1fr;
  }
}
