/* Основные стили 2D-прототипа настольной игры */
:root {
  --bg-app: #0f172a;
  --bg-panel: #1e293b;
  --bg-surface: #273549;
  --bg-board: #14221b;
  --bg-cell: #f8fafc;
  --bg-cell-special: #e2e8f0;
  --text-light: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;
  --border-subtle: rgba(148, 163, 184, 0.22);
  --accent: #10b981;
  --accent-hover: #059669;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gold: #fbbf24;
  --radius: 10px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --font-body: 'Athelas', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  --font-heading: 'DIN Condensed', 'DIN Condensed Bold', 'Bahnschrift Condensed', 'Arial Narrow', sans-serif;
}

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

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  background: radial-gradient(circle at top left, #1e293b, #0b1120 70%);
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

h1,
h2,
h3,
h4,
.setup-header h1,
.section-header h2,
.admin-header h3,
.privacy-guard h4,
.modal-title,
.inspector-title,
.center-title,
.map-option-title,
.shop-section-title,
.field-label,
.turn-banner,
.badge-proto,
.move-card-num {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-muted);
}

.kbd {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Кнопки и поля ввода */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, opacity 0.15s ease;
  color: #fff;
  background: #334155;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary { background: var(--accent); color: #052e16; }
.btn-secondary { background: #3b82f6; }
.btn-success { background: #16a34a; }
.btn-danger { background: #dc2626; }
.btn-warning { background: #d97706; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-subtle);
  color: var(--text-light);
}

.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-xs { padding: 4px 9px; font-size: 12px; }
.btn-block { width: 100%; }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: #0f172a;
  color: var(--text-light);
  font-size: 14px;
}

.field-label {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  margin: 6px 0;
}

/* Экран лобби */
#lobby-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
}

.conn-badge {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 95;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
}

.conn-badge.online { color: #34d399; border-color: rgba(52, 211, 153, 0.45); }
.conn-badge.offline { color: #f87171; border-color: rgba(248, 113, 113, 0.5); }
.conn-badge.connecting { color: #fbbf24; border-color: rgba(251, 191, 36, 0.45); }

.lan-share-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
}

.lan-url {
  font-size: 15px;
  font-weight: 800;
  color: #6ee7b7;
  word-break: break-all;
}

.lobby-self-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lobby-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 10px;
  background: var(--bg-surface);
  padding: 10px 12px;
  border-radius: 9px;
}

.lobby-maps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.map-option-btn {
  text-align: left;
  padding: 10px 12px;
  border-radius: 9px;
  border: 2px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.map-option-btn:hover:not(:disabled) {
  border-color: rgba(16, 185, 129, 0.55);
}

.map-option-btn.active {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.15);
}

.map-option-btn:disabled {
  cursor: default;
  opacity: 0.92;
}

.map-option-title {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.1;
}

.map-option-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

.city-fund-pill {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(251, 191, 36, 0.45) !important;
  color: #fde68a;
  font-weight: 700;
}

.player-tag.debuff-tag {
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.shop-section-title {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 12px 0 6px;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.online-dot.on { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.online-dot.off { background: #64748b; }

.waiting-status-pill {
  align-self: center;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 6px 14px;
  border-radius: 999px;
  max-width: 92%;
}

.reclaim-banner {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.mobile-bar {
  display: none;
}

.setup-card {
  width: 100%;
  max-width: 580px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.setup-header {
  text-align: center;
  margin-bottom: 22px;
}

.lobby-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.lobby-top-bar .badge-proto {
  margin-bottom: 0;
}

.theme-segmented {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border-subtle);
}

.theme-opt-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.theme-opt-btn.active {
  background: var(--accent);
  color: #052e16;
}

.theme-opt-btn:hover:not(.active) {
  color: #fff;
}

.lobby-hero-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.lobby-hero-copy {
  flex: 1 1 auto;
}

.anime-lobby-mascot {
  display: none;
}

.theme-pill-btn,
.theme-toggle-inline {
  cursor: pointer;
  color: var(--text-light);
  font-weight: 700;
}

.theme-toggle-inline {
  min-height: 24px !important;
  padding: 2px 8px;
  font-size: 11px;
}

.badge-proto {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  margin-bottom: 8px;
}

.setup-header h1 {
  font-size: 36px;
  line-height: 1.05;
  margin-bottom: 4px;
}

.setup-block {
  margin-bottom: 18px;
}

.count-pills {
  display: flex;
  gap: 8px;
}

.count-pill {
  flex: 1;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-light);
  font-weight: 700;
  cursor: pointer;
}

.count-pill.active {
  background: var(--accent);
  color: #052e16;
  border-color: var(--accent);
}

.setup-players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setup-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  padding: 8px 10px;
  border-radius: 9px;
}

.setup-player-num {
  width: 24px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.setup-color-input {
  width: 36px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.lobby-color-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  position: relative;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.color-swatch:hover:not(:disabled) {
  transform: scale(1.12);
}

.color-swatch.selected {
  border-color: #fff;
  box-shadow: 0 0 0 3px var(--accent), 0 0 10px rgba(255, 255, 255, 0.55);
  transform: scale(1.12);
}

.color-swatch:disabled,
.color-swatch.taken {
  opacity: 0.35;
  cursor: not-allowed;
}

.setup-actions {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

/* Игровой макет: поле слева, панель справа */
#game-screen {
  height: 100vh;
  padding: 12px;
  overflow: hidden;
}

.game-layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 350px);
  gap: 12px;
  height: 100%;
  align-items: center;
}

.board-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 0;
}

/* Квадратное кольцо 11×11 + внешний пояс цветных плашек владельцев (13×13) */
.board {
  width: min(calc(100vh - 24px), calc(100vw - 386px));
  height: min(calc(100vh - 24px), calc(100vw - 386px));
  min-width: 520px;
  min-height: 520px;
  display: grid;
  grid-template-columns: 15px 1.32fr repeat(9, 1fr) 1.32fr 15px;
  grid-template-rows: 15px 1.32fr repeat(9, 1fr) 1.32fr 15px;
  gap: 2px;
  background: #0b1320;
  padding: 4px;
  border-radius: 12px;
  border: 2px solid #334155;
  box-shadow: var(--shadow);
  position: relative;
}

/* Внешняя плашка цвета владельца (вне поля самой филии) */
.owner-plaque {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.14);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
  font-size: 9.5px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  line-height: 1;
  overflow: hidden;
  z-index: 2;
}

.owner-plaque.side-bottom { border-radius: 0 0 5px 5px; }
.owner-plaque.side-top { border-radius: 5px 5px 0 0; }
.owner-plaque.side-left { border-radius: 5px 0 0 5px; }
.owner-plaque.side-right { border-radius: 0 5px 5px 0; }

.owner-plaque.owned {
  border-color: rgba(255, 255, 255, 0.72);
}

.owner-plaque:hover {
  filter: brightness(1.15);
  transform: scale(1.06);
  z-index: 6;
}

/* Поле 13×13 (Мегаполис 48 клеток + внешний пояс плашек 15×15) */
.board.board-13 {
  grid-template-columns: 14px 1.32fr repeat(11, 1fr) 1.32fr 14px;
  grid-template-rows: 14px 1.32fr repeat(11, 1fr) 1.32fr 14px;
}

.board.board-13 .board-center {
  grid-row: 3 / 14;
  grid-column: 3 / 14;
}

.board.board-13 .cell-strip {
  height: 12px;
  font-size: 8px;
}

.board.board-13 .cell-name {
  font-size: clamp(6.8px, 0.56vw, 9px);
}

.board.board-13 .cell-footer {
  font-size: clamp(6.8px, 0.55vw, 8.8px);
}

.board.board-13 .cell-promo-pill {
  font-size: 7px;
  padding: 0 3px;
}

/* Центр поля 9×9 */
.board-center {
  grid-row: 3 / 12;
  grid-column: 3 / 12;
  background: radial-gradient(circle at center, #132a20, #0d1b16);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.center-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.round-pill,
.deck-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 13px;
}

.turn-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.16);
  font-size: 23px;
  line-height: 1.1;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.turn-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.center-info {
  text-align: center;
}

.center-title {
  font-size: 38px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.14);
  margin-bottom: 6px;
}

.center-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.feature-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
}

.feature-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.feature-tag.on {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

/* Клетки поля */
.cell {
  background: var(--bg-cell);
  color: var(--text-dark);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
  transition: transform 0.1s ease, box-shadow 0.12s ease;
}

.cell:hover {
  z-index: 5;
  transform: scale(1.04);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.cell.active-step {
  outline: 3px solid #fbbf24;
  z-index: 6;
}

.cell.preview-path {
  outline: 2px solid #38bdf8;
  box-shadow: inset 0 0 0 2px rgba(56, 189, 248, 0.35), 0 0 10px rgba(56, 189, 248, 0.4);
  z-index: 5;
}

.cell.preview-target {
  outline: 3px solid #22c55e;
  box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.45), 0 0 18px rgba(34, 197, 94, 0.85);
  z-index: 8;
  transform: scale(1.04);
}

@keyframes spotlightPulse {
  0%, 100% {
    box-shadow: 0 0 0 3px #fff, 0 0 20px var(--spotlight-color, #fbbf24);
  }
  50% {
    box-shadow: 0 0 0 6px #fff, 0 0 32px var(--spotlight-color, #fbbf24);
  }
}

.cell.player-spotlight {
  outline: 3px solid #fff;
  z-index: 12;
  transform: scale(1.08);
  animation: spotlightPulse 0.9s ease-in-out infinite;
}

.player-spotlight-banner {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 999px;
  border: 1.5px solid #fff;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
  z-index: 14;
  pointer-events: none;
}

.preview-target-pin {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 11px;
  line-height: 1;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #22c55e;
  border-radius: 4px;
  padding: 1px 3px;
  z-index: 4;
  pointer-events: none;
}

.cell-promo-pill {
  margin-top: 2px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.25;
  background: rgba(245, 158, 11, 0.24);
  border: 1px solid rgba(217, 119, 6, 0.65);
  color: #78350f;
  white-space: nowrap;
}

.cell-promo-pill.lvl-2 {
  background: rgba(234, 88, 12, 0.26);
  border-color: rgba(234, 88, 12, 0.85);
  color: #7c2d12;
}

.cell.cell-special {
  background: var(--bg-cell-special);
}

.cell.cell-corner {
  background: #dbeafe;
}

.cell-strip {
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.cell-level-badge {
  background: rgba(0, 0, 0, 0.4);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 8.5px;
}

.cell-body {
  padding: 2px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  min-height: 0;
}

.cell-icon {
  font-size: 16px;
  line-height: 1.1;
}

.cell-name {
  font-size: clamp(7.5px, 0.66vw, 10px);
  font-weight: 700;
  line-height: 1.08;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: normal;
  overflow-wrap: break-word;
}

.cell-tokens {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  padding: 1px 2px;
}

.cell-tokens:empty {
  display: none;
}

.token {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.token.is-current {
  box-shadow: 0 0 0 2px #fbbf24, 0 2px 5px rgba(0, 0, 0, 0.6);
  transform: scale(1.15);
}

.token.is-spotlight {
  transform: scale(1.6);
  box-shadow: 0 0 0 3px #fff, 0 0 16px #fff;
  z-index: 12;
}

.cell-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 3px;
  font-size: clamp(7.5px, 0.64vw, 9.5px);
  font-weight: 700;
  background: rgba(15, 23, 42, 0.06);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.cell-price {
  white-space: nowrap;
  color: #1e293b;
}

.cell-owner-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

/* Инспектор клетки (внутри центра поля) */
.inspector-popup {
  position: absolute;
  inset: 14px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  z-index: 20;
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.inspector-title {
  font-weight: 700;
  font-size: 22px;
  line-height: 1.1;
}

.inspector-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.45;
}

.inspector-move-bar {
  flex-shrink: 0;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(15, 23, 42, 0.98);
}

.inspector-move-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: #bbf7d0;
}

.inspector-move-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inspector-move-actions .btn {
  flex: 1 1 auto;
}

.promo-warn-box {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 8px 0;
  font-size: 12.5px;
}

.preview-note-box {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 12.5px;
}

/* Правая панель */
.sidebar {
  height: calc(100vh - 24px);
  padding-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.sidebar-section {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.players-section {
  flex: 0 0 auto;
  max-height: 44%;
}

.debuffs-section {
  flex: 0 0 auto;
  max-height: 24%;
}

.log-section {
  flex: 1 1 auto;
  min-height: 110px;
}

.active-debuffs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.debuff-active-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(127, 29, 29, 0.28);
  border: 1px solid rgba(248, 113, 113, 0.35);
  font-size: 12px;
}

.debuff-active-card {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: #fecaca;
  min-width: 0;
}

.debuff-active-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.debuff-active-target {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

.debuff-turns-badge {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

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

.section-header h2 {
  font-size: 19px;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.mini-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-muted);
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
}

.player-card {
  background: var(--bg-surface);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.player-card.clickable {
  cursor: pointer;
}

.player-card.clickable:hover {
  background: #31425b;
  border-color: rgba(148, 163, 184, 0.45);
}

.player-card.spotlighted {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.player-card.active {
  border-color: var(--gold);
  background: #2e3e57;
}

.player-card.bankrupt {
  opacity: 0.45;
  text-decoration: line-through;
}

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

.player-ident {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  min-width: 0;
}

.player-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  flex-shrink: 0;
}

.player-money {
  font-weight: 800;
  color: #6ee7b7;
  white-space: nowrap;
}

.player-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.player-tag {
  background: rgba(15, 23, 42, 0.5);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.luck-pos { color: #34d399; }
.luck-neg { color: #f87171; }

.event-log {
  list-style: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  line-height: 1.35;
}

.log-item {
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.55);
  border-left: 3px solid #475569;
}

.log-item.log-chance {
  background: rgba(245, 158, 11, 0.15);
  border-left-color: #fbbf24;
  color: #fef3c7;
}

.log-item.log-turn {
  background: rgba(56, 189, 248, 0.14);
  border-left-color: #38bdf8;
  color: #e0f2fe;
}

.log-item.log-jail {
  background: rgba(249, 115, 22, 0.16);
  border-left-color: #fb923c;
  color: #ffedd5;
}

.log-item.log-debuff {
  background: rgba(239, 68, 68, 0.16);
  border-left-color: #f87171;
  color: #fee2e2;
}

.log-item.log-duel {
  background: rgba(168, 85, 247, 0.16);
  border-left-color: #c084fc;
  color: #f3e8ff;
}

.log-item.log-promo {
  background: rgba(234, 179, 8, 0.15);
  border-left-color: #f59e0b;
  color: #fef08a;
}

.log-item.log-trade {
  background: rgba(16, 185, 129, 0.16);
  border-left-color: #34d399;
  color: #d1fae5;
}

.log-item.log-event {
  background: rgba(132, 204, 22, 0.14);
  border-left-color: #a3e635;
  color: #ecfccb;
}

.log-item.log-admin {
  background: rgba(148, 163, 184, 0.16);
  border-left-color: #cbd5e1;
  color: #e2e8f0;
}

.log-round {
  font-weight: 700;
  color: #93c5fd;
  margin-right: 5px;
}

/* Плавающие кнопки угла */
.admin-toggle-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 60;
  box-shadow: var(--shadow);
}

.admin-toggle-btn:hover {
  background: var(--bg-surface);
}

.restore-modal-btn {
  align-self: center;
  padding: 10px 20px;
  border-radius: 999px;
  border: 2px solid var(--gold);
  background: #1e293b;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 10;
}

.restore-modal-btn:hover {
  background: #334155;
}

.center-quick-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 8;
}

.mobile-quick-actions {
  display: flex;
  gap: 6px;
}

.outgoing-trade-pill {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.side-modal-backdrop {
  z-index: 54;
}

.move-card-btn.swap-picked {
  border-color: #22d3ee;
  box-shadow: 0 0 0 2px #22d3ee, 0 0 14px rgba(34, 211, 238, 0.45);
  background: rgba(14, 116, 144, 0.45);
}

.card-swap-bar {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.14);
  border: 1px solid rgba(34, 211, 238, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.debuff-inventory-box {
  margin-top: 12px;
  padding: 10px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-subtle);
}

.inventory-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.inv-slot {
  background: var(--bg-surface);
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  min-height: 76px;
}

.inv-slot.empty {
  border: 1px dashed rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.35);
  color: var(--text-muted);
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
}

.incoming-trade-box {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(94vw, 480px);
  background: #0f172a;
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.72);
  z-index: 56;
  font-size: 13px;
}

.trade-sides-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.trade-side-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lan-url-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lan-url-tag {
  font-size: 11px;
  color: var(--text-muted);
}

/* Выдвижная админ-панель */
.admin-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: #0f172a;
  border-left: 1px solid var(--border-subtle);
  z-index: 105;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.55);
}

.admin-drawer.open {
  transform: translateX(0);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-header h3 {
  font-size: 22px;
  line-height: 1.05;
}

.admin-body {
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.admin-controls-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.admin-auth-error {
  font-size: 12.5px;
  font-weight: 700;
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.4);
  padding: 6px 10px;
  border-radius: 6px;
}

.admin-group {
  background: var(--bg-panel);
  padding: 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-status-note {
  font-size: 12px;
  padding: 8px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.admin-footer {
  margin-top: auto;
  padding-top: 8px;
}

/* Модальные окна */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 45;
}

.modal-dialog {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.55);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 700;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.5;
}

.modal-footer {
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* Специальные элементы внутри модальных окон */
.move-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.move-card-btn {
  padding: 16px 10px;
  border-radius: 10px;
  border: 2px solid #475569;
  background: var(--bg-surface);
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.move-card-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #93c5fd;
}

.move-card-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.move-card-btn.rare {
  border-color: var(--gold);
  background: linear-gradient(145deg, #422006, #78350f);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.25);
}

.move-card-num {
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
}

.move-card-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.move-card-dest {
  font-size: 10.5px;
  color: #cbd5e1;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.car-step-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
}

.car-step-dest {
  font-size: 10px;
  font-weight: 600;
  color: #cbd5e1;
}

.move-card-btn.rare .move-card-sub {
  color: #fde68a;
}

.skate-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.35);
  margin-bottom: 10px;
}

.car-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.rent-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}

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

.rent-table tr.current-row {
  background: rgba(16, 185, 129, 0.16);
  font-weight: 700;
}

.info-box {
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
}

.privacy-guard {
  text-align: center;
  padding: 20px 10px;
}

.privacy-guard h4 {
  font-size: 20px;
  margin: 10px 0;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.artifact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}

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

.buzzer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.buzzer-btn {
  padding: 12px;
  border-radius: 8px;
  border: 2px solid var(--border-subtle);
  background: var(--bg-surface);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.buzzer-btn:hover {
  border-color: #fff;
}

.timer-bar {
  height: 8px;
  border-radius: 999px;
  background: #0f172a;
  overflow: hidden;
  margin: 10px 0;
}

.timer-bar-fill {
  height: 100%;
  background: var(--warning);
  transition: width 0.2s linear;
}

.cups-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.cup-btn {
  padding: 18px 10px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.cup-btn:hover {
  border-color: var(--gold);
}

/* Адаптив для планшетов и смартфонов (< 960px) */
@media (max-width: 959px) {
  body {
    overflow-y: auto;
    font-size: 15px;
  }

  .conn-badge {
    top: 6px;
    right: 6px;
    font-size: 10px;
    padding: 3px 8px;
  }

  #lobby-screen {
    padding-top: 42px;
    align-items: flex-start;
  }

  .input,
  select.input {
    font-size: 16px;
  }

  .btn {
    min-height: 42px;
  }

  .btn-xs {
    min-height: 30px;
  }

  .lobby-features-grid,
  .lobby-maps-grid {
    grid-template-columns: 1fr;
  }

  #game-screen {
    height: auto;
    min-height: 100vh;
    padding: 8px;
    overflow: visible;
    padding-bottom: 70px;
  }

  .mobile-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
  }

  .mobile-top-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-right: 80px;
  }

  .mobile-money {
    font-weight: 800;
    color: #6ee7b7;
    font-size: 13.5px;
    white-space: nowrap;
  }

  .mobile-waiting {
    font-size: 12.5px;
    color: #fde68a;
  }

  .mobile-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .mob-tab {
    padding: 8px 6px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-light);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
  }

  .mob-tab.active {
    background: var(--accent);
    color: #052e16;
    border-color: var(--accent);
  }

  .game-layout {
    display: block;
    height: auto;
  }

  .board-stage {
    height: auto;
    width: 100%;
  }

  .board {
    width: min(96vw, 560px);
    height: min(96vw, 560px);
    min-width: 0;
    min-height: 0;
    grid-template-columns: 10px 1.32fr repeat(9, 1fr) 1.32fr 10px;
    grid-template-rows: 10px 1.32fr repeat(9, 1fr) 1.32fr 10px;
    padding: 2px;
    gap: 1px;
  }

  .board.board-13 {
    grid-template-columns: 9px 1.32fr repeat(11, 1fr) 1.32fr 9px;
    grid-template-rows: 9px 1.32fr repeat(11, 1fr) 1.32fr 9px;
  }

  .board.board-13 .cell-strip {
    height: 9px;
    font-size: 6px;
  }

  .board.board-13 .cell-name {
    font-size: 6px;
  }

  .board.board-13 .cell-footer {
    font-size: 5.5px;
  }

  .owner-plaque {
    font-size: 7px;
  }

  .board-center {
    padding: 8px;
  }

  .center-title {
    font-size: 21px;
  }

  .turn-banner {
    padding: 6px 10px;
    font-size: 17px;
  }

  .waiting-status-pill {
    font-size: 11px;
    padding: 4px 8px;
  }

  .center-hint,
  .feature-badges {
    display: none;
  }

  .cell-strip {
    height: 11px;
    font-size: 7px;
  }

  .cell-name {
    font-size: 7px;
    -webkit-line-clamp: 2;
  }

  .cell-footer {
    font-size: 6.5px;
    padding: 1px 2px;
  }

  .token {
    width: 11px;
    height: 11px;
    font-size: 7.5px;
  }

  .sidebar {
    height: auto;
    padding-top: 0;
    margin-top: 8px;
  }

  .players-section,
  .debuffs-section,
  .log-section {
    max-height: none;
  }

  /* На мобильном показываем выбранный таб */
  .game-layout[data-mobile-tab="board"] .sidebar {
    display: none;
  }

  .game-layout[data-mobile-tab="players"] .board-stage,
  .game-layout[data-mobile-tab="players"] .log-section {
    display: none;
  }

  .game-layout[data-mobile-tab="log"] .board-stage,
  .game-layout[data-mobile-tab="log"] .players-section,
  .game-layout[data-mobile-tab="log"] .debuffs-section {
    display: none;
  }

  .modal-dialog {
    max-height: 92vh;
  }

  .inspector-popup {
    inset: 4px;
    padding: 8px;
    border-radius: 10px;
  }

  .inspector-title {
    font-size: 18px;
  }

  .inspector-body {
    font-size: 11.5px;
  }

  .inspector-move-bar {
    margin-top: 6px;
    padding-top: 6px;
  }

  .inspector-move-summary {
    font-size: 11px;
  }

  .inspector-move-actions .btn {
    min-height: 34px;
    font-size: 12px;
    padding: 6px 8px;
  }

  .cell-promo-pill {
    font-size: 6px;
    padding: 0 2px;
    margin-top: 1px;
  }

  .preview-target-pin {
    font-size: 8px;
    padding: 0 2px;
  }

  .car-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .inventory-slots-grid,
  .trade-sides-grid {
    grid-template-columns: 1fr;
  }

  .center-quick-actions {
    display: none;
  }

  .buzzer-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Аниме-тема (активируется классом body.theme-anime)
   ========================================================= */
body.theme-anime {
  --bg-app: #140b24;
  --bg-panel: rgba(22, 12, 38, 0.90);
  --bg-surface: rgba(42, 23, 68, 0.90);
  --bg-cell: #fff9fc;
  --bg-cell-special: #f4ebff;
  --text-light: #fdf4ff;
  --text-muted: #ddd0f0;
  --text-dark: #190d33;
  --border-subtle: rgba(244, 114, 182, 0.34);
  --accent: #f472b6;
  --accent-hover: #ec4899;
  --shadow: 0 20px 50px rgba(8, 3, 20, 0.65);

  background-color: #140b24;
  background-image:
    linear-gradient(135deg, rgba(16, 8, 34, 0.72), rgba(32, 12, 46, 0.66)),
    url('assets/anime/bg-screen.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

body.theme-anime .btn-primary {
  background: linear-gradient(135deg, #f472b6, #db2777);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
}

body.theme-anime .btn-secondary {
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: #fff;
}

body.theme-anime .btn-ghost {
  background: rgba(34, 18, 58, 0.85);
  border-color: rgba(244, 114, 182, 0.38);
  color: #fdf4ff;
}

body.theme-anime .input {
  background: rgba(16, 9, 30, 0.92);
  border-color: rgba(244, 114, 182, 0.4);
  color: #fff;
}

body.theme-anime .theme-segmented {
  background: rgba(16, 8, 32, 0.85);
  border-color: rgba(244, 114, 182, 0.45);
}

body.theme-anime .theme-opt-btn.active {
  background: linear-gradient(135deg, #f472b6, #db2777);
  color: #fff;
}

/* Лобби в аниме-стиле */
body.theme-anime .setup-card {
  background: rgba(20, 11, 38, 0.88);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(244, 114, 182, 0.45);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 32px rgba(236, 72, 153, 0.18);
}

body.theme-anime .setup-header {
  text-align: left;
}

body.theme-anime .badge-proto {
  background: rgba(244, 114, 182, 0.22);
  color: #fbcfe8;
  border: 1px solid rgba(244, 114, 182, 0.45);
}

body.theme-anime .anime-lobby-mascot {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(244, 114, 182, 0.72);
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.32);
  background: #1a0f33;
}

body.theme-anime .anime-lobby-mascot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}

body.theme-anime .lan-share-box {
  background: rgba(244, 114, 182, 0.14);
  border-color: rgba(244, 114, 182, 0.42);
}

body.theme-anime .lan-url {
  color: #fbcfe8;
}

body.theme-anime .map-option-btn.active {
  border-color: #f472b6;
  background: rgba(244, 114, 182, 0.2);
}

/* Поле и фон за картой + центр поля */
body.theme-anime .board {
  background: rgba(19, 10, 34, 0.94);
  border: 2px solid rgba(244, 114, 182, 0.56);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.75), 0 0 34px rgba(236, 72, 153, 0.22);
}

body.theme-anime .board-center {
  background-color: #160c2c;
  background-image:
    linear-gradient(180deg, rgba(16, 8, 32, 0.74) 0%, rgba(18, 10, 36, 0.40) 48%, rgba(16, 8, 32, 0.80) 100%),
    url('assets/anime/board-center.jpg');
  background-size: cover;
  background-position: center 22%;
  border: 1px solid rgba(244, 114, 182, 0.48);
  box-shadow: inset 0 0 36px rgba(14, 6, 28, 0.58);
}

body.theme-anime .round-pill,
body.theme-anime .deck-pill,
body.theme-anime .turn-banner,
body.theme-anime .waiting-status-pill,
body.theme-anime .restore-modal-btn,
body.theme-anime .outgoing-trade-pill {
  background: rgba(16, 9, 32, 0.88);
  backdrop-filter: blur(8px);
  border-color: rgba(244, 114, 182, 0.48);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

body.theme-anime .center-info {
  align-self: center;
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(15, 8, 30, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(244, 114, 182, 0.34);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.48);
}

body.theme-anime .center-title {
  color: #fce7f3;
  text-shadow: 0 2px 10px rgba(236, 72, 153, 0.55);
}

body.theme-anime .center-hint {
  color: #ede9fe;
}

body.theme-anime .feature-tag {
  background: rgba(42, 23, 68, 0.85);
  color: #e9d5ff;
}

body.theme-anime .feature-tag.on {
  background: rgba(244, 114, 182, 0.25);
  color: #fbcfe8;
  border: 1px solid rgba(244, 114, 182, 0.45);
}

body.theme-anime .cell {
  border-radius: 5px;
}

body.theme-anime .cell.cell-corner {
  background: #ede9fe;
}

body.theme-anime .cell-footer {
  background: rgba(91, 33, 182, 0.08);
}

/* Окна: модалки, инспектор, сайдбар, трейд, админка */
body.theme-anime .modal-backdrop {
  background: rgba(10, 4, 22, 0.76);
  backdrop-filter: blur(5px);
}

body.theme-anime .modal-dialog {
  background: rgba(22, 12, 38, 0.96);
  border: 1.5px solid rgba(244, 114, 182, 0.52);
  box-shadow: 0 26px 68px rgba(0, 0, 0, 0.82), 0 0 30px rgba(236, 72, 153, 0.2);
}

body.theme-anime .modal-header {
  min-height: 60px;
  background-color: #190d30;
  background-image:
    linear-gradient(90deg, rgba(20, 10, 36, 0.96) 28%, rgba(26, 13, 46, 0.78) 70%, rgba(28, 14, 48, 0.48) 100%),
    url('assets/anime/modal-girl.jpg');
  background-size: cover;
  background-position: right 22%;
  border-bottom: 1.5px solid rgba(244, 114, 182, 0.38);
}

body.theme-anime .modal-title,
body.theme-anime .inspector-title {
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
}

body.theme-anime .modal-body {
  background: rgba(20, 11, 36, 0.95);
  color: #faf5ff;
}

body.theme-anime .modal-footer {
  background: rgba(15, 8, 28, 0.96);
  border-top: 1px solid rgba(244, 114, 182, 0.28);
}

body.theme-anime .inspector-popup {
  background: rgba(19, 10, 34, 0.96);
  border: 1.5px solid rgba(244, 114, 182, 0.52);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.85);
}

body.theme-anime .inspector-header {
  margin: -12px -14px 8px;
  padding: 12px 14px;
  background-color: #1b0e33;
  background-image:
    linear-gradient(90deg, rgba(19, 10, 34, 0.96) 35%, rgba(28, 14, 48, 0.72) 82%, rgba(28, 14, 48, 0.45) 100%),
    url('assets/anime/modal-girl.jpg');
  background-size: cover;
  background-position: right 25%;
  border-bottom: 1.5px solid rgba(244, 114, 182, 0.35);
}

body.theme-anime .inspector-move-bar {
  background: rgba(19, 10, 34, 0.98);
  border-top-color: rgba(244, 114, 182, 0.34);
}

body.theme-anime .sidebar-section,
body.theme-anime .mobile-bar,
body.theme-anime .incoming-trade-box,
body.theme-anime .admin-drawer {
  background: rgba(20, 11, 36, 0.90);
  backdrop-filter: blur(10px);
  border-color: rgba(244, 114, 182, 0.38);
}

body.theme-anime .info-box,
body.theme-anime .debuff-inventory-box,
body.theme-anime .trade-side-card,
body.theme-anime .artifact-card {
  background: rgba(34, 18, 56, 0.92);
  border: 1px solid rgba(244, 114, 182, 0.30);
}

/* Дизайн карточек: карты хода, редкие карты, авто, игроки, инвентарь */
body.theme-anime .move-card-btn {
  min-height: 128px;
  padding: 10px 8px;
  justify-content: flex-end;
  border-radius: 14px;
  border: 2px solid rgba(244, 114, 182, 0.62);
  background-color: #1c1032;
  background-size: cover;
  background-position: center 14%;
  background-image:
    linear-gradient(180deg, rgba(18, 9, 32, 0.08) 0%, rgba(18, 9, 32, 0.70) 44%, rgba(14, 7, 26, 0.96) 80%),
    url('assets/anime/cards/card-1.jpg');
  box-shadow: 0 8px 22px rgba(10, 4, 24, 0.55);
}

/* Индивидуальная картинка для каждой карточки хода (1–6, 8, 10, 12) */
body.theme-anime .move-card-btn[data-card-value="1"] {
  background-image: linear-gradient(180deg, rgba(16, 8, 30, 0.14) 0%, rgba(16, 8, 30, 0.78) 44%, rgba(14, 7, 26, 0.97) 76%), url('assets/anime/cards/card-1.jpg');
}
body.theme-anime .move-card-btn[data-card-value="2"] {
  background-image: linear-gradient(180deg, rgba(16, 8, 30, 0.14) 0%, rgba(16, 8, 30, 0.78) 44%, rgba(14, 7, 26, 0.97) 76%), url('assets/anime/cards/card-2.jpg');
}
body.theme-anime .move-card-btn[data-card-value="3"] {
  background-image: linear-gradient(180deg, rgba(16, 8, 30, 0.14) 0%, rgba(16, 8, 30, 0.78) 44%, rgba(14, 7, 26, 0.97) 76%), url('assets/anime/cards/card-3.jpg');
}
body.theme-anime .move-card-btn[data-card-value="4"] {
  background-image: linear-gradient(180deg, rgba(16, 8, 30, 0.14) 0%, rgba(16, 8, 30, 0.78) 44%, rgba(14, 7, 26, 0.97) 76%), url('assets/anime/cards/card-4.jpg');
}
body.theme-anime .move-card-btn[data-card-value="5"] {
  background-image: linear-gradient(180deg, rgba(16, 8, 30, 0.14) 0%, rgba(16, 8, 30, 0.78) 44%, rgba(14, 7, 26, 0.97) 76%), url('assets/anime/cards/card-5.jpg');
}
body.theme-anime .move-card-btn[data-card-value="6"] {
  background-image: linear-gradient(180deg, rgba(16, 8, 30, 0.14) 0%, rgba(16, 8, 30, 0.78) 44%, rgba(14, 7, 26, 0.97) 76%), url('assets/anime/cards/card-6.jpg');
}

body.theme-anime .move-card-btn.rare {
  border-color: #fcd34d;
  background-image:
    linear-gradient(180deg, rgba(38, 16, 10, 0.14) 0%, rgba(36, 14, 14, 0.78) 44%, rgba(26, 9, 14, 0.97) 76%),
    url('assets/anime/cards/card-12.jpg');
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.42), inset 0 0 0 1px rgba(254, 240, 138, 0.45);
}

body.theme-anime .move-card-btn[data-card-value="8"] {
  background-image: linear-gradient(180deg, rgba(38, 16, 10, 0.14) 0%, rgba(36, 14, 14, 0.78) 44%, rgba(26, 9, 14, 0.97) 76%), url('assets/anime/cards/card-8.jpg');
}
body.theme-anime .move-card-btn[data-card-value="10"] {
  background-image: linear-gradient(180deg, rgba(38, 16, 10, 0.14) 0%, rgba(36, 14, 14, 0.78) 44%, rgba(26, 9, 14, 0.97) 76%), url('assets/anime/cards/card-10.jpg');
}
body.theme-anime .move-card-btn[data-card-value="12"] {
  background-image: linear-gradient(180deg, rgba(38, 16, 10, 0.14) 0%, rgba(36, 14, 14, 0.78) 44%, rgba(26, 9, 14, 0.97) 76%), url('assets/anime/cards/card-12.jpg');
}

body.theme-anime .move-card-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: #fbcfe8;
  box-shadow: 0 10px 26px rgba(244, 114, 182, 0.42);
}

body.theme-anime .move-card-num {
  font-size: 34px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 10px #000, 0 0 4px rgba(0, 0, 0, 0.95), 0 0 12px rgba(244, 114, 182, 0.6);
}

body.theme-anime .move-card-btn.rare .move-card-num {
  color: #fde047;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 0 12px rgba(251, 191, 36, 0.6);
}

body.theme-anime .move-card-sub {
  color: #fbcfe8;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

body.theme-anime .move-card-btn.rare .move-card-sub {
  color: #fef08a;
}

body.theme-anime .move-card-dest {
  color: #fff;
  background: rgba(14, 7, 26, 0.80);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

body.theme-anime .car-step-btn {
  background: rgba(38, 20, 62, 0.94);
  border-color: rgba(244, 114, 182, 0.42);
  color: #fff;
}

body.theme-anime .car-step-dest {
  color: #f5d0fe;
}

body.theme-anime .inv-slot {
  background: rgba(38, 18, 58, 0.94);
  border-color: rgba(244, 114, 182, 0.48);
}

body.theme-anime .inv-slot.empty {
  background: rgba(20, 10, 36, 0.65);
  border-color: rgba(244, 114, 182, 0.30);
}

body.theme-anime .player-card {
  background: rgba(34, 19, 56, 0.92);
  border-color: rgba(244, 114, 182, 0.25);
}

body.theme-anime .player-card.active {
  background: rgba(54, 24, 78, 0.95);
  border-color: #fcd34d;
}

body.theme-anime .player-ident::before {
  content: '';
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid rgba(244, 114, 182, 0.72);
  background-size: cover;
  background-position: center 15%;
  flex-shrink: 0;
}

body.theme-anime .player-card:nth-child(6n+1) .player-ident::before { background-image: url('assets/anime/lobby-girl.jpg'); }
body.theme-anime .player-card:nth-child(6n+2) .player-ident::before { background-image: url('assets/anime/card-1.jpg'); }
body.theme-anime .player-card:nth-child(6n+3) .player-ident::before { background-image: url('assets/anime/card-2.jpg'); }
body.theme-anime .player-card:nth-child(6n+4) .player-ident::before { background-image: url('assets/anime/card-3.jpg'); }
body.theme-anime .player-card:nth-child(6n+5) .player-ident::before { background-image: url('assets/anime/card-rare.jpg'); }
body.theme-anime .player-card:nth-child(6n+6) .player-ident::before { background-image: url('assets/anime/board-center.jpg'); }

body.theme-anime .log-item {
  background: rgba(24, 13, 42, 0.85);
}

body.theme-anime * {
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 114, 182, 0.55) rgba(20, 11, 36, 0.5);
}

body.theme-anime *::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

body.theme-anime *::-webkit-scrollbar-track {
  background: rgba(20, 11, 36, 0.55);
  border-radius: 999px;
}

body.theme-anime *::-webkit-scrollbar-thumb {
  background: rgba(244, 114, 182, 0.52);
  border-radius: 999px;
}

body.theme-anime *::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 114, 182, 0.82);
}

@media (max-width: 959px) {
  body.theme-anime .anime-lobby-mascot {
    width: 72px;
    height: 72px;
  }

  body.theme-anime .move-card-btn {
    min-height: 110px;
  }

  body.theme-anime .center-info {
    display: block;
    padding: 4px 8px;
  }

  body.theme-anime .center-title {
    font-size: 13px;
    margin-bottom: 0;
  }
}
