:root {
  --bg: #151827;
  --panel: rgba(255, 255, 255, .9);
  --ink: #17202a;
  --muted: #667085;
  --line: rgba(210, 220, 231, .82);
  --primary: #0f9f8f;
  --primary-strong: #087e73;
  --accent: #f59e0b;
  --pink: #ef476f;
  --violet: #7c3aed;
  --blue: #2563eb;
  --good: #16a34a;
  --warn: #d97706;
  --bad: #e11d48;
  --shadow: 0 18px 60px rgba(10, 18, 36, .28);
  --glow: 0 0 28px rgba(15, 159, 143, .28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(239, 71, 111, .22), transparent 28%),
    linear-gradient(245deg, rgba(15, 159, 143, .28), transparent 30%),
    linear-gradient(180deg, #171827 0%, #20263a 48%, #182639 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 1px, transparent 1px 92px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 1px, transparent 1px 92px);
  mask-image: linear-gradient(180deg, rgba(0,0,0,.72), transparent 74%);
  animation: cityGrid 18s linear infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: auto 0 0;
  height: 32vh;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent, rgba(0,0,0,.32)),
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(255, 224, 93, .18) 34px 36px, transparent 36px 72px);
  opacity: .55;
}

button, input {
  font: inherit;
  letter-spacing: 0;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
  position: relative;
  overflow: hidden;
}

button::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.42), transparent);
  transition: transform .42s ease;
}

button:hover:not(:disabled) { transform: translateY(-1px); border-color: #a9bac9; box-shadow: 0 8px 22px rgba(15, 24, 42, .12); }
button:hover:not(:disabled)::after { transform: translateX(120%); }
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary {
  background: linear-gradient(135deg, #0f9f8f, #2563eb 58%, #ef476f);
  color: #fff;
  border-color: rgba(255,255,255,.28);
  box-shadow: 0 10px 28px rgba(15, 159, 143, .24);
}
button.primary:hover:not(:disabled) { background: linear-gradient(135deg, #087e73, #1d4ed8 58%, #db2777); border-color: rgba(255,255,255,.34); }

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255,255,255,.94);
  color: var(--ink);
  outline: none;
}

input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(520px, 1fr) 280px;
  gap: 16px;
  padding: 16px;
  position: relative;
  z-index: 1;
}

.side-panel, .asset-panel, .control-dock, .top-bar {
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(255, 255, 255, .64);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.side-panel, .asset-panel {
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 32px);
  position: relative;
  overflow: hidden;
}

.side-panel::before, .asset-panel::before, .top-bar::before, .control-dock::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--pink), var(--blue));
  opacity: .92;
}

.side-panel > *, .asset-panel > *, .top-bar > *, .control-dock > * {
  position: relative;
  z-index: 1;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #101828, #0f9f8f 54%, #f59e0b);
  color: #fff;
  font-weight: 800;
  font-size: 22px;
}

.brand-block h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.brand-block p, .action-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.season-card {
  padding: 14px;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 159, 143, .92), rgba(37, 99, 235, .86) 58%, rgba(239, 71, 111, .86)),
    linear-gradient(180deg, rgba(255,255,255,.2), transparent);
  box-shadow: 0 14px 34px rgba(15, 24, 42, .22);
}

.season-kicker {
  font-size: 12px;
  font-weight: 850;
  color: rgba(255,255,255,.78);
}

.season-title {
  margin-top: 5px;
  font-size: 20px;
  line-height: 1.12;
  font-weight: 950;
}

.season-track, .season-meter, .quest-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 24, 42, .13);
}

.season-track { margin: 13px 0 9px; background: rgba(255,255,255,.22); }
.season-track span {
  display: block;
  width: 72%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fef08a, #fb7185, #67e8f9);
  animation: trackFlow 2.8s ease-in-out infinite;
}

.season-row {
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,.86);
  font-size: 12px;
}

.entry-panel, .room-panel, .log-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}

.entry-actions { display: grid; gap: 10px; }
.join-row { display: grid; grid-template-columns: 1fr 82px; gap: 8px; }

.room-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.room-code-row span, .overline {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.room-code-row strong {
  display: block;
  margin-top: 3px;
  font-size: 24px;
  letter-spacing: 2px;
}

.phase-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 11px;
  color: #075985;
  background: #e0f2fe;
  font-size: 13px;
  font-weight: 700;
}

.players-list, .asset-list, .product-list, .leaderboard-list {
  display: grid;
  gap: 9px;
}

.player-row, .asset-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.player-dot {
  width: 12px;
  height: 34px;
  border-radius: 999px;
  background: var(--player);
}

.player-name {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.stat-pill {
  min-width: 74px;
  text-align: right;
  font-weight: 800;
}

.room-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.log-panel { min-height: 0; flex: 1; }
.panel-title { font-weight: 900; font-size: 14px; }
.mock-label {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  margin-left: 6px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 850;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.log-item {
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border-left: 4px solid #94a3b8;
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
}

.log-item.good { border-left-color: var(--good); }
.log-item.warn { border-left-color: var(--warn); }
.log-item.bad { border-left-color: var(--bad); }

.game-stage {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
}

.top-bar {
  min-height: 82px;
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-bar h2 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.2;
}

.turn-meter {
  position: relative;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.turn-meter svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.turn-meter circle {
  fill: none;
  stroke: #dbe4ed;
  stroke-width: 5;
}

.turn-meter .timer-ring {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 126;
  stroke-dashoffset: 126;
  transition: stroke-dashoffset .2s linear;
}

.turn-meter span {
  font-weight: 900;
  font-size: 15px;
}

.board-wrap {
  min-height: 0;
  display: grid;
  place-items: center;
}

.board {
  width: min(100%, 820px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 8px;
}

.tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #d6e0ea;
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  padding: 8px;
  overflow: hidden;
  cursor: pointer;
}

.tile:hover { border-color: var(--primary); }
.tile.center {
  grid-column: 2 / 7;
  grid-row: 2 / 7;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: default;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .1), rgba(217, 119, 6, .11)),
    rgba(255,255,255,.72);
}

.center-title {
  font-size: 42px;
  line-height: 1;
  font-weight: 950;
}

.center-subtitle {
  margin-top: 14px;
  color: var(--muted);
  max-width: 360px;
  line-height: 1.6;
}

.tile-name {
  position: relative;
  z-index: 1;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 850;
}

.tile-meta {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 11px;
}

.tile-type {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.tile.property .tile-type { background: var(--primary); }
.tile.chance .tile-type { background: #2563eb; }
.tile.risk .tile-type { background: var(--bad); }
.tile.tax .tile-type { background: var(--warn); }
.tile.bonus .tile-type { background: var(--good); }

.owner-strip {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--owner, transparent);
}

.tokens {
  position: absolute;
  left: 9px;
  bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 2;
}

.token {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--player);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.18);
  font-size: 10px;
  font-weight: 900;
}

.level {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 1;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.control-dock {
  border-radius: 8px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dice-card {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.dice {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #101828;
  color: #fff;
  font-size: 30px;
  font-weight: 950;
}

.action-title {
  font-weight: 900;
  font-size: 17px;
}

.dice-card p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.action-buttons {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 8px;
}

.asset-panel {
  overflow: auto;
}

.profile-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(135deg, #102a43, #0f766e);
  color: #fff;
}

.profile-name {
  font-size: 18px;
  font-weight: 950;
}

.profile-stats {
  margin-top: 8px;
  color: rgba(255,255,255,.84);
  font-size: 13px;
  line-height: 1.65;
}

.product-card, .leaderboard-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.product-head, .leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-name, .rank-name {
  font-weight: 900;
}

.product-price {
  color: var(--primary);
  font-weight: 950;
}

.product-desc {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.product-buy {
  width: 100%;
  min-height: 34px;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 850;
}

.rank-left {
  min-width: 0;
}

.rank-index {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-right: 8px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.rank-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.rank-score {
  text-align: right;
  color: var(--accent);
  font-weight: 950;
  white-space: nowrap;
}

.asset-row {
  grid-template-columns: 12px 1fr;
}

.asset-row .money {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.tile-inspector {
  min-height: 144px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  line-height: 1.6;
  background: #fff;
  color: #344054;
}

.hidden { display: none !important; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(120deg, rgba(10, 18, 36, .86), rgba(18, 31, 52, .72)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 76px);
  backdrop-filter: blur(18px);
}

.auth-scene {
  width: min(920px, 100%);
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 380px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 28px 90px rgba(0,0,0,.34);
  background: rgba(255,255,255,.08);
}

.auth-visual {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 38px;
  color: #fff;
  background:
    linear-gradient(180deg, transparent, rgba(10,18,36,.66)),
    url("/assets/city-board.svg") center / cover no-repeat;
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(15,159,143,.42), transparent 48%),
    linear-gradient(315deg, rgba(239,71,111,.34), transparent 46%);
}

.auth-logo, .auth-title, .auth-subtitle, .auth-road {
  position: relative;
  z-index: 1;
}

.auth-logo {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #101828, #0f9f8f 54%, #f59e0b);
  box-shadow: 0 16px 34px rgba(0,0,0,.25);
  font-size: 26px;
  font-weight: 950;
}

.auth-title {
  margin-top: 20px;
  font-size: 42px;
  line-height: 1;
  font-weight: 950;
  text-shadow: 0 4px 24px rgba(0,0,0,.34);
}

.auth-subtitle {
  margin-top: 12px;
  max-width: 440px;
  color: rgba(255,255,255,.86);
  line-height: 1.65;
  font-weight: 720;
}

.auth-road {
  width: min(360px, 100%);
  height: 8px;
  margin-top: 26px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fef08a, #67e8f9, #fb7185);
  box-shadow: 0 0 28px rgba(103,232,249,.42);
  animation: trackFlow 2.8s ease-in-out infinite;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  background: rgba(255,255,255,.94);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border-radius: 8px;
  background: #eef3f7;
}

.auth-tabs button {
  min-height: 38px;
  border-color: transparent;
  background: transparent;
  font-weight: 950;
}

.auth-tabs button.is-active {
  background: #101828;
  color: #fff;
  box-shadow: 0 8px 22px rgba(16,24,40,.18);
}

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

.auth-submit {
  min-height: 46px;
  margin-top: 2px;
  font-weight: 950;
}

.guest-button {
  min-height: 42px;
  border-style: dashed;
  color: #475467;
  font-weight: 850;
}

.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.profile-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 850;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 20;
  min-width: min(440px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 13px 16px;
  border-radius: 8px;
  background: #101828;
  color: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .asset-panel {
    grid-column: 1 / -1;
    min-height: auto;
    max-height: none;
  }
  .asset-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .auth-gate {
    padding: 10px;
  }
  .auth-scene {
    min-height: auto;
    grid-template-columns: 1fr;
  }
  .auth-visual {
    min-height: 210px;
    padding: 22px;
  }
  .auth-title {
    font-size: 32px;
  }
  .auth-card {
    padding: 18px;
  }
  .profile-actions {
    grid-template-columns: 1fr;
  }
  .app-shell {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  .side-panel, .asset-panel {
    min-height: auto;
  }
  .game-stage {
    order: -1;
  }
  .top-bar {
    min-height: 72px;
    padding: 12px;
  }
  .top-bar h2 {
    font-size: 19px;
  }
  .board {
    gap: 5px;
  }
  .tile {
    padding: 5px;
    border-radius: 6px;
  }
  .tile-name {
    font-size: 9px;
  }
  .tile-meta, .level {
    display: none;
  }
  .token {
    width: 17px;
    height: 17px;
    font-size: 9px;
  }
  .control-dock {
    align-items: stretch;
    flex-direction: column;
  }
  .action-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  .asset-list {
    grid-template-columns: 1fr;
  }
}

.top-bar {
  position: relative;
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.78)),
    linear-gradient(90deg, rgba(15,159,143,.12), rgba(245,158,11,.12), rgba(239,71,111,.1));
}

.turn-copy {
  min-width: 0;
}

.round-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.live-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  margin-left: auto;
}

.live-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(15, 159, 143, .22);
  border-radius: 999px;
  background: rgba(15, 159, 143, .09);
  color: #075985;
  font-size: 12px;
  font-weight: 900;
}

.board-wrap {
  position: relative;
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.13), rgba(255,255,255,.04)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0 1px, transparent 1px 18px);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 18px 56px rgba(0,0,0,.22);
  overflow: hidden;
}

.board-wrap::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  pointer-events: none;
}

.board {
  width: min(100%, 800px, calc(100vh - 190px));
  max-width: 800px;
  min-width: 0;
  gap: 7px;
  filter: drop-shadow(0 18px 26px rgba(0,0,0,.18));
}

.tile {
  border-color: rgba(255,255,255,.58);
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(241,245,249,.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 8px 20px rgba(15, 24, 42, .08);
  isolation: isolate;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, filter .16s ease;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .09;
  background:
    linear-gradient(135deg, transparent 0 44%, currentColor 44% 46%, transparent 46%),
    linear-gradient(45deg, transparent 0 58%, currentColor 58% 60%, transparent 60%);
}

.tile:hover {
  transform: translateY(-2px) scale(1.012);
  border-color: rgba(15, 159, 143, .68);
  box-shadow: 0 14px 28px rgba(15, 24, 42, .16), var(--glow);
}

.tile.property { color: var(--primary); }
.tile.chance { color: var(--blue); }
.tile.risk { color: var(--bad); }
.tile.tax { color: var(--warn); }
.tile.bonus { color: var(--good); }
.tile.start { color: var(--accent); }
.tile.rest { color: var(--violet); }

.tile.is-owned {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.86)),
    linear-gradient(135deg, color-mix(in srgb, var(--owner) 26%, transparent), transparent);
}

.tile.is-level-2 {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--owner) 38%, transparent), 0 9px 22px rgba(15, 24, 42, .12);
}

.tile.is-level-3 {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--owner) 54%, transparent), 0 12px 30px rgba(15, 24, 42, .16);
}

.tile.is-arrival, .tile.is-pending {
  animation: tilePulse 1.35s ease-in-out infinite;
}

.tile.is-turn-position {
  border-color: rgba(245, 158, 11, .8);
}

.tile.has-me .owner-strip {
  width: 7px;
}

.owner-strip {
  width: 6px;
  box-shadow: 0 0 18px color-mix(in srgb, var(--owner) 70%, transparent);
}

.tile-type {
  position: relative;
  right: auto;
  top: auto;
  width: fit-content;
  height: auto;
  min-height: 18px;
  max-width: calc(100% - 4px);
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 13%, white);
  color: currentColor;
  font-size: 10px;
  line-height: 18px;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile.property .tile-type,
.tile.chance .tile-type,
.tile.risk .tile-type,
.tile.tax .tile-type,
.tile.bonus .tile-type {
  background: color-mix(in srgb, currentColor 13%, white);
}

.tile-name {
  font-size: 12px;
  line-height: 1.2;
  min-height: 28px;
  display: flex;
  align-items: center;
}

.tile-meta {
  font-size: 11px;
  color: #475467;
  font-weight: 760;
  padding-right: 28px;
}

.tokens {
  left: 8px;
  bottom: 7px;
}

.token {
  width: 22px;
  height: 22px;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.88), 0 6px 12px rgba(0,0,0,.18);
  animation: tokenIdle 2.6s ease-in-out infinite;
}

.token.is-active {
  animation: tokenTurn 1.1s ease-in-out infinite;
}

.token.is-me {
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(245, 158, 11, .35), 0 8px 18px rgba(0,0,0,.22);
}

.level {
  min-width: 35px;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(245, 158, 11, .13);
  color: #b45309;
}

.tile.center {
  background:
    linear-gradient(135deg, rgba(15,24,42,.82), rgba(15,159,143,.42)),
    rgba(255,255,255,.4);
  border-color: rgba(255,255,255,.46);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 18px 46px rgba(0,0,0,.18);
  color: #fff;
  padding: 0;
}

.city-core {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 26px;
}

.city-map {
  position: absolute;
  inset: 14px;
  background: url("/assets/city-board.svg") center / cover no-repeat;
  opacity: .9;
  border-radius: 8px;
  transform: rotate(-2deg) scale(1.03);
  filter: saturate(1.12) contrast(1.02);
}

.pulse-road {
  position: absolute;
  width: 72%;
  height: 72%;
  border: 2px solid rgba(255, 224, 93, .46);
  border-radius: 26%;
  transform: rotate(-8deg);
  animation: roadPulse 2.8s ease-in-out infinite;
}

.center-title, .center-subtitle, .center-jackpot {
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 14px rgba(0,0,0,.28);
}

.center-title {
  font-size: 42px;
  max-width: min(86%, 420px);
}

.center-subtitle {
  color: rgba(255,255,255,.88);
  font-weight: 720;
  max-width: 410px;
}

.center-jackpot {
  position: absolute;
  left: 22px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(15, 24, 42, .56);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  backdrop-filter: blur(10px);
}

.center-jackpot span {
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 800;
}

.center-jackpot strong {
  color: #fef08a;
  font-size: 16px;
}

.control-dock {
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.78)),
    linear-gradient(90deg, rgba(245,158,11,.12), rgba(239,71,111,.1), rgba(15,159,143,.1));
}

.dice {
  background:
    linear-gradient(135deg, #101828, #26243a),
    linear-gradient(180deg, rgba(255,255,255,.2), transparent);
  border: 1px solid rgba(255,255,255,.26);
  box-shadow: 0 12px 28px rgba(16, 24, 40, .24), inset 0 1px 0 rgba(255,255,255,.2);
  transform-style: preserve-3d;
}

.dice.is-rolling {
  animation: diceRoll .72s cubic-bezier(.22, 1, .36, 1);
}

.profile-card {
  background:
    linear-gradient(135deg, rgba(16,24,40,.95), rgba(15,159,143,.88) 55%, rgba(245,158,11,.9)),
    linear-gradient(180deg, rgba(255,255,255,.16), transparent);
  box-shadow: 0 14px 36px rgba(15, 24, 42, .2);
}

.profile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-kicker {
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 850;
}

.diamond-chip {
  min-width: 58px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  color: #fef08a;
  font-weight: 950;
}

.diamond-chip::before {
  content: "◆";
  margin-right: 5px;
  color: #67e8f9;
}

.account-badge {
  width: fit-content;
  max-width: 100%;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: rgba(255,255,255,.9);
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.season-meter {
  margin-top: 12px;
  background: rgba(255,255,255,.18);
}

.season-meter span, .quest-track span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fef08a, #67e8f9, #fb7185);
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.profile-stats span {
  display: flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  background: rgba(255,255,255,.12);
}

.quest-list {
  display: grid;
  gap: 9px;
}

.quest-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 20px rgba(15, 24, 42, .06);
}

.quest-card.is-ready {
  border-color: rgba(15, 159, 143, .42);
  box-shadow: 0 0 0 1px rgba(15,159,143,.12), 0 12px 28px rgba(15,159,143,.12);
}

.quest-card.is-claimed {
  opacity: .72;
}

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

.quest-name {
  font-weight: 950;
}

.quest-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.quest-reward {
  flex: 0 0 auto;
  color: #b45309;
  font-weight: 950;
}

.quest-reward::after {
  content: " ◆";
  color: #0891b2;
}

.quest-track {
  margin: 9px 0;
  height: 7px;
}

.quest-claim {
  width: 100%;
  min-height: 32px;
  font-weight: 850;
}

.quest-card.is-ready .quest-claim {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.product-card, .leaderboard-row {
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 20px rgba(15, 24, 42, .06);
}

.product-card.is-featured {
  border-color: rgba(245, 158, 11, .38);
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,247,237,.94)),
    linear-gradient(90deg, rgba(245,158,11,.16), transparent);
}

.product-head {
  align-items: flex-start;
}

.product-badge {
  margin-top: 5px;
}

.product-buy {
  background: #101828;
  color: #fff;
  border-color: #101828;
}

.leaderboard-row.rank-1 {
  border-color: rgba(245, 158, 11, .44);
  background: linear-gradient(135deg, #fff, #fffbeb);
}

.leaderboard-row.rank-2 {
  border-color: rgba(37, 99, 235, .24);
}

.leaderboard-row.rank-3 {
  border-color: rgba(239, 71, 111, .24);
}

.rank-1 .rank-index { background: #f59e0b; color: #fff; }
.rank-2 .rank-index { background: #2563eb; color: #fff; }
.rank-3 .rank-index { background: #ef476f; color: #fff; }

.log-item {
  position: relative;
  animation: logIn .28s ease both;
}

.log-item.is-latest {
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 24, 42, .08);
}

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.fx-pop {
  position: absolute;
  transform: translate(-50%, -50%);
  min-height: 42px;
  max-width: min(380px, calc(100vw - 40px));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(16, 24, 40, .9);
  color: #fff;
  border: 1px solid rgba(255,255,255,.26);
  box-shadow: 0 16px 42px rgba(0,0,0,.3);
  font-weight: 950;
  animation: fxPop 1.25s ease both;
}

.fx-pop.good { color: #bbf7d0; }
.fx-pop.warn { color: #fed7aa; }
.fx-pop.bad { color: #fecdd3; }
.fx-pop.roll { color: #bae6fd; }

.confetti-piece {
  position: absolute;
  top: -18px;
  width: 9px;
  height: 15px;
  border-radius: 3px;
  background: linear-gradient(180deg, #fef08a, #fb7185);
  animation: confettiFall 1.4s ease-in var(--delay, 0s) both;
}

.confetti-piece:nth-child(3n) { background: linear-gradient(180deg, #67e8f9, #2563eb); }
.confetti-piece:nth-child(4n) { background: linear-gradient(180deg, #86efac, #0f9f8f); }

@keyframes cityGrid {
  from { background-position: 0 0, 0 0; }
  to { background-position: 92px 0, 0 92px; }
}

@keyframes trackFlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.22); }
}

@keyframes tilePulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 10px 22px rgba(15, 24, 42, .11); }
  50% { transform: translateY(-3px); box-shadow: 0 0 0 3px rgba(245, 158, 11, .18), 0 16px 34px rgba(245, 158, 11, .22); }
}

@keyframes tokenIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes tokenTurn {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.12); }
}

@keyframes roadPulse {
  0%, 100% { opacity: .42; transform: rotate(-8deg) scale(.98); }
  50% { opacity: .9; transform: rotate(-8deg) scale(1.03); }
}

@keyframes diceRoll {
  0% { transform: rotateX(0deg) rotateZ(0deg) scale(1); }
  45% { transform: rotateX(180deg) rotateZ(16deg) scale(1.08); }
  100% { transform: rotateX(360deg) rotateZ(0deg) scale(1); }
}

@keyframes logIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fxPop {
  0% { opacity: 0; transform: translate(-50%, 16px) scale(.84); }
  16% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
  78% { opacity: 1; transform: translate(-50%, -64px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -86px) scale(.96); }
}

@keyframes confettiFall {
  from { opacity: 0; transform: translateY(0) rotate(0deg); }
  12% { opacity: 1; }
  to { opacity: 0; transform: translateY(var(--fall, 420px)) rotate(var(--spin, 180deg)); }
}

@media (max-width: 1180px) {
  .board {
    width: min(100%, 720px);
  }
  .live-badges {
    display: none;
  }
}

@media (max-width: 820px) {
  .board-wrap {
    padding: 8px;
  }
  .board {
    width: min(100%, 370px);
    gap: 4px;
  }
  .city-core {
    min-height: 0;
    padding: 14px;
  }
  .city-map {
    inset: 7px;
  }
  .center-title {
    font-size: 24px;
    max-width: 88%;
  }
  .center-subtitle {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.35;
    max-width: 240px;
  }
  .center-jackpot {
    left: 10px;
    bottom: 9px;
    min-height: 28px;
  }
  .center-jackpot span {
    display: none;
  }
  .tile-type {
    min-height: 14px;
    line-height: 14px;
    padding: 0 4px;
    font-size: 8px;
  }
  .tile-name {
    min-height: 22px;
    font-size: 9px;
  }
  .tokens {
    left: 5px;
    bottom: 5px;
  }
  .token {
    width: 16px;
    height: 16px;
    font-size: 8px;
  }
  .season-title {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* v0.6 天天富翁式手游包装：地图、玩家 HUD、角色社交 */
:root {
  --map-accent: #0f9f8f;
}

body[data-theme="resort"] {
  background:
    linear-gradient(115deg, rgba(37, 99, 235, .28), transparent 28%),
    linear-gradient(245deg, rgba(56, 189, 248, .3), transparent 30%),
    linear-gradient(180deg, #082f49 0%, #164e63 52%, #0f172a 100%);
}

body[data-theme="candy"] {
  background:
    linear-gradient(115deg, rgba(239, 71, 111, .34), transparent 28%),
    linear-gradient(245deg, rgba(251, 191, 36, .28), transparent 30%),
    linear-gradient(180deg, #3b0a2a 0%, #6d1d45 52%, #1f1024 100%);
}

body[data-theme="space"] {
  background:
    linear-gradient(115deg, rgba(124, 58, 237, .34), transparent 28%),
    linear-gradient(245deg, rgba(6, 182, 212, .28), transparent 30%),
    linear-gradient(180deg, #10113a 0%, #22235f 52%, #0f172a 100%);
}

body[data-theme] .season-card,
body[data-theme] button.primary,
body[data-theme] .hud-menu button span {
  background: linear-gradient(135deg, var(--map-accent), #2563eb 58%, #f59e0b);
}

.match-hud {
  position: absolute;
  inset: 12px;
  z-index: 9;
  pointer-events: none;
}

.match-card {
  position: absolute;
  min-width: 190px;
  max-width: 245px;
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  background: rgba(16, 24, 40, .72);
  color: #fff;
  box-shadow: 0 12px 34px rgba(0,0,0,.24);
  backdrop-filter: blur(14px);
}

.match-card.is-empty {
  left: 16px;
  top: 16px;
  grid-template-columns: 1fr;
}

.match-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.match-card span {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  white-space: nowrap;
}

.match-card.is-turn {
  border-color: rgba(254, 240, 138, .7);
  box-shadow: 0 0 0 2px rgba(254,240,138,.16), 0 14px 38px rgba(245,158,11,.28);
}

.match-card.is-me {
  background: linear-gradient(135deg, rgba(15, 159, 143, .86), rgba(16, 24, 40, .76));
}

.seat-1 { left: 14px; top: 14px; }
.seat-2 { right: 14px; top: 14px; }
.seat-3 { right: 14px; bottom: 14px; }
.seat-4 { left: 14px; bottom: 14px; }

.match-avatar {
  width: 34px;
  height: 42px;
}

.map-theme-list {
  display: grid;
  gap: 10px;
  overflow: auto;
}

.map-theme-card {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 10px;
  background: rgba(255,255,255,.94);
}

.map-theme-card.is-active {
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-accent) 22%, transparent);
}

.map-preview {
  width: 76px;
  height: 54px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.22), transparent),
    var(--theme-bg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.26), 0 10px 24px rgba(15,24,42,.12);
}

.map-theme-card strong,
.map-theme-card small {
  display: block;
}

.map-theme-card small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.hud-menu {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.dice-stack {
  display: grid;
  gap: 7px;
}

.dice-power {
  width: 58px;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(16,24,40,.16);
}

.dice-power span {
  display: block;
  width: 18%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fef08a, var(--map-accent), #67e8f9);
  transition: width .25s ease;
}

.dice-power span.is-ready {
  animation: trackFlow 1.1s ease-in-out infinite;
}

.quick-emotes {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-emotes button {
  min-height: 32px;
  padding: 0 10px;
  color: #344054;
  font-size: 12px;
  font-weight: 850;
}

.emote-bubble {
  position: absolute;
  z-index: 30;
  transform: translate(-50%, -100%);
  min-height: 30px;
  max-width: 140px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  color: #101828;
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
  font-size: 13px;
  font-weight: 950;
  animation: emoteFloat 1.4s ease both;
}

.plot-pad {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 34px;
  height: 18px;
  border-radius: 50% 50% 6px 6px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.42), transparent),
    color-mix(in srgb, currentColor 18%, #fff);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
}

.building.is-landmark {
  width: 42px;
  height: 43px;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--owner) 54%, transparent));
}

.building.is-landmark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: #fef08a;
  box-shadow: 0 0 16px rgba(254,240,138,.72);
}

.building.is-landmark i:nth-child(2) {
  border-radius: 5px 5px 1px 1px;
}

@keyframes emoteFloat {
  0% { opacity: 0; transform: translate(-50%, -70%) scale(.82); }
  18% { opacity: 1; transform: translate(-50%, -100%) scale(1.06); }
  78% { opacity: 1; transform: translate(-50%, -128%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -150%) scale(.96); }
}

@media (max-width: 820px) {
  .match-hud {
    inset: 8px;
  }
  .match-card {
    min-width: 130px;
    max-width: 158px;
    min-height: 48px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
  }
  .match-card strong {
    font-size: 11px;
  }
  .match-card span {
    font-size: 9px;
  }
  .match-avatar {
    width: 26px;
    height: 34px;
  }
  .seat-1 { left: 4px; top: 4px; }
  .seat-2 { right: 4px; top: 4px; }
  .seat-3 { right: 4px; bottom: 4px; }
  .seat-4 { left: 4px; bottom: 4px; }
  .hud-menu {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
  .hud-menu button {
    font-size: 9px;
  }
  .quick-emotes {
    justify-content: stretch;
  }
  .quick-emotes button {
    flex: 1;
    min-width: 0;
  }
  .map-theme-card {
    grid-template-columns: 62px minmax(0, 1fr);
  }
  .map-preview {
    width: 62px;
    height: 46px;
  }
}

/* v0.5 app-game shell */
html, body {
  height: 100%;
  overflow: hidden;
}

.app-shell {
  height: 100dvh;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  padding: 14px;
  overflow: hidden;
  z-index: auto;
}

.game-stage {
  height: calc(100dvh - 28px);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
}

.game-logo {
  position: fixed;
  left: 18px;
  top: 18px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px 0 5px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(16, 24, 40, .62);
  color: #fff;
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
}

.game-logo span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f9f8f, #f59e0b);
  font-weight: 950;
}

.game-logo strong {
  font-size: 14px;
}

.top-bar {
  max-width: min(760px, calc(100vw - 32px));
  width: 100%;
  margin: 0 auto;
  min-height: 74px;
}

.board-wrap {
  min-height: 0;
  padding: 10px;
}

.board {
  width: min(calc(100dvh - 238px), calc(100vw - 36px), 800px);
  max-width: 800px;
}

.control-dock {
  width: min(900px, calc(100vw - 28px));
  margin: 0 auto;
  min-height: 82px;
}

.hud-menu {
  position: relative;
  z-index: 55;
  width: min(780px, calc(100vw - 28px));
  min-height: 58px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  background: rgba(16, 24, 40, .72);
  box-shadow: 0 18px 54px rgba(0,0,0,.22);
  backdrop-filter: blur(18px);
}

.hud-menu button {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 6px;
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
  font-size: 12px;
  font-weight: 900;
}

.hud-menu button span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(15,159,143,.95), rgba(37,99,235,.9));
  color: #fff;
  font-size: 11px;
}

.hud-menu button.is-active {
  background: linear-gradient(135deg, rgba(15,159,143,.96), rgba(245,158,11,.88));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.16), 0 10px 24px rgba(15,159,143,.22);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 52;
  border: 0;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: rgba(6, 10, 22, .46);
  backdrop-filter: blur(6px);
}

.drawer-backdrop::after {
  display: none;
}

.drawer-close {
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 72;
  width: 38px;
  height: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  background: rgba(16,24,40,.78);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 12px 32px rgba(0,0,0,.24);
}

.drawer-close::after {
  display: none;
}

.side-panel,
.asset-panel {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: min(392px, calc(100vw - 36px));
  min-height: 0;
  max-height: none;
  display: flex;
  transform: translateX(calc(100% + 34px)) scale(.98);
  opacity: 0;
  pointer-events: none;
  overflow: auto;
  transition: transform .24s ease, opacity .24s ease;
}

.side-panel.is-open,
.asset-panel.is-open {
  transform: translateX(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.drawer-section {
  display: none;
  min-height: 0;
}

.drawer-section.is-active {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-panel .drawer-section.is-active,
.asset-panel .drawer-section.is-active {
  flex: 1;
}

.log-panel.drawer-section.is-active {
  min-height: 0;
}

body[data-panel="room"] .side-panel,
body[data-panel="log"] .side-panel,
body[data-panel="profile"] .asset-panel,
body[data-panel="maps"] .asset-panel,
body[data-panel="quests"] .asset-panel,
body[data-panel="shop"] .asset-panel,
body[data-panel="rank"] .asset-panel,
body[data-panel="assets"] .asset-panel {
  transform: translateX(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

body[data-panel="room"] .drawer-section[data-panel="room"],
body[data-panel="log"] .drawer-section[data-panel="log"],
body[data-panel="profile"] .drawer-section[data-panel="profile"],
body[data-panel="maps"] .drawer-section[data-panel="maps"],
body[data-panel="quests"] .drawer-section[data-panel="quests"],
body[data-panel="shop"] .drawer-section[data-panel="shop"],
body[data-panel="rank"] .drawer-section[data-panel="rank"],
body[data-panel="assets"] .drawer-section[data-panel="assets"] {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width: 820px) {
  .side-panel,
  .asset-panel {
    bottom: 88px;
    max-height: calc(100dvh - 106px);
  }
}

.log-list,
.quest-list,
.product-list,
.leaderboard-list,
.asset-list {
  overflow: auto;
  padding-right: 3px;
}

.walk-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.character {
  --skin: #ffe0bd;
  position: relative;
  display: inline-block;
  width: 28px;
  height: 38px;
  transform-origin: 50% 90%;
}

.character-shadow {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 24px;
  height: 7px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: rgba(15, 24, 42, .22);
}

.character-head {
  position: absolute;
  left: 50%;
  top: 1px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  transform: translateX(-50%);
  background:
    linear-gradient(135deg, rgba(255,255,255,.34), transparent 45%),
    var(--skin);
  border: 2px solid rgba(16, 24, 40, .2);
}

.character-head::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: -5px;
  height: 9px;
  border-radius: 9px 9px 3px 3px;
  background: #263244;
}

.character-body {
  position: absolute;
  left: 50%;
  top: 17px;
  width: 22px;
  height: 17px;
  border-radius: 8px 8px 5px 5px;
  transform: translateX(-50%);
  background:
    linear-gradient(135deg, rgba(255,255,255,.36), transparent 42%),
    var(--player);
  border: 2px solid rgba(255,255,255,.78);
  box-shadow: 0 8px 14px rgba(0,0,0,.16);
}

.character-body::before,
.character-body::after {
  content: "";
  position: absolute;
  top: 5px;
  width: 7px;
  height: 13px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--player) 76%, #101828);
}

.character-body::before {
  left: -6px;
  transform: rotate(16deg);
}

.character-body::after {
  right: -6px;
  transform: rotate(-16deg);
}

.character-feet {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 20px;
  height: 7px;
  transform: translateX(-50%);
}

.character-feet::before,
.character-feet::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 8px;
  height: 7px;
  border-radius: 4px;
  background: #101828;
}

.character-feet::before { left: 1px; }
.character-feet::after { right: 1px; }

.token.character {
  width: 28px;
  height: 38px;
  background: transparent;
  border: 0;
  box-shadow: none;
  animation: characterIdle 2.4s ease-in-out infinite;
}

.token.character.is-active {
  animation: characterReady .9s ease-in-out infinite;
}

.token.character.is-me .character-body {
  box-shadow: 0 0 0 4px rgba(245,158,11,.28), 0 8px 18px rgba(0,0,0,.2);
}

.player-avatar,
.asset-avatar {
  width: 32px;
  height: 42px;
}

.player-row {
  grid-template-columns: 34px 1fr auto;
}

.asset-row {
  grid-template-columns: 34px 1fr;
}

.walk-ghost {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 20;
  transform: translate(var(--x), var(--y));
  animation: boardWalk 1.05s cubic-bezier(.2, .86, .2, 1) forwards;
}

.walk-ghost .character-body::before {
  animation: armRun .24s ease-in-out infinite alternate;
}

.walk-ghost .character-body::after {
  animation: armRun .24s ease-in-out infinite alternate-reverse;
}

.walk-ghost .character-feet::before {
  animation: footRun .2s ease-in-out infinite alternate;
}

.walk-ghost .character-feet::after {
  animation: footRun .2s ease-in-out infinite alternate-reverse;
}

.building,
.building-rise {
  position: absolute;
  right: 8px;
  bottom: 7px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  pointer-events: none;
}

.building i,
.building-rise i {
  display: block;
  width: 8px;
  border-radius: 3px 3px 1px 1px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.46), transparent 38%),
    var(--owner);
  box-shadow: 0 4px 10px rgba(15, 24, 42, .18);
}

.building i:nth-child(1),
.building-rise i:nth-child(1) { height: 16px; }
.building i:nth-child(2),
.building-rise i:nth-child(2) { height: 25px; }
.building i:nth-child(3),
.building-rise i:nth-child(3) { height: 20px; }

.building-level-2 i:nth-child(1),
.building-rise.building-level-2 i:nth-child(1) { height: 21px; }
.building-level-2 i:nth-child(2),
.building-rise.building-level-2 i:nth-child(2) { height: 30px; }
.building-level-2 i:nth-child(3),
.building-rise.building-level-2 i:nth-child(3) { height: 24px; }

.building-level-3 i:nth-child(1),
.building-rise.building-level-3 i:nth-child(1) { height: 26px; }
.building-level-3 i:nth-child(2),
.building-rise.building-level-3 i:nth-child(2) { height: 34px; }
.building-level-3 i:nth-child(3),
.building-rise.building-level-3 i:nth-child(3) { height: 29px; }

.building-rise {
  animation: buildingRise .9s cubic-bezier(.16, 1, .3, 1) both;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--owner) 62%, transparent));
}

.building-rise.upgrade {
  animation-name: buildingUpgrade;
}

@keyframes characterIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes characterReady {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.08); }
}

@keyframes boardWalk {
  0% { opacity: 0; transform: translate(var(--x), var(--y)) translate(-50%, -82%) scale(.86); }
  12% { opacity: 1; }
  45% { transform: translate(calc(var(--x) + var(--dx) * .45), calc(var(--y) + var(--dy) * .45 - 34px)) translate(-50%, -82%) scale(1.05); }
  100% { opacity: 0; transform: translate(calc(var(--x) + var(--dx)), calc(var(--y) + var(--dy))) translate(-50%, -82%) scale(1); }
}

@keyframes armRun {
  from { transform: rotate(28deg); }
  to { transform: rotate(-28deg); }
}

@keyframes footRun {
  from { transform: translateY(0) rotate(10deg); }
  to { transform: translateY(-3px) rotate(-10deg); }
}

@keyframes buildingRise {
  0% { opacity: 0; transform: translateY(28px) scaleY(.08); }
  55% { opacity: 1; transform: translateY(-5px) scaleY(1.12); }
  100% { opacity: 0; transform: translateY(0) scaleY(1); }
}

@keyframes buildingUpgrade {
  0% { opacity: 0; transform: scale(.78); }
  35% { opacity: 1; transform: scale(1.18); }
  100% { opacity: 0; transform: scale(1); }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 8px;
  }
  .game-stage {
    height: calc(100dvh - 16px);
    gap: 8px;
  }
  .game-logo {
    left: 12px;
    top: 10px;
  }
  .game-logo strong {
    display: none;
  }
  .top-bar {
    min-height: 66px;
    padding: 10px 12px;
  }
  .board {
    width: min(calc(100dvh - 250px), calc(100vw - 24px), 372px);
  }
  .control-dock {
    min-height: 112px;
    padding: 10px;
  }
  .hud-menu {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    padding: 6px;
  }
  .hud-menu button {
    min-height: 40px;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
  }
  .hud-menu button span {
    width: 20px;
    height: 20px;
  }
  .side-panel,
  .asset-panel {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-height: min(72dvh, 640px);
    transform: translateY(calc(100% + 28px)) scale(.98);
  }
  .drawer-close {
    right: 16px;
    top: auto;
    bottom: min(72dvh, 640px);
    margin-bottom: 14px;
  }
  .side-panel.is-open,
  .asset-panel.is-open {
    transform: translateY(0) scale(1);
  }
  .token.character {
    width: 20px;
    height: 30px;
  }
  .character {
    width: 22px;
    height: 31px;
  }
  .character-head {
    width: 13px;
    height: 13px;
  }
  .character-body {
    top: 13px;
    width: 17px;
    height: 13px;
  }
  .character-feet {
    width: 16px;
  }
  .building,
  .building-rise {
    right: 4px;
    bottom: 4px;
    width: 24px;
    height: 26px;
    gap: 2px;
  }
  .building i,
  .building-rise i {
    width: 6px;
  }
}

/* v0.6 final layout overrides */
.game-stage {
  position: relative;
  z-index: 54;
}

.hud-menu {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  z-index: 74;
}

@media (max-width: 820px) {
  .hud-menu {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    z-index: 74;
  }

  .side-panel,
  .asset-panel {
    bottom: 88px;
    max-height: min(60dvh, 540px);
    transform: translateY(calc(100% + 108px)) scale(.98);
  }

  .side-panel.is-open,
  .asset-panel.is-open,
  body[data-panel="room"] .side-panel,
  body[data-panel="log"] .side-panel,
  body[data-panel="profile"] .asset-panel,
  body[data-panel="maps"] .asset-panel,
  body[data-panel="quests"] .asset-panel,
  body[data-panel="shop"] .asset-panel,
  body[data-panel="rank"] .asset-panel,
  body[data-panel="assets"] .asset-panel {
    transform: translateY(0) scale(1);
  }

  .drawer-close {
    top: 14px;
    bottom: auto;
  }
}

/* v0.7 cinematic tycoon arena */
:root {
  --arena-ink: #f8fbff;
  --arena-card: rgba(12, 17, 34, .74);
  --arena-line: rgba(255, 255, 255, .2);
  --tile-depth: 0 13px 0 rgba(8, 13, 27, .58), 0 20px 34px rgba(0, 0, 0, .28);
}

body {
  background:
    radial-gradient(circle at 14% 14%, rgba(255, 204, 77, .18), transparent 28%),
    radial-gradient(circle at 80% 16%, rgba(72, 196, 255, .2), transparent 26%),
    linear-gradient(180deg, #151831 0%, #252250 44%, #102b42 100%);
}

body[data-theme="resort"] {
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 224, 136, .24), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(45, 212, 191, .25), transparent 26%),
    linear-gradient(180deg, #08335f 0%, #116078 52%, #0c2539 100%);
}

body[data-theme="candy"] {
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 214, 102, .26), transparent 30%),
    radial-gradient(circle at 82% 20%, rgba(255, 110, 176, .28), transparent 28%),
    linear-gradient(180deg, #3c1c52 0%, #7b2f6f 52%, #241536 100%);
}

body[data-theme="space"] {
  background:
    radial-gradient(circle at 15% 18%, rgba(125, 92, 255, .3), transparent 30%),
    radial-gradient(circle at 82% 17%, rgba(34, 211, 238, .22), transparent 28%),
    linear-gradient(180deg, #10103e 0%, #24246d 50%, #07162d 100%);
}

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

.arena-skyline {
  position: absolute;
  left: -5vw;
  right: -5vw;
  bottom: 0;
  height: 29vh;
  background:
    linear-gradient(180deg, transparent 0 18%, rgba(7, 11, 25, .54) 19% 100%),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,255,255,.12) 22px 24px, transparent 24px 64px),
    linear-gradient(90deg, #07111f, #12243c, #07111f);
  clip-path: polygon(0 38%, 5% 38%, 5% 22%, 10% 22%, 10% 48%, 16% 48%, 16% 16%, 22% 16%, 22% 42%, 28% 42%, 28% 26%, 34% 26%, 34% 52%, 42% 52%, 42% 18%, 48% 18%, 48% 46%, 56% 46%, 56% 24%, 63% 24%, 63% 52%, 70% 52%, 70% 15%, 77% 15%, 77% 43%, 84% 43%, 84% 25%, 91% 25%, 91% 46%, 100% 46%, 100% 100%, 0 100%);
  opacity: .76;
}

.arena-orbit {
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(86vw, 920px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
}

.arena-orbit::before,
.arena-orbit::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fef08a;
  box-shadow: 0 0 24px #fef08a;
  animation: arenaDot 7s linear infinite;
}

.arena-orbit::after {
  animation-delay: -3.2s;
  background: #67e8f9;
  box-shadow: 0 0 24px #67e8f9;
}

.orbit-b {
  width: min(70vw, 760px);
  transform: translate(-50%, -50%) rotate(26deg);
  opacity: .75;
}

.arena-lights {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 96px, rgba(255,255,255,.055) 96px 97px),
    repeating-linear-gradient(0deg, transparent 0 96px, rgba(255,255,255,.042) 96px 97px);
  mask-image: radial-gradient(circle at 50% 40%, #000 0 62%, transparent 80%);
  animation: cityGrid 22s linear infinite;
}

.app-shell {
  z-index: auto;
}

.game-stage {
  isolation: isolate;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}

.game-logo {
  background: rgba(10, 15, 31, .78);
  border-color: rgba(255, 255, 255, .24);
}

.match-banner {
  width: min(620px, calc(100vw - 32px));
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(10,15,31,.58), rgba(255,255,255,.1), rgba(10,15,31,.58));
  color: #fff;
  box-shadow: 0 14px 36px rgba(0,0,0,.2);
  backdrop-filter: blur(16px);
}

.match-banner span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--map-accent) 76%, #111827);
  font-size: 11px;
  font-weight: 950;
}

.match-banner strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.top-bar,
.control-dock {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(13, 18, 39, .82), rgba(30, 36, 70, .62)),
    linear-gradient(90deg, color-mix(in srgb, var(--map-accent) 18%, transparent), rgba(255,255,255,.06));
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 18px 48px rgba(0,0,0,.24);
}

.top-bar h2,
.action-title {
  color: #fff;
}

.round-hint,
.dice-card p,
.overline {
  color: rgba(255,255,255,.7);
}

.live-badges span {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.82);
}

.turn-meter circle {
  stroke: rgba(255,255,255,.18);
}

.turn-meter .timer-ring {
  stroke: #fef08a;
  filter: drop-shadow(0 0 8px rgba(254,240,138,.58));
}

.board-wrap {
  position: relative;
  padding: 18px;
}

.board-wrap::after {
  content: "";
  position: absolute;
  width: min(86vmin, 860px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--map-accent) 28%, transparent), transparent 62%);
  filter: blur(20px);
  opacity: .76;
  z-index: -1;
  animation: arenaBreath 4.2s ease-in-out infinite;
}

.board {
  position: relative;
  gap: 9px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.04)),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--map-accent) 18%, transparent), transparent 62%),
    rgba(7, 12, 29, .66);
  box-shadow: 0 28px 80px rgba(0,0,0,.36), inset 0 0 0 1px rgba(255,255,255,.12);
  transform: perspective(1300px) rotateX(4deg);
}

.board::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,.18);
  pointer-events: none;
}

.tile {
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 11px;
  padding: 7px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(225,241,255,.86)),
    linear-gradient(135deg, color-mix(in srgb, currentColor 12%, white), white);
  box-shadow: var(--tile-depth);
  transform: translateY(0);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.55), transparent 44%);
  pointer-events: none;
}

.tile:hover {
  transform: translateY(-4px);
  filter: saturate(1.08);
}

.tile-glow {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 15%, color-mix(in srgb, currentColor 28%, transparent), transparent 58%);
  opacity: .34;
  pointer-events: none;
}

.tile.is-route .tile-glow,
.tile.route-flash .tile-glow {
  opacity: .92;
  animation: routeGlow .78s ease both;
  animation-delay: calc(var(--route-step) * 70ms);
}

.tile.is-arrival,
.tile.is-pending {
  outline: 3px solid rgba(254,240,138,.45);
  box-shadow: 0 0 0 5px rgba(254,240,138,.14), 0 16px 0 rgba(8,13,27,.55), 0 24px 50px rgba(245,158,11,.35);
}

.tile.is-turn-position {
  animation: tilePulse 1.35s ease-in-out infinite;
}

.tile-type {
  position: static;
  width: fit-content;
  height: auto;
  min-height: 17px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  box-shadow: 0 5px 12px rgba(0,0,0,.12);
}

.tile-name {
  margin-top: 3px;
  color: #121a2c;
  font-size: 11px;
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255,255,255,.52);
}

.tile-meta {
  color: rgba(18, 26, 44, .66);
  font-size: 10px;
  font-weight: 800;
}

.tile-stage {
  position: absolute;
  left: 7px;
  bottom: 7px;
  z-index: 1;
  min-height: 17px;
  display: inline-flex;
  align-items: center;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(16,24,40,.72);
  color: #fff;
  font-size: 8px;
  font-weight: 950;
}

.owner-strip {
  inset: auto 0 0;
  width: auto;
  height: 6px;
  box-shadow: 0 0 18px color-mix(in srgb, var(--owner) 62%, transparent);
}

.tile.center {
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--map-accent) 42%, transparent), transparent 46%),
    linear-gradient(145deg, rgba(10,15,31,.92), rgba(20,34,63,.78));
}

.theme-aura {
  position: absolute;
  inset: 4%;
  border-radius: 24%;
  background:
    conic-gradient(from 10deg, transparent, color-mix(in srgb, var(--map-accent) 52%, transparent), transparent 34%, rgba(254,240,138,.34), transparent 70%);
  filter: blur(12px);
  opacity: .8;
  animation: stageSpin 12s linear infinite;
}

.city-map {
  opacity: .78;
  border-radius: 18px;
  transform: rotate(-3deg) scale(1.08);
}

.center-landmark {
  position: absolute;
  left: 50%;
  top: 45%;
  z-index: 2;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  opacity: .9;
}

.center-landmark span {
  width: 24px;
  border-radius: 8px 8px 2px 2px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), transparent 36%),
    linear-gradient(180deg, color-mix(in srgb, var(--map-accent) 82%, #fff), #0b1224);
  box-shadow: 0 0 20px color-mix(in srgb, var(--map-accent) 44%, transparent);
}

.center-landmark span:nth-child(1) { height: 68px; }
.center-landmark span:nth-child(2) { height: 106px; }
.center-landmark span:nth-child(3) { height: 82px; }

.center-title {
  margin-top: 96px;
  font-size: clamp(28px, 5vmin, 56px);
  color: #fff;
  filter: drop-shadow(0 0 16px rgba(0,0,0,.36));
}

.center-events {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 55%;
}

.center-events span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.86);
  font-size: 10px;
  font-weight: 950;
}

.match-card {
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(14,20,42,.86), rgba(33,42,82,.68)),
    linear-gradient(90deg, color-mix(in srgb, var(--player, var(--map-accent)) 24%, transparent), transparent);
  box-shadow: 0 18px 42px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.08);
}

.match-card.is-turn::after {
  content: "TURN";
  position: absolute;
  right: 8px;
  top: -10px;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #fef08a;
  color: #3b2600;
  font-size: 10px;
  font-weight: 950;
}

.character {
  width: 34px;
  height: 48px;
}

.character-badge {
  position: absolute;
  left: 50%;
  top: -7px;
  z-index: 5;
  transform: translateX(-50%);
  min-width: 22px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--player);
  border: 1px solid rgba(16,24,40,.18);
  font-size: 9px;
  font-weight: 950;
  box-shadow: 0 5px 12px rgba(0,0,0,.18);
}

.character-head {
  width: 22px;
  height: 22px;
  border-width: 2px;
  box-shadow: 0 5px 10px rgba(0,0,0,.16);
}

.character-head::before {
  top: -6px;
  left: 1px;
  right: 1px;
  height: 11px;
  background:
    linear-gradient(90deg, #111827 0 55%, color-mix(in srgb, var(--player) 72%, #111827) 56%);
}

.character-face {
  position: absolute;
  left: 50%;
  top: 9px;
  z-index: 4;
  width: 14px;
  height: 8px;
  transform: translateX(-50%);
}

.character-face::before,
.character-face::after {
  content: "";
  position: absolute;
  top: 0;
  width: 3px;
  height: 5px;
  border-radius: 999px;
  background: #101828;
  box-shadow: 0 1px 0 rgba(255,255,255,.55);
}

.character-face::before { left: 2px; }
.character-face::after { right: 2px; }

.character-body {
  top: 21px;
  width: 26px;
  height: 20px;
  border-radius: 10px 10px 6px 6px;
}

.character-feet {
  width: 24px;
}

.token.character {
  width: 36px;
  height: 50px;
  filter: drop-shadow(0 10px 12px rgba(0,0,0,.22));
}

.tokens {
  left: auto;
  right: 8px;
  bottom: 8px;
}

.plot-pad {
  width: 38px;
  height: 20px;
  border-radius: 50% 50% 8px 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), transparent),
    linear-gradient(90deg, rgba(14,165,233,.3), rgba(245,158,11,.25));
}

.building,
.building-rise {
  right: 8px;
  bottom: 13px;
  width: 42px;
  height: 48px;
  gap: 4px;
}

.building b,
.building-rise b {
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 52px;
  height: 12px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--owner) 42%, transparent);
  filter: blur(4px);
}

.building.is-landmark {
  width: 52px;
  height: 58px;
}

.building.is-landmark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -18px;
  width: 34px;
  height: 34px;
  transform: translateX(-50%);
  background: radial-gradient(circle, #fef08a 0 22%, transparent 24%), conic-gradient(from 0deg, transparent, #fef08a, transparent);
  filter: drop-shadow(0 0 18px #fef08a);
  animation: landmarkHalo 2.1s linear infinite;
}

.control-dock {
  border-radius: 16px;
  min-height: 92px;
}

.dice {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.5), transparent 28%),
    linear-gradient(145deg, #ffffff, #dfe7ff 52%, #7dd3fc);
  color: #0f172a;
  border: 2px solid rgba(255,255,255,.72);
  box-shadow: 0 16px 0 rgba(8,13,27,.42), 0 24px 44px rgba(0,0,0,.28), inset 0 -10px 18px rgba(37,99,235,.18);
}

.dice::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(15,23,42,.18);
  border-radius: 13px;
}

.dice-power {
  width: 70px;
  height: 9px;
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}

.dice-power span {
  background: linear-gradient(90deg, #67e8f9, #fef08a, #fb7185);
  box-shadow: 0 0 14px rgba(254,240,138,.72);
}

.action-buttons button {
  border-radius: 999px;
  font-weight: 950;
}

.quick-emotes button {
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #fff;
  border-color: rgba(255,255,255,.16);
}

.hud-menu {
  border-radius: 18px;
  background: rgba(7, 12, 29, .76);
  border-color: rgba(255,255,255,.18);
}

.hud-menu button {
  border-radius: 14px;
  background: rgba(255,255,255,.09);
}

.side-panel,
.asset-panel {
  border-radius: 18px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(11,16,32,.92), rgba(29,36,69,.82)),
    linear-gradient(90deg, color-mix(in srgb, var(--map-accent) 16%, transparent), transparent);
  border-color: rgba(255,255,255,.18);
}

.side-panel,
.asset-panel {
  z-index: 82;
}

.drawer-backdrop {
  z-index: 50;
}

.drawer-close {
  z-index: 92;
}

.side-panel input,
.asset-panel input {
  background: rgba(255,255,255,.9);
}

.panel-title,
.player-name,
.quest-name,
.product-name,
.rank-name {
  color: #fff;
}

.room-code-row,
.player-row,
.asset-row,
.quest-card,
.product-card,
.leaderboard-row,
.tile-inspector {
  color: #101828;
  border-radius: 12px;
}

.dice-cinematic {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(circle, rgba(6,10,22,.38), rgba(6,10,22,.08) 46%, transparent 70%);
}

.auth-gate {
  z-index: 130;
}

.dice-cinematic-card {
  width: min(320px, calc(100vw - 44px));
  min-height: 320px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 28px;
  background:
    conic-gradient(from 0deg, rgba(103,232,249,.28), rgba(254,240,138,.32), rgba(251,113,133,.25), rgba(103,232,249,.28)),
    rgba(9, 14, 29, .82);
  color: #fff;
  box-shadow: 0 28px 90px rgba(0,0,0,.48), inset 0 0 0 1px rgba(255,255,255,.12);
  animation: cinematicIn .2s ease both;
}

.dice-cinematic-kicker {
  font-size: 11px;
  font-weight: 950;
  color: rgba(255,255,255,.68);
}

.dice-cinematic-value {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  border-radius: 32px;
  background: linear-gradient(145deg, #fff, #dbeafe);
  color: #0f172a;
  font-size: 76px;
  line-height: 1;
  font-weight: 950;
  box-shadow: 0 18px 0 rgba(0,0,0,.24), 0 30px 50px rgba(0,0,0,.3), inset 0 -12px 20px rgba(37,99,235,.18);
}

.dice-cinematic.is-charging .dice-cinematic-value {
  animation: diceCharge .38s ease-in-out infinite;
}

.dice-cinematic.is-result .dice-cinematic-value {
  animation: diceResult .62s cubic-bezier(.18, 1.3, .28, 1) both;
}

.dice-cinematic-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.12);
}

.dice-cinematic-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #67e8f9, #fef08a, #fb7185);
  transform-origin: left;
  animation: cinematicTrack .82s ease-in-out infinite;
}

.dice-cinematic-copy {
  font-size: 14px;
  font-weight: 950;
}

.fx-pop {
  border-radius: 18px;
  text-shadow: 0 2px 10px rgba(0,0,0,.24);
}

.emote-bubble {
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, #e0f2fe);
}

@keyframes arenaDot {
  from { transform: rotate(0deg) translateX(calc(min(43vw, 460px))) rotate(0deg); }
  to { transform: rotate(360deg) translateX(calc(min(43vw, 460px))) rotate(-360deg); }
}

@keyframes arenaBreath {
  0%, 100% { opacity: .58; transform: scale(.98); }
  50% { opacity: .9; transform: scale(1.04); }
}

@keyframes stageSpin {
  to { transform: rotate(360deg); }
}

@keyframes routeGlow {
  0% { transform: scale(.86); opacity: 0; }
  30% { transform: scale(1.08); opacity: .98; }
  100% { transform: scale(1); opacity: .35; }
}

@keyframes landmarkHalo {
  to { transform: translateX(-50%) rotate(360deg); }
}

@keyframes cinematicIn {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes diceCharge {
  0%, 100% { transform: rotateX(0) rotateY(0) scale(1); }
  50% { transform: rotateX(18deg) rotateY(-22deg) scale(1.05); }
}

@keyframes diceResult {
  0% { transform: scale(.68) rotate(-20deg); opacity: .4; }
  55% { transform: scale(1.16) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes cinematicTrack {
  0% { transform: scaleX(.08); filter: hue-rotate(0deg); }
  60% { transform: scaleX(1); }
  100% { transform: scaleX(.22); filter: hue-rotate(90deg); }
}

@media (max-width: 820px) {
  .game-stage {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  }

  .match-banner {
    min-height: 36px;
    gap: 6px;
  }

  .match-banner strong {
    font-size: 12px;
  }

  .top-bar {
    min-height: 58px;
  }

  .live-badges {
    display: none;
  }

  .board-wrap {
    padding: 8px;
  }

  .board {
    padding: 9px;
    gap: 4px;
    transform: none;
  }

  .tile {
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 7px 0 rgba(8,13,27,.42), 0 12px 22px rgba(0,0,0,.2);
  }

  .tile-stage,
  .tile-meta {
    display: none;
  }

  .tile-name {
    font-size: 8px;
  }

  .tile-type {
    min-height: 13px;
    padding: 0 4px;
    font-size: 7px;
  }

  .center-landmark {
    width: 82px;
    height: 82px;
  }

  .center-title {
    margin-top: 70px;
  }

  .center-events {
    display: none;
  }

  .character-badge {
    display: none;
  }

  .token.character {
    width: 23px;
    height: 33px;
  }

  .building,
  .building-rise {
    width: 28px;
    height: 31px;
  }

  .control-dock {
    min-height: 100px;
    gap: 8px;
  }

  .dice {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 26px;
  }

  .quick-emotes button {
    min-height: 28px;
    font-size: 11px;
  }

  .dice-cinematic-card {
    min-height: 270px;
  }
}
