:root {
  --felt: #123a2b;
  --felt-2: #1b4d3a;
  --felt-3: #23604a;
  --ink: #eef5ef;
  --muted: #9fbcae;
  --accent: #f5c542;
  --red: #e5484d;
  --green: #3ecf7a;
  --line: #22322b;
  --cell: #f6f3e4;
  --board: #cfe6d4;
  --board-ink: #1d2a24;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at 50% 15%, var(--felt-3), var(--felt) 70%) fixed;
  background-color: var(--felt);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100%;
  padding: env(safe-area-inset-top) 8px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

header { display: flex; align-items: center; height: 50px; gap: 8px; }
header h1 { flex: 1; margin: 0; font-size: 20px; display: flex; align-items: center; gap: 6px; letter-spacing: .02em; }
.logo { font-size: 20px; }
.header-right { display: flex; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .09);
  font-size: 17px; cursor: pointer;
}
#btn-lang {
  display: flex; align-items: center; padding: 2px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .09); font-size: 12px; font-weight: 700; height: 36px;
}
#btn-lang span { padding: 4px 8px; border-radius: 999px; color: var(--muted); }
#btn-lang span.on { background: var(--accent); color: #2a2205; }

button { cursor: pointer; }
.primary, #btn-join, #btn-addbot, #action-bar button, .pbtns button, .seg button {
  border: 0;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-weight: 700;
  background: rgba(255, 255, 255, .12);
}
.primary, #action-bar button.primary, .pbtns button.primary { background: var(--accent); color: #2a2205; }
#action-bar button.big { padding: 15px; font-size: 17px; }
.wide { width: 100%; margin-top: 8px; border: 0; border-radius: var(--radius); padding: 12px; font-weight: 700; background: rgba(255, 255, 255, .12); }
.primary.wide { background: var(--accent); }
button:disabled { opacity: .4; cursor: default; }
.danger, .pbtns button.danger { background: var(--red); color: #fff; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.warn { color: var(--red); }
.mini { border: 0; border-radius: 8px; padding: 6px 8px; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .14); white-space: nowrap; }
.mini.on { background: var(--accent); color: #2a2205; }
#wait-players .mini { margin-left: auto; }

/* ---------- lobby ---------- */
#lobby { display: flex; flex-direction: column; gap: 14px; padding-top: 8vh; }
.tagline { text-align: center; color: var(--muted); margin: 0 0 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 13px; color: var(--muted); }
input {
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .25);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
  user-select: text;
}
input:focus { border-color: var(--accent); }
.or { text-align: center; color: var(--muted); font-size: 13px; }
.join-row { display: flex; gap: 8px; }
.join-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .2em; }

/* ---------- waiting ---------- */
#waiting { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.chip { border: 1px dashed var(--accent); background: rgba(245, 197, 66, .08); border-radius: var(--radius); padding: 12px; color: var(--ink); }
.chip b { color: var(--accent); letter-spacing: .15em; }
#waiting h2 { font-size: 16px; margin: 8px 0 0; }
#wait-players { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
#wait-players li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: rgba(0, 0, 0, .2); border-radius: 10px; }
#wait-players li.offline { opacity: .5; }
#host-controls { display: flex; flex-direction: column; gap: 10px; }
.opt-row { display: flex; align-items: center; gap: 10px; }
.opt-label { font-size: 13px; color: var(--muted); white-space: nowrap; width: 92px; }
.seg { display: flex; flex: 1; gap: 4px; background: rgba(0, 0, 0, .2); border-radius: var(--radius); padding: 4px; }
.seg button { flex: 1; padding: 8px 2px; font-size: 13px; background: transparent; color: var(--muted); }
.seg button.on { background: rgba(255, 255, 255, .16); color: var(--ink); }
.btn-row { display: flex; gap: 8px; }
.btn-row .primary { flex: 1; }
.hint { color: var(--muted); font-size: 14px; text-align: center; margin: 0; line-height: 1.5; }
.hint.small { font-size: 12px; text-align: left; }

.name { font-weight: 700; color: var(--c, var(--ink)); }
.badge { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, .12); }
.badge.host { background: var(--accent); color: #2a2205; }
.tk {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  background: var(--c);
  border: 1.5px solid #fff;
  display: inline-grid; place-items: center;
  font-size: 12px; line-height: 1;
}

/* ---------- board ---------- */
#game { display: flex; flex-direction: column; gap: 8px; }
#board {
  --u: 28px;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: 1.6fr repeat(9, 1fr) 1.6fr;
  grid-template-rows: 1.6fr repeat(9, 1fr) 1.6fr;
  gap: 1px;
  background: var(--line);
  border: 2px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  color: var(--board-ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.cell {
  position: relative;
  background: var(--cell);
  display: flex;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  cursor: pointer;
}
.cell.side-b { flex-direction: column; }
.cell.side-t { flex-direction: column-reverse; }
.cell.side-l { flex-direction: row-reverse; }
.cell.side-r { flex-direction: row; }
.band {
  flex: 0 0 calc(var(--u) * .34);
  background: var(--gc);
  display: flex; align-items: center; justify-content: center;
  border: 0 solid var(--line);
}
.side-b .band { border-bottom-width: 1px; }
.side-t .band { border-top-width: 1px; }
.side-l .band { border-left-width: 1px; }
.side-r .band { border-right-width: 1px; }
.hs { display: flex; gap: 1px; align-items: center; justify-content: center; }
.side-l .hs, .side-r .hs { flex-direction: column; }
.hs .house { width: calc(var(--u) * .17); height: calc(var(--u) * .17); background: #1f9e4a; border: 1px solid #0b4a20; border-radius: 1px; }
.hs .hotel { width: calc(var(--u) * .46); height: calc(var(--u) * .2); background: #d62f2f; border: 1px solid #5e0c0c; border-radius: 1px; }
.side-l .hs .hotel, .side-r .hs .hotel { width: calc(var(--u) * .2); height: calc(var(--u) * .46); }
.ct {
  flex: 1;
  min-width: 0; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 1px;
  gap: 1px;
}
.nm {
  font-size: calc(var(--u) * .22);
  line-height: 1.08;
  font-weight: 600;
  word-break: keep-all;
  max-width: 100%;
}
.pr { font-size: calc(var(--u) * .23); font-weight: 800; line-height: 1; }
.ic { font-size: calc(var(--u) * .38); line-height: 1; }
.own { flex: 0 0 0; background: var(--oc); }
.cell.owned .own { flex-basis: calc(var(--u) * .13); }
.cell.owned .pr { color: var(--oc); filter: brightness(.75) saturate(1.3); }
.cell.mort { background: repeating-linear-gradient(45deg, #ece8d6 0 3px, #d9d4bf 3px 6px); }
.cell.mort .ct, .cell.mort .band { opacity: .5; }
.cell.mort .pr { color: #7a2020; filter: none; }
.cell.hl { box-shadow: inset 0 0 0 2px #e0a800; animation: hl 1s ease-in-out infinite alternate; }
@keyframes hl { to { box-shadow: inset 0 0 0 3px #ff8a00; } }

.cell.side-c { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; }
.side-c .big { font-size: calc(var(--u) * .62); line-height: 1; font-weight: 900; }
.side-c .nm { font-size: calc(var(--u) * .26); font-weight: 800; }
.side-c .pr { font-size: calc(var(--u) * .22); }
.t-go .big { color: #c0392b; }
.t-go .nm { color: #c0392b; letter-spacing: .05em; }
.t-gotojail .big { font-size: calc(var(--u) * .55); }
.t-jail { justify-content: flex-end; align-items: flex-start; }
.t-jail .cage {
  position: absolute; top: 0; right: 0;
  width: 69%; height: 69%;
  background: repeating-linear-gradient(90deg, #f39c2b 0 calc(var(--u) * .14), #1d2a24 calc(var(--u) * .14) calc(var(--u) * .2));
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: calc(var(--u) * .3);
}
.t-jail .cage span { background: rgba(246, 243, 228, .92); padding: 0 2px; border-radius: 2px; line-height: 1.1; }
.t-jail .cage .nm { font-size: calc(var(--u) * .22); }
.t-jail .visit { font-size: calc(var(--u) * .2); font-weight: 700; padding: 0 0 2px 3px; color: #5b6b63; }

#center {
  grid-row: 2 / 11;
  grid-column: 2 / 11;
  background: var(--board);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.watermark {
  position: absolute;
  font-size: calc(var(--u) * 1.2);
  font-weight: 900;
  letter-spacing: .08em;
  color: rgba(190, 40, 40, .13);
  transform: rotate(-45deg);
  white-space: nowrap;
  pointer-events: none;
}
#c-info {
  position: absolute; top: 3%; left: 4%; right: 4%;
  display: flex; justify-content: space-between; gap: 6px;
  font-size: calc(var(--u) * .3); font-weight: 800;
}
#c-pot { background: rgba(255, 255, 255, .7); border-radius: 6px; padding: 1px 5px; }
#c-clock { margin-left: auto; background: rgba(255, 255, 255, .7); border-radius: 6px; padding: 1px 5px; }
#stage {
  position: relative;
  z-index: 1;
  width: 90%;
  display: flex; flex-direction: column; align-items: center;
  gap: calc(var(--u) * .2);
}
.caption {
  font-size: calc(var(--u) * .34);
  line-height: 1.4;
  text-align: center;
  font-weight: 600;
  background: rgba(255, 255, 255, .72);
  border-radius: 8px;
  padding: 3px 8px;
  max-width: 100%;
}
.caption.big { font-size: calc(var(--u) * .48); font-weight: 800; }
.caption .name { color: var(--c); filter: brightness(.8) saturate(1.2); }

.dice { display: flex; gap: calc(var(--u) * .28); }
.die {
  width: calc(var(--u) * 1.05); height: calc(var(--u) * 1.05);
  background: #fff;
  border-radius: 20%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .35), inset 0 -2px 0 #ddd;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 13%;
}
.die i { width: 74%; height: 74%; background: #1d2a24; border-radius: 50%; place-self: center; }
.dice.dbl .die { box-shadow: 0 0 0 2px var(--accent), 0 2px 4px rgba(0, 0, 0, .35); }
.dice.rolling .die { animation: tumble .55s cubic-bezier(.2, 1.3, .5, 1); }
.dice.rolling .die + .die { animation-delay: .06s; }
@keyframes tumble { from { transform: translateY(-60%) rotate(-220deg) scale(.5); opacity: .3; } }
.die[data-v="1"] i { grid-area: 2 / 2; }
.die[data-v="2"] i:nth-child(1), .die[data-v="3"] i:nth-child(1) { grid-area: 1 / 1; }
.die[data-v="2"] i:nth-child(2), .die[data-v="3"] i:nth-child(3) { grid-area: 3 / 3; }
.die[data-v="3"] i:nth-child(2) { grid-area: 2 / 2; }
.die[data-v="4"] i:nth-child(1), .die[data-v="5"] i:nth-child(1), .die[data-v="6"] i:nth-child(1) { grid-area: 1 / 1; }
.die[data-v="4"] i:nth-child(2), .die[data-v="5"] i:nth-child(2), .die[data-v="6"] i:nth-child(2) { grid-area: 1 / 3; }
.die[data-v="4"] i:nth-child(3), .die[data-v="5"] i:nth-child(3), .die[data-v="6"] i:nth-child(3) { grid-area: 3 / 1; }
.die[data-v="4"] i:nth-child(4), .die[data-v="5"] i:nth-child(4), .die[data-v="6"] i:nth-child(4) { grid-area: 3 / 3; }
.die[data-v="5"] i:nth-child(5) { grid-area: 2 / 2; }
.die[data-v="6"] i:nth-child(5) { grid-area: 2 / 1; }
.die[data-v="6"] i:nth-child(6) { grid-area: 2 / 3; }

#stage .card {
  width: 82%;
  background: #fffdf6;
  border-radius: 8px;
  border: 2px solid;
  padding: calc(var(--u) * .2) calc(var(--u) * .25);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .25);
  animation: pop .35s cubic-bezier(.2, 1.4, .5, 1);
  text-align: center;
}
#stage .card.chance { border-color: #f39c2b; }
#stage .card.chest { border-color: #3b8fd9; }
.card-head { font-weight: 900; font-size: calc(var(--u) * .3); margin-bottom: 3px; }
.card.chance .card-head { color: #d9770f; }
.card.chest .card-head { color: #2b77c0; }
.card-body { font-size: calc(var(--u) * .32); line-height: 1.4; font-weight: 600; }
@keyframes pop { from { transform: scale(.3) rotate(-10deg); opacity: 0; } }

.deed.mini {
  width: 52%;
  border: 1px solid #333;
  border-radius: 5px;
  overflow: hidden;
  background: #fffdf6;
  text-align: center;
  animation: pop .3s ease-out;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.deed.mini .deed-head { font-size: calc(var(--u) * .3); padding: calc(var(--u) * .14) 4px; }
.deed-line { font-size: calc(var(--u) * .3); font-weight: 700; padding: 3px; }
.auc-box {
  width: 78%;
  background: #fffdf6;
  border-radius: 8px;
  border: 2px solid var(--accent);
  padding: calc(var(--u) * .18);
  display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * .12);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .25);
}
.auc-box .deed.mini { width: 75%; animation: none; }
.auc-tag { font-weight: 900; font-size: calc(var(--u) * .32); color: #b5651d; }
.auc-hi { font-size: calc(var(--u) * .36); font-weight: 700; display: flex; gap: 4px; align-items: center; }
.auc-box .auc-left { font-size: calc(var(--u) * .5); font-weight: 900; color: #c0392b; }

/* property chips (logs, sheets) */
.pc { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; white-space: nowrap; }
.pc::before { content: ''; width: .72em; height: .72em; border-radius: 2px; background: var(--gc); border: 1px solid rgba(0, 0, 0, .35); flex: none; }
.pc.nog::before { display: none; }
.pc.mort { opacity: .55; text-decoration: line-through; }
.pc.pick { border: 1px solid rgba(255, 255, 255, .2); border-radius: 8px; padding: 6px 9px; cursor: pointer; background: rgba(0, 0, 0, .2); font-size: 13px; }
.pc.pick.on { background: var(--accent); color: #2a2205; border-color: var(--accent); }
.pc.pick.blocked { opacity: .35; }
.money { font-weight: 800; font-variant-numeric: tabular-nums; }
.cc b { color: #f39c2b; }
.cc.chest b { color: #4aa3ff; }
#center .cc.chest b { color: #2b77c0; }

/* tokens */
#tokens { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.token {
  position: absolute;
  width: calc(var(--u) * .62); height: calc(var(--u) * .62);
  margin: calc(var(--u) * -.31) 0 0 calc(var(--u) * -.31);
  border-radius: 50%;
  background: var(--c);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .55);
  display: grid; place-items: center;
  font-size: calc(var(--u) * .36);
  line-height: 1;
  transition: left .14s ease-out, top .14s ease-out;
}
.token.active { z-index: 1; box-shadow: 0 0 0 2px var(--accent), 0 2px 6px rgba(0, 0, 0, .6); }

/* ---------- players ---------- */
#players { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#players.n2, #players.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pl {
  position: relative;
  border: 2px solid transparent;
  border-radius: 10px;
  background: rgba(0, 0, 0, .25);
  padding: 4px 8px;
  display: flex; flex-direction: column; gap: 1px;
  text-align: left;
  min-width: 0;
}
.pl.active { border-color: var(--c); background: rgba(255, 255, 255, .08); }
.pl.me .pn::after { content: ' ●'; color: var(--accent); font-size: 9px; vertical-align: middle; }
.pl.out { opacity: .45; }
.pl-top { display: flex; align-items: center; gap: 5px; min-width: 0; }
.pn { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.flags { font-size: 11px; white-space: nowrap; }
.pl .cash { font-weight: 800; font-size: 14px; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- panel ---------- */
#panel { display: flex; flex-direction: column; gap: 8px; }
#prompt { display: flex; flex-direction: column; gap: 8px; }
.pblock {
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.pblock.debt { border-color: var(--red); }
.pblock.auc { border-color: var(--accent); }
.pblock.trade { border-color: #6ab0ff; }
.pblock.trade-out { padding: 6px 10px; }
.pblock.buy { background: transparent; border: 0; padding: 0; }
.ptitle { font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pline { font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; line-height: 1.5; }
.pline .mini { margin-left: auto; }
.pbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.pbtns button { flex: 1; padding: 10px 8px; }
.pbtns button.bid { background: rgba(245, 197, 66, .2); color: var(--accent); }
.lead { color: var(--accent); font-weight: 700; }
.tlabel { font-size: 12px; color: var(--muted); margin-right: 4px; }
#status { text-align: center; color: var(--muted); font-size: 14px; line-height: 1.4; }
#status.mine { color: var(--ink); font-weight: 700; }
#action-bar { display: flex; gap: 8px; }
#action-bar:empty { display: none; }
#action-bar button { flex: 1; }
#tools { display: flex; gap: 6px; }
.tool { flex: 1; border: 0; border-radius: 10px; padding: 10px 6px; background: rgba(255, 255, 255, .08); font-weight: 600; font-size: 14px; }
.tool.subtle { flex: 0 0 auto; color: var(--muted); font-size: 12px; }

/* deed card (sheets, buy prompt) */
.deed { background: #fffdf6; color: #222; border-radius: 8px; overflow: hidden; border: 1px solid #333; max-width: 270px; width: 100%; margin: 0 auto; }
.deed-head {
  background: var(--gc);
  color: #fff;
  text-align: center;
  font-weight: 800;
  padding: 10px 8px;
  font-size: 16px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.deed-head.light { color: #222; text-shadow: none; }
.deed-head.plain { background: #ece8d6; color: #222; text-shadow: none; }
.deed-body { padding: 8px 12px; font-size: 13px; }
.drow { display: flex; justify-content: space-between; padding: 2px 6px; border-radius: 4px; }
.drow.on { background: #ffe9a8; font-weight: 700; }
.dnote { font-size: 11px; color: #666; text-align: center; margin-top: 6px; }
.deed-foot { border-top: 1px solid #ddd; padding: 6px 10px; font-size: 13px; display: flex; justify-content: center; align-items: center; gap: 4px; flex-wrap: wrap; }
.deed .name { filter: brightness(.75) saturate(1.3); }
.deed.compact { max-width: none; }
.deed.compact .deed-head { padding: 7px 8px; font-size: 15px; }
.deed.compact .deed-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 14px; padding: 6px 10px; font-size: 12px; }
.deed.compact .dnote { grid-column: 1 / -1; margin-top: 2px; }
.deed.compact .deed-foot { padding: 4px 10px; }

/* ---------- sheets ---------- */
.space-info h2 { margin-bottom: 6px; }
.player-head { display: flex; align-items: center; gap: 8px; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; margin-bottom: 8px; font-weight: 600; }
.pgroup { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.glabel { font-size: 12px; color: var(--muted); border-left: 5px solid var(--gc); padding-left: 6px; width: 100%; }
.pgroup .pc { cursor: pointer; font-size: 14px; }
.mgroup { margin-top: 12px; font-weight: 800; font-size: 13px; padding-left: 8px; border-left: 6px solid var(--gc); }
.mrow { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); flex-wrap: wrap; }
.minfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.minfo .pc { cursor: pointer; }
.mstate { font-size: 12px; color: var(--muted); }
.mbtns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
#info-body .mrow { margin-top: 10px; border: 0; }
#info-body .mrow .minfo { display: none; }
#info-body .mrow .mbtns { justify-content: center; width: 100%; }
#info-body .mrow .mini { padding: 9px 12px; font-size: 13px; }

.partners { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.partner { border: 1px solid rgba(255, 255, 255, .2); border-radius: 10px; padding: 6px 10px; display: flex; gap: 5px; align-items: center; background: transparent; }
.partner.on { background: rgba(255, 255, 255, .15); border-color: var(--accent); }
.tsec { background: rgba(0, 0, 0, .2); border-radius: 10px; padding: 10px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
.tsec-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tprops { display: flex; flex-wrap: wrap; gap: 6px; }
.trow { display: flex; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.cash-in { width: 120px; padding: 8px 10px; font-size: 15px; }

#result { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.result-card { background: var(--felt-2); border: 2px solid var(--accent); border-radius: 16px; padding: 18px; width: min(100%, 420px); display: flex; flex-direction: column; gap: 10px; }
.result-card h2 { margin: 0; text-align: center; }
.result-card p { margin: 0; text-align: center; }
#result-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
#result-list li { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; background: rgba(0, 0, 0, .2); font-size: 14px; }
#result-list li.won { background: rgba(245, 197, 66, .2); }
#result-list li span:last-child { margin-left: auto; }
.rank { width: 18px; text-align: center; font-weight: 800; color: var(--muted); }

/* ---------- dialogs ---------- */
dialog {
  border: 0;
  border-radius: 16px;
  background: var(--felt-2);
  color: var(--ink);
  width: min(94vw, 480px);
  max-height: 86vh;
  padding: 16px 16px;
}
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog h2 { margin: 0 0 10px; font-size: 18px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
dialog h3 { margin: 14px 0 4px; font-size: 15px; color: var(--accent); }
dialog p { margin: 4px 0; line-height: 1.55; font-size: 14px; }
dialog form { margin-top: 14px; }
dialog form button { width: 100%; border: 0; border-radius: var(--radius); padding: 12px; font-weight: 700; background: rgba(255, 255, 255, .12); }
dialog form button.primary { background: var(--accent); color: #2a2205; }
.log-line { font-size: 13px; padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); line-height: 1.5; }
.log-line.sep { color: var(--muted); font-size: 12px; padding-top: 8px; }

/* ---------- effects ---------- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 15; }
.badge-fx {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 20px;
  white-space: nowrap;
  text-shadow: 0 1px 4px #000, 0 0 10px rgba(0, 0, 0, .8);
  animation: rise 1.7s ease-out forwards;
}
.badge-fx.gain { color: var(--green); }
.badge-fx.loss { color: #ff6b6b; }
.badge-fx.dead { font-size: 28px; }
@keyframes rise {
  0% { opacity: 0; margin-top: 4px; }
  15% { opacity: 1; }
  100% { opacity: 0; margin-top: -36px; }
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: rgba(8, 26, 19, .94);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
  z-index: 20;
  max-width: 90vw;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
