/* ═══════════════════════════════════════════════════════════
   BUNKER.IO v4 — Mobile-first Design System
   Fonts: Unbounded (display) + DM Mono + DM Sans
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@700;900&family=DM+Mono:wght@400;500&family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── LIGHT THEME ───────────────────────────── */
:root {
  --bg:        #f0ebe1;
  --surface:   #ffffff;
  --surface2:  #f8f4ed;
  --surface3:  #ede8df;
  --border:    #ddd6ca;
  --border2:   #c8bfb2;
  --txt:       #1c1610;
  --txt2:      #4a3f32;
  --txt3:      #7a6f62;
  --muted:     #a89d90;
  --accent:    #d4521a;
  --accent-bg: rgba(212,82,26,.1);
  --green:     #1a7a49;
  --green-bg:  rgba(26,122,73,.1);
  --red:       #c0392b;
  --red-bg:    rgba(192,57,43,.1);
  --yellow:    #b87700;
  --blue:      #1a5fa8;
  --purple:    #6b369a;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.08);
  --shadow:    0 4px 16px rgba(0,0,0,.12);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.18);
  --radius:    12px;
  --radius-sm: 8px;
  --noise:     url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* ── DARK THEME ────────────────────────────── */
html.dark {
  --bg:        #0d1117;
  --surface:   #161b22;
  --surface2:  #1c2230;
  --surface3:  #222c3c;
  --border:    #2d3748;
  --border2:   #3d4f68;
  --txt:       #e8ecf0;
  --txt2:      #b0bec5;
  --txt3:      #8899aa;
  --muted:     #5a6f84;
  --accent:    #3de07b;
  --accent-bg: rgba(61,224,123,.1);
  --green:     #3de07b;
  --green-bg:  rgba(61,224,123,.1);
  --red:       #ff6b6b;
  --red-bg:    rgba(255,107,107,.1);
  --yellow:    #ffd166;
  --blue:      #60a5fa;
  --purple:    #c084fc;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.4);
  --shadow:    0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.7);
}

/* ════════════════════════════════════════════
   BASE
   ════════════════════════════════════════════ */
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ════════════════════════════════════════════
   UTILITIES
   ════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 20px;
  border-radius: var(--radius-sm); border: 2px solid transparent;
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .18s; white-space: nowrap;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.95); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; }

.btn-primary  { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }

.btn-secondary { background: var(--surface2); color: var(--txt2); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--border2); }

.btn-danger  { background: var(--red-bg); color: var(--red); border-color: rgba(192,57,43,.3); }
.btn-danger:hover:not(:disabled) { background: rgba(192,57,43,.18); }

.btn-green   { background: var(--green-bg); color: var(--green); border-color: rgba(26,122,73,.3); }
.btn-green:hover:not(:disabled) { background: rgba(26,122,73,.18); }

.btn-sm  { padding: 8px 14px; font-size: 13px; border-radius: 7px; }
.btn-lg  { padding: 15px 28px; font-size: 16px; font-weight: 700; }
.btn-full { width: 100%; }
.btn-icon { padding: 10px; border-radius: 50%; width: 40px; height: 40px; }

.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.badge-accent  { background: var(--accent-bg); color: var(--accent); }
.badge-green   { background: var(--green-bg);  color: var(--green); }
.badge-red     { background: var(--red-bg);    color: var(--red); }
.badge-yellow  { background: rgba(184,119,0,.12); color: var(--yellow); }
.badge-muted   { background: var(--surface3); color: var(--muted); }
.badge-blue    { background: rgba(26,95,168,.12); color: var(--blue); }

/* ════════════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════════════ */
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 var(--accent);} 50%{box-shadow:0 0 0 8px transparent;} }
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes flipIn { 0%{transform:rotateY(-90deg);opacity:0;} 100%{transform:rotateY(0);opacity:1;} }
@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-6px);} 75%{transform:translateX(6px);} }
@keyframes glow { 0%,100%{opacity:.6;} 50%{opacity:1;} }

.anim-fadein { animation: fadeIn .3s ease both; }
.anim-slideup { animation: slideUp .4s ease both; }

/* ════════════════════════════════════════════
   LOGIN SCREEN
   ════════════════════════════════════════════ */
#screen-login {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; padding: 20px;
  gap: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212,82,26,.12) 0%, transparent 60%),
    var(--bg);
  overflow-y: auto;
}
html.dark #screen-login {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(61,224,123,.08) 0%, transparent 60%),
    var(--bg);
}

.login-logo { text-align: center; }
.login-logo h1 {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(32px, 10vw, 52px);
  font-weight: 900;
  color: var(--txt);
  letter-spacing: -1px;
  line-height: 1.1;
}
.login-logo h1 em { font-style: normal; color: var(--accent); }
.login-logo p {
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--muted); margin-top: 6px;
}

.login-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: 20px; padding: 28px 24px;
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow-lg);
}
.login-card h2 { font-weight: 700; font-size: 17px; margin-bottom: 18px; }

.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 6px;
}
.field input {
  width: 100%; background: var(--surface2); border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 16px;
  color: var(--txt); font-family: 'DM Mono', monospace; font-size: 15px;
  outline: none; transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }
.field input::placeholder { color: var(--muted); }

.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 12px; margin: 4px 0;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

#login-error {
  background: var(--red-bg); border: 1.5px solid rgba(192,57,43,.3);
  border-radius: var(--radius-sm); padding: 12px 14px;
  color: var(--red); font-size: 13px; display: none; margin-top: 8px;
}
#login-error.show { display: block; animation: shake .3s ease; }

.theme-btn-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted);
}

/* ════════════════════════════════════════════
   LOBBY SCREEN
   ════════════════════════════════════════════ */
#screen-lobby {
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; padding: 20px; gap: 20px;
  background: var(--bg); overflow-y: auto;
}

.lobby-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: 20px; padding: 24px;
  width: 100%; max-width: 500px;
  box-shadow: var(--shadow-lg);
}
.lobby-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.lobby-top h2 { font-family: 'Unbounded', sans-serif; font-size: 18px; font-weight: 700; }

.code-badge {
  background: var(--surface2); border: 2.5px solid var(--border);
  border-radius: 10px; padding: 8px 16px;
  font-family: 'DM Mono', monospace; font-size: 22px; font-weight: 500;
  color: var(--accent); letter-spacing: 5px;
  cursor: pointer; transition: border-color .2s, box-shadow .2s;
  user-select: all;
}
.code-badge:hover { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }

.player-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 18px; min-height: 60px;
}
.lobby-player {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 2px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
  font-size: 14px; font-weight: 500;
}
.lobby-player .av {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.lobby-player.is-host .av { background: var(--yellow); color: #000; }
.lobby-player .pname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lobby-hint {
  background: var(--surface2); border: 2px solid var(--border);
  border-radius: 10px; padding: 12px 16px; font-size: 13px;
  color: var(--txt3); line-height: 1.6; margin-bottom: 18px;
}
.lobby-actions { display: flex; gap: 10px; }

/* ════════════════════════════════════════════
   GAME SCREEN — DESKTOP
   ════════════════════════════════════════════ */
#screen-game {
  display: none; height: 100%;
}

/* ── Desktop Grid ───────────────────────────── */
@media (min-width: 768px) {
  #screen-game {
    display: none;
    grid-template-rows: 52px 1fr;
    grid-template-columns: 280px 1fr 300px;
    grid-template-areas: "tb tb tb" "left center right";
  }
  #screen-game.active { display: grid; }
  #mobile-tabs { display: none !important; }
  #panel-left, #panel-center, #panel-right { display: flex !important; }
  #panel-left   { grid-area: left; }
  #panel-center { grid-area: center; }
  #panel-right  { grid-area: right; }
}

/* ── Mobile ─────────────────────────────────── */
@media (max-width: 767px) {
  #screen-game {
    display: none;
    grid-template-rows: 52px 1fr 60px;
    grid-template-columns: 1fr;
    grid-template-areas: "tb" "content" "tabs";
  }
  #screen-game.active { display: grid; }

  #panel-left, #panel-center, #panel-right {
    grid-area: content;
    display: none !important;
  }
  #panel-left.tab-active,
  #panel-center.tab-active,
  #panel-right.tab-active {
    display: flex !important;
  }
  #mobile-tabs {
    grid-area: tabs;
    display: flex !important;
    align-items: center;
    background: var(--surface);
    border-top: 2px solid var(--border);
  }
  .panel-title { display: none; }
}

/* ── Topbar ─────────────────────────────────── */
#topbar {
  grid-area: tb;
  background: var(--surface); border-bottom: 2px solid var(--border);
  display: flex; align-items: center; padding: 0 14px; gap: 10px;
  overflow: hidden;
}
.tb-logo {
  font-family: 'Unbounded', sans-serif; font-size: 16px; font-weight: 900;
  color: var(--txt); white-space: nowrap; flex-shrink: 0;
}
.tb-logo em { font-style: normal; color: var(--accent); }
.tb-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.tb-chips { display: flex; align-items: center; gap: 6px; flex: 1; overflow: hidden; min-width: 0; }
.tb-chip {
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 6px; padding: 3px 9px;
  font-size: 12px; font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.tb-chip.g { border-color: rgba(26,122,73,.4);  color: var(--green); }
.tb-chip.r { border-color: rgba(192,57,43,.4);  color: var(--red); }
.tb-chip.y { border-color: rgba(184,119,0,.4);  color: var(--yellow); }
.tb-chip.b { border-color: rgba(26,95,168,.4);  color: var(--blue); }
.tb-right { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.tb-theme-btn {
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 7px; padding: 5px 8px; cursor: pointer;
  font-size: 16px; line-height: 1; transition: border-color .2s;
}
.tb-theme-btn:hover { border-color: var(--accent); }

/* ── Mobile tabs bar ────────────────────────── */
#mobile-tabs {
  display: none;
}
.mob-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; padding: 8px 4px;
  background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 600;
  color: var(--muted); transition: color .2s; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.mob-tab .tab-icon { font-size: 20px; }
.mob-tab.active { color: var(--accent); }
.mob-tab.active::after {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%;
  height: 2px; background: var(--accent); border-radius: 0 0 2px 2px;
}
.mob-tab .tab-badge {
  position: absolute; top: 6px; right: calc(50% - 18px);
  background: var(--red); color: #fff; border-radius: 50%;
  width: 16px; height: 16px; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ── Panel commons ─────────────────────────── */
.panel {
  display: flex; flex-direction: column;
  background: var(--surface); overflow: hidden;
}
#panel-left   { border-right: 2px solid var(--border); }
#panel-right  { border-left: 2px solid var(--border); }
#panel-center { border: none; background: var(--bg); }

.panel-title {
  padding: 10px 14px 8px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 2px; color: var(--muted);
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════
   PLAYERS LIST
   ════════════════════════════════════════════ */
#players-list {
  flex: 1; overflow-y: auto;
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
}

.player-row {
  background: var(--surface2); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
  cursor: default; transition: all .18s;
  animation: fadeIn .25s ease both;
}
.player-row.dead        { opacity: .4; border-style: dashed; filter: grayscale(.5); }
.player-row.vote-target { border-color: var(--red); cursor: pointer; }
.player-row.vote-target:hover { background: var(--red-bg); transform: scale(1.01); }
.player-row.voted-for   { border-color: var(--blue); }
.player-row.is-me       { border-color: var(--accent); }
.player-row.disconnected{ opacity: .6; }

.pr-header { display: flex; align-items: center; gap: 10px; }
.pr-av {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
  border: 2px solid var(--border2);
}
.pr-name { flex: 1; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-badges { display: flex; gap: 4px; flex-wrap: wrap; }

.pr-cards { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.pr-card-row {
  display: flex; gap: 6px; align-items: flex-start;
  font-size: 12px; line-height: 1.4;
}
.pr-card-row .c { flex-shrink: 0; width: 16px; }
.pr-card-row .v { color: var(--txt2); }
.pr-card-row.hidden .v { color: var(--border2); font-style: italic; }

/* Reveal this round indicator */
.pr-row-revealed { border-color: var(--green) !important; }
.pr-row-waiting  { }

/* ════════════════════════════════════════════
   CENTER: PHASE BAR, CHAT, ACTIONS
   ════════════════════════════════════════════ */
.phase-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1.5px solid var(--border);
  background: var(--surface); flex-shrink: 0;
  font-size: 13px; color: var(--txt3); font-weight: 500;
}
.phase-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); flex-shrink: 0;
  animation: glow 2s ease-in-out infinite;
}
.phase-dot.g { background: var(--green); }
.phase-dot.r { background: var(--red); }
.phase-dot.y { background: var(--yellow); }
.phase-dot.b { background: var(--blue); }
.phase-dot.a { background: var(--accent); }
.phase-text { flex: 1; }

/* Disaster/Bunker banner */
#info-banner {
  background: var(--surface); border-bottom: 1.5px solid var(--border);
  padding: 10px 14px; flex-shrink: 0; display: none;
}
#info-banner.show { display: block; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

@media (max-width: 767px) {
  .info-grid { grid-template-columns: 1fr; }
}

.info-card {
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.info-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.info-name  { font-family: 'Unbounded', sans-serif; font-size: 13px; color: var(--red); margin-bottom: 3px; }
.info-name.bunker { color: var(--green); }
.info-desc  { font-size: 11px; color: var(--txt3); line-height: 1.5; }

/* Elim banner */
#elim-banner {
  display: none; padding: 10px 14px;
  background: var(--red-bg); border-bottom: 1.5px solid rgba(192,57,43,.2);
  font-size: 13px; font-weight: 600; color: var(--red);
  text-align: center; flex-shrink: 0;
}
#elim-banner.show { display: block; }

/* Reveal turn banner */
#reveal-banner {
  display: none; padding: 10px 14px;
  border-bottom: 1.5px solid var(--border); flex-shrink: 0;
  background: var(--surface);
}
#reveal-banner.show { display: block; }
.rb-box {
  background: var(--surface2); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.rb-box.my-turn { border-color: var(--accent); background: var(--accent-bg); animation: pulse 2s infinite; }
.rb-box .rb-icon { font-size: 24px; flex-shrink: 0; }
.rb-box .rb-body { flex: 1; }
.rb-title { font-size: 15px; font-weight: 700; color: var(--txt); }
.rb-sub   { font-size: 12px; color: var(--txt3); margin-top: 2px; }
.rb-prog  { font-size: 13px; font-weight: 700; color: var(--muted); font-family: 'DM Mono', monospace; flex-shrink: 0; }

/* Chat */
#chat-log {
  flex: 1; overflow-y: auto;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
}
.chat-msg { display: flex; gap: 8px; align-items: flex-start; padding: 2px 0; }
.cm-name {
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  min-width: 80px; text-align: right; color: var(--blue);
}
.cm-text { font-size: 13px; color: var(--txt3); flex: 1; word-break: break-word; line-height: 1.5; }
.chat-msg.system .cm-name   { color: var(--muted); }
.chat-msg.system .cm-text   { color: var(--muted); font-style: italic; }
.chat-msg.reveal .cm-name   { color: var(--purple); }
.chat-msg.reveal .cm-text   { color: var(--txt); font-weight: 500; }
.chat-msg.eliminated .cm-name,.chat-msg.eliminated .cm-text { color: var(--red); font-weight: 700; }
.chat-msg.win .cm-name,.chat-msg.win .cm-text { color: var(--yellow); font-weight: 700; }
.chat-msg.me .cm-name       { color: var(--accent); }
.chat-msg.me .cm-text       { color: var(--txt); }
.chat-msg.new               { animation: fadeIn .2s ease both; }

#chat-footer {
  display: flex; gap: 8px; padding: 10px 14px;
  border-top: 1.5px solid var(--border); background: var(--surface); flex-shrink: 0;
}
#chat-input {
  flex: 1; background: var(--surface2); border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--txt); font-family: 'DM Sans', sans-serif; font-size: 14px; outline: none;
  transition: border-color .2s; -webkit-appearance: none;
}
#chat-input:focus { border-color: var(--accent); }
#chat-input::placeholder { color: var(--muted); }

/* Action area */
#action-area {
  border-top: 1.5px solid var(--border); background: var(--surface);
  padding: 12px 14px; flex-shrink: 0; display: none;
}
#action-area.show { display: block; }
.action-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--muted); margin-bottom: 10px;
}
#action-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }

/* ════════════════════════════════════════════
   VOTE TIMER — big, animated SVG ring
   ════════════════════════════════════════════ */
.vote-timer-block {
  display: flex; align-items: center; gap: 16px; margin-bottom: 12px;
}
.vt-ring-wrap { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.vt-ring-wrap svg { transform: rotate(-90deg); }
.vt-bg { fill: none; stroke: var(--border); stroke-width: 4; }
.vt-fg { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.vt-fg.urgent { stroke: var(--red); }
.vt-num {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace; font-size: 18px; font-weight: 500; color: var(--txt2);
}
.vt-num.urgent { color: var(--red); }
.vt-info { flex: 1; }
.vt-title { font-size: 15px; font-weight: 700; color: var(--txt); margin-bottom: 4px; }
.vt-sub   { font-size: 12px; color: var(--muted); }
.vote-progress-bar {
  height: 4px; background: var(--surface3);
  border-radius: 2px; margin-top: 8px; overflow: hidden;
}
.vote-progress-fill {
  height: 100%; background: var(--green);
  border-radius: 2px; transition: width .4s;
}

/* ════════════════════════════════════════════
   MY CARDS — RIGHT PANEL
   ════════════════════════════════════════════ */
#panel-right { background: var(--surface); }
#my-cards-area { flex: 1; overflow-y: auto; padding: 10px; }

/* Card grid: 2 columns on desktop, 2 on mobile */
.cards-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
@media (min-width: 1024px) {
  .cards-grid { grid-template-columns: 1fr; }
}

/* Individual card — flip animation */
.my-card {
  background: var(--surface2); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 0;
  cursor: default; transition: border-color .2s, transform .15s, box-shadow .2s;
  overflow: hidden;
  position: relative;
}
.my-card.can-reveal {
  cursor: pointer; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
  animation: pulse 2s infinite;
}
.my-card.can-reveal:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.15), 0 0 0 3px var(--accent-bg); }
.my-card.already-revealed { opacity: .65; border-style: dashed; }
.my-card.revealed-this-round { border-color: var(--green); }

.card-inner { padding: 12px; }
.card-cat-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--muted); margin-bottom: 4px;
}
.card-name {
  font-family: 'Unbounded', sans-serif; font-size: 12px; font-weight: 700;
  color: var(--txt); line-height: 1.3; margin-bottom: 4px;
}
.card-desc {
  font-size: 11px; color: var(--txt3); line-height: 1.5;
}
.card-status {
  position: absolute; top: 8px; right: 8px;
  padding: 2px 7px; border-radius: 5px;
  font-size: 10px; font-weight: 700;
}

.card-flip-anim { animation: flipIn .4s ease both; }

/* Eliminated panel */
#elim-panel { padding: 10px; border-top: 2px solid var(--border); flex-shrink: 0; }
.elim-panel-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--red); margin-bottom: 8px; }
.elim-entry {
  background: var(--red-bg); border: 1.5px solid rgba(192,57,43,.2);
  border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 6px;
  font-size: 13px;
}
.elim-name { font-weight: 700; color: var(--red); margin-bottom: 2px; }
.elim-job  { font-size: 12px; color: var(--txt3); }

/* ════════════════════════════════════════════
   OVERLAY (game end)
   ════════════════════════════════════════════ */
#overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
#overlay.show { display: flex; }
.overlay-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: 24px; padding: 36px 28px;
  max-width: 400px; width: 100%;
  text-align: center; box-shadow: var(--shadow-lg);
  animation: slideUp .4s ease both;
}
.ov-icon  { font-size: 64px; margin-bottom: 12px; }
.ov-title { font-family: 'Unbounded', sans-serif; font-size: 22px; font-weight: 900; margin-bottom: 8px; }
.ov-sub   { font-size: 14px; color: var(--txt3); margin-bottom: 20px; line-height: 1.6; white-space: pre-line; }
.ov-survivors {
  background: var(--green-bg); border: 1.5px solid rgba(26,122,73,.25);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px;
  font-size: 14px; color: var(--green); line-height: 1.8;
}
.ov-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ════════════════════════════════════════════
   TOAST
   ════════════════════════════════════════════ */
#toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--txt); color: var(--surface);
  border-radius: 50px; padding: 10px 20px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0;
  transition: all .25s; pointer-events: none; z-index: 300;
  white-space: nowrap; max-width: calc(100vw - 40px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 768px) {
  #toast { bottom: 24px; }
}

/* ════════════════════════════════════════════
   CONFIRM DIALOG (native-style overlay)
   ════════════════════════════════════════════ */
#confirm-dialog {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  z-index: 400; padding: 20px;
}
#confirm-dialog.show { display: flex; }
.confirm-box {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: 20px; padding: 28px 24px;
  max-width: 340px; width: 100%;
  box-shadow: var(--shadow-lg); animation: slideUp .3s ease both;
}
.confirm-box h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.confirm-box p  { font-size: 14px; color: var(--txt3); margin-bottom: 20px; line-height: 1.5; }
.confirm-btns   { display: flex; gap: 10px; }
.confirm-btns .btn { flex: 1; }

/* ════════════════════════════════════════════
   PLAYER AVATAR COLORS (rotating palette)
   ════════════════════════════════════════════ */
.av-0  { background: #e74c3c; color: #fff; }
.av-1  { background: #3498db; color: #fff; }
.av-2  { background: #2ecc71; color: #fff; }
.av-3  { background: #f39c12; color: #000; }
.av-4  { background: #9b59b6; color: #fff; }
.av-5  { background: #1abc9c; color: #fff; }
.av-6  { background: #e67e22; color: #fff; }
.av-7  { background: #e91e63; color: #fff; }
.av-8  { background: #00bcd4; color: #fff; }
.av-9  { background: #8bc34a; color: #000; }
.av-10 { background: #ff5722; color: #fff; }
.av-11 { background: #607d8b; color: #fff; }
.av-12 { background: #795548; color: #fff; }
.av-13 { background: #673ab7; color: #fff; }
.av-14 { background: #009688; color: #fff; }
.av-15 { background: #ff9800; color: #000; }
