/* ==========================================================================
   MAFIA HOST PANEL — MOBILE-FIRST STYLESHEET (v3)
   - Foul visual highlighting for 1, 2, 3 (yellow), and 4+ (red) fouls
   - Icon-only expressive Mafia role buttons (compact, zero text clutter)
   - Foul card icon replacing "Ф"
   - Confirmation dialog for Role change, Elimination toggle, and Vote removal
   - Drag-and-drop reordering mode for Voting nominees
   - Locked timer preset switching while timer is active until Reset
   ========================================================================== */

:root {
  --bg-base: #0f1117;
  --bg-surface: #181b24;
  --bg-elevated: #212634;
  --bg-card-hover: #282e3e;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --accent-primary: #e11d48;
  --accent-primary-hover: #be123c;
  --accent-secondary: #3b82f6;
  --color-success: #10b981;
  --color-yellow: #facc15;
  --color-yellow-text: #111827;
  --color-red: #ef4444;
  --color-red-dark: #b91c1c;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  transition: background-color 0.2s ease;
}

/* Sharp screen flash states for Timer */
body.screen-alert-yellow {
  background-color: #eab308 !important;
}
body.screen-alert-yellow .app-container {
  background-color: rgba(17, 24, 39, 0.92);
  box-shadow: 0 0 0 5px #facc15, 0 0 40px rgba(250, 204, 21, 0.85);
}

body.screen-alert-red {
  background-color: #dc2626 !important;
}
body.screen-alert-red .app-container {
  background-color: rgba(17, 24, 39, 0.92);
  box-shadow: 0 0 0 5px #ef4444, 0 0 45px rgba(239, 68, 68, 0.95);
}

.app-container {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 96px;
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Inline SVG Icon sizing */
.role-svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.role-svg-lg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.foul-svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  opacity: 0.92;
}

/* ==========================================================================
   TOP NAVIGATION BAR
   ========================================================================== */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(24, 27, 36, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e11d48, #9f1239);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.4);
}

.session-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.session-current-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-indicator {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  display: inline-block;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn.eye-active {
  background: rgba(250, 204, 21, 0.18);
  border-color: var(--color-yellow);
  color: var(--color-yellow);
}

.lang-switch {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 38px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
}

/* ==========================================================================
   INDEX / EMPTY LANDING PAGE (When 0 sessions exist)
   ========================================================================== */
.index-empty-view {
  display: none;
  flex: 1;
  padding: 32px 16px;
  align-items: center;
  justify-content: center;
}

.index-empty-view.active {
  display: flex;
}

.index-hero-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 22px;
  text-align: center;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.index-hero-icon {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.22), rgba(159, 18, 57, 0.35));
  border: 1px solid rgba(225, 29, 72, 0.45);
  color: #fb7185;
  display: flex;
  align-items: center;
  justify-content: center;
}

.index-hero-title {
  font-size: 20px;
  font-weight: 800;
}

.index-hero-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.btn-start-big {
  margin-top: 6px;
  width: 100%;
  height: 50px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.4);
  transition: transform 0.15s ease;
}

.btn-start-big:active {
  transform: scale(0.97);
}

/* ==========================================================================
   MAIN SECTION TABS (Игровой стол / Таймер)
   ========================================================================== */
.main-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 12px 6px;
}

.tab-btn {
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
}

.tab-timer-badge {
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  font-variant-numeric: tabular-nums;
}

.tab-timer-badge.warn {
  background: var(--color-yellow);
  color: var(--color-yellow-text);
  font-weight: 800;
}

.tab-timer-badge.expired {
  background: var(--color-red);
  color: #ffffff;
  font-weight: 800;
}

/* ==========================================================================
   VIEWS & CARDS
   ========================================================================== */
.view-section {
  display: none;
  padding: 8px 12px;
  flex-direction: column;
  gap: 12px;
}

.view-section.active {
  display: flex;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   ROLE SUMMARY QUOTA STRIP (1st Round Helper - Icon + Count)
   ========================================================================== */
.role-quota-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: space-between;
}

.quota-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quota-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quota-chip.complete {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
}

/* ==========================================================================
   PLAYER TABLE / ROWS (Игровой стол + подсветка фолов 1, 2, 3, 4+)
   ========================================================================== */
.players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}

/* Row highlights when player has fouls so host immediately sees them */
.player-row.row-fouls-1 {
  border-left: 4px solid #38bdf8;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.11) 0%, var(--bg-surface) 60%);
}

.player-row.row-fouls-2 {
  border-left: 5px solid #f97316;
  border-color: rgba(249, 115, 22, 0.45);
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.17) 0%, var(--bg-surface) 70%);
}

.player-row.row-fouls-3 {
  border-left: 5px solid var(--color-yellow);
  border-color: rgba(250, 204, 21, 0.6);
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.2) 0%, var(--bg-surface) 75%);
}

.player-row.row-fouls-4 {
  border-left: 5px solid var(--color-red);
  border-color: rgba(239, 68, 68, 0.7);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.22) 0%, var(--bg-surface) 75%);
}

.player-row.is-eliminated {
  opacity: 0.52;
  background: rgba(18, 20, 28, 0.75) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}

.player-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.player-ident {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.player-num-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.player-row.is-eliminated .player-num-badge {
  text-decoration: line-through;
  color: var(--color-red);
}

.player-name-input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 6px;
}

.player-name-input:focus {
  outline: none;
  border-color: var(--border-subtle);
  background: var(--bg-elevated);
}

.player-row.is-eliminated .player-name-input {
  text-decoration: line-through;
  color: var(--text-muted);
}

.player-controls-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Fouls Counter Switcher (- [num + icon] +) */
.foul-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 2px;
  transition: all 0.15s ease;
}

/* 1 Foul -> Sky Blue highlight */
.foul-switcher.fouls-1 {
  background: rgba(56, 189, 248, 0.24);
  border-color: #38bdf8;
  color: #e0f2fe;
}

/* 2 Fouls -> Vivid Orange highlight */
.foul-switcher.fouls-2 {
  background: #ea580c !important;
  border-color: #fdba74 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
}

/* 3 Fouls -> Bright Yellow background */
.foul-switcher.fouls-3 {
  background: var(--color-yellow) !important;
  border-color: #fde047 !important;
  color: var(--color-yellow-text) !important;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
}

/* 4+ Fouls -> Bright Red background */
.foul-switcher.fouls-4 {
  background: var(--color-red) !important;
  border-color: #f87171 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.75);
}

.foul-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.foul-btn:active {
  transform: scale(0.92);
}

.foul-val {
  min-width: 38px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  padding: 0 5px;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

/* Eliminated Toggle Button */
.elim-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.elim-btn.eliminated {
  background: rgba(239, 68, 68, 0.22);
  border-color: var(--color-red);
  color: #fca5a5;
}

/* Role Selector Row inside Player Card — ICON ONLY */
.player-role-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.current-role-pill {
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.current-role-pill.role-citizen,
.vote-player-role-badge.role-citizen {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.current-role-pill.role-mafia,
.vote-player-role-badge.role-mafia {
  color: #f87171;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.current-role-pill.role-don,
.vote-player-role-badge.role-don {
  color: #e879f9;
  background: rgba(192, 38, 211, 0.22);
  border: 1px solid rgba(192, 38, 211, 0.5);
}

.current-role-pill.role-commissar,
.vote-player-role-badge.role-commissar {
  color: #facc15;
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid rgba(234, 179, 8, 0.5);
}

.current-role-pill.role-doctor,
.vote-player-role-badge.role-doctor {
  color: #34d399;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.current-role-pill.role-hidden {
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.role-quick-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Compact square icon-only role buttons */
.role-qbtn {
  width: 36px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.role-qbtn.rbtn-citizen { color: #93c5fd; }
.role-qbtn.rbtn-mafia { color: #fca5a5; }
.role-qbtn.rbtn-don { color: #f5d0fe; }
.role-qbtn.rbtn-commissar { color: #fde047; }
.role-qbtn.rbtn-doctor { color: #6ee7b7; }

.role-qbtn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.role-qbtn.active {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.role-qbtn:disabled,
.role-qbtn.quota-full {
  opacity: 0.22;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   BOTTOM SCOREBOARD (Счётчик Мирных / Мафии под таблицей)
   ========================================================================== */
.bottom-scoreboard {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background: rgba(17, 20, 28, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  padding: 10px 14px;
}

.scoreboard-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.score-counts-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.score-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-weight: 700;
  font-size: 13px;
}

.score-pill.peaceful {
  border-left: 4px solid #3b82f6;
}

.score-pill.mafia {
  border-left: 4px solid #ef4444;
}

.score-num {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.win-banner {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.3px;
  animation: pulsePop 0.35s ease;
}

.win-banner.mafia-win {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.45);
}

.win-banner.peaceful-win {
  background: linear-gradient(135deg, #059669, #065f46);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
}

@keyframes pulsePop {
  0% { transform: scale(0.96); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   TIMER SECTION (Раздел Таймер)
   ========================================================================== */
.timer-card {
  text-align: center;
  padding: 18px 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.timer-card.alert-yellow {
  background: var(--color-yellow) !important;
  border-color: #fef08a !important;
  color: var(--color-yellow-text) !important;
  box-shadow: 0 0 30px rgba(250, 204, 21, 0.8);
}

.timer-card.alert-red {
  background: var(--color-red) !important;
  border-color: #fecaca !important;
  color: #ffffff !important;
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.9);
}

.timer-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.preset-btn {
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.preset-btn.active {
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.18);
}

.preset-btn:disabled,
.preset-btn.preset-locked {
  opacity: 0.32;
  cursor: not-allowed;
  pointer-events: none;
}

.timer-digits {
  font-size: 64px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  margin: 8px 0 12px;
}

.timer-status-text {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  min-height: 20px;
}

.timer-controls {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
}

.t-btn {
  height: 46px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s ease;
}

.t-btn:active {
  transform: scale(0.96);
}

.t-btn.primary {
  background: #10b981;
  color: #052e16;
}

.t-btn.primary.running {
  background: #f59e0b;
  color: #111827;
}

.t-btn.plus10 {
  background: #3b82f6;
  color: #ffffff;
}

.t-btn.reset {
  background: rgba(0, 0, 0, 0.35);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   VOTING SECTION (Блок голосования, Перетаскивание и Перестрелка)
   ========================================================================== */
.alive-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.alive-num-btn {
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.alive-num-btn:active {
  transform: scale(0.94);
}

.alive-num-btn.nominated {
  background: var(--accent-primary);
  border-color: #fb7185;
  color: #ffffff;
}

.nom-order-tag {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.9;
}

.voting-rounds-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.vote-round-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.vote-round-box.shootout-box {
  border-color: rgba(250, 204, 21, 0.5);
  background: rgba(250, 204, 21, 0.06);
}

.vote-round-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* Reorder Mode Toggle Button */
.btn-reorder-toggle {
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-reorder-toggle.active {
  background: rgba(250, 204, 21, 0.2);
  border-color: var(--color-yellow);
  color: var(--color-yellow);
}

.vote-table {
  width: 100%;
  border-collapse: collapse;
}

.vote-table th,
.vote-table td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}

.vote-table th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.vote-row-draggable {
  transition: background-color 0.12s ease;
}

.vote-row-draggable.dragging {
  opacity: 0.45;
  background: rgba(59, 130, 246, 0.2);
}

.vote-row-draggable.drag-over {
  border-top: 2px solid var(--color-yellow);
}

.drag-controls-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.drag-handle {
  cursor: grab;
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-yellow);
  font-weight: 900;
  user-select: none;
  touch-action: none;
}

.move-arrow-btn {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.move-arrow-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.vote-player-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Icon-only role badge inside Voting Table */
.vote-player-role-badge {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vote-counter-wrap {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 2px;
}

.vote-step-btn {
  width: 32px;
  height: 30px;
  border: none;
  background: var(--bg-elevated);
  color: var(--text-main);
  border-radius: 6px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.vote-step-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.vote-count-num {
  min-width: 36px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* Auto-calculated remaining hands badge for the last nominated player */
.vote-auto-last-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  border-radius: 8px;
  padding: 4px 10px;
  height: 34px;
}

.vote-auto-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  opacity: 0.85;
}

.remove-nom-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  padding: 4px 8px;
  cursor: pointer;
}

.vote-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-next-vote {
  flex: 1;
  height: 44px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-clear-vote {
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.vote-result-banner {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vote-result-banner.eliminated {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid var(--color-red);
  color: #fecaca;
}

.vote-result-banner.shootout {
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid var(--color-yellow);
  color: #fef08a;
}

/* ==========================================================================
   MODALS (Sessions Drawer & Unified Action Confirmation Modal)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.open {
  display: flex;
}

.modal-backdrop.center-modal {
  align-items: center;
  padding: 16px;
  z-index: 120;
}

.modal-sheet {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-radius: 20px 20px 0 0;
  padding: 18px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.confirm-dialog-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.confirm-role-icon-box {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-dialog-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.confirm-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.btn-confirm-yes {
  height: 44px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--color-success);
  color: #052e16;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.btn-confirm-no {
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-input {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  padding: 0 12px;
  font-size: 14px;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.session-item.current {
  border-color: var(--accent-primary);
  background: rgba(225, 29, 72, 0.12);
}

.session-item-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.session-item-title {
  font-weight: 700;
  font-size: 14px;
}

.session-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.del-session-btn {
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

@media (min-width: 520px) {
  .modal-backdrop {
    align-items: center;
    padding: 16px;
  }
  .modal-sheet {
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
  }
}
