/* ============================================
   СУЕТАПОЛИЯ — Main Styles
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== PREROLL AD ===== */
#ad-preroll {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #0a0a1a, #1a0a3a, #0a0a1a);
  display: flex; align-items: center; justify-content: center;
}
.preroll-content { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.preroll-logo { font-size: 3.5em; font-weight: 900; color: #00ffff; text-shadow: 0 0 40px #00ffff, 0 0 80px #ff00ff; letter-spacing: 5px; animation: logoPulse 2s ease infinite; }
@keyframes logoPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.03)} }
.preroll-subtitle { font-size: 1.2em; color: #8888cc; letter-spacing: 3px; }
.preroll-ad-box { background: rgba(255,255,255,0.05); border: 2px dashed rgba(255,255,255,0.15); border-radius: 16px; padding: 30px 60px; }
.preroll-ad-label { font-size: 0.7em; color: #666; letter-spacing: 3px; margin-bottom: 10px; }
.preroll-ad-space { color: #555; font-size: 0.9em; }
.preroll-timer { color: #aaa; }
.preroll-timer span { color: #00ffff; font-weight: 900; font-size: 1.3em; }
.btn-skip { padding: 12px 40px; background: linear-gradient(135deg,#00cccc,#cc00cc); color: #fff; border: none; border-radius: 12px; font-family: var(--font-main); font-size: 1.1em; font-weight: 700; cursor: pointer; transition: all 0.3s; opacity: 0.4; }
.btn-skip:not(:disabled) { opacity: 1; }
.btn-skip:not(:disabled):hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,204,204,0.4); }
#ad-preroll.hidden { opacity: 0; pointer-events: none; transition: opacity 0.5s; }

/* ===== MAIN MENU (landing) ===== */
#nickname-screen {
  position: fixed; inset: 0; z-index: 9998; overflow-y: auto; overflow-x: hidden;
  background: transparent;
  display: flex; flex-direction: column; align-items: center;
}
.menu-top {
  position: relative; z-index: 2; width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
}
.menu-icon-btn {
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 1.05em;
  background: var(--bg-panel); border: 1px solid var(--border-color); color: var(--text-primary);
}
.menu-icon-btn:hover { border-color: var(--accent); }
.theme-switcher-nick { display: flex; align-items: center; gap: 6px; }

.menu-center {
  position: relative; z-index: 2; width: min(92vw, 460px);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 6px 0 26px; text-align: center;
}

.menu-tagline { color: var(--text-secondary); font-size: 1em; margin-top: -4px; }

.menu-nick {
  width: min(100%, 280px); padding: 13px 18px; text-align: center;
  background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 12px;
  color: var(--text-primary); font-family: var(--font-main); font-size: 1.05em; font-weight: 600; outline: none; transition: var(--transition);
}
.menu-nick::placeholder { color: var(--text-secondary); opacity: 0.7; }
.menu-nick:focus { border-color: var(--accent); box-shadow: var(--accent-glow); }

.menu-play {
  width: min(100%, 280px); padding: 15px 20px; border: none; border-radius: 14px; cursor: pointer;
  font-family: var(--font-main); font-size: 1.5em; font-weight: 800; color: #fff;
  background: linear-gradient(180deg, #8b5cf6, #6d28d9);
  box-shadow: 0 8px 26px rgba(109, 40, 217, 0.5), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.menu-play-arrows { font-size: 1.2em; margin-right: 6px; opacity: 0.85; }
.menu-play:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(109, 40, 217, 0.6), inset 0 1px 0 rgba(255,255,255,0.3); }
.menu-play:active:not(:disabled) { transform: translateY(0); }
.menu-play:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.menu-secondary { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.menu-sec-btn {
  padding: 9px 16px; border-radius: 10px; cursor: pointer; font-family: var(--font-main); font-weight: 700; font-size: 0.9em;
  color: var(--text-primary); background: rgba(124, 58, 237, 0.55); border: 1px solid rgba(167, 139, 250, 0.35);
  box-shadow: 0 4px 14px rgba(0,0,0,0.3); transition: var(--transition);
}
.menu-sec-btn:hover:not(:disabled) { background: rgba(139, 92, 246, 0.8); transform: translateY(-1px); }
.menu-sec-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.menu-join { display: flex; gap: 8px; width: min(100%, 360px); }
.menu-join input {
  flex: 1; min-width: 0; padding: 9px 12px; text-align: center; text-transform: uppercase; letter-spacing: 3px; font-weight: 800;
  background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 10px;
  color: var(--text-primary); font-family: var(--font-main); outline: none;
}
.menu-join input:focus { border-color: var(--accent); }

.menu-colors { width: min(100%, 360px); }
.menu-colors summary { cursor: pointer; color: var(--text-secondary); font-size: 0.85em; list-style: none; padding: 4px; }
.menu-colors summary::-webkit-details-marker { display: none; }
.menu-colors summary:hover { color: var(--accent); }
.menu-colors .token-grid { margin-top: 8px; }

.menu-how {
  position: relative; z-index: 2; width: min(92vw, 520px); margin: 10px 0 40px; padding: 22px 24px;
  background: color-mix(in srgb, var(--bg-panel) 85%, transparent); border: 1px solid var(--border-color); border-radius: 18px; text-align: left;
}
.menu-how h2 { font-size: 1.1em; color: var(--accent); margin-bottom: 12px; }
.menu-how-row { display: flex; gap: 14px; align-items: flex-start; padding: 8px 0; }
.menu-how-row > span { font-size: 1.5em; width: 34px; text-align: center; }
.menu-how-row b { display: block; font-weight: 700; font-size: 0.95em; }
.menu-how-row small { display: block; color: var(--text-secondary); font-size: 0.8em; margin-top: 2px; }

/* ===== ROOM LIST ===== */
#rooms-screen {
  position: fixed; inset: 0; z-index: 9998; overflow-y: auto; padding: 20px; display: flex; justify-content: center;
  background: transparent;
}
.rooms-card { margin: auto; width: min(94vw, 560px); background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 20px; padding: 20px; box-shadow: 0 20px 80px rgba(0,0,0,0.5); }
.rooms-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.rooms-head h2 { flex: 1; font-size: 1.1em; color: var(--accent); }
.rooms-online { font-size: 0.8em; color: var(--text-secondary); }
.rooms-list { display: flex; flex-direction: column; gap: 8px; min-height: 120px; max-height: 55vh; overflow-y: auto; }
.rooms-empty { margin: auto; text-align: center; color: var(--text-secondary); line-height: 1.6; padding: 30px 0; }
.room-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px; }
.room-main { flex: 1; min-width: 0; }
.room-host { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-meta { font-size: 0.75em; color: var(--text-secondary); }
.room-count { font-weight: 800; color: var(--accent); }
.rooms-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.token-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%;
}
.token-option {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px; background: var(--bg-secondary); border: 2px solid var(--border-color); border-radius: 14px;
  cursor: pointer; transition: all 0.3s;
}
.token-option:hover { border-color: var(--accent); transform: translateY(-3px); }
.token-option.selected { border-color: var(--accent); background: var(--btn-hover); box-shadow: var(--accent-glow); transform: scale(1.05); }
.token-option .tok-color-big {
  width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid transparent; position: relative;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: all 0.3s;
}
.token-option .tok-label { font-size: 0.6em; font-weight: 700; color: var(--text-secondary); }
.token-option.selected .tok-color-big { border-color: #fff; transform: scale(1.1); box-shadow: 0 0 25px rgba(255,255,255,0.4); }
/* Googly eyes on selected */
.token-option.selected .tok-color-big::before,
.token-option.selected .tok-color-big::after {
  content: ''; position: absolute;
  width: 14px; height: 16px;
  background: #fff; border-radius: 50%;
  top: 12px;
  box-shadow: inset 4px -2px 0 2px #222;
}
.token-option.selected .tok-color-big::before { left: 8px; }
.token-option.selected .tok-color-big::after { right: 8px; }

.token-option.taken {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(80%);
}

.invite-banner {
  padding: 10px 16px;
  background: var(--btn-bg);
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9em;
  line-height: 1.4;
  text-align: center;
  width: 100%;
}
.invite-banner.error {
  border-color: #ff5555;
  background: rgba(255, 85, 85, 0.15);
  color: #ff8888;
}

.btn-play {
  padding: 14px 50px; background: var(--btn-primary-bg); color: #fff; border: none; border-radius: 14px;
  font-family: var(--font-main); font-size: 1.15em; font-weight: 800; cursor: pointer; transition: all 0.3s; letter-spacing: 2px;
}
.btn-play:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
.btn-play:disabled { opacity: 0.35; cursor: not-allowed; }

.theme-switcher-nick { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.nick-theme-label { font-size: 0.75em; color: var(--text-secondary); }

/* ===== LOBBY SCREEN ===== */
#lobby-screen {
  position: fixed; inset: 0; z-index: 9997;
  background: transparent;
  display: flex; justify-content: center;
  overflow-y: auto; padding: 20px;
}
#lobby-screen > .lobby-container { margin: auto; }
.lobby-container {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 24px;
  padding: 35px 45px; box-shadow: 0 20px 80px rgba(0,0,0,0.5), var(--border-glow);
  max-width: 550px; width: 90%;
}
.lobby-logo { font-size: 1.8em; font-weight: 900; color: var(--accent); text-shadow: var(--accent-glow); letter-spacing: 2px; }
.lobby-subtitle { color: var(--text-secondary); font-size: 0.9em; margin-bottom: 5px; }

.lobby-invite-row {
  display: flex;
  gap: 8px;
  width: 100%;
  align-items: center;
}
.lobby-invite-row input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.75em;
  font-family: monospace;
}
.lobby-invite-row .btn-copy {
  white-space: nowrap;
  font-size: 0.75em;
  padding: 8px 12px;
}

.lobby-section {
  width: 100%; background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: 14px; padding: 14px 18px;
}
.lobby-section h3 { font-size: 0.9em; color: var(--accent); margin-bottom: 10px; font-weight: 700; }

.lobby-options { display: flex; gap: 8px; }
.lobby-opt {
  flex: 1; padding: 10px; background: var(--bg-panel); border: 2px solid var(--border-color);
  border-radius: 10px; color: var(--text-primary); font-family: var(--font-main);
  font-size: 1em; font-weight: 700; cursor: pointer; transition: all 0.3s;
}
.lobby-opt:hover { border-color: var(--accent); }
.lobby-opt.active { border-color: var(--accent); background: var(--btn-hover); box-shadow: var(--accent-glow); }

.lobby-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.lobby-toggle-row span { font-size: 0.8em; color: var(--text-primary); }

.lobby-hint { font-size: 0.7em; color: var(--text-secondary); margin-top: 5px; line-height: 1.4; opacity: 0.7; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg-panel); border: 2px solid var(--border-color);
  border-radius: 24px; transition: 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute; height: 16px; width: 16px;
  left: 2px; bottom: 2px; background: var(--text-secondary);
  border-radius: 50%; transition: 0.3s;
}
.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); background: #fff; }

/* ===== MAIN LAYOUT: left (invite + chat) | board | right (players, streets) ===== */
#main-layout { display: flex; height: 100vh; gap: 10px; padding: 10px; }

#left-col, #sidebar {
  width: clamp(240px, 21vw, 320px); flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; min-height: 0;
}
#left-col .brand {
  font-family: var(--font-game); font-weight: 900; font-size: 1.35em; letter-spacing: 1.5px; color: #fff; padding: 2px 4px 4px;
  text-shadow: 0 0 20px color-mix(in srgb, var(--accent2) 55%, transparent);
}
#left-col .brand span { color: color-mix(in srgb, var(--accent2) 70%, #fff); }
.share-row { display: flex; gap: 6px; }
.share-row input {
  flex: 1; min-width: 0; padding: 7px 9px; font-size: 0.72em; font-family: monospace;
  background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-secondary);
}
.share-row .btn-action { width: auto; padding: 7px 11px; }
.share-code { margin-top: 6px; font-size: 0.78em; color: var(--text-secondary); }
.share-code b { color: var(--accent); letter-spacing: 2px; }
.side-tools { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.side-tools .theme-switcher-bar { flex: 1; padding: 4px; border-radius: 10px; }
.side-tools .menu-icon-btn { width: 34px; height: 34px; flex-shrink: 0; }

#game-area { flex: 1; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }

/* ===== SIDEBAR (right column) ===== */
#sidebar { overflow-y: auto; padding-right: 2px; }
.side-tools .menu-icon-btn { width: 34px; height: 34px; flex-shrink: 0; }
.theme-switcher-bar {
  display: flex; gap: 5px; justify-content: center; padding: 6px;
  background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 10px;
}
.theme-btn {
  width: 32px; height: 32px; border: 2px solid var(--border-color); background: var(--bg-secondary);
  border-radius: 8px; font-size: 0.95em; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.theme-btn:hover, .theme-btn.active { border-color: var(--accent); box-shadow: var(--accent-glow); transform: scale(1.1); }
.panel { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 12px; padding: 10px; }
.panel h3 { font-size: 0.8em; color: var(--accent); margin-bottom: 6px; font-weight: 700; }

.player-info {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px;
  margin-bottom: 4px; transition: var(--transition); border: 1px solid transparent;
}
.player-info.active { background: var(--btn-bg); border-color: var(--accent); box-shadow: var(--accent-glow); }
.player-token-display { font-size: 1.2em; }
.player-color-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.player-name { font-weight: 600; font-size: 0.8em; flex: 1; }
.player-money { font-size: 0.8em; color: var(--accent); font-weight: 700; }

/* ===== MY PROPERTIES PANEL ===== */
.props-header { cursor: pointer; display: flex; align-items: center; gap: 4px; user-select: none; }
.props-header:hover { opacity: 0.8; }
.props-toggle { margin-left: auto; font-size: 0.7em; transition: transform 0.3s; }
.props-header.open .props-toggle { transform: rotate(180deg); }
#props-count { font-size: 0.8em; color: var(--text-secondary); font-weight: 400; }

.props-list {
  max-height: 400px; overflow-y: auto;
  transition: max-height 0.3s ease;
}
.props-list.collapsed { max-height: 0; overflow: hidden; }

.prop-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; margin: 3px 0; border-radius: 8px;
  background: rgba(255,255,255,0.04);
  font-size: 0.8em; transition: background 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}
.prop-item:hover { background: rgba(255,255,255,0.1); }
.prop-item.monopoly {
  border-color: var(--accent);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 8px rgba(255,255,255,0.1);
}
.prop-item .prop-color-big {
  width: 8px; height: 32px; border-radius: 4px; flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}
.prop-item .prop-info {
  flex: 1; display: flex; flex-direction: column; gap: 1px;
}
.prop-item .prop-name {
  font-weight: 700; color: var(--text-primary);
  text-transform: uppercase; font-size: 0.85em;
}
.prop-item .prop-price {
  color: var(--accent); font-weight: 800; font-size: 0.9em; white-space: nowrap;
}
.prop-item .prop-rent-val {
  color: #fff; font-size: 0.85em; font-weight: 800;
}
.prop-item .prop-house-label {
  font-size: 0.75em; color: var(--accent); font-weight: 700;
}
.prop-item.monopoly .prop-rent-val { color: #ffe066; }
.props-empty {
  text-align: center; color: var(--text-secondary);
  font-size: 0.75em; padding: 8px;
}

#action-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 8px; }
.btn-action {
  width: 100%; padding: 7px; background: var(--btn-bg); color: var(--text-primary);
  border: 1px solid var(--border-color); border-radius: 8px; font-family: var(--font-main);
  font-size: 0.8em; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.btn-action:hover:not(:disabled) { background: var(--btn-hover); border-color: var(--accent); }
.btn-action:disabled { opacity: 0.35; cursor: not-allowed; }

/* Board: a square-ish area that fits the free height and width */
#board-container { width: 100%; height: 100%; }
#board {
  width: min(100%, calc((100vh - 24px) * 1.1738)); height: auto; aspect-ratio: 115 / 98;
  min-width: 0; min-height: 0; max-width: 100%; max-height: calc(100vh - 24px);
}

/* Tablet / narrow: the board goes first, the side columns follow below */
@media (max-width: 1100px) {
  #main-layout { flex-direction: column; height: auto; min-height: 100vh; }
  #game-area { order: -1; flex: none; width: 100%; }
  #left-col, #sidebar { width: 100%; }
  #left-col .brand { display: none; }
}
/* ===== CHAT ===== */
#chat-panel { flex: 1; display: flex; flex-direction: column; min-height: 140px; }
#chat-messages { flex: 1; min-height: 0; background: var(--chat-bg); border-radius: 8px; padding: 6px; overflow-y: auto; margin-bottom: 6px; font-size: 0.75em; }
.chat-msg { margin-bottom: 3px; padding: 2px 0; line-height: 1.4; }
.chat-msg .sender { font-weight: 700; color: var(--accent); }
#chat-input-area { display: flex; gap: 5px; }
#chat-input {
  flex: 1; padding: 7px 10px; background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: 8px; color: var(--text-primary); font-family: var(--font-main); font-size: 0.8em; outline: none; transition: var(--transition);
}
#chat-input:focus { border-color: var(--accent); }
#chat-send { padding: 7px 12px; background: var(--btn-primary-bg); border: none; border-radius: 8px; color: #fff; font-size: 0.95em; cursor: pointer; }
#quick-emoji { display: flex; gap: 3px; margin-top: 5px; flex-wrap: wrap; }
.emoji-btn {
  width: 30px; height: 30px; background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: 6px; font-size: 1em; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.emoji-btn:hover { transform: scale(1.2); border-color: var(--accent); }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

/* ===== BUY PANEL ===== */
.buy-panel {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.buy-panel-inner {
  background: var(--bg-panel);
  border: 2px solid var(--border-color);
  border-radius: 16px; padding: 24px 32px;
  text-align: center; min-width: 260px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: popIn 0.3s ease;
}
.buy-title {
  font-family: 'Nunito', var(--font-main);
  font-size: 1.4em; font-weight: 800;
  margin-bottom: 8px; text-transform: uppercase;
}
.buy-price { font-size: 1.1em; margin-bottom: 4px; color: var(--accent); font-weight: 700; }
.buy-rent { font-size: 0.85em; color: var(--text-secondary); margin-bottom: 14px; }
.buy-buttons { display: flex; gap: 10px; margin-top: 10px; }
.buy-btn {
  flex: 1; padding: 10px 16px; border: none; border-radius: 10px;
  font-family: 'Nunito', var(--font-main);
  font-size: 0.9em; font-weight: 700; cursor: pointer;
  transition: all 0.2s;
}
.buy-btn.buy-yes {
  background: var(--btn-primary-bg); color: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.buy-btn.buy-yes:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.buy-btn.buy-yes:disabled { opacity: 0.4; cursor: not-allowed; }
.buy-btn.buy-no {
  background: rgba(255,255,255,0.08); color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.buy-btn.buy-no:hover { background: rgba(255,80,80,0.15); color: #ff6b6b; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===== ROOM / LOBBY ADDITIONS ===== */
.nick-room-actions {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.nick-or {
  font-size: 0.8em; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 2px;
}
.nick-join-row {
  display: flex; gap: 8px; width: 100%;
}
.nick-join-row input {
  flex: 1; padding: 12px 16px;
  background: var(--bg-secondary); border: 2px solid var(--border-color); border-radius: 12px;
  color: var(--text-primary); font-family: var(--font-main); font-size: 1.1em; font-weight: 800;
  text-align: center; letter-spacing: 4px; outline: none; transition: var(--transition);
}
.nick-join-row input:focus { border-color: var(--accent); box-shadow: var(--accent-glow); }
.btn-join { padding: 12px 20px !important; font-size: 0.9em !important; }

.lobby-room-code {
  font-size: 1.1em; color: var(--text-primary); display: flex; align-items: center; gap: 8px;
}
.lobby-room-code strong {
  font-size: 1.4em; letter-spacing: 4px; color: var(--accent);
  background: var(--bg-secondary); padding: 4px 12px; border-radius: 8px;
  border: 1px solid var(--border-color);
}
.btn-copy {
  background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px;
  padding: 6px 10px; cursor: pointer; font-size: 1em; transition: var(--transition);
}
.btn-copy:hover { border-color: var(--accent); transform: scale(1.1); }

.lobby-players-list {
  width: 100%; display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: 14px; padding: 10px;
}
.lobby-wait {
  font-size: 0.85em; color: var(--text-secondary); text-align: center; padding: 8px;
}

/* ===== AUCTION ===== */
.auction-bid-row {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0;
}
.auction-amount {
  font-size: 1.4em; font-weight: 800; color: var(--accent); min-width: 80px; text-align: center;
}
.auction-bid-row .btn-action {
  width: 40px; height: 40px; font-size: 1.3em; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}

/* ===== BANKRUPT PLAYER ===== */
.player-info.bankrupt {
  opacity: 0.4; text-decoration: line-through;
}


/* ===== TOASTS + CONNECTION BANNER ===== */
#toast-box {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 100000; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; max-width: 92vw;
}
.toast {
  padding: 10px 18px; border-radius: 10px; font-size: 0.9em; font-weight: 600;
  background: var(--bg-panel); color: var(--text-primary);
  border: 1px solid var(--accent); box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  animation: toastIn 0.25s ease-out;
}
.toast-error { border-color: #ff5555; color: #ff9a9a; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

#connection-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100001;
  padding: 8px; text-align: center; font-weight: 700; font-size: 0.9em;
  background: #b8860b; color: #fff;
}
/* ===== MORTGAGE / DEBT ===== */
.prop-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.prop-act {
  padding: 3px 7px; font-size: 0.7em; font-weight: 700; cursor: pointer;
  background: var(--btn-bg); color: var(--text-primary);
  border: 1px solid var(--border-color); border-radius: 6px; font-family: var(--font-main);
}
.prop-act:hover:not(:disabled) { border-color: var(--accent); background: var(--btn-hover); }
.prop-act:disabled { opacity: 0.4; cursor: not-allowed; }
.prop-item.mortgaged { opacity: 0.75; background: repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0 6px, rgba(255,255,255,0.09) 6px 12px); }

.tile.mortgaged { filter: grayscale(60%) brightness(0.8); }
.tile-mortgage-mark { position: absolute; top: 1px; right: 2px; font-size: 0.9em; z-index: 6; pointer-events: none; }

.debt-banner {
  background: rgba(255, 85, 85, 0.15); border: 1px solid #ff5555; border-radius: 12px;
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.debt-title { font-weight: 800; font-size: 0.9em; color: #ff8a8a; }
.debt-sub { font-size: 0.75em; color: var(--text-secondary); line-height: 1.4; }
.btn-danger { border-color: #ff5555; color: #ff8a8a; }
.btn-danger:hover:not(:disabled) { background: rgba(255, 85, 85, 0.2); border-color: #ff5555; }
#giveup-btn { grid-column: 1 / -1; }
/* ===== PHONES ===== */
@media (max-width: 600px) {
  #lobby-screen, #rooms-screen { padding: 10px; }
  .lobby-container { padding: 20px 14px; width: 100%; max-width: 100%; border-radius: 18px; }
  .lobby-logo { font-size: 1.4em; text-align: center; }
  .lobby-room-code { flex-wrap: wrap; justify-content: center; }
  .lobby-invite-row { flex-wrap: wrap; }
  .lobby-invite-row input { min-width: 0; flex: 1 1 100%; }
  .lobby-options { flex-wrap: wrap; }
  .token-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .token-option { padding: 8px 2px; min-width: 0; }
  .token-option .tok-color-big { width: 38px; height: 38px; }
  .token-option.selected .tok-color-big::before, .token-option.selected .tok-color-big::after { width: 10px; height: 12px; top: 8px; }
  .token-option.selected .tok-color-big::before { left: 6px; } .token-option.selected .tok-color-big::after { right: 6px; }
  #main-layout { padding: 6px; gap: 8px; }
  #board { border-radius: 10px; }
  .btn-roll { width: min(80%, 240px); }
  .menu-top { padding: 10px 12px; }
}
.btn-copy { color: var(--text-primary); font-family: var(--font-main); }

/* ============ LIVE BACKGROUND (menu, rooms, lobby) ============ */
#fx-bg { position: fixed; inset: 0; z-index: 9990; overflow: hidden; pointer-events: none;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent2) 14%, var(--bg-primary)), var(--bg-primary) 70%); }
body.in-game #fx-bg { display: none; }
.fx-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.32; will-change: transform; }
.fx-orb.o1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: var(--accent2); animation: orbA 22s ease-in-out infinite alternate; }
.fx-orb.o2 { width: 40vmax; height: 40vmax; right: -12vmax; bottom: -14vmax; background: var(--accent); opacity: 0.22; animation: orbB 26s ease-in-out infinite alternate; }
.fx-orb.o3 { width: 28vmax; height: 28vmax; left: 38%; top: 40%; background: #7c3aed; opacity: 0.22; animation: orbC 30s ease-in-out infinite alternate; }
@keyframes orbA { to { transform: translate(24vw, 18vh) scale(1.2); } }
@keyframes orbB { to { transform: translate(-22vw, -16vh) scale(1.15); } }
@keyframes orbC { to { transform: translate(-18vw, 14vh) scale(0.8); } }
/* slowly moving perspective grid */
.fx-grid { position: absolute; left: -50%; right: -50%; bottom: -10%; height: 55%; opacity: 0.22;
  background-image: linear-gradient(var(--accent) 1px, transparent 1px), linear-gradient(90deg, var(--accent) 1px, transparent 1px);
  background-size: 60px 60px; transform: perspective(420px) rotateX(62deg); transform-origin: bottom;
  mask-image: linear-gradient(to top, #000 10%, transparent 90%); -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  animation: gridMove 3.2s linear infinite; }
@keyframes gridMove { to { background-position: 0 60px, 0 0; } }
/* things drifting up the screen */
#fx-items span { position: absolute; bottom: -12vh; opacity: 0; will-change: transform; animation: fxRise linear infinite; }
@keyframes fxRise {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: var(--o, 0.5); }
  90%  { opacity: var(--o, 0.5); }
  100% { transform: translate(var(--dx, 40px), -118vh) rotate(var(--rot, 360deg)); opacity: 0; }
}

/* ============ MENU ENTRANCE ("drop-in") ============ */
@keyframes dropIn { 0% { transform: translateY(-80px) scale(0.85); opacity: 0; } 60% { transform: translateY(8px) scale(1.03); opacity: 1; } 80% { transform: translateY(-3px); } 100% { transform: none; opacity: 1; } }
.menu-center > *, .menu-how { animation: dropIn 0.7s cubic-bezier(0.22, 1.2, 0.36, 1) both; }
.menu-center > :nth-child(2) { animation-delay: 0.15s; } .menu-center > :nth-child(3) { animation-delay: 0.25s; }
.menu-center > :nth-child(4) { animation-delay: 0.32s; } .menu-center > :nth-child(5) { animation-delay: 0.4s; }
.menu-center > :nth-child(6) { animation-delay: 0.48s; } .menu-center > :nth-child(7) { animation-delay: 0.56s; }
.menu-center > :nth-child(8) { animation-delay: 0.64s; } .menu-how { animation-delay: 0.8s; }
.menu-top { animation: dropIn 0.6s ease both; }
.rooms-card, .lobby-container { animation: dropIn 0.6s cubic-bezier(0.22, 1.2, 0.36, 1) both; }
.room-row { animation: dropIn 0.45s ease both; }

/* logo: letters fall one by one, then shimmer */
.menu-logo { font-family: var(--font-game); font-weight: 900; font-size: clamp(2.2rem, 8vw, 3.8rem); letter-spacing: 2px; line-height: 1; color: #fff;
  text-shadow: 0 0 30px color-mix(in srgb, var(--accent2) 60%, transparent); display: flex; justify-content: center; flex-wrap: wrap; animation: none !important; }
.menu-logo b { display: inline-block; font-weight: 900; animation: letterDrop 0.7s cubic-bezier(0.3, 1.5, 0.5, 1) both, letterGlow 3.5s ease-in-out 1.4s infinite; animation-delay: calc(var(--i) * 70ms + 200ms), calc(var(--i) * 140ms + 1.4s); }
.menu-logo span { color: color-mix(in srgb, var(--accent2) 70%, #fff); display: inline-flex; }
@keyframes letterDrop { 0% { transform: translateY(-120px) rotate(-25deg) scale(0.4); opacity: 0; } 70% { transform: translateY(8px) rotate(4deg) scale(1.1); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes letterGlow { 0%, 100% { filter: none; } 50% { filter: drop-shadow(0 0 14px #fff) brightness(1.25); transform: translateY(-4px); } }

/* ============ SPINNING 3D CUBE ============ */
.menu-cube-wrap { --die: 84px; position: relative; width: 84px; height: 110px; perspective: 700px; margin-bottom: 4px; animation-name: dropIn, cubeBob !important; animation-duration: 0.7s, 3.6s !important; animation-iteration-count: 1, infinite !important; animation-delay: 0s, 0.8s !important; filter: drop-shadow(0 0 26px rgba(168, 85, 247, 0.7)); }
.menu-cube { --size: var(--die); position: absolute; left: 0; top: 6px; width: var(--die); height: var(--die); transform-style: preserve-3d; animation: cubeSpin 9s linear infinite; }
.menu-cube-shadow { position: absolute; left: 50%; bottom: 0; width: 70px; height: 12px; margin-left: -35px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,0.55), transparent); animation: shadowPulse 3.6s ease-in-out 0.8s infinite; }
@keyframes cubeSpin { from { transform: rotateX(-24deg) rotateY(0deg) rotateZ(0deg); } 50% { transform: rotateX(-24deg) rotateY(180deg) rotateZ(14deg); } to { transform: rotateX(-24deg) rotateY(360deg) rotateZ(0deg); } }
@keyframes cubeBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes shadowPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.65); opacity: 0.5; } }

/* ============ BUTTON EFFECTS ============ */
.menu-play, .menu-sec-btn, .btn-play { position: relative; overflow: hidden; }
.menu-play::before, .menu-sec-btn::before, .btn-play::before {
  content: ''; position: absolute; top: 0; left: -80%; width: 50%; height: 100%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent); transform: skewX(-20deg); }
.menu-play:hover:not(:disabled)::before, .menu-sec-btn:hover:not(:disabled)::before, .btn-play:hover:not(:disabled)::before { animation: shine 0.7s ease; }
@keyframes shine { to { left: 140%; } }
.menu-play:not(:disabled) { animation: playPulse 2.4s ease-in-out infinite; }
@keyframes playPulse { 0%, 100% { box-shadow: 0 8px 26px rgba(109, 40, 217, 0.5), 0 0 0 0 rgba(139, 92, 246, 0.55), inset 0 1px 0 rgba(255,255,255,0.25); } 50% { box-shadow: 0 8px 26px rgba(109, 40, 217, 0.5), 0 0 0 14px rgba(139, 92, 246, 0), inset 0 1px 0 rgba(255,255,255,0.25); } }
.menu-play-arrows { display: inline-block; animation: arrowsGo 1.2s ease-in-out infinite; }
@keyframes arrowsGo { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
.menu-how-row > span { display: inline-block; transition: transform 0.25s; }
.menu-how-row:hover > span { transform: scale(1.35) rotate(-10deg); }

@media (prefers-reduced-motion: reduce) {
  #fx-bg *, .menu-center > *, .menu-how, .menu-logo b, .menu-cube, .menu-cube-wrap, .menu-play { animation: none !important; opacity: 1; }
}