:root {
  --bg: #1a3a2e;
  --ink: #f5f0e4;
  --muted: #9fbfb0;
  --accent: #f0c56d;
  --card: #244a3c;
  --danger: #ff6b6b;
  --font: "Noto Sans SC", sans-serif;
  --display: "ZCOOL KuaiLe", cursive;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 0%, #2f6b52, transparent 50%),
    radial-gradient(ellipse at 90% 10%, #4a3820, transparent 45%),
    var(--bg);
}
.back-hub {
  position: fixed; top: max(0.6rem, env(safe-area-inset-top)); left: 0.75rem;
  z-index: 5; color: var(--muted); text-decoration: none; font-size: 0.85rem;
}
.screen {
  min-height: 100dvh;
  padding: 2.5rem 1rem 2rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.panel {
  width: min(420px, 100%);
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 1.2rem 1.1rem 1.4rem;
}
.brand { font-family: var(--display); color: var(--accent); margin: 0; letter-spacing: 0.08em; }
h1, h2 { font-family: var(--display); font-weight: 400; margin: 0.35rem 0 0.5rem; }
.sub, .label { color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.me-row, .join-row, .share { display: flex; gap: 0.45rem; margin: 0.75rem 0; }
input, select {
  flex: 1; min-height: 44px; border-radius: 12px; border: 2px solid #fff;
  background: #102820; color: var(--ink); padding: 0 0.75rem; font: inherit;
}
button {
  min-height: 44px; border-radius: 999px; border: 2px solid #fff;
  background: #102820; color: #fff; font-weight: 700; cursor: pointer; font: inherit;
  padding: 0 1rem;
}
button.primary { background: var(--accent); color: #102820; border-color: #fff; }
button.ghost { width: 100%; margin-top: 0.6rem; background: transparent; }
button:disabled { opacity: 0.45; cursor: default; }
.or { text-align: center; color: var(--muted); font-size: 0.8rem; margin: 0.6rem 0; }
.size-row { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; margin: 0.5rem 0 0.85rem; }
.size-btn {
  width: 2.5rem; height: 2.5rem; min-height: 0; padding: 0; border-radius: 50%;
  font-size: 0.75rem;
}
.size-btn.active { background: #c40000; color: #ffd54a; }
.seats { list-style: none; padding: 0; margin: 0.5rem 0 1rem; }
.seats li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 0.65rem; margin-bottom: 0.35rem;
  background: rgba(0,0,0,0.25); border-radius: 12px; border: 1px solid rgba(255,255,255,0.08);
}
.code { color: var(--accent); }
.err { color: var(--danger); font-size: 0.85rem; }

.table { flex-direction: column; align-items: center; padding-top: 2.2rem; max-width: 560px; margin: 0 auto; }
.bar {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem; margin-bottom: 0.6rem; font-size: 0.85rem;
}
.bar .hint { color: var(--accent); font-weight: 700; flex: 1; text-align: center; }
.mini { min-height: 36px; padding: 0 0.7rem; font-size: 0.8rem; }

.board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  width: min(96vw, 420px);
  aspect-ratio: 1;
  background: #0d241c;
  border: 3px solid #fff;
  border-radius: 12px;
  padding: 4px;
}
.cell {
  background: var(--card);
  border-radius: 6px;
  font-size: 0.58rem;
  line-height: 1.15;
  padding: 2px;
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
  color: #fff;
}
.cell .nm { font-weight: 700; word-break: break-all; }
.cell .pr { opacity: 0.75; }
.cell.brown { background: #6b3e26; }
.cell.sky { background: #2a6f97; }
.cell.pink { background: #9b4b7c; }
.cell.orange { background: #c46b2a; }
.cell.red { background: #a03333; }
.cell.go { background: #1f6f4a; }
.cell.tax { background: #5a2a2a; }
.cell.chance { background: #5a4a1a; }
.cell.station { background: #333; }
.cell.utility { background: #2a4a5a; }
.cell.jail, .cell.gotojail { background: #3a3a50; }
.cell.park { background: #2f5a3a; }
.cell .tokens {
  display: flex; flex-wrap: wrap; gap: 1px; font-size: 0.72rem; line-height: 1;
}
.cell.here { outline: 2px solid var(--accent); }

.dice { font-size: 1.4rem; margin: 0.45rem 0; font-weight: 800; color: var(--accent); }
.cash-row {
  display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center;
  width: 100%; margin-bottom: 0.5rem;
}
.chip {
  background: rgba(0,0,0,0.35); border-radius: 999px; padding: 0.25rem 0.55rem;
  font-size: 0.75rem; border: 1px solid rgba(255,255,255,0.12);
}
.chip.turn { border-color: var(--accent); color: var(--accent); }
.chip.dead { opacity: 0.45; text-decoration: line-through; }
.actions {
  display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center;
  width: 100%;
  position: sticky; bottom: 0.5rem; z-index: 20;
  background: rgba(16, 40, 32, 0.92);
  padding: 0.55rem 0.4rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
}
.actions button { flex: 1 1 40%; min-height: 48px; font-size: 1rem; }
.action-hint {
  flex: 1 1 100%; margin: 0; text-align: center;
  color: var(--accent); font-weight: 700; font-size: 0.9rem;
}
.back-hub { z-index: 3; pointer-events: auto; }
.modal { z-index: 40; }
.modal[hidden], .wx-share-mask[hidden] { display: none !important; pointer-events: none !important; }
.log {
  list-style: none; padding: 0; margin: 0.75rem 0 0; width: 100%;
  max-height: 28vh; overflow: auto; font-size: 0.78rem; color: var(--muted);
}
.log li { padding: 0.2rem 0; border-bottom: 1px dashed rgba(255,255,255,0.08); }

.share-more { background: #07c160; border-color: #fff; color: #fff; }
.share-actions { display: flex; gap: 0.4rem; margin: -0.35rem 0 0.75rem; }
.ghost.mini {
  min-height: 36px; padding: 0 0.75rem; font-size: 0.8rem;
  background: transparent; width: auto; margin: 0;
}
.modal {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal[hidden] { display: none !important; }
.modal-box {
  background: #1a3a2e; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px; padding: 1.1rem 1.15rem 1.25rem;
  width: min(400px, 100%); position: relative;
}
.share-box .close {
  position: absolute; top: 0.45rem; right: 0.55rem;
  width: 36px; height: 36px; min-height: 0; padding: 0;
  border-radius: 50%; background: transparent; border: 1px solid rgba(255,255,255,0.25);
}
.share-box h3 { margin: 0.2rem 0 0.35rem; font-family: var(--display); font-weight: 400; }
.share-box .tight { margin: 0 0 0.75rem; font-size: 0.85rem; }
.share-qr-wrap { text-align: center; margin: 0.5rem 0 0.85rem; }
.share-qr-wrap img {
  width: 200px; height: 200px; border-radius: 12px; background: #fff; padding: 8px;
}
.share-qr-wrap .tip { color: var(--muted); font-size: 0.8rem; margin: 0.35rem 0 0; }
.share-grid { display: grid; gap: 0.45rem; }
.share-act {
  width: 100%; background: #102820;
}
.share-act.wx { background: #07c160; }
.muted { color: var(--muted); word-break: break-all; font-size: 0.75rem; }
.wx-share-mask {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.55);
  display: flex; justify-content: flex-end; padding: 0.75rem 1rem;
}
.wx-share-mask[hidden] { display: none !important; }
.wx-share-mask .bubble {
  background: #fff; color: #222; border-radius: 12px;
  padding: 0.85rem 1rem; max-width: 220px; height: fit-content;
  font-size: 0.9rem; line-height: 1.45; margin-top: 0.5rem;
  position: relative;
}
.wx-share-mask .bubble::after {
  content: ""; position: absolute; top: -8px; right: 18px;
  border: 8px solid transparent; border-bottom-color: #fff; border-top: 0;
}

.primary.block, .ghost.block { width: 100%; margin-top: 0.55rem; }
.my-props {
  width: 100%; margin: 0.35rem 0 0.5rem; padding: 0.45rem 0.55rem;
  background: rgba(0,0,0,0.28); border-radius: 12px; font-size: 0.78rem;
  color: var(--muted); line-height: 1.4;
}
.my-props b { color: var(--accent); }
.dice.pop { animation: dicepop 0.35s ease; }
@keyframes dicepop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25) rotate(-8deg); }
  100% { transform: scale(1); }
}
.cell .own {
  position: absolute; top: 2px; right: 2px; font-size: 0.55rem;
  background: rgba(0,0,0,0.45); border-radius: 4px; padding: 0 2px;
}
