/* ============================================================
   Binopoly — stylesheet
   Dark, vibrant theme with a classic Monopoly board ring.
   ============================================================ */

:root {
  --bg-0: #070b18;
  --bg-1: #0d1426;
  --bg-2: #141d36;
  --panel: rgba(22, 31, 56, 0.72);
  --panel-solid: #161f38;
  --border: rgba(255, 255, 255, 0.10);
  --text: #eaf0ff;
  --muted: #8ea0c8;
  --primary: #4f7cff;
  --primary-2: #6f9bff;
  --gold: #ffce4d;
  --gold-2: #ffb020;
  --green: #36d399;
  --red: #ff5d6c;
  --board-felt: #122b1e;
  --tile: #f3f2e7;
  --tile-ink: #1a2238;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 70% -10%, #1b2750 0%, var(--bg-0) 55%) fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: 0.3px; }
button, input { font-family: inherit; }
.muted { color: var(--muted); }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; opacity: 0; pointer-events: none; transform: translateY(10px) scale(0.995); transition: opacity 0.4s ease, transform 0.4s ease; overflow: auto; }
.screen.active { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--border); cursor: pointer;
  background: rgba(255, 255, 255, 0.06); color: var(--text);
  padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px;
  transition: transform 0.08s ease, background 0.2s ease, box-shadow 0.2s, opacity 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(180deg, var(--primary-2), var(--primary)); border-color: transparent; box-shadow: 0 6px 18px rgba(79, 124, 255, 0.45); }
.btn-primary:hover { box-shadow: 0 8px 24px rgba(79, 124, 255, 0.6); }
.btn-gold { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #3a2700; border-color: transparent; box-shadow: 0 6px 18px rgba(255, 176, 32, 0.45); }
.btn-ghost { background: transparent; }
.btn-danger { background: linear-gradient(180deg, #ff7480, var(--red)); border-color: transparent; color: #fff; }
.btn-lg { padding: 14px 22px; font-size: 16px; width: 100%; }
.btn-tiny { padding: 6px 10px; font-size: 13px; border-radius: 9px; }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 13px; color: var(--muted); font-weight: 600; }
input[type=text], input[type=number], select {
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border); color: var(--text);
  padding: 12px 14px; border-radius: 11px; font-size: 15px; outline: none; width: 100%;
  transition: border 0.2s, box-shadow 0.2s;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.25); }
.code-input { text-transform: uppercase; letter-spacing: 4px; font-weight: 800; text-align: center; }

/* ---------- glass panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.glass { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* ============================================================ LANDING */
.landing-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 400px at 15% 20%, rgba(79, 124, 255, 0.20), transparent 60%),
    radial-gradient(700px 500px at 85% 80%, rgba(255, 176, 32, 0.14), transparent 60%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translateY(-20px) scale(1.05); } }

.landing-wrap { position: relative; max-width: 980px; margin: 0 auto; padding: 5vh 20px 40px; min-height: 100%; display: flex; flex-direction: column; }
.brand { text-align: center; margin-bottom: 28px; }
.logo {
  font-size: clamp(44px, 9vw, 86px); line-height: 1; font-weight: 900; letter-spacing: 2px;
  background: linear-gradient(180deg, #fff, #b9c8ff); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 10px 40px rgba(79, 124, 255, 0.4); filter: drop-shadow(0 4px 0 rgba(0,0,0,0.2));
}
.logo span { color: var(--gold); -webkit-text-fill-color: var(--gold); }
.tagline { color: var(--muted); margin-top: 10px; font-size: clamp(14px, 2.4vw, 18px); }

.landing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.or { text-align: center; color: var(--muted); margin: 12px 0; font-size: 13px; position: relative; }
.join-row { display: flex; gap: 10px; margin-bottom: 12px; }
.join-row .code-input { flex: 1; }
.room-list { display: flex; flex-direction: column; gap: 10px; max-height: 360px; overflow: auto; }
.room-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: rgba(0,0,0,0.25); border: 1px solid var(--border); border-radius: 12px; transition: border 0.2s, transform 0.08s; }
.room-row:hover { border-color: var(--primary); transform: translateX(2px); }
.room-row .rr-name { font-weight: 700; }
.room-row .rr-meta { font-size: 12px; color: var(--muted); }
.room-row .rr-status { font-size: 11px; padding: 3px 8px; border-radius: 20px; background: rgba(255,255,255,0.08); }
.room-row .rr-status.playing { background: rgba(255, 93, 108, 0.18); color: #ff9aa4; }
.room-row .rr-status.lobby { background: rgba(54, 211, 153, 0.18); color: var(--green); }
.empty { color: var(--muted); text-align: center; padding: 24px 0; font-size: 14px; }
.landing-foot { margin-top: auto; padding-top: 24px; text-align: center; color: var(--muted); font-size: 13px; display: flex; gap: 10px; justify-content: center; }

/* ============================================================ ROOM */
.room-layout { max-width: 1000px; margin: 0 auto; padding: 4vh 20px; display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; min-height: 100%; align-content: start; }
.room-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.room-code-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.code-pill { font-family: monospace; font-size: 20px; font-weight: 800; letter-spacing: 3px; background: rgba(255, 206, 77, 0.14); color: var(--gold); border: 1px dashed rgba(255, 206, 77, 0.5); padding: 4px 14px; border-radius: 10px; cursor: pointer; }
.copied-hint { color: var(--green); font-size: 12px; opacity: 0; transition: opacity 0.3s; }
.copied-hint.show { opacity: 1; }

.members { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.member { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(0,0,0,0.22); border: 1px solid var(--border); border-radius: 12px; border-left: 4px solid var(--mc, #888); }
.member .m-token { font-size: 22px; width: 30px; text-align: center; }
.member .m-name { font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .m-badge { font-size: 11px; padding: 2px 7px; border-radius: 20px; }
.badge-host { background: rgba(255, 206, 77, 0.2); color: var(--gold); }
.badge-ready { background: rgba(54, 211, 153, 0.2); color: var(--green); }
.badge-wait { background: rgba(255,255,255,0.08); color: var(--muted); }
.badge-spec { background: rgba(143,160,200,0.2); color: var(--muted); }
.badge-off { background: rgba(255, 93, 108, 0.2); color: var(--red); }

.customize { display: flex; gap: 24px; margin-bottom: 18px; flex-wrap: wrap; }
.cust-label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 8px; font-weight: 600; }
.picker { display: flex; gap: 8px; flex-wrap: wrap; }
.pick { width: 42px; height: 42px; border-radius: 11px; border: 2px solid transparent; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; transition: transform 0.08s, border 0.15s; }
.pick:hover { transform: translateY(-2px); }
.pick.sel { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,0.15); }
.pick.taken { opacity: 0.3; cursor: not-allowed; }
.pick.color { font-size: 0; }

.room-actions { display: flex; gap: 12px; }
.room-actions .btn { flex: 1; }
.start-hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; text-align: center; }

.room-chat { display: flex; flex-direction: column; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 12px 0; min-height: 200px; max-height: 50vh; padding-right: 4px; }
.chat-log.small { min-height: 120px; }
.chat-msg { font-size: 14px; line-height: 1.35; }
.chat-msg .cm-name { font-weight: 800; }
.chat-msg.system { color: var(--muted); font-style: italic; font-size: 13px; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; }

/* ============================================================ GAME */
.game-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 14px; height: 100%; padding: 12px; }
.game-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.game-side .panel { min-height: 0; }
.players-panel { flex: 0 0 auto; max-height: 56%; display: flex; flex-direction: column; }
.players { display: flex; flex-direction: column; gap: 9px; overflow-y: auto; margin-top: 10px; }
.log-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.game-log { overflow-y: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; flex: 1; }
.log-entry { line-height: 1.35; color: #cdd8f5; padding-left: 10px; border-left: 2px solid rgba(255,255,255,0.08); }
.log-entry.good { border-color: var(--green); }
.log-entry.warn { border-color: var(--gold-2); }

.player-card { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 12px; background: rgba(0,0,0,0.25); border: 1px solid var(--border); border-left: 4px solid var(--pc, #888); position: relative; transition: box-shadow 0.3s; }
.player-card.turn { box-shadow: 0 0 0 2px var(--pc), 0 0 22px -4px var(--pc); }
.player-card.bankrupt { opacity: 0.45; filter: grayscale(0.7); }
.player-card .pc-token { font-size: 22px; }
.player-card .pc-info { flex: 1; min-width: 0; }
.player-card .pc-name { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.player-card .pc-name .crown { font-size: 12px; }
.player-card .pc-money { color: var(--green); font-weight: 800; font-size: 15px; }
.player-card .pc-sub { font-size: 11px; color: var(--muted); }
.player-card .pc-jail { font-size: 11px; color: var(--gold); }
.bank-info { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }

/* ---------- board ---------- */
.board-area { display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; }
.board {
  position: relative; aspect-ratio: 1 / 1; width: min(100%, 88vh);
  display: grid; grid-template-columns: repeat(11, 1fr); grid-template-rows: repeat(11, 1fr);
  background: var(--board-felt);
  border: 3px solid #0a1813; border-radius: 12px; box-shadow: var(--shadow), inset 0 0 60px rgba(0,0,0,0.5);
  padding: 2px; gap: 2px;
}
.board-center {
  grid-area: 2 / 2 / 11 / 11;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 20px, transparent 20px 40px),
    radial-gradient(circle at 50% 40%, #173a29, #0e2419);
  border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  overflow: hidden;
}
.center-logo {
  font-size: clamp(22px, 4.4vw, 52px); font-weight: 900; letter-spacing: 2px; transform: rotate(-12deg);
  background: linear-gradient(180deg, #fff, #aef0c8); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4)); user-select: none;
}
.center-logo span { color: var(--gold); -webkit-text-fill-color: var(--gold); }
.dice-tray { display: flex; gap: 14px; perspective: 320px; }
.die {
  width: clamp(34px, 6vw, 58px); height: clamp(34px, 6vw, 58px); border-radius: 14px;
  background: linear-gradient(160deg, #fff, #d7deef);
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  padding: 14%; gap: 4%; box-sizing: border-box;
  box-shadow: 0 6px 16px rgba(0,0,0,0.4), inset 0 -3px 6px rgba(0,0,0,0.15), inset 0 3px 4px rgba(255,255,255,0.8);
  position: relative; transform-style: preserve-3d;
}
.die .pip { border-radius: 50%; background: transparent; align-self: center; justify-self: center; width: 80%; height: 80%; }
.die .pip.on { background: radial-gradient(circle at 35% 30%, #4a5578, #11182e); box-shadow: inset 0 1px 1px rgba(255,255,255,0.3); }
.die.rolling { animation: diceRoll 0.6s cubic-bezier(.3,1.4,.5,1); }
@keyframes diceRoll {
  0% { transform: rotateX(0) rotateY(0) scale(1); }
  30% { transform: rotateX(220deg) rotateY(140deg) scale(1.25); }
  60% { transform: rotateX(380deg) rotateY(300deg) scale(1.3); }
  100% { transform: rotateX(360deg) rotateY(360deg) scale(1); }
}
.center-msg { color: #d6ffe7; font-weight: 700; font-size: clamp(12px, 2vw, 16px); text-align: center; min-height: 1.2em; padding: 0 10px; }
.pot-display { color: var(--gold); font-weight: 800; font-size: 13px; }

/* tiles */
.tile {
  position: relative; color: var(--tile-ink); border-radius: 4px;
  background: linear-gradient(160deg, #fbfbf3, #ebe9da);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: clamp(5px, 0.85vw, 9px); line-height: 1.04; overflow: hidden; cursor: pointer; user-select: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.07), inset 0 -3px 5px rgba(0,0,0,0.05);
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.tile:hover { z-index: 5; transform: scale(1.06); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.07), 0 0 0 2px var(--primary), 0 4px 12px rgba(0,0,0,0.4); }
.tile .t-name { padding: 1px 2px; font-weight: 800; letter-spacing: 0.2px; z-index: 2; text-transform: uppercase; }
.tile.t-tax .t-name, .tile.t-chance .t-name, .tile.t-chest .t-name { text-transform: none; }
.tile .t-price { position: absolute; bottom: 1px; left: 0; right: 0; font-size: 0.82em; font-weight: 800; opacity: 0.78; z-index: 2; }
.tile .strip {
  position: absolute; z-index: 1; background: var(--g, #ccc);
  background-image: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(0,0,0,0.16));
}
.tile.side-bottom .strip { top: 0; left: 0; right: 0; height: 24%; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.25); }
.tile.side-top    .strip { bottom: 0; left: 0; right: 0; height: 24%; box-shadow: inset 0 1px 0 rgba(0,0,0,0.25); }
.tile.side-left   .strip { right: 0; top: 0; bottom: 0; width: 24%; box-shadow: inset -1px 0 0 rgba(0,0,0,0.25); }
.tile.side-right  .strip { left: 0; top: 0; bottom: 0; width: 24%; box-shadow: inset 1px 0 0 rgba(0,0,0,0.25); }
.tile.side-bottom .t-name { margin-top: 20%; }
.tile.side-top .t-name { margin-bottom: 20%; }
.tile.side-left .t-name { margin-right: 20%; }
.tile.side-right .t-name { margin-left: 20%; }
.tile.owned::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px var(--owner); border-radius: 4px; pointer-events: none; z-index: 3; }
/* owner-coloured corner flag on owned tiles */
.tile .owner-flag { display: none; position: absolute; z-index: 5; width: 0; height: 0; pointer-events: none; }
.tile.owned .owner-flag { display: block; }
.tile.side-bottom .owner-flag, .tile.side-left .owner-flag { right: 0; bottom: 0; border-left: 7px solid transparent; border-bottom: 7px solid var(--owner); }
.tile.side-top .owner-flag, .tile.side-right .owner-flag { left: 0; top: 0; border-right: 7px solid transparent; border-top: 7px solid var(--owner); }
.tile.mortgaged { filter: grayscale(0.6) brightness(0.82); }
.tile.mortgaged .t-price::before { content: '🔒 '; }

/* corners */
.tile.corner { background: linear-gradient(160deg, #f4f2e6, #e3e0cf); font-size: clamp(6px, 1vw, 10px); }
.corner-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.tile .corner-emoji { font-size: clamp(14px, 2.6vw, 28px); display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25)); }
.corner-label { font-weight: 900; letter-spacing: 0.5px; }
.corner-sub { font-size: 0.82em; opacity: 0.7; font-weight: 700; }
.tile.go { background: linear-gradient(160deg, #fff0d6, #ffe1ad); }
.tile.go .corner-label { color: var(--red); font-size: 1.5em; }
.tile.go .corner-emoji { color: var(--red); }

.t-icon { font-size: clamp(13px, 2.3vw, 22px); z-index: 2; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2)); }

/* houses */
.houses { position: absolute; z-index: 4; display: flex; gap: 1px; pointer-events: none; }
.tile.side-bottom .houses { top: 1px; left: 0; right: 0; justify-content: center; }
.tile.side-top .houses { bottom: 1px; left: 0; right: 0; justify-content: center; }
.tile.side-left .houses { right: 1px; top: 0; bottom: 0; flex-direction: column; align-items: flex-end; justify-content: center; }
.tile.side-right .houses { left: 1px; top: 0; bottom: 0; flex-direction: column; align-items: flex-start; justify-content: center; }
.house-pip { width: clamp(3px, 0.7vw, 6px); height: clamp(3px, 0.7vw, 6px); background: #2bd07a; border: 0.5px solid #0a5c33; border-radius: 1px; }
.house-pip.hotel { width: clamp(6px, 1.3vw, 11px); background: var(--red); border-color: #7a1722; }

/* tokens */
.token {
  position: absolute; width: clamp(15px, 2.7vw, 26px); height: clamp(15px, 2.7vw, 26px);
  border-radius: 50%; background: var(--tk, #fff); border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center; font-size: clamp(9px, 1.7vw, 15px);
  transform: translate(-50%, -50%); z-index: 20; box-shadow: 0 3px 8px rgba(0,0,0,0.5);
  transition: left 0.25s cubic-bezier(.34,1.56,.64,1), top 0.25s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.token.notrans { transition: none !important; }
.token.hop { animation: hop 0.25s ease; }
@keyframes hop { 50% { transform: translate(-50%, -50%) scale(1.3); } }
.token.me { box-shadow: 0 0 0 2px var(--gold), 0 3px 8px rgba(0,0,0,0.5); }

/* ---------- turn / actions ---------- */
.turn-panel { flex: 0 0 auto; }
.turn-banner { font-weight: 800; font-size: 15px; text-align: center; padding: 8px; border-radius: 10px; background: rgba(0,0,0,0.25); margin-bottom: 12px; }
.turn-banner.you { background: linear-gradient(180deg, rgba(79,124,255,0.3), rgba(79,124,255,0.12)); box-shadow: 0 0 0 1px var(--primary); }
.action-bar { display: flex; flex-direction: column; gap: 9px; }
.action-bar .btn { width: 100%; }
.action-row { display: flex; gap: 8px; }
.action-row .btn { flex: 1; }
.buy-info { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 4px; }
.debt-banner { background: rgba(255, 93, 108, 0.15); border: 1px solid var(--red); padding: 10px; border-radius: 10px; font-size: 13px; margin-bottom: 8px; text-align: center; }

.mini-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ============================================================ MODALS */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4, 8, 20, 0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 18px;
  padding: 24px; width: min(560px, 100%); max-height: 88vh; overflow: auto; box-shadow: var(--shadow);
  animation: pop 0.25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop { from { transform: scale(0.9); opacity: 0; } }
.modal h2 { margin-bottom: 6px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }

/* property modal */
.prop-card { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.prop-banner { padding: 16px; color: #fff; text-align: center; }
.prop-banner h3 { font-size: 20px; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.prop-body { padding: 16px; background: rgba(0,0,0,0.2); }
.rent-table { width: 100%; font-size: 14px; border-collapse: collapse; }
.rent-table td { padding: 5px 4px; border-bottom: 1px solid var(--border); }
.rent-table td:last-child { text-align: right; font-weight: 700; }
.prop-owner { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* trade modal */
.trade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.trade-col h4 { margin-bottom: 8px; font-size: 14px; }
.trade-props { display: flex; flex-direction: column; gap: 5px; max-height: 200px; overflow: auto; margin-bottom: 10px; }
.trade-prop { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: rgba(0,0,0,0.25); cursor: pointer; border: 1px solid transparent; }
.trade-prop.sel { border-color: var(--primary); background: rgba(79,124,255,0.15); }
.trade-prop .swatch { width: 14px; height: 14px; border-radius: 3px; flex: 0 0 auto; }
.trade-money { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.trade-money input { width: 100%; }

/* card overlay */
.card-overlay, .win-overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 150; background: rgba(4,8,20,0.74); backdrop-filter: blur(5px); perspective: 1200px; }
.card-overlay.show, .win-overlay.show { display: flex; }

/* radial glow burst behind the card */
.card-burst { position: absolute; width: 560px; height: 560px; max-width: 120vw; border-radius: 50%; opacity: 0; pointer-events: none; }
.card-overlay.chance .card-burst { background: radial-gradient(circle, rgba(255,138,61,0.45), transparent 62%); }
.card-overlay.chest .card-burst { background: radial-gradient(circle, rgba(79,124,255,0.45), transparent 62%); }
.card-overlay.show .card-burst { animation: cardBurst 0.8s ease-out; }
@keyframes cardBurst { 0% { opacity: 0; transform: scale(0.4); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(1.35); } }

.game-card {
  position: relative; overflow: hidden; width: min(380px, 90%); padding: 26px 26px 24px; text-align: center;
  color: #1a2238; border-radius: 20px; border: 1px solid rgba(0,0,0,0.08);
  background:
    radial-gradient(120% 80% at 50% -10%, #ffffff, #eaeefb 75%),
    repeating-linear-gradient(45deg, rgba(0,0,0,0.018) 0 14px, transparent 14px 28px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.game-card::after { content: ''; position: absolute; inset: 7px; border: 2px solid rgba(0,0,0,0.07); border-radius: 14px; pointer-events: none; }
.game-card.chance { border-top: 6px solid #ff8a3d; box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 70px -14px #ff8a3d; }
.game-card.chest { border-top: 6px solid #4f7cff; box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 70px -14px #4f7cff; }
.game-card.k-good { box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 70px -10px var(--green); }
.game-card.k-bad { box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 70px -10px var(--red); }
.game-card.flip { animation: cardFlip 0.6s cubic-bezier(.34,1.4,.5,1); }
@keyframes cardFlip { 0% { transform: rotateY(-90deg) scale(0.85); opacity: 0; } 60% { transform: rotateY(12deg) scale(1.03); opacity: 1; } 100% { transform: rotateY(0) scale(1); } }

.card-corner { position: absolute; font-size: 18px; opacity: 0.45; z-index: 2; }
.card-corner.tl { top: 9px; left: 12px; }
.card-corner.br { bottom: 9px; right: 12px; transform: rotate(180deg); }
.card-sheen { position: absolute; top: 0; left: -60%; width: 45%; height: 100%; transform: skewX(-20deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent); pointer-events: none; z-index: 3; }
.card-overlay.show .card-sheen { animation: cardSheen 0.9s ease 0.32s; }
@keyframes cardSheen { from { left: -60%; } to { left: 130%; } }

.card-deck { position: relative; z-index: 2; font-weight: 900; letter-spacing: 3px; font-size: 13px; padding: 6px 14px; border-radius: 20px; display: inline-block; margin-bottom: 12px; color: #fff; }
.card-deck.chance { background: #ff8a3d; }
.card-deck.chest { background: #4f7cff; }
.card-badge {
  position: relative; z-index: 2; width: 92px; height: 92px; border-radius: 50%; margin: 4px auto 14px;
  display: flex; align-items: center; justify-content: center; font-size: 46px; line-height: 1;
  box-shadow: 0 10px 26px rgba(0,0,0,0.28), inset 0 -4px 8px rgba(0,0,0,0.12), inset 0 4px 8px rgba(255,255,255,0.6);
  animation: badgePop 0.6s cubic-bezier(.34,1.7,.5,1);
}
.game-card.chance .card-badge { background: radial-gradient(circle at 40% 32%, #ffe0c2, #ff8a3d); }
.game-card.chest .card-badge { background: radial-gradient(circle at 40% 32%, #d4e0ff, #4f7cff); }
@keyframes badgePop { 0% { transform: scale(0) rotate(-25deg); } 70% { transform: scale(1.22); } 100% { transform: scale(1); } }
.card-text { position: relative; z-index: 2; font-size: 18px; font-weight: 700; line-height: 1.4; margin-bottom: 12px; min-height: 48px; }
.card-who { position: relative; z-index: 2; font-size: 13px; color: #5a6485; margin-bottom: 18px; }
.card-who b { color: #1a2238; }
.game-card .btn { position: relative; z-index: 2; }

/* ---------- power-up cards (arcade mode) ---------- */
.card-overlay.power .card-burst { background: radial-gradient(circle, rgba(255,210,63,0.5), rgba(124,92,255,0.28) 46%, transparent 66%); }
.card-overlay.power .card-burst { animation: cardBurst 0.9s ease-out, powerSpin 4s linear infinite; }
.game-card.power, .game-card.k-power {
  border-top: 6px solid #ffd23f;
  background:
    radial-gradient(120% 80% at 50% -10%, #fffdf6, #f1ecff 78%),
    repeating-linear-gradient(45deg, rgba(124,92,255,0.04) 0 14px, transparent 14px 28px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 90px -8px #ffd23f, 0 0 130px -18px #7c5cff;
  animation: cardFlip 0.6s cubic-bezier(.34,1.4,.5,1), powerGlow 1.8s ease-in-out 0.6s infinite;
}
.card-deck.power { background: linear-gradient(90deg, #ffb43f, #7c5cff); box-shadow: 0 0 18px rgba(124,92,255,0.55); }
.game-card.power .card-badge {
  background: radial-gradient(circle at 38% 30%, #fff3c4, #ffd23f 52%, #7c5cff);
  box-shadow: 0 10px 26px rgba(124,92,255,0.4), 0 0 30px rgba(255,210,63,0.7), inset 0 -4px 8px rgba(0,0,0,0.12), inset 0 4px 8px rgba(255,255,255,0.6);
}
.game-card.power .card-badge::before {
  content: ''; position: absolute; inset: -10px; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 0deg, #ffd23f, #7c5cff, #36d399, #ffd23f);
  filter: blur(7px); opacity: 0.7; animation: powerSpin 3s linear infinite;
}
.game-card.power .card-corner { opacity: 0.6; animation: powerBob 1.5s ease-in-out infinite; }
@keyframes powerGlow { 50% { box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 120px -4px #ffd23f, 0 0 170px -10px #7c5cff; } }
@keyframes powerSpin { to { transform: rotate(360deg); } }
@keyframes powerBob { 50% { transform: translateY(-3px); } }

/* active power-up badges on player cards */
.pc-powers { display: inline-flex; gap: 1px; margin-left: 4px; vertical-align: middle; }
.pc-power { font-size: 12px; line-height: 1; filter: drop-shadow(0 0 4px rgba(255,210,63,0.85)); animation: powerBob 1.6s ease-in-out infinite; }

/* house-rule chips (room view) */
.rule-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.rule-chip { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--muted); }
.rule-chip.power { background: linear-gradient(90deg, rgba(255,178,63,0.22), rgba(124,92,255,0.22)); border-color: rgba(255,210,63,0.5); color: #ffe9a8; }
.rule-power { background: linear-gradient(90deg, rgba(255,178,63,0.10), rgba(124,92,255,0.12)); border: 1px solid rgba(124,92,255,0.32); border-radius: 12px; padding: 10px 12px !important; }
.rule-power b { color: #ffd23f; }

/* ---------- emotes & reactions ---------- */
.emote-bar { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 10px 0 2px; }
.emote-btn {
  font-size: 18px; line-height: 1; width: 34px; height: 34px; padding: 0; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border); transition: transform 0.12s, background 0.15s;
}
.emote-btn:hover { transform: translateY(-2px) scale(1.14); background: rgba(255,255,255,0.13); }
.emote-btn:active { transform: scale(0.88); }

.speech-bubble {
  position: fixed; z-index: 180; transform: translate(-50%, -50%);
  background: #fff; color: #1a2238; font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45); white-space: nowrap; pointer-events: none;
  animation: bubbleIn 0.3s cubic-bezier(.34,1.6,.5,1); max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.speech-bubble::after { content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); border: 7px solid transparent; border-top-color: #fff; border-bottom: 0; }
.speech-bubble.gone { opacity: 0; transform: translate(-50%, -130%); transition: opacity 0.4s ease, transform 0.4s ease; }
@keyframes bubbleIn { from { opacity: 0; transform: translate(-50%, 12%) scale(0.6); } }

.player-card.reacted { animation: cardReact 0.5s ease; }
@keyframes cardReact { 30% { transform: scale(1.035); box-shadow: 0 0 0 2px var(--gold); } }
.pc-crown { filter: drop-shadow(0 0 5px rgba(255,206,77,0.85)); animation: powerBob 1.8s ease-in-out infinite; }
.pc-broke { animation: powerBob 1.1s ease-in-out infinite; }

/* win overlay */
.win-box { text-align: center; animation: pop 0.5s cubic-bezier(.34,1.56,.64,1); }
.trophy { font-size: 90px; animation: float 2.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-14px); } }
.win-box h2 { font-size: 40px; background: linear-gradient(180deg, var(--gold), var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.win-box p { color: var(--muted); margin: 6px 0 22px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--panel-solid); border: 1px solid var(--border); padding: 10px 18px; border-radius: 30px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); animation: toastIn 0.3s ease; max-width: 90vw; }
.toast.error { border-color: var(--red); color: #ffb3ba; }
.toast.good { border-color: var(--green); color: #b6f5da; }
@keyframes toastIn { from { transform: translateY(-16px); opacity: 0; } }

/* ---------- card notifications (other players' draws) ---------- */
.card-notifs { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 160; display: flex; flex-direction: column; gap: 8px; align-items: stretch; width: min(420px, 92vw); pointer-events: none; }
.card-notif {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: var(--panel-solid); border: 1px solid var(--border); border-left: 4px solid var(--cn, #4f7cff);
  border-radius: 12px; padding: 9px 14px; box-shadow: var(--shadow);
  animation: cardNotifIn 0.34s cubic-bezier(.34,1.5,.5,1);
}
.card-notif.chance { --cn: #ff8a3d; }
.card-notif.chest  { --cn: #4f7cff; }
.card-notif.power  { --cn: #ffd23f; border-left-color: #ffd23f; box-shadow: var(--shadow), 0 0 24px -8px #7c5cff; }
.card-notif.gone { animation: cardNotifOut 0.4s ease forwards; }
.cn-icon { font-size: 24px; line-height: 1; flex: none; }
.cn-body { min-width: 0; }
.cn-who { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-verb { color: var(--muted); font-weight: 600; }
.cn-text { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes cardNotifIn { from { transform: translateY(18px); opacity: 0; } }
@keyframes cardNotifOut { to { transform: translateY(12px); opacity: 0; } }

/* ---------- turn auto-play countdown ---------- */
.turn-timer { display: none; margin: 7px auto 0; width: fit-content; font-size: 12px; font-weight: 700; color: var(--muted); background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 20px; padding: 3px 12px; }
.turn-timer.show { display: block; }
.turn-timer.low { color: #ffb3ba; border-color: var(--red); animation: timerPulse 1s ease-in-out infinite; }
@keyframes timerPulse { 50% { opacity: 0.5; } }

/* ---------- start screen pitch + mode cards ---------- */
.pitch { max-width: 640px; margin: 0 auto 22px; text-align: center; color: var(--muted); font-size: clamp(14px, 2.2vw, 16px); line-height: 1.5; }
.intro-row { display: flex; gap: 12px; align-items: flex-end; justify-content: center; max-width: 560px; margin: 0 auto 18px; }
.intro-row .name-field { flex: 1; margin-bottom: 0; }
.intro-row .btn { white-space: nowrap; }

.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 760px; margin: 0 auto 22px; width: 100%; }
.mode-card {
  display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform 0.1s ease, border 0.2s, box-shadow 0.2s; box-shadow: var(--shadow);
}
.mode-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 14px 34px rgba(79,124,255,0.25); }
.mode-card.primary { border-color: rgba(79,124,255,0.5); background: linear-gradient(180deg, rgba(79,124,255,0.16), var(--panel)); }
.mode-card .mc-icon { font-size: 34px; flex: 0 0 auto; width: 48px; text-align: center; }
.mode-card .mc-body { flex: 1; min-width: 0; }
.mode-card .mc-title { font-weight: 800; font-size: 17px; margin-bottom: 3px; }
.mode-card .mc-desc { font-size: 13px; color: var(--muted); line-height: 1.4; }
.mode-card .mc-go { font-size: 26px; color: var(--muted); flex: 0 0 auto; }
.mode-card.join-card { cursor: default; }
.mode-card.join-card:hover { transform: none; border-color: var(--border); box-shadow: var(--shadow); }
.mode-card .join-row { margin-top: 8px; margin-bottom: 0; }
#public-panel { max-width: 760px; margin: 0 auto; width: 100%; }

.bot-count { display: flex; flex-wrap: wrap; gap: 10px; }
.bot-count .btn { flex: 1; min-width: 80px; }
.seg { display: flex; gap: 8px; }
.seg .btn { flex: 1; }
.diff-note { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.4; min-height: 2.6em; }

/* ---------- bot badges + room ---------- */
.badge-bot { background: rgba(31, 182, 196, 0.2); color: #5fe0ec; }
.member.bot { opacity: 0.95; }
.m-remove { margin-left: auto; background: rgba(255,93,108,0.15); color: var(--red); border: none; width: 24px; height: 24px; border-radius: 7px; cursor: pointer; font-size: 16px; line-height: 1; flex: 0 0 auto; }
.m-remove:hover { background: rgba(255,93,108,0.3); }
.pc-bot { font-size: 12px; }
.thinking { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
.buy-info.thinking { color: #5fe0ec; }

/* ---------- how to play ---------- */
.howto-list { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 9px; font-size: 14px; line-height: 1.45; }
.howto-list li { color: #dce5fb; }
.howto-modes { display: flex; flex-direction: column; gap: 8px; background: rgba(0,0,0,0.25); border-radius: 12px; padding: 14px; margin-bottom: 18px; font-size: 13px; color: var(--muted); }
.howto-modes b { color: var(--text); }

/* ---------- visual effects (fx.js) ---------- */
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
#fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-float {
  position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 20px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7); white-space: nowrap; animation: floatUp 1.4s ease-out forwards;
}
.fx-float.big { font-size: 32px; }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.6); }
  18% { opacity: 1; transform: translate(-50%, -60%) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -165%) scale(1); }
}
.fx-coin { position: absolute; font-size: 18px; transform: translate(-50%, -50%); animation: coinFly 0.9s ease-out forwards; }
@keyframes coinFly {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(0); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(220deg); }
}
.fx-ring { position: absolute; width: 30px; height: 30px; border: 3px solid; border-radius: 50%; transform: translate(-50%, -50%) scale(0.3); animation: ringPulse 0.7s ease-out forwards; }
@keyframes ringPulse { 0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.3); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(3); } }
.fx-flash { position: absolute; inset: 0; animation: flashOut 0.45s ease-out forwards; }
@keyframes flashOut { 0% { opacity: 1; } 100% { opacity: 0; } }
.fx-shake { animation: fxShake 0.6s cubic-bezier(.36,.07,.19,.97); }
@keyframes fxShake {
  10%, 90% { transform: translate(calc(var(--shake, 6px) * -0.4), 0); }
  20%, 80% { transform: translate(calc(var(--shake, 6px) * 0.6), 0) rotate(-0.4deg); }
  30%, 50%, 70% { transform: translate(calc(var(--shake, 6px) * -1), 0) rotate(0.4deg); }
  40%, 60% { transform: translate(var(--shake, 6px), 0); }
}

.token.landed { animation: tokenLand 0.38s ease; }
@keyframes tokenLand {
  0% { transform: translate(-50%, -150%) scale(1.1); }
  60% { transform: translate(-50%, -50%) scale(1.35, 0.7); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
.tile-ripple { position: absolute; inset: 0; border: 2px solid #fff; border-radius: 3px; pointer-events: none; z-index: 6; animation: tileRipple 0.6s ease-out forwards; }
@keyframes tileRipple { 0% { opacity: 0.85; transform: scale(1); } 100% { opacity: 0; transform: scale(1.45); } }
.house-pip.pop { animation: housePop 0.4s cubic-bezier(.34,1.7,.5,1); }
@keyframes housePop { 0% { transform: scale(0); } 70% { transform: scale(1.6); } 100% { transform: scale(1); } }

/* ---------- clarity: announcement banner ---------- */
.announce {
  position: absolute; top: 5%; left: 50%; transform: translate(-50%, -16px);
  z-index: 30; pointer-events: none; max-width: 88%;
  background: rgba(9, 14, 30, 0.93); color: #fff; border: 1.5px solid var(--border);
  padding: 9px 18px; border-radius: 14px; font-size: clamp(12px, 1.7vw, 16px); font-weight: 700;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55); text-align: center; line-height: 1.35;
  opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease; backdrop-filter: blur(6px);
}
.announce.show { opacity: 1; transform: translate(-50%, 0); }
.announce b { color: var(--gold); }
.announce.land { border-color: var(--primary); }
.announce.good { border-color: var(--green); box-shadow: 0 12px 34px rgba(54, 211, 153, 0.35); }
.announce.warn { border-color: var(--red); box-shadow: 0 12px 34px rgba(255, 93, 108, 0.35); }

/* ---------- clarity: current tile + landing glow ---------- */
.tile.current-tile::before {
  content: ''; position: absolute; inset: 0; border: 2px solid var(--gold); border-radius: 3px;
  z-index: 7; pointer-events: none; animation: curTile 1.2s ease-in-out infinite;
}
@keyframes curTile { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 206, 77, 0.5); } 50% { box-shadow: 0 0 9px 1px rgba(255, 206, 77, 0.9); } }
.land-glow {
  position: absolute; inset: -1px; border-radius: 4px; z-index: 9; pointer-events: none;
  border: 3px solid #fff; animation: landGlow 1.6s ease-out forwards;
}
@keyframes landGlow {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.95), inset 0 0 12px rgba(255,255,255,0.8); opacity: 1; transform: scale(1.04); }
  100% { box-shadow: 0 0 22px 8px rgba(255, 255, 255, 0); opacity: 0; transform: scale(1); }
}

/* ---------- clarity: action hint ---------- */
.action-hint { font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-bottom: 10px; min-height: 1.2em; }

/* ---------- polish: active token, monopolies, doubles ---------- */
.token.active { z-index: 25; box-shadow: 0 0 0 2px #fff, 0 0 12px 3px var(--tk); animation: tokenActive 1.4s ease-in-out infinite; }
@keyframes tokenActive { 50% { box-shadow: 0 0 0 3px #fff, 0 0 22px 7px var(--tk); } }
.tile.monopoly::after { box-shadow: inset 0 0 0 2px var(--owner), 0 0 9px -1px var(--owner); animation: monoGlow 1.9s ease-in-out infinite; }
@keyframes monoGlow { 50% { box-shadow: inset 0 0 0 3px var(--owner), 0 0 14px 1px var(--owner); } }

.doubles-badge { display: none; margin-top: 2px; padding: 4px 16px; border-radius: 20px; font-weight: 900; font-size: 13px; letter-spacing: 1px; color: #3a2700; background: linear-gradient(180deg, var(--gold), var(--gold-2)); box-shadow: 0 4px 16px rgba(255,176,32,0.5); }
.doubles-badge.show { display: inline-block; animation: doublesPop 0.45s cubic-bezier(.34,1.6,.5,1); }
@keyframes doublesPop { 0% { transform: scale(0) rotate(-8deg); } 70% { transform: scale(1.2) rotate(2deg); } 100% { transform: scale(1); } }

/* ---------- polish: buy card ---------- */
.buy-card { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 6px; box-shadow: var(--shadow); }
.buy-card-head { padding: 11px 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.55); font-size: 15px; }
.buy-card-body { padding: 10px 12px; background: rgba(0,0,0,0.28); }
.buy-rent { font-size: 12.5px; color: #cdd8f5; line-height: 1.4; }
.buy-houses { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- polish: connecting overlay ---------- */
.connect-overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 160; background: rgba(4,8,20,0.82); backdrop-filter: blur(6px); }
.connect-overlay.show { display: flex; animation: fade 0.25s ease; }
.connect-box { text-align: center; }
.spinner { width: 56px; height: 56px; border: 5px solid rgba(255,255,255,0.14); border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 18px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.connect-text { font-size: 20px; font-weight: 800; }
.connect-sub { color: var(--muted); margin: 6px 0 22px; font-size: 14px; }

/* ---------- polish: end-game standings ---------- */
.standings { display: flex; flex-direction: column; gap: 8px; margin: 18px 0 22px; text-align: left; }
.standing { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(0,0,0,0.25); border-left: 4px solid var(--pc, #888); }
.standing.winner { background: linear-gradient(90deg, rgba(255,206,77,0.22), rgba(0,0,0,0.2)); box-shadow: 0 0 0 1px var(--gold); }
.standing.out { opacity: 0.5; }
.st-rank { font-size: 17px; width: 30px; text-align: center; }
.st-token { font-size: 20px; }
.st-name { flex: 1; font-weight: 700; }
.st-worth { font-weight: 800; color: var(--green); }
.st-out { color: var(--red); font-weight: 700; font-size: 13px; }
.win-actions { display: flex; gap: 10px; justify-content: center; }
.win-box { width: min(440px, 92vw); }

/* ---------- spectating / visibility ---------- */
.watchers { margin-top: 8px; }
.watchers-head { font-size: 12px; color: var(--gold); font-weight: 700; }
.watcher { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); padding: 3px 2px; }
.room-visibility { font-size: 12px; color: var(--muted); margin-top: 8px; }
.host-warning { font-size: 12px; color: var(--gold); margin: 8px 0 0; text-align: center; }
.rr-status.playing { background: rgba(255, 93, 108, 0.18); color: #ff9aa4; }

/* ---------- host / admin controls ---------- */
.m-acts { display: flex; gap: 5px; margin-left: auto; }
.m-act { background: rgba(255, 206, 77, 0.16); color: var(--gold); border: none; width: 24px; height: 24px; border-radius: 7px; cursor: pointer; font-size: 13px; flex: 0 0 auto; }
.m-act:hover { background: rgba(255, 206, 77, 0.32); }
.player-card .pc-kick { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; font-size: 12px; opacity: 0; transition: opacity 0.15s; }
.player-card:hover .pc-kick { opacity: 0.9; }
.leave-game { margin-top: 10px; width: 100%; opacity: 0.75; }
.leave-game:hover { opacity: 1; }

/* ---------- mode adjustments ---------- */
.mode-card.wide { grid-column: 1 / -1; }
body.local-mode .room-code-row,
body.local-mode .room-visibility { display: none !important; }

/* scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================ RESPONSIVE */
@media (max-width: 1100px) {
  .game-layout { grid-template-columns: 240px minmax(0,1fr) 240px; }
}
@media (max-width: 900px) {
  .landing-grid, .room-layout { grid-template-columns: 1fr; }
  .game-layout { grid-template-columns: 1fr; grid-template-rows: auto auto auto; overflow: auto; height: auto; min-height: 100%; }
  .game-side { flex-direction: row; flex-wrap: wrap; }
  .game-side .panel { flex: 1; min-width: 220px; }
  .board { width: min(100%, 92vw); }
  .players-panel { max-height: none; }
}
@media (max-width: 560px) {
  .members { grid-template-columns: 1fr; }
  .game-side { flex-direction: column; }
}
