/* 樂點大富翁 · Rich Party — 扁平卡通風（粗邊線、明亮飽和色） */
:root {
  --bg: #FFF4DC;
  --bg2: #FFE8B8;
  --paper: #FFFFFF;
  --ink: #1E2A3A;
  --ink-2: #5B6875;
  --line: #1E2A3A;
  --accent: #FF8C42;
  --accent-2: #FFD93D;
  --green: #2ECC71;
  --red: #E63946;
  --blue: #2F80ED;
  --purple: #9C6ADE;
  --shadow: 0 4px 0 var(--line);
  --radius: 14px;
  --font: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button, .tile, .near-tile, .charbtn, .pcard, .sticker-choice { touch-action: manipulation; }   /* 手機取消 300ms 點擊延遲與雙擊縮放 */
img { -webkit-user-drag: none; user-select: none; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(circle at 20% 10%, #FFE39A 0, transparent 35%), radial-gradient(circle at 85% 90%, #FFD1B3 0, transparent 40%);
  min-height: 100vh; line-height: 1.45; font-size: 15px;
}
button, input, select { font-family: inherit; font-size: inherit; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
.hidden { display: none !important; }

/* ===== 元件 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .6em 1.1em; border: 3px solid var(--line); border-radius: 12px; background: var(--paper);
  color: var(--ink); font-weight: 700; cursor: pointer; box-shadow: var(--shadow); transition: transform .08s, box-shadow .08s;
  user-select: none; white-space: nowrap;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: var(--shadow); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.gold { background: var(--accent-2); }
.btn.green { background: var(--green); color: #fff; }
.btn.red { background: var(--red); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.purple { background: var(--purple); color: #fff; }
.btn.sm { padding: .35em .7em; font-size: .85em; border-width: 2px; border-radius: 9px; box-shadow: 0 2px 0 var(--line); }
.btn.lg { font-size: 1.15em; padding: .75em 1.4em; }
.btn.block { width: 100%; }
.card {
  background: var(--paper); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.input {
  width: 100%; padding: .65em .9em; border: 3px solid var(--line); border-radius: 12px; background: #fff; outline: none;
}
.input:focus { border-color: var(--accent); }
.chip { display: inline-block; padding: .1em .55em; border-radius: 999px; font-size: .78em; font-weight: 700; border: 2px solid var(--line); background: #fff; }
.chip.green { background: var(--green); color: #fff; } .chip.red { background: var(--red); color: #fff; } .chip.gold { background: var(--accent-2); }
.chip.gray { background: #ddd; }
.muted { color: var(--ink-2); font-size: .9em; }
.money { font-variant-numeric: tabular-nums; font-weight: 800; }
.money.pos { color: #1B9E4B; } .money.neg { color: var(--red); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.ico { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.ico img { width: 1em; height: 1em; object-fit: contain; }

/* ===== 首頁 ===== */
.landing { max-width: 520px; margin: 0 auto; padding: 24px 16px 60px; }
.logo { text-align: center; margin: 18px 0 20px; }
.logo .title { font-size: 2.3em; font-weight: 900; letter-spacing: .02em; text-shadow: 3px 3px 0 var(--accent-2); }
.logo .sub { color: var(--ink-2); font-weight: 700; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs .btn { flex: 1; }
.tabs .btn.active { background: var(--accent-2); }
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 700; margin-bottom: 4px; }
.seg { display: flex; gap: 6px; }
.seg .btn { flex: 1; }
.seg .btn.active { background: var(--accent-2); }
.err { color: var(--red); font-weight: 700; min-height: 1.4em; margin-top: 6px; }
.feature { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 16px; }
.feature .card { padding: 10px; font-size: .9em; }
.feature .card b { display: block; font-size: 1.1em; }

/* ===== 遊戲頁佈局 ===== */
.app { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; padding: 10px; max-width: 1180px; margin: 0 auto; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar .title { font-weight: 900; font-size: 1.15em; }
.topbar .code { font-family: ui-monospace, monospace; letter-spacing: .12em; }
.side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; padding: 6px; gap: 8px; }
  .side { order: 2; }
}

/* ===== 棋盤 ===== */
.board-wrap { position: relative; width: 100%; max-width: 760px; margin: 0 auto; align-self: start; }
.board {
  position: relative; width: 100%; aspect-ratio: 1 / 1; display: grid;
  grid-template-columns: 1.45fr repeat(9, 1fr) 1.45fr; grid-template-rows: 1.45fr repeat(9, 1fr) 1.45fr;
  gap: 2px; padding: 4px; background: var(--line); border-radius: 16px; border: 3px solid var(--line);
  box-shadow: 0 6px 0 #b98b3d;
}
.tile {
  position: relative; background: #FFFDF7; border-radius: 6px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: clamp(7px, 1.35vw, 11px); text-align: center; padding: 2px;
  transition: outline .15s;
}
.tile .band { position: absolute; left: 0; right: 0; top: 0; height: 18%; min-height: 6px; }
.tile.side-bottom .band { top: 0; } .tile.side-top .band { top: auto; bottom: 0; }
.tile.side-left .band { top: 0; bottom: 0; left: auto; right: 0; width: 18%; height: auto; min-width: 6px; }
.tile.side-right .band { top: 0; bottom: 0; right: auto; left: 0; width: 18%; height: auto; min-width: 6px; }
.tile .emoji { font-size: 1.9em; line-height: 1; }
.tile .emoji img { width: 2.2em; height: 2.2em; object-fit: contain; }
.tile .name { font-weight: 800; line-height: 1.1; margin-top: 2px; }
.tile .price { color: var(--ink-2); font-weight: 700; }
.tile.corner .emoji { font-size: 2.6em; }
.tile.corner .name { font-size: 1.15em; }
.tile.owned { box-shadow: inset 0 0 0 3px var(--owner); }
.tile .lvl { position: absolute; display: flex; gap: 1px; font-size: .9em; }
.tile.side-bottom .lvl { top: 20%; left: 3px; } .tile.side-top .lvl { bottom: 20%; left: 3px; }
.tile.side-left .lvl { left: 3px; bottom: 3px; flex-direction: column; } .tile.side-right .lvl { right: 3px; top: 3px; flex-direction: column; }
.tile .owner-dot { position: absolute; right: 3px; bottom: 3px; width: 1.2em; height: 1.2em; border-radius: 50%; background: var(--owner); border: 2px solid var(--line); }
.tile.side-top .owner-dot, .tile.side-left .owner-dot { bottom: auto; top: 3px; }
.tile .block { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 2em; filter: drop-shadow(0 2px 0 #000); pointer-events: none; }
.tile.selectable { outline: 4px solid var(--accent); outline-offset: -4px; animation: pulse 1s infinite; }
.tile.highlight { outline: 4px solid var(--accent-2); outline-offset: -4px; }
/* 目前輪到的玩家所在格：清楚外框 + 光暈（顏色 = 該玩家角色色） */
.tile.current { outline: 4px solid var(--cur, var(--accent)); outline-offset: -4px; z-index: 3; box-shadow: inset 0 0 0 3px #fff, 0 0 0 3px var(--cur, var(--accent)), 0 0 16px 4px var(--cur, var(--accent)); animation: curpulse 1.2s ease-in-out infinite; }
.tile.current.owned { box-shadow: inset 0 0 0 3px var(--owner), 0 0 0 3px var(--cur, var(--accent)), 0 0 16px 4px var(--cur, var(--accent)); }
.tile.current::before { content: '▶ 目前'; position: absolute; top: 2px; left: 50%; transform: translateX(-50%); font-size: .8em; font-weight: 900; color: #fff; background: var(--cur, var(--accent)); padding: 0 5px; border-radius: 999px; line-height: 1.4; z-index: 2; white-space: nowrap; }
.tile.current.current-me::before { content: '▶ 你在這'; }
@keyframes curpulse { 0%, 100% { box-shadow: inset 0 0 0 3px #fff, 0 0 0 3px var(--cur, var(--accent)), 0 0 10px 2px var(--cur, var(--accent)); } 50% { box-shadow: inset 0 0 0 3px #fff, 0 0 0 4px var(--cur, var(--accent)), 0 0 22px 8px var(--cur, var(--accent)); } }
@media (prefers-reduced-motion: reduce) { .tile.current { animation: none; } }
@keyframes pulse { 0%, 100% { outline-color: var(--accent); } 50% { outline-color: var(--accent-2); } }
.tile.jail { background: #E9EDF2; } .tile.go_jail { background: #FDE2E2; } .tile.park { background: #E3F7E8; }
.tile.exchange { background: #E4F0FF; } .tile.shop { background: #FFF0F8; } .tile.chance { background: #FFF8DC; } .tile.fate { background: #F1E9FF; }
.tile.start { background: linear-gradient(135deg, #FFE066, #FFB347); }
.tile.tax { background: #F5F5F5; }

.center {
  grid-column: 2 / 11; grid-row: 2 / 11; background: var(--bg2); border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 6px; gap: 6px; position: relative; overflow: hidden; min-height: 0;
}
.center .brand { position: absolute; top: 6px; left: 0; right: 0; text-align: center; font-weight: 900; font-size: clamp(11px, 2vw, 18px); opacity: .55; letter-spacing: .1em; }
.dice { display: flex; gap: 10px; }
.die {
  width: clamp(30px, 6vw, 54px); height: clamp(30px, 6vw, 54px); background: #fff; border: 3px solid var(--line); border-radius: 22%;
  display: grid; place-items: center; font-size: clamp(16px, 3.4vw, 30px); font-weight: 900; box-shadow: 0 3px 0 var(--line);
}
.die.rolling { animation: shake .12s infinite; }
@keyframes shake { 0% { transform: rotate(-12deg) translateY(-2px); } 50% { transform: rotate(10deg) translateY(2px); } 100% { transform: rotate(-8deg); } }
.turn-info { font-weight: 800; text-align: center; font-size: clamp(10px, 1.8vw, 15px); }
.timer { position: relative; width: clamp(40px, 7vw, 64px); height: clamp(40px, 7vw, 64px); }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer .n { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: clamp(11px, 2vw, 18px); }
.timer .arc { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.timer .bgc { fill: #fff; stroke: var(--line); stroke-width: 3; }
.action-box { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: 100%; }
.action-box .btn { font-size: clamp(9px, 1.6vw, 14px); padding: .45em .8em; }
.cardview { background: #fff; border: 3px solid var(--line); border-radius: 12px; padding: 8px 12px; text-align: center; font-weight: 800; max-width: 90%; font-size: clamp(10px, 1.8vw, 15px); box-shadow: var(--shadow); animation: pop .3s; }
.cardview.chance { background: #FFF8DC; } .cardview.fate { background: #F1E9FF; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* 棋子 */
.tokens { position: absolute; inset: 0; pointer-events: none; }
.token {
  position: absolute; width: 8.5%; height: 8.5%; display: grid; place-items: center; font-size: clamp(14px, 3.2vw, 26px);
  transition: left .26s ease-in-out, top .26s ease-in-out; will-change: left, top; z-index: 5; transform: translate(-50%, -50%);
}
.token .av { width: 100%; height: 100%; border-radius: 50%; background: #fff; border: 3px solid var(--c); display: grid; place-items: center; box-shadow: 0 2px 0 var(--line); overflow: hidden; }
.token .av img { width: 100%; height: 100%; object-fit: cover; }
.token.me .av { box-shadow: 0 0 0 3px var(--accent-2), 0 2px 0 var(--line); }
.token.active { z-index: 6; animation: bounce .6s infinite; }
.token.bankrupt { opacity: .35; filter: grayscale(1); }
@keyframes bounce { 0%, 100% { margin-top: 0; } 50% { margin-top: -6px; } }
.token .badge { position: absolute; right: -4px; top: -4px; font-size: .55em; }

/* ===== 側欄 ===== */
.players { display: flex; flex-direction: column; gap: 6px; }
.pcard { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 3px solid var(--line); border-radius: 12px; background: #fff; position: relative; }
.pcard.current { background: #FFF3C4; box-shadow: 0 0 0 3px var(--accent-2); }
.pcard.bankrupt { opacity: .5; }
.pcard .av { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--c); display: grid; place-items: center; font-size: 22px; background: #fff; overflow: hidden; flex: none; }
.pcard .av img { width: 100%; height: 100%; object-fit: cover; }
.pcard .info { flex: 1; min-width: 0; }
.pcard .nm { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .sub { font-size: .8em; color: var(--ink-2); }
.pcard .cash { text-align: right; }
.pcard .cash .money { font-size: 1.05em; }
.pcard .tags { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 2px; }
@media (max-width: 860px) {
  .players { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .pcard { min-width: 150px; flex: none; }
}
.log { height: 180px; overflow-y: auto; font-size: .85em; display: flex; flex-direction: column; gap: 3px; scroll-behavior: smooth; }
.log .line { padding: 3px 6px; border-radius: 6px; background: #fff; }
.log .line.chat { background: #E4F0FF; }
.chat-row { display: flex; gap: 6px; margin-top: 6px; }
.chat-row .input { padding: .4em .7em; }
.mybar { display: flex; gap: 8px; flex-wrap: wrap; }
.mybar .btn { flex: 1; }
.stat { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed #ccc; }

/* ===== 面板 / Modal ===== */
.modal { position: fixed; inset: 0; background: rgba(30, 42, 58, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 50; animation: fade .2s; }
@media (min-width: 640px) { .modal { align-items: center; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { background: var(--paper); border: 3px solid var(--line); border-radius: 18px 18px 0 0; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; padding: 16px; box-shadow: 0 -4px 0 var(--line); animation: up .25s; }
@media (min-width: 640px) { .sheet { border-radius: 18px; box-shadow: var(--shadow); } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h3 { display: flex; align-items: center; gap: 8px; }
.sheet .close { margin-left: auto; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.item .em { font-size: 1.8em; width: 1.5em; text-align: center; }
.item .em img { width: 1.5em; height: 1.5em; object-fit: contain; }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 800; }
.item .d { font-size: .8em; color: var(--ink-2); }
.qty { display: flex; gap: 4px; align-items: center; }
.qty input { width: 64px; text-align: center; padding: .3em; border: 2px solid var(--line); border-radius: 8px; font-weight: 700; }
.spark { width: 70px; height: 26px; }
.spark polyline { fill: none; stroke-width: 2; }
.rent-table { width: 100%; border-collapse: collapse; font-size: .85em; margin-top: 6px; }
.rent-table td { padding: 2px 4px; border-bottom: 1px dashed #ddd; }
.rent-table td:last-child { text-align: right; font-weight: 700; }
.numpad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }

/* ===== 大廳（play 頁內） ===== */
.lobby { max-width: 760px; margin: 0 auto; padding: 12px; display: grid; gap: 12px; }
.chars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.charbtn { border: 3px solid var(--line); border-radius: 14px; background: #fff; padding: 8px 4px; text-align: center; cursor: pointer; box-shadow: var(--shadow); position: relative; }
.charbtn .em { font-size: 2.2em; line-height: 1; }
.charbtn .em img { width: 2.4em; height: 2.4em; object-fit: contain; }
.charbtn .nm { font-weight: 800; font-size: .85em; }
.charbtn.mine { background: var(--accent-2); outline: 4px solid var(--accent); }
.charbtn.taken { opacity: .45; cursor: not-allowed; }
.charbtn .who { position: absolute; top: -8px; right: -6px; font-size: .7em; background: var(--line); color: #fff; padding: 1px 6px; border-radius: 999px; }
.lobby-players { display: flex; flex-direction: column; gap: 6px; }
.share { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bigcode { font-family: ui-monospace, monospace; font-size: 2em; font-weight: 900; letter-spacing: .18em; background: #fff; border: 3px solid var(--line); border-radius: 12px; padding: 4px 14px; box-shadow: var(--shadow); }

/* ===== 排序 / 結算 ===== */
.order-list { display: flex; flex-direction: column; gap: 6px; }
.rank { display: flex; align-items: center; gap: 10px; padding: 10px; border: 3px solid var(--line); border-radius: 12px; background: #fff; }
.rank.first { background: linear-gradient(90deg, #FFE066, #FFF6D5); box-shadow: 0 0 0 3px var(--accent-2); }
.rank .pos { font-size: 1.5em; font-weight: 900; width: 1.4em; text-align: center; }

/* toast */
.toasts { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 700; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); animation: pop .25s; max-width: 90vw; text-align: center; }
.toast.gain { background: #1B9E4B; } .toast.loss { background: var(--red); }
.float-money { position: absolute; font-weight: 900; pointer-events: none; animation: floatUp 1.2s forwards; z-index: 20; font-size: clamp(12px, 2.4vw, 20px); text-shadow: 0 2px 0 #fff; }
@keyframes floatUp { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -50px); } }

.conn { position: fixed; bottom: 8px; right: 8px; font-size: .75em; padding: 2px 8px; border-radius: 999px; background: #ddd; z-index: 40; }
.conn.on { background: var(--green); color: #fff; } .conn.off { background: var(--red); color: #fff; }

/* admin */
table.tbl { width: 100%; border-collapse: collapse; font-size: .9em; background: #fff; }
table.tbl th, table.tbl td { border: 1px solid #ccc; padding: 6px 8px; text-align: left; }
table.tbl th { background: var(--bg2); }

/* Keep a full table readable while the board remains visible. */
@media (min-width: 861px) { .players { max-height: 460px; overflow-y: auto; padding: 4px; } }
.order-summary { font-size: clamp(9px, 1.5vw, 13px); text-align: center; overflow-y: auto; max-height: 24%; flex-shrink: 1; }
.token .av { border-width: 2px; }
@media (min-width: 600px) { .chars { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* 1.2 — a close street camera with a separate, always available strategy board. */
[hidden] { display: none !important; }
.game-main { min-width: 0; align-self: start; }
.map-toolbar, .route-nav, .zoom-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.map-toolbar { padding: 0 0 8px; }
.map-toolbar .btn { flex: 1; min-height: 40px; }
.map-toolbar [aria-pressed="true"] { background: #214b4b; color: #fff; }
#journey { border: 2px solid #284949; border-radius: 20px; background: #f7f8ed; overflow: hidden; box-shadow: 0 4px 0 #c1c9ad; }
.journey-head { display: flex; justify-content: space-between; gap: 5px; padding: 10px 14px; font-size: 13px; color: #254d4a; }
.journey-head span { font-size: 11px; align-self: center; }
.street-scene { position: relative; height: 260px; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 65% 5%, #fff9d8 0 15%, transparent 55%), linear-gradient(#b8e2dc 0 42%, #d1dfb6 43% 100%); }
.street-scene::after { content: ''; position: absolute; bottom: -25px; left: -5%; width: 110%; height: 85px; background: #8ba56c44; border-radius: 50%; z-index: -1; }
.skyline { position: absolute; width: 100%; top: 10px; font-size: 45px; text-align: center; opacity: .65; letter-spacing: 6px; }
.road-perspective { position: absolute; left: 50%; top: 65%; width: 160px; height: 160px; transform: translate(-50%, -50%) perspective(480px) rotateX(57deg); transform-style: preserve-3d; }
.road-belt { width: 100%; height: 100%; transform-style: preserve-3d; }
.street-tile { position: absolute; width: 160px; height: 148px; top: calc(var(--step) * -158px); background: var(--land); border: 4px solid #f7f7de; border-radius: 15px; box-shadow: 0 12px 0 #62725f, 10px 18px 18px #253c3a35; display: grid; place-items: center; }
.street-tile.current { border: 6px solid var(--accent); box-shadow: 0 12px 0 #62725f, 0 0 0 4px #fff, 0 0 24px 6px #ff8c42aa; }
.location-pill { border: 3px solid var(--accent) !important; box-shadow: 0 0 0 3px #fff, 0 3px 0 var(--line); }
.street-tile .ico, .street-tile img { width: 98px; height: 98px; object-fit: contain; }
.hero { position: absolute; width: 160px; height: 205px; left: calc(50% - 80px); bottom: 31px; border: 0; padding: 0; background: transparent; cursor: pointer; color: #213b38; }
.hero-art { position: absolute; inset: 26px 0 0; transform-origin: 50% 88%; filter: drop-shadow(0 5px 1px #35574030); animation: hero-idle 3s ease-in-out infinite; }
.hero-art .ico, .hero-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.hero-shadow { position: absolute; left: 24%; bottom: 1%; width: 52%; height: 12px; border-radius: 50%; background: #284b4266; filter: blur(3px); }
.hero-face { position: absolute; top: 52px; right: -13px; font-size: 29px; filter: drop-shadow(0 2px 0 white); }
.hero-speech { position: absolute; top: 0; left: -35px; width: 230px; font-size: 12px; font-weight: 800; background: #fffdf2; border: 2px solid #325952; border-radius: 14px; padding: 5px 9px; line-height: 1.4; overflow-wrap: anywhere; max-height: 60px; overflow: hidden; }
.hero[data-mood="sad"] .hero-art { filter: saturate(.65) drop-shadow(0 5px 1px #35574030); }
.hero[data-mood="surprised"] .hero-art { animation: hero-surprise .45s ease-in-out 2; }
.walking .hero-art { animation: hero-walk .28s linear infinite; }
.walking .hero-shadow { animation: shadow-step .28s infinite; }
.walking .road-belt { animation: road-flow .28s linear infinite; }
.previewing .hero { opacity: .65; }
.location-pill { position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%); border: 1px solid #284b42; border-radius: 999px; background: #fffbe8; padding: 5px 15px; font: inherit; font-size: 13px; font-weight: 800; white-space: nowrap; cursor: pointer; }
@keyframes hero-idle { 50% { transform: translateY(-3px); } }
@keyframes hero-walk { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-9px) rotate(3deg) scaleY(1.025); } }
@keyframes hero-surprise { 50% { transform: translateY(-17px) scale(1.05); } }
@keyframes road-flow { from { transform: translateY(-158px); } to { transform: translateY(0); } }
@keyframes shadow-step { 50% { transform: scale(.8); opacity: .5; } }
.route-heading { display: flex; justify-content: space-between; gap: 4px; padding: 8px 10px 5px; font-size: 11px; font-weight: 800; color: #45665b; }
.nearby-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; padding: 0 8px; }
.near-tile { position: relative; min-width: 0; border: 1px solid #b0bdad; border-top: 4px solid var(--land); border-radius: 10px; background: #fffef7; padding: 4px 2px; display: flex; align-items: center; flex-direction: column; cursor: pointer; color: #213d35; font: inherit; }
.near-tile.ahead { background: #eaf3dc; }
.near-tile .distance { position: absolute; top: 3px; left: 3px; font-size: 10px; border-radius: 5px; background: #fff9; padding: 0 2px; }
.near-tile .ico, .near-tile img { width: 35px; height: 30px; object-fit: contain; }
.near-tile b { font-size: 12px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-cost { font-size: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-presence { font-size: 10px; min-height: 13px; }
.near-tile.selectable { outline: 3px solid #ef993b; }
.route-nav { justify-content: space-between; padding: 8px; }
.route-nav .btn { font-size: 11px; min-height: 34px; }
#overview { border: 2px solid #284949; background: #f7f8ed; border-radius: 16px; overflow: hidden; }
.zoom-tools { padding: 8px; font-size: 12px; }
.zoom-tools input { flex: 1; width: 50px; min-width: 50px; accent-color: #295b50; }
.map-viewport { overflow: auto; max-height: 65vh; overscroll-behavior: contain; cursor: grab; padding-bottom: 7px; }
.map-viewport:active { cursor: grabbing; }
.map-viewport .board-wrap { max-width: none; margin: 0; }
.map-viewport .tile { user-select: none; }
.overview-legend { text-align: center; gap: 16px; background: radial-gradient(ellipse, #ecf4de, #cfddbd); color: #375c50; }
.overview-legend span { font-size: 12px; }
.map-help { font-size: 11px; color: #45665b; text-align: center; margin: 7px; }
.action-dock { position: sticky; bottom: 6px; z-index: 25; border: 2px solid #284949; background: #fffdf1f5; backdrop-filter: blur(10px); box-shadow: 0 3px 0 #a0af8e, 0 -2px 12px #23443b15; border-radius: 16px; margin-top: 10px; padding: 8px 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 5px 10px; overflow: visible; }
.action-dock .brand { display: none; }
.action-dock .dice { grid-column: 1; grid-row: 1; gap: 4px; }
.action-dock .die { width: 32px; height: 32px; font-size: 19px; border-width: 2px; }
.action-dock .turn-info { grid-column: 2; grid-row: 1; font-size: 13px; }
.action-dock .turn-info .ico { display: none; }
.action-dock .timer { grid-column: 3; grid-row: 1; width: 40px; height: 40px; }
.action-dock .timer .n { font-size: 16px; }
.action-dock .action-box, .action-dock .order-summary, .action-dock .cardview, .action-dock > .muted { grid-column: 1 / -1; }
.action-dock .action-box .btn { min-height: 40px; font-size: 13px; flex: 1; }
.action-dock .order-summary { max-height: 45px; font-size: 11px; }
.action-dock .cardview { max-width: 100%; max-height: 60px; overflow-y: auto; font-size: 12px; padding: 4px; }
.chat-history { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; margin: 8px 0; padding: 5px; font-size: 13px; }
.chat-message { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; background: #eaf0ed; border-radius: 12px 12px 12px 0; padding: 7px 10px; max-width: 90%; align-self: flex-start; overflow-wrap: anywhere; }
.chat-message.mine { align-self: flex-end; background: #e5edc9; border-radius: 12px 12px 0 12px; }
.chat-message b { font-size: 11px; color: #486b5d; }
.chat-sticker { position: relative; width: 85px; height: 85px; }
.chat-sticker .ico, .chat-sticker img { display: block; width: 80px; height: 80px; object-fit: contain; }
.chat-sticker > span:last-child { position: absolute; right: -6px; top: 0; font-size: 25px; }
.chat-tools summary { cursor: pointer; font-size: 13px; font-weight: 800; padding: 10px 0; }
.quick-phrases { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 8px; }
.quick-phrases > span { position: relative; }
.quick-phrases .btn { font-size: 11px; box-shadow: none; border-width: 1px; min-height: 34px; }
.remove-phrase { background: #fff; border: 1px solid #aaa; border-radius: 50%; cursor: pointer; padding: 1px 5px; }
.sticker-picker { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-bottom: 9px; }
.sticker-choice { position: relative; display: flex; flex-direction: column; align-items: center; border: 1px solid #c4d0bf; background: #fffef5; border-radius: 12px; padding: 6px; cursor: pointer; font: inherit; }
.sticker-choice .ico, .sticker-choice img { width: 58px; height: 58px; object-fit: contain; }
.sticker-choice > span:nth-child(2) { position: absolute; top: 5px; right: 10px; font-size: 21px; }
.sticker-choice small { font-size: 11px; }
.chat-row .input { min-width: 0; flex: 1; }
.game-main ~ .side .log { height: 100px; }
@media (max-width: 600px) {
  .topbar { gap: 5px; padding: 7px !important; }
  .topbar .title { font-size: 14px; }
  .topbar .muted { font-size: 11px; }
  .street-scene { height: 185px; }
  .skyline { font-size: 29px; top: 6px; }
  .hero { width: 120px; height: 155px; left: calc(50% - 60px); bottom: 28px; }
  .hero-speech { left: -40px; width: 200px; font-size: 11px; }
  .hero-face { top: 47px; right: -11px; font-size: 23px; }
  .hero-art { top: 22px; }
  .near-tile b { font-size: 11px; }
  .near-tile .ico, .near-tile img { height: 24px; width: 30px; }
  .tile-presence { min-height: 10px; font-size: 9px; }
  .journey-head { padding: 7px 10px; font-size: 12px; }
  .map-toolbar .btn { font-size: 12px; padding: 7px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-art, .hero-shadow, .road-belt, .token, .die, .toast, .sheet { animation: none !important; transition: none !important; }
}
.map-toolbar .chat-jump { flex: 0 0 40px; }
.map-viewport .board-wrap { container-type: inline-size; }
.map-viewport .tile { border: 0; color: var(--ink); font-family: inherit; font-size: clamp(8px, 2cqw, 18px); }
.chat-history { scroll-margin-top: 12px; }
@media (max-width: 860px) {
  .action-dock { position: fixed; left: 6px; right: 6px; bottom: max(6px, env(safe-area-inset-bottom)); margin: 0; }
  .app { padding-bottom: 180px; }
  .side { padding-top: 4px; }
  .conn { bottom: 2px; font-size: 10px; }
}
.modal-countdown { margin-left: auto; font-size: 12px; white-space: nowrap; color: #a45124; }
.sheet .close { margin-left: 4px; }
