/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --bg-0:       #080810;
  --bg-1:       #0e0e1c;
  --bg-2:       #161628;
  --bg-3:       #1f1f38;
  --bg-4:       #2a2a48;

  --red:        #c0392b;
  --red-dark:   #7f1d1d;
  --red-light:  #e74c3c;
  --red-glow:   rgba(192,57,43,0.35);

  --gold:       #d4af37;
  --gold-light: #f0c93a;

  --blue:       #2980b9;
  --green:      #27ae60;
  --purple:     #8e44ad;
  --orange:     #e67e22;

  --text-0:     #f0f0f5;
  --text-1:     #b0b0c8;
  --text-2:     #70708a;

  --border:     rgba(255,255,255,0.07);
  --border-red: rgba(192,57,43,0.4);

  --font-title: 'Cinzel', serif;
  --font-body:  'Rajdhani', sans-serif;

  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 8px 32px rgba(0,0,0,0.6);
  --shadow-red: 0 0 30px rgba(192,57,43,0.25);
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font-body); background: var(--bg-0); color: var(--text-0); min-height: 100vh; overflow-x: hidden; }
input, button, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; }

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ══════════════════════════════════════════════════════════════════════════════
   AUTH PAGE
══════════════════════════════════════════════════════════════════════════════ */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; position: relative; }

.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.15; }
.bg-orb-1 { width: 600px; height: 600px; background: var(--red); top: -200px; left: -200px; animation: orbFloat 8s ease-in-out infinite; }
.bg-orb-2 { width: 400px; height: 400px; background: var(--purple); bottom: -100px; right: -100px; animation: orbFloat 10s ease-in-out infinite reverse; }
.bg-orb-3 { width: 300px; height: 300px; background: var(--gold); top: 50%; left: 60%; animation: orbFloat 12s ease-in-out infinite 2s; }
@keyframes orbFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-30px) scale(1.05); } }

.auth-container { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 1.5rem; }

.auth-logo { text-align: center; margin-bottom: 2rem; }
.logo-icon { font-size: 3.5rem; filter: drop-shadow(0 0 20px rgba(192,57,43,0.5)); }
.logo-title { font-family: var(--font-title); font-size: 3rem; font-weight: 900; letter-spacing: 0.2em; color: var(--red-light); text-shadow: 0 0 40px var(--red-glow), 0 0 80px var(--red-glow); margin: 0.3rem 0 0.2rem; }
.logo-subtitle { color: var(--text-2); font-size: 0.9rem; letter-spacing: 0.05em; }

.auth-card { background: rgba(14,14,28,0.85); border: 1px solid var(--border-red); border-radius: var(--radius-lg); padding: 2rem; backdrop-filter: blur(20px); box-shadow: var(--shadow), var(--shadow-red); }

.auth-tabs { display: flex; position: relative; background: var(--bg-2); border-radius: 8px; padding: 4px; margin-bottom: 1.8rem; gap: 4px; }
.tab-btn { flex: 1; padding: 0.6rem; border-radius: 6px; font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; letter-spacing: 0.03em; color: var(--text-2); transition: color 0.2s; }
.tab-btn.active { background: var(--red); color: #fff; box-shadow: 0 0 15px var(--red-glow); }

.auth-form { display: none; flex-direction: column; gap: 1.2rem; }
.auth-form.active { display: flex; animation: fadeSlideUp 0.3s ease; }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-1); letter-spacing: 0.04em; }
.form-group label i { margin-right: 0.4rem; color: var(--red); }
.form-group input { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.7rem 1rem; color: var(--text-0); font-size: 0.95rem; transition: border-color 0.2s, box-shadow 0.2s; outline: none; }
.form-group input:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }
.form-group input::placeholder { color: var(--text-2); }
.form-hint { font-size: 0.78rem; color: var(--text-2); }

.input-eye-wrap { position: relative; }
.input-eye-wrap input { width: 100%; padding-right: 2.8rem; }
.eye-btn { position: absolute; right: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--text-2); font-size: 0.9rem; transition: color 0.2s; }
.eye-btn:hover { color: var(--text-0); }

.form-error { font-size: 0.85rem; color: var(--red-light); min-height: 1.2rem; text-align: center; }

.auth-footer { text-align: center; margin-top: 1.2rem; font-size: 0.8rem; color: var(--text-2); }

/* ══════════════════════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════════════════════ */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.7rem 1.4rem; background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; border-radius: var(--radius); font-family: var(--font-body); font-size: 0.95rem; font-weight: 700; letter-spacing: 0.04em; transition: all 0.2s; border: 1px solid transparent; }
.btn-primary:hover { background: linear-gradient(135deg, var(--red-light), var(--red)); transform: translateY(-1px); box-shadow: 0 4px 20px var(--red-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary.btn-full { width: 100%; }
.btn-primary.btn-lg { padding: 0.9rem 2rem; font-size: 1.1rem; }

.btn-secondary { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.2rem; background: var(--bg-3); color: var(--text-0); border-radius: var(--radius); font-family: var(--font-body); font-weight: 600; border: 1px solid var(--border); transition: all 0.2s; }
.btn-secondary:hover { background: var(--bg-4); border-color: var(--red); }

.btn-ghost { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.9rem; background: transparent; color: var(--text-1); border-radius: var(--radius); font-family: var(--font-body); font-weight: 500; border: 1px solid var(--border); transition: all 0.2s; }
.btn-ghost:hover { color: var(--text-0); border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

/* ══════════════════════════════════════════════════════════════════════════════
   LOBBY PAGE
══════════════════════════════════════════════════════════════════════════════ */
.lobby-body { min-height: 100vh; background: var(--bg-0); }

.lobby-nav { display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; height: 64px; background: rgba(8,8,16,0.9); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 50; }
.nav-logo { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-title); font-size: 1.3rem; font-weight: 900; letter-spacing: 0.12em; color: var(--red-light); }
.logo-text { display: inline; }
.nav-user { display: flex; align-items: center; gap: 0.8rem; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; color: #fff; flex-shrink: 0; border: 2px solid rgba(255,255,255,0.2); }
.user-name { font-weight: 600; color: var(--text-0); }
.user-stats { display: flex; gap: 0.6rem; }
.stat-badge { padding: 0.2rem 0.6rem; background: var(--bg-3); border-radius: 20px; font-size: 0.78rem; font-weight: 600; color: var(--text-1); }
.stat-badge.win { color: var(--green); }
.stat-badge.loss { color: var(--red-light); }

.lobby-main { max-width: 1100px; margin: 0 auto; padding: 2rem; }

.lobby-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.section-title { font-family: var(--font-title); font-size: 1.6rem; font-weight: 600; color: var(--text-0); }
.section-subtitle { color: var(--text-2); font-size: 0.9rem; margin-top: 0.3rem; }
.lobby-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* How to Play bar */
.how-to-play { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin-bottom: 2rem; }
.htp-item { display: flex; align-items: center; gap: 0.8rem; background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 1rem; font-size: 0.82rem; color: var(--text-1); }
.htp-icon { font-size: 1.5rem; flex-shrink: 0; }
.htp-item strong { color: var(--text-0); display: block; margin-bottom: 0.1rem; }
@media(max-width:700px) { .how-to-play { grid-template-columns: repeat(2,1fr); } }

/* Rooms Grid */
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.rooms-loading { grid-column: 1/-1; text-align: center; padding: 3rem; color: var(--text-2); font-size: 1rem; }
.rooms-empty { grid-column: 1/-1; text-align: center; padding: 4rem 2rem; color: var(--text-2); }
.rooms-empty .empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.5; }
.rooms-empty h3 { color: var(--text-1); margin-bottom: 0.5rem; }

.room-card { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.4rem; transition: all 0.2s; cursor: pointer; position: relative; overflow: hidden; }
.room-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--red-glow), transparent); opacity: 0; transition: opacity 0.2s; }
.room-card:hover { border-color: var(--border-red); transform: translateY(-2px); box-shadow: var(--shadow-red); }
.room-card:hover::before { opacity: 1; }
.room-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.8rem; }
.room-card-name { font-family: var(--font-title); font-size: 1rem; font-weight: 600; color: var(--text-0); }
.room-status { padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; }
.status-waiting { background: rgba(39,174,96,0.2); color: #2ecc71; border: 1px solid rgba(46,204,113,0.3); }
.status-playing { background: rgba(192,57,43,0.2); color: var(--red-light); border: 1px solid var(--border-red); }
.room-card-meta { display: flex; gap: 1rem; color: var(--text-2); font-size: 0.85rem; margin-bottom: 1rem; }
.room-card-meta i { margin-right: 0.3rem; }
.room-player-bar { background: var(--bg-2); height: 4px; border-radius: 2px; margin-bottom: 1rem; overflow: hidden; }
.room-player-fill { height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); border-radius: 2px; transition: width 0.3s; }
.room-card-footer { display: flex; justify-content: space-between; align-items: center; }
.room-host { font-size: 0.82rem; color: var(--text-2); }
.room-host strong { color: var(--text-1); }

/* ══════════════════════════════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════════════════════════════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.2s; padding: 1rem; }
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-card { background: var(--bg-1); border: 1px solid var(--border-red); border-radius: var(--radius-lg); padding: 1.8rem; width: 100%; max-width: 440px; box-shadow: var(--shadow); animation: modalSlideIn 0.25s ease; }
@keyframes modalSlideIn { from { transform: scale(0.94) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-header h3 { font-family: var(--font-title); font-weight: 600; font-size: 1.15rem; }
.modal-header h3 i { color: var(--red); margin-right: 0.5rem; }
.modal-close { color: var(--text-2); font-size: 1rem; padding: 0.3rem; transition: color 0.2s; }
.modal-close:hover { color: var(--text-0); }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.8rem; margin-top: 1.5rem; }

.range-input { width: 100%; -webkit-appearance: none; height: 4px; border-radius: 2px; background: var(--bg-3); outline: none; margin: 0.5rem 0; }
.range-input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--red); cursor: pointer; box-shadow: 0 0 8px var(--red-glow); }
.range-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-2); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.form-select { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.8rem; color: var(--text-0); font-size: 0.9rem; outline: none; cursor: pointer; }
.form-select:focus { border-color: var(--red); }

.role-preview { background: var(--bg-2); border-radius: var(--radius); padding: 0.8rem 1rem; font-size: 0.82rem; color: var(--text-1); line-height: 1.6; }

.join-room-info { background: var(--bg-2); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.join-info-row { display: flex; justify-content: space-between; padding: 0.3rem 0; font-size: 0.9rem; color: var(--text-1); }
.join-info-row strong { color: var(--text-0); }

/* ══════════════════════════════════════════════════════════════════════════════
   GAME PAGE
══════════════════════════════════════════════════════════════════════════════ */
.game-body { height: 100vh; overflow: hidden; }

.game-container { display: grid; grid-template-columns: 200px 1fr 280px; grid-template-rows: 60px 1fr; height: 100vh; }

/* Game Header */
.game-header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; background: rgba(8,8,16,0.95); border-bottom: 1px solid var(--border); gap: 1rem; }
.header-left { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.header-logo { font-family: var(--font-title); font-weight: 900; color: var(--red-light); letter-spacing: 0.1em; font-size: 1rem; white-space: nowrap; }
.room-name { font-size: 0.85rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-center { display: flex; align-items: center; gap: 1rem; }
.header-right { display: flex; align-items: center; gap: 0.8rem; flex-shrink: 0; }

.phase-badge { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 1rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 20px; white-space: nowrap; }
.phase-badge.phase-night { background: rgba(0,0,30,0.8); border-color: rgba(100,100,200,0.3); }
.phase-badge.phase-day { background: rgba(30,20,0,0.8); border-color: rgba(200,160,0,0.3); }
.phase-icon { font-size: 1rem; }
.phase-text { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.05em; }

.timer-display { display: flex; align-items: center; }
.timer-ring { position: relative; width: 40px; height: 40px; }
.timer-ring svg { transform: rotate(-90deg); }
.timer-track { stroke: var(--bg-3); }
.timer-fill { stroke: var(--red); transition: stroke-dasharray 1s linear; }
.timer-fill.urgent { stroke: var(--red-light); animation: timerPulse 0.5s ease infinite; }
@keyframes timerPulse { 0%,100% { stroke: var(--red-light); } 50% { stroke: var(--gold); } }
.timer-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; color: var(--text-0); }

.my-role-badge { padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; }
.role-badge-mafia     { background: rgba(192,57,43,0.25); color: var(--red-light); border: 1px solid var(--border-red); }
.role-badge-detective { background: rgba(41,128,185,0.25); color: #5dade2; border: 1px solid rgba(41,128,185,0.4); }
.role-badge-doctor    { background: rgba(39,174,96,0.25); color: #58d68d; border: 1px solid rgba(39,174,96,0.4); }
.role-badge-villager  { background: rgba(127,140,141,0.25); color: #aab7b8; border: 1px solid rgba(127,140,141,0.4); }

/* Player List */
.player-list { background: var(--bg-1); border-right: 1px solid var(--border); overflow-y: auto; padding: 0.8rem; display: flex; flex-direction: column; gap: 0.5rem; }
.panel-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; color: var(--text-2); text-transform: uppercase; padding: 0.3rem 0 0.5rem; display: flex; align-items: center; gap: 0.4rem; }
.panel-title i { color: var(--red); }
.players-container { display: flex; flex-direction: column; gap: 0.4rem; }

.player-card { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; transition: all 0.2s; }
.player-card.me { border-color: var(--red); background: rgba(192,57,43,0.08); }
.player-card.dead { opacity: 0.45; filter: grayscale(0.7); }
.player-card.dead .player-name { text-decoration: line-through; }
.player-avatar-sm { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.player-info { flex: 1; min-width: 0; }
.player-name { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-tag { font-size: 0.7rem; color: var(--text-2); }
.player-status { font-size: 0.8rem; }
.player-dead-role { font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 4px; }

/* Game Board */
.game-board { overflow-y: auto; background: var(--bg-0); }
.board-section { min-height: calc(100vh - 60px); }

/* Waiting Section */
.waiting-area { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - 60px); padding: 2rem; text-align: center; gap: 1rem; }
.waiting-icon { font-size: 4rem; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.waiting-area h3 { font-family: var(--font-title); font-size: 1.5rem; color: var(--text-0); }
.waiting-area p { color: var(--text-2); max-width: 340px; font-size: 0.9rem; }
.player-count-display { font-size: 2.5rem; font-family: var(--font-title); font-weight: 600; color: var(--red-light); }
.room-code-display { margin-top: 0.5rem; }
.room-code-label { font-size: 0.8rem; color: var(--text-2); margin-bottom: 0.3rem; }
.room-code { font-family: var(--font-title); font-size: 1.8rem; letter-spacing: 0.3em; color: var(--gold); background: var(--bg-2); padding: 0.5rem 1.5rem; border-radius: 8px; border: 1px solid rgba(212,175,55,0.3); }

/* Night Section */
.night-overlay { min-height: calc(100vh - 60px); background: linear-gradient(180deg, #020210 0%, #050518 100%); display: flex; flex-direction: column; align-items: center; padding: 2rem 1.5rem; gap: 1.5rem; }
.night-header { text-align: center; }
.moon-icon { font-size: 3rem; animation: moonGlow 3s ease-in-out infinite; }
@keyframes moonGlow { 0%,100% { filter: drop-shadow(0 0 8px rgba(150,150,255,0.5)); } 50% { filter: drop-shadow(0 0 20px rgba(150,150,255,0.9)); } }
.night-title { font-family: var(--font-title); font-size: 2rem; color: #8080ff; letter-spacing: 0.15em; }
.night-desc { color: var(--text-2); font-size: 0.95rem; margin-top: 0.3rem; }

.night-action-panel { width: 100%; max-width: 600px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); border-radius: var(--radius-lg); padding: 1.5rem; }
.action-instructions { margin-bottom: 1.2rem; }
.action-instructions h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.action-instructions p { font-size: 0.85rem; color: var(--text-2); }
.target-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.6rem; margin-bottom: 1.2rem; }
.target-card { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 0.8rem; background: var(--bg-2); border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: all 0.2s; }
.target-card:hover { border-color: var(--red); background: rgba(192,57,43,0.1); transform: translateY(-2px); }
.target-card.selected { border-color: var(--red); background: rgba(192,57,43,0.2); box-shadow: 0 0 12px var(--red-glow); }
.target-card .player-avatar-sm { width: 40px; height: 40px; font-size: 1rem; }
.target-name { font-size: 0.82rem; font-weight: 600; text-align: center; }
.action-buttons { display: flex; gap: 0.8rem; justify-content: center; }
.action-confirm { display: flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.2rem; background: var(--bg-2); border: 1px solid rgba(39,174,96,0.4); border-radius: var(--radius); color: #58d68d; font-size: 0.9rem; margin-top: 0.5rem; }

.game-log-mini { width: 100%; max-width: 600px; display: flex; flex-direction: column; gap: 0.3rem; max-height: 140px; overflow-y: auto; }

/* Day Section */
.day-area { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; max-width: 700px; margin: 0 auto; }
.day-header { text-align: center; }
.sun-icon { font-size: 2.5rem; animation: sunSpin 20s linear infinite; }
@keyframes sunSpin { from { filter: drop-shadow(0 0 8px rgba(240,200,0,0.5)); } to { filter: drop-shadow(0 0 16px rgba(240,200,0,0.9)); } }
.day-title { font-family: var(--font-title); font-size: 1.8rem; color: var(--gold-light); letter-spacing: 0.15em; }

.result-banner { padding: 1rem 1.5rem; border-radius: var(--radius); font-size: 1rem; font-weight: 600; text-align: center; }
.result-banner.killed { background: rgba(192,57,43,0.15); border: 1px solid var(--border-red); color: var(--red-light); }
.result-banner.saved { background: rgba(39,174,96,0.15); border: 1px solid rgba(39,174,96,0.4); color: #58d68d; }
.result-banner.quiet { background: var(--bg-2); border: 1px solid var(--border); color: var(--text-1); }

.voting-section { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.voting-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.voting-hint { font-size: 0.82rem; color: var(--text-2); margin-bottom: 1rem; }
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; }

.vote-card { background: var(--bg-2); border: 2px solid var(--border); border-radius: var(--radius); padding: 0.8rem; cursor: pointer; transition: all 0.2s; text-align: center; }
.vote-card:hover { border-color: var(--red); background: rgba(192,57,43,0.1); }
.vote-card.my-vote { border-color: var(--red); background: rgba(192,57,43,0.2); }
.vote-card .player-avatar-sm { width: 36px; height: 36px; font-size: 0.9rem; margin: 0 auto 0.4rem; }
.vote-card-name { font-size: 0.82rem; font-weight: 600; margin-bottom: 0.3rem; }
.vote-bar { height: 4px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
.vote-bar-fill { height: 100%; background: var(--red); border-radius: 2px; transition: width 0.3s; }
.vote-count { font-size: 0.72rem; color: var(--text-2); margin-top: 0.2rem; }

.game-log-panel { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.2rem; }
.game-log-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 200px; overflow-y: auto; margin-top: 0.5rem; }
.log-entry { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.82rem; padding: 0.3rem 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.log-entry:last-child { border-bottom: none; }
.log-icon { flex-shrink: 0; }
.log-text { color: var(--text-1); flex: 1; }
.log-entry.phase .log-text { color: var(--gold); font-weight: 600; }
.log-entry.win .log-text { color: var(--gold-light); font-weight: 700; }
.log-entry.eliminate .log-text { color: var(--red-light); }
.log-entry.saved .log-text { color: #58d68d; }

/* Chat Panel */
.chat-panel { background: var(--bg-1); border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.chat-panel .panel-title { padding: 0.8rem 1rem 0.3rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 0.8rem; display: flex; flex-direction: column; gap: 0.5rem; }

.chat-msg { display: flex; gap: 0.5rem; animation: msgSlideIn 0.2s ease; }
@keyframes msgSlideIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.chat-msg .msg-avatar { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; color: #fff; flex-shrink: 0; margin-top: 0.1rem; }
.chat-msg-content { flex: 1; min-width: 0; }
.msg-header { display: flex; align-items: baseline; gap: 0.4rem; margin-bottom: 0.1rem; }
.msg-username { font-size: 0.78rem; font-weight: 700; }
.msg-time { font-size: 0.68rem; color: var(--text-2); }
.msg-text { font-size: 0.85rem; color: var(--text-1); word-break: break-word; line-height: 1.4; }
.chat-msg.mafia-msg .msg-username { color: var(--red-light); }
.chat-msg.mafia-msg .msg-text { color: rgba(231,76,60,0.9); }
.chat-msg.dead-msg { opacity: 0.6; }
.chat-msg.dead-msg .msg-text { font-style: italic; }
.chat-msg.system-msg { justify-content: center; }
.chat-msg.system-msg .msg-text { font-size: 0.78rem; color: var(--text-2); text-align: center; font-style: italic; }

.chat-input-area { padding: 0.7rem; border-top: 1px solid var(--border); background: var(--bg-0); flex-shrink: 0; }
.chat-type-toggle { display: flex; gap: 0.4rem; margin-bottom: 0.5rem; }
.chat-type-btn { flex: 1; padding: 0.3rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text-2); font-size: 0.75rem; transition: all 0.2s; }
.chat-type-btn.active { background: var(--bg-3); color: var(--text-0); border-color: rgba(255,255,255,0.2); }
.chat-type-btn.mafia-btn.active { background: rgba(192,57,43,0.3); color: var(--red-light); border-color: var(--border-red); }
.chat-input-wrap { display: flex; gap: 0.4rem; }
.chat-input-wrap input { flex: 1; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.55rem 0.8rem; color: var(--text-0); font-size: 0.88rem; outline: none; transition: border-color 0.2s; }
.chat-input-wrap input:focus { border-color: var(--red); }
.chat-send-btn { width: 36px; height: 36px; border-radius: 8px; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; transition: all 0.2s; flex-shrink: 0; }
.chat-send-btn:hover { background: var(--red-light); }

/* Role Modal */
.role-modal-card { background: var(--bg-1); border: 2px solid; border-radius: 20px; padding: 2.5rem 2rem; text-align: center; width: 100%; max-width: 380px; animation: roleReveal 0.5s cubic-bezier(0.175,0.885,0.32,1.275); }
@keyframes roleReveal { from { transform: scale(0.5) rotate(-10deg); opacity: 0; } 70% { transform: scale(1.05) rotate(2deg); } to { transform: scale(1) rotate(0); opacity: 1; } }
.role-modal-card.mafia     { border-color: var(--red);    box-shadow: 0 0 60px var(--red-glow); }
.role-modal-card.detective { border-color: var(--blue);   box-shadow: 0 0 60px rgba(41,128,185,0.3); }
.role-modal-card.doctor    { border-color: var(--green);  box-shadow: 0 0 60px rgba(39,174,96,0.3); }
.role-modal-card.villager  { border-color: #7f8c8d;       box-shadow: 0 0 40px rgba(127,140,141,0.2); }
.role-modal-icon { font-size: 4rem; margin-bottom: 0.8rem; }
.role-modal-name { font-family: var(--font-title); font-size: 2rem; font-weight: 900; margin-bottom: 0.8rem; letter-spacing: 0.1em; }
.role-modal-desc { color: var(--text-1); font-size: 0.95rem; line-height: 1.6; margin-bottom: 1rem; }
.role-modal-team { background: rgba(192,57,43,0.15); border: 1px solid var(--border-red); border-radius: var(--radius); padding: 0.7rem; margin-bottom: 1.2rem; font-size: 0.88rem; color: var(--red-light); }

/* Night Result Modal */
.night-result-card { max-width: 400px; text-align: center; }
.night-result-content { padding: 1.5rem; }
.night-result-icon { font-size: 3rem; margin-bottom: 0.8rem; }
.night-result-title { font-family: var(--font-title); font-size: 1.3rem; margin-bottom: 0.5rem; }
.night-result-text { color: var(--text-1); font-size: 0.9rem; }

/* Toast */
.toast { position: fixed; bottom: 2rem; right: 2rem; background: var(--bg-2); border: 1px solid var(--border-red); border-radius: var(--radius); padding: 1rem 1.5rem; color: var(--text-0); font-size: 0.9rem; max-width: 300px; z-index: 300; box-shadow: var(--shadow); animation: toastIn 0.3s ease; }
.toast.detective { border-color: var(--blue); background: rgba(41,128,185,0.15); }
.toast.saved { border-color: var(--green); background: rgba(39,174,96,0.15); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Game Over */
.game-over-card { background: var(--bg-1); border-radius: 24px; width: 100%; max-width: 600px; overflow: hidden; box-shadow: var(--shadow); }
.game-over-banner { padding: 2.5rem; text-align: center; font-size: 3rem; }
.game-over-banner.mafia-wins { background: linear-gradient(135deg, #2c0000, #500000); }
.game-over-banner.town-wins  { background: linear-gradient(135deg, #001a00, #004000); }
.game-over-title { font-family: var(--font-title); font-size: 1.6rem; font-weight: 900; text-align: center; padding: 1.5rem 1.5rem 0.5rem; }
.game-over-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.8rem; padding: 1.5rem; }
.go-player-card { background: var(--bg-2); border-radius: var(--radius); padding: 0.8rem; text-align: center; border: 1px solid var(--border); }
.go-player-card.winner { border-color: var(--gold); background: rgba(212,175,55,0.1); }
.go-player-avatar { width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 0.5rem; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 700; color: #fff; }
.go-player-name { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.go-player-role { font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 10px; display: inline-block; }
.game-over-actions { padding: 0 1.5rem 1.5rem; display: flex; justify-content: center; }

/* Eliminated animation */
@keyframes elimAnim { to { opacity: 0.35; transform: scale(0.97); filter: grayscale(0.8); } }
.player-card.just-eliminated { animation: elimAnim 0.5s ease forwards; }

/* Empire RPG */
.empire-main { max-width: 1320px; }
.empire-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); gap: 1rem; align-items: stretch; margin-bottom: 1rem; }
.empire-identity { background: linear-gradient(135deg, rgba(192,57,43,0.14), rgba(41,128,185,0.08)); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; min-width: 0; }
.eyebrow { display: inline-flex; color: var(--gold); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.35rem; }
.empire-identity h1 { font-family: var(--font-title); font-size: 1.8rem; letter-spacing: 0.04em; margin-bottom: 0.4rem; }
.empire-identity p { color: var(--text-1); max-width: 720px; line-height: 1.45; }
.empire-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.kpi-card { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; min-width: 0; }
.kpi-card span { display: block; color: var(--text-2); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.2rem; }
.kpi-card strong { font-size: 1.25rem; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* Legacy tab buttons kept for safety */
.empire-tabs { display: none; }
.empire-tab-btn { display: none; }
.empire-tab-panel { display: none; }
.empire-tab-panel.active { display: block; animation: fadeSlideUp 0.2s ease; }

/* ── App shell (sidebar + content) ─────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: calc(100vh - 64px);
  position: relative;
}

/* ── Sidebar navigation ─────────────────────────────────────────────────────── */
.side-nav {
  width: 210px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--bg-1) 0%, rgba(8,8,16,0.98) 100%);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  z-index: 40;
  padding-bottom: 2rem;
}
.nav-section {
  padding: .9rem 0 .4rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.nav-section--top { padding-top: .6rem; }
.nav-section--bottom { border-bottom: none; margin-top: auto; }
.nav-section-label {
  display: block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--text-2);
  text-transform: uppercase;
  padding: 0 1.1rem .45rem;
  opacity: .7;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .52rem 1.1rem;
  color: var(--text-1);
  font-size: .875rem;
  font-weight: 500;
  border: none;
  border-left: 2px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: color .14s, background .14s, border-color .14s;
  letter-spacing: .01em;
}
.nav-item i {
  width: 15px;
  text-align: center;
  flex-shrink: 0;
  opacity: .55;
  font-size: .85rem;
  transition: opacity .14s;
}
.nav-item:hover {
  color: var(--text-0);
  background: rgba(255,255,255,0.04);
}
.nav-item:hover i { opacity: .85; }
.nav-item.active {
  color: #fff;
  background: rgba(192,57,43,0.13);
  border-left-color: var(--red-light);
  font-weight: 600;
}
.nav-item.active i { opacity: 1; color: var(--red-light); }

/* ── Main content area ──────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1.8rem;
}
.empire-main { max-width: none; }

/* ── Mobile hamburger + overlay ─────────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-size: 1rem;
  margin-left: .3rem;
}
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 39;
  backdrop-filter: blur(2px);
}
.nav-overlay.visible { display: block; }
.empire-alert { align-items: center; justify-content: space-between; gap: 1rem; background: var(--bg-1); border: 1px solid rgba(39,174,96,0.4); color: #58d68d; border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 1rem; }
.empire-alert.fail { border-color: var(--border-red); color: var(--red-light); }
.empire-alert span { color: var(--text-1); }

.overview-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1rem; }
.action-layout, .family-layout, .casino-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 0.75fr); gap: 1rem; align-items: start; }
.casino-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(300px, 0.75fr); }
.empire-panel { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; margin-bottom: 1rem; }
.panel-heading h2 { font-family: var(--font-title); font-size: 1rem; letter-spacing: 0.04em; }
.panel-heading span { color: var(--text-2); font-size: 0.8rem; }
.progress-bar { height: 7px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.progress-bar > div { height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); border-radius: inherit; transition: width 0.25s ease; }
.progress-meta { display: flex; justify-content: space-between; color: var(--text-2); font-size: 0.78rem; margin-top: 0.35rem; }

.stat-bars { display: grid; gap: 0.65rem; margin-top: 1rem; }
.stat-bar-row > div:first-child, .stat-line, .equipment-row { display: flex; justify-content: space-between; gap: 0.8rem; align-items: center; color: var(--text-1); font-size: 0.9rem; }
.stat-bar-row strong, .stat-line strong, .equipment-row strong { color: var(--text-0); }
.stat-bar-row.health .progress-bar > div { background: linear-gradient(90deg, var(--green), #58d68d); }
.stat-bar-row.heat .progress-bar > div { background: linear-gradient(90deg, var(--orange), var(--red)); }
.bank-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.5rem; margin-top: 1rem; }
.bank-actions input, .market-row input, .rival-row input, .family-create input, .roulette-controls input, .roulette-controls select, .blackjack-controls input { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text-0); padding: 0.5rem 0.7rem; min-width: 0; outline: none; }

.activity-list, .leaderboard-list, .garage-list, .market-list, .blackmarket-list, .family-list, .rival-list { display: grid; gap: 0.55rem; }
.activity-row, .leader-row, .garage-row, .market-row, .family-card, .rival-row { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem; min-width: 0; }
.activity-row, .leader-row, .garage-row, .family-card, .rival-row, .market-row { display: grid; align-items: center; gap: 0.65rem; }
.activity-row { grid-template-columns: minmax(0, 1fr) auto; }
.activity-row span, .garage-row span, .family-card span, .leader-row span, .rival-row span, .market-name span { color: var(--text-2); font-size: 0.78rem; }
.positive { color: #58d68d; }
.negative { color: var(--red-light); }
.empty-state { color: var(--text-2); background: var(--bg-2); border: 1px dashed var(--border); border-radius: 8px; padding: 1rem; text-align: center; }

.achievement-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.55rem; }
.achievement-card { display: flex; gap: 0.65rem; align-items: flex-start; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem; }
.achievement-card i { color: var(--gold); margin-top: 0.15rem; }
.achievement-card.locked { opacity: 0.45; filter: grayscale(0.8); }
.achievement-card strong, .market-name strong, .garage-row strong, .family-card strong, .rival-row strong, .leader-row strong { display: block; color: var(--text-0); font-size: 0.9rem; }
.achievement-card span { display: block; color: var(--text-2); font-size: 0.76rem; line-height: 1.35; margin-top: 0.15rem; }

.leader-row { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.leader-pos { color: var(--gold) !important; font-weight: 800; }
.mini-avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff !important; font-weight: 800; flex-shrink: 0; }
.leader-row em { color: var(--gold); font-style: normal; font-weight: 700; }

.action-grid { display: grid; gap: 0.65rem; }
.action-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem; }
.action-card.disabled { opacity: 0.62; }
.action-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: rgba(192,57,43,0.18); color: var(--red-light); }
.action-body strong { display: block; font-size: 0.95rem; color: var(--text-0); }
.action-body > span { display: block; color: var(--text-2); font-size: 0.78rem; margin-top: 0.1rem; }
.action-meta { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-top: 0.45rem; }
.action-meta span { color: var(--text-1); background: var(--bg-3); border-radius: 6px; padding: 0.18rem 0.45rem; font-size: 0.72rem; }
.garage-list { margin-top: 1rem; }
.garage-row { grid-template-columns: minmax(0, 1fr) auto; }

.market-row { grid-template-columns: minmax(180px, 1fr) auto 82px auto auto; }
.market-name { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.market-name i { color: var(--gold); width: 22px; text-align: center; }
.blackmarket-list .market-row { grid-template-columns: minmax(180px, 1fr) auto auto; }
.blackmarket-list .market-row:has(input) { grid-template-columns: minmax(180px, 1fr) 90px auto; }

.roulette-table { min-height: 360px; border-radius: var(--radius); border: 1px solid var(--border-red); background: radial-gradient(circle at center, rgba(212,175,55,0.12), rgba(192,57,43,0.10) 45%, var(--bg-1) 70%); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1.2rem; padding: 1rem; }
.roulette-number { width: 140px; height: 140px; border-radius: 50%; border: 10px solid var(--bg-3); display: flex; align-items: center; justify-content: center; font-family: var(--font-title); font-size: 3rem; color: var(--gold-light); background: var(--bg-0); box-shadow: inset 0 0 40px rgba(0,0,0,0.7), 0 0 30px rgba(212,175,55,0.2); }
.roulette-controls { display: grid; grid-template-columns: 120px 150px auto; gap: 0.6rem; }
.casino-copy { color: var(--text-1); line-height: 1.5; }
.blackjack-table { min-height: 360px; border-radius: var(--radius); border: 1px solid rgba(212,175,55,0.32); background: linear-gradient(145deg, rgba(39,174,96,0.10), var(--bg-1)); padding: 1rem; display: grid; gap: 1rem; align-content: space-between; }
.blackjack-top { display: flex; justify-content: space-between; gap: 0.8rem; align-items: baseline; }
.blackjack-top h2 { font-family: var(--font-title); font-size: 1.15rem; }
.blackjack-top span { color: var(--text-2); font-size: 0.8rem; text-align: right; }
.blackjack-hands { display: grid; gap: 1rem; }
.blackjack-hands > div > span { display: block; color: var(--text-2); font-size: 0.78rem; margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.08em; }
.card-row { display: flex; flex-wrap: wrap; gap: 0.45rem; min-height: 58px; align-items: center; }
.playing-card { width: 42px; height: 56px; border-radius: 7px; background: #f7f3e8; color: #101010; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; box-shadow: 0 10px 22px rgba(0,0,0,0.25); }
.playing-card.red { color: #b72b2b; }
.playing-card.muted { background: var(--bg-3); color: var(--text-2); box-shadow: none; }
.blackjack-controls { display: grid; grid-template-columns: minmax(90px, 1fr) auto auto auto; gap: 0.55rem; }

.family-create { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 0.5rem; margin-top: 0.8rem; }
.family-card { grid-template-columns: minmax(0, 1fr) auto auto; }
.family-card.mine { grid-template-columns: minmax(0, 1fr); }
.family-card em { color: var(--gold); font-style: normal; font-weight: 700; }
.rival-row { grid-template-columns: auto minmax(0, 1fr) 74px auto; }
.equipment-row { border-bottom: 1px solid rgba(255,255,255,0.05); padding: 0.55rem 0; }
.equipment-row:last-child { border-bottom: 0; }
.equipment-row.spec-active { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
.equipment-row.spec-active strong { color: var(--gold); }
.equipment-row.spec-active small, .equipment-row.spec-empty em { color: var(--text-2); font-size: 0.8rem; font-style: italic; }
.spec-picker { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.btn-spec { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem; align-items: center; text-align: left; padding: 0.65rem 0.8rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text-1); cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.btn-spec strong { color: var(--text-0); font-size: 0.9rem; display: block; }
.btn-spec small { color: var(--text-2); font-size: 0.78rem; display: block; }
.btn-spec:hover { border-color: var(--gold); background: rgba(212,175,55,0.06); }
.btn-spec.active { border-color: var(--gold); background: rgba(212,175,55,0.12); color: var(--gold); }
.spec-reset-note { color: var(--text-2); font-size: 0.78rem; margin-top: 0.5rem; }

/* Arsenal & Kledingkast */
.inv-section-title { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin: 1rem 0 0.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.65rem; }
.inv-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.4rem; transition: border-color 0.2s; }
.inv-card:hover { border-color: var(--gold); }
.inv-card.inv-equipped { border-color: var(--gold); background: rgba(212,175,55,0.07); }
.inv-card.inv-broken { opacity: 0.45; filter: grayscale(1); }
.inv-card-name strong { font-size: 0.88rem; display: block; color: var(--text-0); }
.inv-card-name small { font-size: 0.76rem; color: var(--text-2); }
.inv-card-desc { font-size: 0.74rem; color: var(--text-2); font-style: italic; }
.inv-card-dur { display: flex; align-items: center; gap: 0.4rem; }
.dur-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.dur-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.dur-high { background: #4caf50; }
.dur-mid  { background: #ff9800; }
.dur-low  { background: var(--red); }
.dur-label { font-size: 0.72rem; color: var(--text-2); white-space: nowrap; }
.inv-empty { color: var(--text-2); font-size: 0.82rem; font-style: italic; }

.shop-list { display: grid; gap: 0.5rem; }
.shop-row { display: grid; grid-template-columns: 1fr auto auto; gap: 0.75rem; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.65rem 0.8rem; }
.shop-info { min-width: 0; }
.shop-info strong { font-size: 0.88rem; display: block; color: var(--text-0); }
.shop-info small { font-size: 0.76rem; color: var(--text-2); display: block; }
.shop-desc { font-style: italic; }

.lobby-header.compact { margin-bottom: 1rem; }
.htp-icon { width: 28px; text-align: center; color: var(--red-light); }

.recommendation-list { display: grid; gap: 0.55rem; }
.recommendation-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.7rem; align-items: center; text-align: left; color: var(--text-0); background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem; transition: border-color 0.2s, transform 0.2s; }
.recommendation-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.recommendation-card i { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(212,175,55,0.12); color: var(--gold); }
.recommendation-card strong { display: block; font-size: 0.9rem; }
.recommendation-card span { color: var(--text-2); font-size: 0.78rem; display: block; margin-top: 0.1rem; }

.city-layout, .heist-layout, .contract-layout, .business-layout, .mission-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); gap: 1rem; align-items: start; }
.city-map-panel, .heist-board, .contract-board, .mission-board { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.city-map-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.city-map-header h2 { font-family: var(--font-title); font-size: 1.25rem; letter-spacing: 0.04em; }
.city-map { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(122px, auto); gap: 0.7rem; }
.district-card { display: flex; flex-direction: column; justify-content: space-between; gap: 0.55rem; border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem; background: linear-gradient(140deg, var(--bg-2), rgba(41,128,185,0.08)); min-width: 0; }
.district-card.controlled { border-color: rgba(212,175,55,0.55); box-shadow: inset 0 0 0 1px rgba(212,175,55,0.12); }
.district-1, .district-4 { grid-column: span 2; }
.district-2, .district-3 { grid-column: span 2; }
.district-5, .district-6 { grid-column: span 3; }
.district-top { display: flex; align-items: center; gap: 0.55rem; }
.district-top i { color: var(--red-light); }
.district-card span { color: var(--text-2); font-size: 0.78rem; line-height: 1.35; }
.district-progress { height: 6px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.district-progress > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--gold)); }
.district-foot { display: flex; justify-content: space-between; gap: 0.7rem; align-items: center; }
.district-foot em { color: var(--text-1); font-style: normal; font-size: 0.72rem; text-align: right; }

.heist-board, .contract-board, .mission-board, .business-grid { display: grid; gap: 0.8rem; }
.heist-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.9rem; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.heist-card.disabled { opacity: 0.62; }
.heist-card.heist-prepped { border-color: rgba(212,175,55,0.5); }
.heist-btns { display: grid; gap: 0.4rem; justify-items: stretch; }
.heist-prep-btn { font-size: 0.72rem; }
.heist-prep-badge { display: inline-block; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.05em; padding: 0.1rem 0.35rem; border-radius: 4px; background: rgba(212,175,55,0.2); color: var(--gold); vertical-align: middle; margin-left: 0.3rem; }
.heist-mark { width: 48px; height: 48px; border-radius: 10px; background: rgba(212,175,55,0.12); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.heist-content strong { display: block; color: var(--text-0); font-size: 1rem; }
.heist-content > span, .heist-content em { display: block; color: var(--text-2); font-size: 0.8rem; margin-top: 0.15rem; font-style: normal; }
.heist-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.heist-meta span { color: var(--text-1); background: var(--bg-3); border-radius: 6px; padding: 0.18rem 0.45rem; font-size: 0.72rem; }
.contract-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.9rem; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.contract-card.disabled { opacity: 0.62; }
.contract-mark { width: 48px; height: 48px; border-radius: 10px; background: rgba(192,57,43,0.16); color: var(--red-light); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.contract-content strong { display: block; color: var(--text-0); font-size: 1rem; }
.contract-content > span, .contract-content em { display: block; color: var(--text-2); font-size: 0.8rem; margin-top: 0.15rem; font-style: normal; }

.business-actions { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.business-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.85rem; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.85rem; }
.business-card.owned { border-color: rgba(39,174,96,0.3); }
.business-card.disabled { opacity: 0.58; }
.business-card.biz-damaged { border-color: rgba(231,76,60,0.5); }
.biz-tag { display: inline-block; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.05em; padding: 0.1rem 0.35rem; border-radius: 4px; vertical-align: middle; margin-left: 0.3rem; }
.biz-tag-danger { background: rgba(231,76,60,0.2); color: #e74c3c; }
.biz-tag-warn   { background: rgba(230,126,34,0.2); color: #e67e22; }
.biz-prot-btn   { font-size: 0.72rem; padding: 0.25rem 0.5rem; }
.biz-sabotage-btn { font-size: 0.7rem; padding: 0.2rem 0.4rem; color: var(--red-light); }
.rival-info { min-width: 0; }
.rival-biz-row { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.btn-xs { font-size: 0.72rem; padding: 0.22rem 0.45rem; }
.business-icon { width: 42px; height: 42px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #58d68d; background: rgba(39,174,96,0.12); }
.business-copy strong { display: block; color: var(--text-0); }
.business-copy > span { color: var(--text-2); font-size: 0.78rem; display: block; margin-top: 0.1rem; }
.business-metrics { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-top: 0.45rem; }
.business-metrics span { color: var(--text-1); background: var(--bg-3); border-radius: 6px; padding: 0.18rem 0.45rem; font-size: 0.72rem; }
.business-buttons { display: grid; gap: 0.45rem; justify-items: stretch; }
.safehouse-card { display: grid; gap: 0.65rem; }
.safehouse-card > strong { font-family: var(--font-title); font-size: 1.15rem; }
.safehouse-card > span, .next-safehouse { color: var(--text-2); line-height: 1.4; }
.safehouse-level { width: max-content; color: var(--gold); background: rgba(212,175,55,0.12); border: 1px solid rgba(212,175,55,0.28); border-radius: 99px; padding: 0.2rem 0.65rem; font-size: 0.78rem; font-weight: 800; }

.mission-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.8rem; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.9rem; }
.mission-card.claimable { border-color: rgba(212,175,55,0.55); }
.mission-card.claimed { opacity: 0.62; }
.mission-status { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bg-3); color: var(--gold); }
.mission-card strong { display: block; color: var(--text-0); }
.mission-card span { display: block; color: var(--text-2); font-size: 0.8rem; margin-top: 0.1rem; }
.mission-card em { display: block; color: #58d68d; font-style: normal; font-size: 0.76rem; margin-top: 0.35rem; }

/* ── KPI weather card ───────────────────────────────────────────────────────── */
.kpi-card { display: flex; flex-direction: column; }
.kpi-weather {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: .9rem;
  padding: .65rem 1rem;
  border-left: 3px solid var(--kpi-w-color, var(--border));
  background: linear-gradient(90deg, rgba(var(--kpi-w-rgb, 255,255,255),.07) 0%, transparent 70%);
}
.kpi-w-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.kpi-w-info { min-width: 0; }
.kpi-w-info strong { display: block; font-size: .95rem; color: var(--kpi-w-color, var(--text-0)); white-space: nowrap; }
.kpi-w-info small { display: block; font-size: .72rem; color: var(--text-2); margin-top: .1rem; }
.kpi-w-effect { display: inline-block; margin-top: .2rem; font-size: .72rem; font-weight: 600; padding: .1rem .45rem; border-radius: 99px; background: rgba(var(--kpi-w-rgb, 255,255,255),.12); color: var(--kpi-w-color, var(--gold)); }

.kpi-weather--sunny  { --kpi-w-color: #f39c12; --kpi-w-rgb: 243,156,18; }
.kpi-weather--rainy  { --kpi-w-color: #5dade2; --kpi-w-rgb: 93,173,226; }
.kpi-weather--foggy  { --kpi-w-color: #aab7b8; --kpi-w-rgb: 170,183,184; }
.kpi-weather--festival { --kpi-w-color: #af7ac5; --kpi-w-rgb: 175,122,197; }
.kpi-weather--normal { --kpi-w-color: var(--text-2); --kpi-w-rgb: 112,112,138; }

/* ── World event banner (improved) ─────────────────────────────────────────── */
.world-event-banner {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem 1.2rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, rgba(192,57,43,0.18) 0%, rgba(192,57,43,0.05) 100%);
  border: 1px solid rgba(192,57,43,0.45);
  border-left: 3px solid var(--red-light);
  border-radius: var(--radius);
  font-size: .88rem;
  color: #e8b4b8;
  animation: worldEventPulse 3s ease-in-out infinite;
}
.world-event-banner i { color: var(--red-light); font-size: 1rem; flex-shrink: 0; }
.world-event-banner strong { color: #ff8c8c; }
.world-event-banner small { margin-left: auto; font-size: .72rem; color: var(--text-2); flex-shrink: 0; white-space: nowrap; }
@keyframes worldEventPulse {
  0%, 100% { border-left-color: var(--red-light); }
  50% { border-left-color: var(--red); box-shadow: 0 0 12px rgba(192,57,43,0.3); }
}

@media (max-width: 1050px) {
  .empire-hero, .overview-grid, .action-layout, .family-layout, .casino-layout, .city-layout, .heist-layout, .contract-layout, .business-layout, .mission-layout { grid-template-columns: 1fr; }
  .city-map { grid-template-columns: repeat(2, 1fr); }
  .district-card { grid-column: span 1; }
}

@media (max-width: 860px) {
  .side-nav {
    position: fixed;
    top: 0;
    left: -230px;
    height: 100vh;
    width: 210px;
    transition: left .25s cubic-bezier(.4,0,.2,1);
    z-index: 100;
  }
  .side-nav.open {
    left: 0;
    box-shadow: 8px 0 40px rgba(0,0,0,0.7);
  }
  .nav-hamburger { display: flex; }
  .main-content { padding: 1rem; }
  .empire-hero { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .lobby-main { padding: 1rem; }
  .lobby-nav { padding: 0 1rem; }
  .nav-user { gap: 0.45rem; }
  .user-name, .user-stats { display: none; }
  .empire-kpis { grid-template-columns: 1fr 1fr; }
  .empire-identity h1 { font-size: 1.35rem; }
  .bank-actions, .market-row, .blackmarket-list .market-row, .blackmarket-list .market-row:has(input), .family-create, .family-card, .rival-row, .roulette-controls, .blackjack-controls { grid-template-columns: 1fr; }
  .market-row input, .rival-row input, .roulette-controls input, .roulette-controls select, .blackjack-controls input { width: 100%; }
  .leader-row { grid-template-columns: auto auto minmax(0, 1fr); }
  .leader-row em { grid-column: 3; }
  .action-card, .heist-card, .contract-card, .business-card, .mission-card { grid-template-columns: auto minmax(0, 1fr); }
  .heist-btns { grid-column: 1 / -1; width: 100%; }
  .action-card button, .heist-card button, .contract-card button, .business-buttons, .mission-card button { grid-column: 1 / -1; width: 100%; }
  .city-map { grid-template-columns: 1fr; }
  .city-map-header { flex-direction: column; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   NOTIFICATION BELL & PANEL
══════════════════════════════════════════════════════════════════════════════ */
.notif-btn { position: relative; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bg-2); border: 1px solid var(--border); color: var(--text-1); font-size: 1rem; transition: all .2s; }
.notif-btn:hover { border-color: var(--red); color: var(--text-0); }
.notif-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; background: var(--red); border-radius: 99px; font-size: .65rem; font-weight: 800; color: #fff; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid var(--bg-0); animation: pulse .8s ease-in-out infinite; }

.notif-panel { position: fixed; top: 72px; right: 1rem; width: 340px; background: var(--bg-1); border: 1px solid var(--border-red); border-radius: var(--radius-lg); box-shadow: var(--shadow); z-index: 150; display: none; overflow: hidden; }
.notif-panel.active { display: block; animation: fadeSlideUp .2s ease; }
.notif-panel-header { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.notif-panel-header h4 { font-size: .88rem; font-weight: 700; color: var(--text-0); }
.notif-mark-read { font-size: .75rem; color: var(--text-2); transition: color .15s; }
.notif-mark-read:hover { color: var(--text-0); }
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem 1rem; border-bottom: 1px solid rgba(255,255,255,.04); transition: background .15s; }
.notif-item:hover { background: rgba(255,255,255,.03); }
.notif-item.unread { background: rgba(192,57,43,.05); }
.notif-icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .75rem; flex-shrink: 0; }
.notif-icon.bounty { background: rgba(192,57,43,.2); color: var(--red-light); }
.notif-icon.jail   { background: rgba(142,68,173,.2); color: #bb8fce; }
.notif-icon.challenge { background: rgba(212,175,55,.2); color: var(--gold); }
.notif-icon.admin  { background: rgba(41,128,185,.2); color: #5dade2; }
.notif-icon.family { background: rgba(39,174,96,.2); color: #58d68d; }
.notif-icon.default{ background: var(--bg-3); color: var(--text-2); }
.notif-body { flex: 1; min-width: 0; }
.notif-body strong { display: block; font-size: .82rem; color: var(--text-0); }
.notif-body span { display: block; font-size: .75rem; color: var(--text-2); margin-top: .1rem; line-height: 1.35; }
.notif-empty { text-align: center; padding: 1.5rem; color: var(--text-2); font-size: .85rem; }

/* ══════════════════════════════════════════════════════════════════════════════
   JAIL STATUS BANNER
══════════════════════════════════════════════════════════════════════════════ */
.jail-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: rgba(142,68,173,.12); border: 1px solid rgba(142,68,173,.4); border-radius: var(--radius); padding: .8rem 1.2rem; margin-bottom: 1rem; }
.jail-banner.hidden { display: none; }
.jail-banner-left { display: flex; align-items: center; gap: .7rem; }
.jail-banner-left i { color: #bb8fce; font-size: 1.2rem; }
.jail-banner-left strong { display: block; color: var(--text-0); font-size: .95rem; }
.jail-banner-left span { display: block; color: var(--text-2); font-size: .8rem; }
.jail-countdown { font-family: var(--font-title); font-size: 1.1rem; color: #bb8fce; white-space: nowrap; }

/* ══════════════════════════════════════════════════════════════════════════════
   DAILY CHALLENGES
══════════════════════════════════════════════════════════════════════════════ */
.challenge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.challenge-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem; display: flex; flex-direction: column; gap: .55rem; }
.challenge-card.complete { border-color: rgba(212,175,55,.5); }
.challenge-card.claimed  { opacity: .55; }
.challenge-header { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.challenge-header strong { font-size: .92rem; color: var(--text-0); }
.challenge-header .ch-status { font-size: .7rem; font-weight: 700; padding: .15rem .45rem; border-radius: 20px; white-space: nowrap; }
.ch-status.done    { background: rgba(212,175,55,.2); color: var(--gold); border: 1px solid rgba(212,175,55,.4); }
.ch-status.claimed { background: var(--bg-3); color: var(--text-2); border: 1px solid var(--border); }
.ch-status.active  { background: rgba(39,174,96,.12); color: #58d68d; border: 1px solid rgba(39,174,96,.3); }
.challenge-desc { font-size: .78rem; color: var(--text-2); line-height: 1.35; }
.challenge-progress { display: flex; flex-direction: column; gap: .25rem; }
.challenge-progress .progress-bar { height: 5px; }
.challenge-progress-text { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text-2); }
.challenge-rewards { display: flex; gap: .4rem; flex-wrap: wrap; }
.challenge-rewards span { background: var(--bg-3); border-radius: 6px; padding: .15rem .45rem; font-size: .7rem; color: var(--text-1); }
.challenge-rewards .cash-reward { color: var(--gold); }
.challenge-rewards .xp-reward   { color: #5dade2; }
.challenge-rewards .bul-reward  { color: var(--red-light); }

/* ══════════════════════════════════════════════════════════════════════════════
   BOUNTY BOARD
══════════════════════════════════════════════════════════════════════════════ */
.bounty-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.bounty-list { display: grid; gap: .65rem; }
.bounty-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .75rem; align-items: center; background: var(--bg-2); border: 1px solid var(--border-red); border-radius: var(--radius); padding: .9rem; }
.bounty-amount { font-family: var(--font-title); font-size: 1.15rem; color: var(--gold); text-align: right; }
.bounty-skull { width: 36px; height: 36px; border-radius: 50%; background: rgba(192,57,43,.2); display: flex; align-items: center; justify-content: center; color: var(--red-light); font-size: .9rem; flex-shrink: 0; }
.bounty-body strong { display: block; font-size: .92rem; color: var(--text-0); }
.bounty-body span   { display: block; font-size: .75rem; color: var(--text-2); margin-top: .1rem; }
.bounty-empty { text-align: center; padding: 2rem; color: var(--text-2); }
.place-bounty-form { display: grid; gap: .65rem; }
.place-bounty-form input { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text-0); padding: .55rem .8rem; outline: none; }
.place-bounty-form input:focus { border-color: var(--red); }
.my-bounty-warn { background: rgba(192,57,43,.08); border: 1px solid var(--border-red); border-radius: var(--radius); padding: .75rem 1rem; font-size: .85rem; color: var(--red-light); }

/* ══════════════════════════════════════════════════════════════════════════════
   FAMILY MEMBERS PANEL
══════════════════════════════════════════════════════════════════════════════ */
.family-members-list { display: grid; gap: .5rem; margin-top: .8rem; }
.family-member-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; gap: .7rem; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: .65rem .8rem; }
.family-member-row .mini-av { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.family-member-info strong { display: block; font-size: .85rem; color: var(--text-0); }
.family-member-info span   { display: block; font-size: .72rem; color: var(--text-2); }
.role-badge { font-size: .65rem; font-weight: 700; padding: .1rem .4rem; border-radius: 20px; }
.role-baas     { background: rgba(192,57,43,.2); color: var(--red-light); border: 1px solid var(--border-red); }
.role-soldaat  { background: var(--bg-3); color: var(--text-2); border: 1px solid var(--border); }
.family-bank-actions { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: .5rem; margin-top: .8rem; }

@media (max-width: 1050px) {
  .bounty-layout { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   CITY SKYLINE BACKGROUND
══════════════════════════════════════════════════════════════════════════════ */
.city-skyline {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.sky-bld {
  flex: 1;
  min-width: 20px;
  position: relative;
  background: #0b0b1c;
  border-top: 1px solid #1a1a30;
  border-left: 1px solid #141428;
  border-right: 1px solid #141428;
  display: grid;
  grid-template-columns: repeat(auto-fill, 5px);
  grid-auto-rows: 7px;
  gap: 2px 3px;
  padding: 6px 4px 4px;
  align-content: start;
}

.sky-bld::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 40%);
  pointer-events: none;
}

.sky-win {
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: rgba(255, 215, 90, 0.88);
  animation: winFlicker 6s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

.sky-win.off {
  background: rgba(255, 255, 255, 0.04);
  animation: none;
}

@keyframes winFlicker {
  0%, 100% { opacity: 0.88; }
  38%       { opacity: 0.12; }
  41%       { opacity: 0.82; }
  48%       { opacity: 0.18; }
  51%       { opacity: 0.78; }
  68%       { opacity: 0.05; }
  70%       { opacity: 0.92; }
}

.sky-win:nth-child(2n+1)  { animation-delay: 0.7s;  animation-duration: 4.4s; }
.sky-win:nth-child(3n+2)  { animation-delay: 2.0s;  animation-duration: 6.9s; }
.sky-win:nth-child(4n)    { animation-delay: 1.3s;  animation-duration: 5.1s; }
.sky-win:nth-child(5n+3)  { animation-delay: 3.5s;  animation-duration: 7.2s; }
.sky-win:nth-child(7n+1)  { animation-delay: 0.2s;  animation-duration: 9.4s; }
.sky-win:nth-child(11n)   { animation-delay: 4.9s;  animation-duration: 4.7s; }
.sky-win:nth-child(13n+5) { animation-delay: 2.6s;  animation-duration: 8.5s; }
.sky-win:nth-child(17n+3) { animation-delay: 1.8s;  animation-duration: 5.8s; }

.lobby-main { position: relative; z-index: 2; }

/* ══════════════════════════════════════════════════════════════════════════════
   RAIN CANVAS
══════════════════════════════════════════════════════════════════════════════ */
#rainCanvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════════════════════
   GAME PAGE — NIGHT / DAY ATMOSPHERE
══════════════════════════════════════════════════════════════════════════════ */
.night-overlay { position: relative; }

.night-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 8%  12%, rgba(255,255,255,0.65) 0%, transparent 100%),
    radial-gradient(1px 1px at 25%  7%, rgba(255,255,255,0.45) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 48% 10%, rgba(255,255,255,0.55) 0%, transparent 100%),
    radial-gradient(1px 1px at 67%  5%, rgba(255,255,255,0.5)  0%, transparent 100%),
    radial-gradient(1px 1px at 82% 15%, rgba(255,255,255,0.4)  0%, transparent 100%),
    radial-gradient(1px 1px at 15% 22%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 37%  3%, rgba(255,255,255,0.65) 0%, transparent 100%),
    radial-gradient(1px 1px at 58% 18%, rgba(255,255,255,0.3)  0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 75% 8%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 93% 25%, rgba(255,255,255,0.38) 0%, transparent 100%),
    radial-gradient(1px 1px at 5%  30%, rgba(255,255,255,0.28) 0%, transparent 100%),
    radial-gradient(1px 1px at 44% 28%, rgba(255,255,255,0.32) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
  animation: starsTwinkle 5s ease-in-out infinite alternate;
}

.night-overlay::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent 0%, rgba(192,57,43,0.07) 100%);
  pointer-events: none;
  z-index: 0;
}

.night-overlay > * { position: relative; z-index: 1; }

@keyframes starsTwinkle {
  0%   { opacity: 0.9; }
  50%  { opacity: 0.5; }
  100% { opacity: 1.0; }
}

.day-area { position: relative; }

.day-area::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 180px;
  background: linear-gradient(180deg, rgba(200, 80, 20, 0.08) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.day-area > * { position: relative; z-index: 1; }

/* ══════════════════════════════════════════════════════════════════════════════
   SVG CITY MAP
══════════════════════════════════════════════════════════════════════════════ */
.city-map { display: block !important; }

.city-map svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.zone-bg {
  fill: #111120;
  stroke: rgba(255,255,255,0.07);
  stroke-width: 1;
  transition: fill 0.2s;
}

.zone-bg.zone-ctrl {
  fill: #141426;
  stroke: rgba(212,175,55,0.6);
}

.zone-name         { fill: #b0b0c8; }
.zone-name.zone-ctrl-lbl { fill: #d4af37; }

.svg-district { cursor: pointer; }
.svg-district:hover .zone-bg    { fill: #181828; }
.svg-district.sel   .zone-bg    { fill: #1c1c32; stroke: rgba(212,175,55,0.75); stroke-width: 1.5; }
.svg-district.sel   .zone-name  { fill: #d4af37; }

@media (max-width: 720px) {
  .city-skyline { display: none; }
}

/* ── Uitrusting tab ─────────────────────────────────────────────────────────── */
.uitrusting-layout { display: flex; flex-direction: column; gap: 1rem; }

/* ── Instellingen tab ───────────────────────────────────────────────────────── */
.instellingen-layout { display: flex; flex-direction: column; gap: 1.25rem; }

/* Email address row */
.email-addr-row { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.email-addr-input-wrap { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.empire-input { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text-0); padding: 0.5rem 0.8rem; font-size: 0.9rem; font-family: var(--font-body); flex: 1; min-width: 0; }
.empire-input:focus { outline: none; border-color: var(--gold); }
.field-label { font-size: 0.85rem; color: var(--text-1); font-weight: 600; }
.field-hint { font-size: 0.78rem; color: var(--text-2); }
.btn-small { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.45rem 0.85rem; background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; color: var(--text-0); font-size: 0.82rem; font-weight: 600; white-space: nowrap; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.btn-small:hover { border-color: var(--gold); background: rgba(212,175,55,0.08); }

/* Email preference toggle rows */
.email-prefs-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.email-pref-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0.85rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: border-color 0.2s; }
.email-pref-row:hover { border-color: rgba(212,175,55,0.4); }
.email-pref-row input[type="checkbox"] { display: none; }
.email-pref-label { font-size: 0.88rem; color: var(--text-1); flex: 1; }
.email-pref-toggle { width: 38px; height: 20px; background: var(--bg-4); border-radius: 10px; position: relative; flex-shrink: 0; transition: background 0.2s; }
.email-pref-toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: var(--text-2); border-radius: 50%; transition: left 0.2s, background 0.2s; }
.email-pref-row input:checked ~ .email-pref-toggle { background: rgba(212,175,55,0.3); border: 1px solid var(--gold); }
.email-pref-row input:checked ~ .email-pref-toggle::after { left: 19px; background: var(--gold); }

/* Save button and status */
.email-prefs-actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }
.btn-gold { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 1.2rem; background: linear-gradient(135deg, rgba(212,175,55,0.2), rgba(212,175,55,0.1)); border: 1px solid var(--gold); border-radius: 8px; color: var(--gold); font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: background 0.2s; }
.btn-gold:hover { background: rgba(212,175,55,0.22); }
.save-msg { font-size: 0.82rem; }
.save-msg.success { color: #4caf50; }
.save-msg.error { color: var(--red-light); }

/* Account info panel */
.account-info-grid { display: flex; flex-direction: column; gap: 0.4rem; }
.account-info-row { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.75rem; background: var(--bg-2); border-radius: 6px; }
.account-info-label { font-size: 0.82rem; color: var(--text-2); }
.account-info-val { font-size: 0.88rem; color: var(--text-0); font-weight: 600; }

/* ── Weather Badge ──────────────────────────────────────────────────────────── */
.weather-badge {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .35rem .8rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  font-size: .8rem;
  color: var(--text-2);
  margin: .3rem 1.5rem 0;
}
.weather-badge span { color: var(--text-1); font-weight: 500; }
.weather-badge small { font-size: .72rem; }

/* ── World Event Banner ─────────────────────────────────────────────────────── */
.world-event-banner {
  background: linear-gradient(90deg, rgba(231,76,60,0.15) 0%, rgba(231,76,60,0.05) 100%);
  border: 1px solid rgba(231,76,60,0.4);
  border-radius: 8px;
  padding: .6rem 1.2rem;
  margin: .5rem 1.5rem;
  font-size: .88rem;
  color: #e74c3c;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.world-event-banner strong { color: #ff6b6b; }
.world-event-banner small { color: var(--text-2); margin-left: auto; }

/* ── Login Streak Badge ─────────────────────────────────────────────────────── */
.streak-badge {
  font-size: .8rem;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: #fff;
  padding: .2rem .5rem;
  border-radius: 12px;
  font-weight: 600;
  margin-left: auto;
}

/* ── Comeback Bonus Notice ──────────────────────────────────────────────────── */
.comeback-notice {
  background: linear-gradient(90deg, rgba(46,204,113,0.15), rgba(46,204,113,0.05));
  border: 1px solid rgba(46,204,113,0.35);
  border-radius: 6px;
  padding: .5rem .8rem;
  margin: .5rem 0;
  font-size: .82rem;
  color: #2ecc71;
}
.comeback-notice strong { color: #55efc4; }

/* ── Online indicator dot ───────────────────────────────────────────────────── */
.mini-avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.online-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 9px; height: 9px;
  background: #2ecc71;
  border: 2px solid var(--bg-1);
  border-radius: 50%;
}
.rival-title {
  font-size: .7rem;
  color: var(--gold);
  font-style: italic;
  margin-left: .3rem;
}

/* ── Krant Tab Styling ──────────────────────────────────────────────────────── */
.krant-feed { display: flex; flex-direction: column; gap: 1.2rem; }

.krant-event-alert {
  background: linear-gradient(90deg, rgba(231,76,60,0.2), rgba(231,76,60,0.05));
  border-left: 3px solid #e74c3c;
  padding: .7rem 1rem;
  border-radius: 0 6px 6px 0;
  color: #ff6b6b;
  font-size: .88rem;
}

.krant-insider-tip {
  background: linear-gradient(90deg, rgba(247,199,68,0.2), rgba(247,199,68,0.05));
  border-left: 3px solid var(--gold);
  padding: .7rem 1rem;
  border-radius: 0 6px 6px 0;
  color: var(--gold);
  font-size: .88rem;
}

.krant-deadrop {
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: .8rem 1rem;
}
.krant-deadrop-label { font-size: .8rem; color: var(--text-2); margin-bottom: .5rem; }
.krant-deadrop-row { display: flex; gap: .5rem; }

.krant-section-title {
  font-family: 'Cinzel', serif;
  font-size: .9rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .08em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: .4rem;
  margin-top: .4rem;
}

.krant-articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.krant-article {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: .9rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.krant-article-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); }
.krant-article-headline { font-family: 'Cinzel', serif; font-size: .9rem; font-weight: 600; color: var(--text-1); line-height: 1.3; }
.krant-article-body { font-size: .78rem; color: var(--text-2); line-height: 1.5; }
.krant-article-byline { display: flex; align-items: center; gap: .4rem; font-size: .72rem; color: var(--text-3); margin-top: auto; }

.krant-wanted-row { display: flex; flex-wrap: wrap; gap: .8rem; }
.krant-wanted-card {
  background: rgba(231,76,60,0.08);
  border: 1px solid rgba(231,76,60,0.25);
  border-radius: 8px;
  padding: .8rem .9rem;
  min-width: 130px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.wanted-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid rgba(231,76,60,0.5);
}
.wanted-label { font-size: .65rem; letter-spacing: .15em; color: #e74c3c; font-weight: 700; text-transform: uppercase; }
.wanted-name { font-weight: 600; font-size: .85rem; color: var(--text-1); }
.wanted-crime { font-size: .72rem; color: var(--text-2); font-style: italic; }
.wanted-heat { font-size: .72rem; color: var(--text-3); }
.wanted-heat strong { color: #e74c3c; }

.krant-market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.krant-market-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: .4rem .6rem;
  font-size: .78rem;
}
.market-drug-name { color: var(--text-2); flex: 1; }
.market-price { color: var(--text-1); font-weight: 600; }
.market-pct { font-size: .7rem; }
.market-pct.pos { color: #2ecc71; }
.market-pct.neg { color: #e74c3c; }

.krant-letters { display: flex; flex-direction: column; gap: .5rem; }
.krant-letter {
  background: rgba(255,255,255,0.03);
  border-left: 2px solid var(--gold);
  padding: .5rem .7rem;
  border-radius: 0 6px 6px 0;
}
.letter-author { font-size: .72rem; color: var(--gold); font-weight: 600; }
.letter-text { font-size: .82rem; color: var(--text-2); font-style: italic; margin: .2rem 0 0; }

.krant-write-letter { margin-top: .4rem; }

/* ── Season Leaderboard ─────────────────────────────────────────────────────── */
.season-info { font-size: .82rem; color: var(--text-2); padding: .4rem 0; }
.season-leaderboard { display: flex; flex-direction: column; gap: .3rem; margin-top: .4rem; }
.season-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem .6rem;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  font-size: .82rem;
}
.season-pos { min-width: 24px; font-weight: 600; color: var(--gold); }
.season-row div { flex: 1; }
.season-row div strong { display: block; font-size: .84rem; }
.season-row div small { color: var(--text-2); font-size: .72rem; }
.season-score { color: var(--gold); font-size: .85rem; }

/* ── Hall of Fame ───────────────────────────────────────────────────────────── */
.hof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .7rem; margin: .5rem 0; }
.hof-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: .8rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.hof-icon { font-size: 1.4rem; }
.hof-title { font-size: .68rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.hof-name { font-size: .85rem; font-weight: 600; color: var(--text-1); }
.hof-val { font-size: .72rem; color: var(--gold); }

/* ── NPC Mission Card ───────────────────────────────────────────────────────── */
.npc-mission-card {
  background: linear-gradient(135deg, rgba(156,107,255,0.12), rgba(156,107,255,0.04));
  border: 1px solid rgba(156,107,255,0.3);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  grid-column: 1 / -1;
}
.npc-mission-header { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: #b388ff; }
.npc-mission-header i { color: #9c6bff; }
.npc-timer { margin-left: auto; font-size: .72rem; color: var(--text-3); }
.npc-mission-text { font-size: .85rem; color: var(--text-1); font-style: italic; margin: 0; }
.npc-mission-text strong { color: #b388ff; }
.npc-mission-reward { font-size: .82rem; color: var(--text-2); }
.npc-mission-reward strong { color: var(--gold); }

/* ── Prison Chat ────────────────────────────────────────────────────────────── */
.prison-chat-section {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  margin: .8rem 1.5rem;
  overflow: hidden;
}
.prison-chat-header {
  background: rgba(255,255,255,0.05);
  padding: .5rem .9rem;
  font-size: .8rem;
  color: var(--text-2);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.prison-chat-list {
  max-height: 200px;
  overflow-y: auto;
  padding: .5rem .8rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.prison-msg { font-size: .8rem; color: var(--text-2); display: flex; align-items: baseline; gap: .4rem; }
.prison-msg strong { color: var(--text-1); }
.prison-chat-input-row {
  display: flex;
  gap: .4rem;
  padding: .4rem .6rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.mini-avatar.sm { width: 18px; height: 18px; font-size: .6rem; flex-shrink: 0; }

/* ── Spectator Panel ────────────────────────────────────────────────────────── */
.spectator-panel { margin-top: 1.2rem; }
.spectator-header {
  font-family: 'Cinzel', serif;
  font-size: .9rem;
  color: var(--gold);
  padding: .4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: .8rem;
}
.spectator-room {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: .8rem;
  margin-bottom: .6rem;
}
.spectator-room-name { font-size: .85rem; font-weight: 600; margin-bottom: .5rem; }
.spectator-room-name small { color: var(--text-2); font-weight: 400; }
.spectator-bet-form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.spectator-bet-form .empire-input.sm,
.spectator-bet-form .form-select.sm { height: 32px; font-size: .8rem; padding: 0 .5rem; }
.spectator-empty { color: var(--text-2); font-size: .85rem; padding: .8rem 0; text-align: center; }

/* ── Family Votes ───────────────────────────────────────────────────────────── */
.family-votes-section { margin-top: 1rem; }
.vote-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: .8rem;
  margin-bottom: .6rem;
}
.vote-question { font-size: .88rem; font-weight: 600; color: var(--text-1); margin: 0 0 .5rem; }
.vote-stats { display: flex; gap: 1rem; font-size: .78rem; margin-bottom: .5rem; }
.vote-yes { color: #2ecc71; }
.vote-no { color: #e74c3c; }
.vote-time { color: var(--text-3); margin-left: auto; }
.vote-btns { display: flex; gap: .4rem; }
.vote-create-form { display: flex; gap: .5rem; margin-top: .8rem; flex-wrap: wrap; }

/* ── User title tag ─────────────────────────────────────────────────────────── */
.user-title-tag {
  font-size: .65em;
  color: var(--gold);
  font-style: italic;
  font-weight: 400;
  margin-left: .4rem;
  font-family: 'Rajdhani', sans-serif;
}

/* ── Informant hint in stat bars ────────────────────────────────────────────── */
.informant-hint { align-items: center; }
.informant-tag { cursor: default; }

/* ── btn-xs ─────────────────────────────────────────────────────────────────── */
.btn-xs {
  font-size: .7rem;
  padding: .2rem .5rem;
  height: auto;
  min-height: 0;
}

