#game { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 14px; padding: 40px 14px 14px; max-width: 1400px; margin: 0 auto; }
@media (max-width: 960px) { #game { grid-template-columns: 1fr; padding: 40px 8px 8px; } }
#side { display: grid; gap: 10px; align-content: start; }
#side section { display: grid; gap: 10px; }

#boardWrap { width: 100%; max-width: min(100%, calc(100vh - 60px)); margin: 0 auto; align-self: start; }
@media (max-width: 960px) { #boardWrap { max-width: 100%; } }
#board {
  display: grid; grid-template-columns: repeat(11, 1fr); grid-template-rows: repeat(11, 1fr);
  aspect-ratio: 1; background: #cfe8d4; border: 4px solid #111; border-radius: 10px; overflow: hidden; color: #111;
}
.cell {
  position: relative; border: 1px solid #0004; background: #fbf7ec; display: flex; flex-direction: column;
  font-size: clamp(6px, 0.85vw, 11px); line-height: 1.1; overflow: hidden; cursor: pointer; text-align: center; min-width: 0;
}
@media (max-width: 960px) { .cell { font-size: clamp(5px, 1.6vw, 11px); } }
.cell:hover { outline: 3px solid var(--accent); z-index: 2; }
.cell .bar { height: 22%; flex: none; }
.cell .nm { padding: 1px; font-weight: 600; word-break: break-word; }
.cell .pr { color: #444; margin-top: auto; padding-bottom: 1px; }
.cell .big { font-size: 2.2em; margin: auto 0 0; }
.cell.corner { background: #fff3c4; font-weight: 800; justify-content: center; }
.cell.owned { box-shadow: inset 0 -5px 0 var(--own); }
.cell.mort { background: repeating-linear-gradient(45deg, #ddd, #ddd 4px, #eee 4px, #eee 8px); }
.cell .houses { position: absolute; top: 0; right: 0; left: 0; font-size: .95em; line-height: 1; }
.cell .tokens { position: absolute; inset: 22% 0 0 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0; pointer-events: none; }
.tok { font-size: clamp(11px, 1.8vw, 22px); filter: drop-shadow(0 1px 1px #000a); border-radius: 50%; }
.tok.now { animation: bob .8s infinite alternate; }
@keyframes bob { to { transform: translateY(-25%) scale(1.15); } }
.cell.lastland { outline: 3px solid #ff3b7f; z-index: 1; }

#center {
  grid-area: 2 / 2 / 11 / 11; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2%;
  background: radial-gradient(circle at 50% 40%, #e7f7ea, #bcdcc3); padding: 4%; text-align: center; color: #123;
}
#center .logo { font-size: clamp(18px, 4.5vw, 54px); font-weight: 900; letter-spacing: -.02em; transform: rotate(-8deg); color: #c8102e; text-shadow: 2px 2px 0 #fff, 4px 4px 0 #0002; }
.dice { display: flex; gap: 8px; }
.die { width: clamp(26px, 4vw, 48px); aspect-ratio: 1; background: #fff; border-radius: 18%; border: 2px solid #222; display: grid; place-items: center; font-weight: 900; font-size: clamp(14px, 2.2vw, 26px); box-shadow: 0 3px 0 #222; }
.die.roll { animation: shake .4s; }
@keyframes shake { 25% { transform: rotate(18deg) } 50% { transform: rotate(-14deg) } 75% { transform: rotate(8deg) } }
#banner { background: #222; color: #ffd75e; padding: 2% 4%; border-radius: 12px; font-weight: 700; font-size: clamp(10px, 1.5vw, 17px); max-width: 95%; }
#banner.flash { animation: pop .5s; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0 } 70% { transform: scale(1.08) } }
.jp { font-weight: 800; font-size: clamp(10px, 1.4vw, 16px); }
.turnline { font-size: clamp(10px, 1.4vw, 16px); }

.pl { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 10px; }
.pl.now { background: #ffb40022; outline: 1px solid var(--accent); }
.pl .em { font-size: 22px; }
.pl .info { flex: 1; min-width: 0; }
.pl .money { font-weight: 800; }
.pl .neg { color: var(--bad); }
.pl.dead { opacity: .45; text-decoration: line-through; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.prop-row { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.prop-row .sw { width: 12px; height: 26px; border-radius: 3px; flex: none; }
.prop-row .nm { flex: 1; min-width: 110px; }

.twist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 8px; }
.twist-grid button { font-size: 13px; }
.rules { display: grid; gap: 8px; }
.rules label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.rules input[type=number] { width: 90px; }
.deck-list { max-height: 260px; overflow-y: auto; margin-top: 8px; display: grid; gap: 4px; }
.deck-list div { display: flex; gap: 6px; align-items: center; font-size: 13px; background: #15172a; padding: 5px 8px; border-radius: 8px; }
.deck-list span { flex: 1; }

.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.checks { display: grid; gap: 3px; margin-top: 6px; font-size: 13px; max-height: 200px; overflow-y: auto; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { font-size: 22px; padding: 4px 8px; }
.emoji-pick button.on { background: var(--accent); }

#actions .big-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
#actions .big-actions button { font-size: 17px; padding: 10px 16px; }

.rule-builder { border-color: var(--accent); }
.rb-line { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.rb-line select { max-width: 100%; }
.rb-preview { font-size: 13px; margin: 4px 0 8px; font-style: italic; }
.rule-list { display: grid; gap: 5px; }
.rule-list .rl { display: flex; gap: 6px; align-items: center; font-size: 13px; background: #15172a; padding: 6px 8px; border-radius: 8px; }
.rule-list .rl span { flex: 1; }
.rule-list .rl.off span { opacity: .45; text-decoration: line-through; }
.ideas { display: grid; gap: 5px; }
.ideas button { text-align: left; font-size: 13px; }

#modal { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 30; padding: 16px; }
#modalBox { width: min(360px, 100%); }
#modalBox table { width: 100%; font-size: 14px; border-collapse: collapse; }
#modalBox td { padding: 2px 4px; }
#modalBox td:last-child { text-align: right; }
