:root {
  --bg-color: #0c0f17;
  --bg-card: rgba(22, 28, 44, 0.85);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --primary: #e63946;
  --primary-glow: rgba(230, 57, 70, 0.4);
  --accent: #4cc9f0;
  --accent-glow: rgba(76, 201, 240, 0.35);
  --gold: #f4a261;
  --text-main: #f8f9fa;
  --text-muted: #94a3b8;
  --success: #2ec4b6;
  --danger: #e63946;
  --radius: 16px;
  --radius-sm: 10px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
}

html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-color);
  color: var(--text-main);
  touch-action: manipulation;
}

body {
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(230, 57, 70, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(76, 201, 240, 0.07) 0%, transparent 40%);
  background-attachment: fixed;
}

#app-container {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  padding-top: max(12px, env(safe-area-inset-top, 12px));
  padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
  position: relative;
  overflow-x: hidden;
  transition: max-width 0.25s ease, padding 0.25s ease;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bg-card-border);
  margin-bottom: 14px;
  width: 100%;
}

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

.brand-icon {
  font-size: 20px;
  background: rgba(230, 57, 70, 0.15);
  border: 1px solid var(--primary-glow);
  border-radius: 10px;
  padding: 5px 8px;
  box-shadow: 0 0 12px var(--primary-glow);
  flex-shrink: 0;
}

.brand-title {
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.brand-sub {
  font-size: 10px;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--bg-card-border);
  font-size: 12px;
  font-weight: 550;
  max-width: 48%;
  flex-shrink: 0;
}

#user-name-display {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.user-avatar-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  flex-shrink: 0;
}

/* Screens */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  width: 100%;
  animation: fadeIn 0.22s ease-out forwards;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards & Glassmorphism */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 16px 14px;
  margin-bottom: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  width: 100%;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* Games Slider / List */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.games-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  width: 100%;
}

.game-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.game-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 14px var(--primary-glow);
  background: rgba(30, 38, 60, 0.85);
}

.game-item.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.game-item-icon {
  font-size: 24px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.game-item-info {
  flex: 1;
  min-width: 0;
}

.game-item-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.game-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

.badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-active {
  background: rgba(46, 196, 182, 0.2);
  color: var(--success);
  border: 1px solid var(--success);
}

.badge-soon {
  background: rgba(244, 162, 97, 0.2);
  color: var(--gold);
  border: 1px solid var(--gold);
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  font-size: clamp(13px, 3.8vw, 15px);
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  text-align: center;
  word-break: break-word;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #e63946, #c1121f);
  color: #fff;
  box-shadow: 0 4px 18px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-success {
  background: linear-gradient(135deg, #2ec4b6, #0e9f6e);
  color: #fff;
  box-shadow: 0 4px 18px rgba(46, 196, 182, 0.3);
}

.btn-accent {
  background: linear-gradient(135deg, #4cc9f0, #4361ee);
  color: #fff;
  box-shadow: 0 4px 18px var(--accent-glow);
}

/* Inputs */
.input-group {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.btn-join {
  width: auto;
  min-width: 85px;
  flex-shrink: 0;
  padding: 0 16px;
}

.input-field {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(12, 15, 23, 0.85);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #fff;
  font-size: 15px;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: bold;
  text-align: center;
  min-height: 46px;
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Room Code Banner */
.room-code-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(12, 15, 23, 0.75);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--accent);
  margin-bottom: 14px;
  width: 100%;
  cursor: pointer;
}

.room-code-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.room-code-value {
  font-size: clamp(26px, 8vw, 34px);
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
  line-height: 1.2;
}

.room-code-copy-hint {
  font-size: 10px;
  color: var(--gold);
  margin-top: 2px;
}

/* Player List */
.player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
  max-height: 220px;
  overflow-y: auto;
  width: 100%;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(12, 15, 23, 0.65);
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-card-border);
  width: 100%;
}

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

.player-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #252e48;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}

.player-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.host-badge {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

/* Counter Controls */
.counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg-card-border);
  width: 100%;
}

.counter-row:last-child {
  border-bottom: none;
}

.counter-label {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 550;
}

.counter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid var(--bg-card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-circle:active {
  transform: scale(0.9);
  background: var(--primary);
}

.counter-value {
  font-size: 15px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}

/* Game / In-Round Screen */
.timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

.timer-digits {
  font-size: clamp(30px, 9vw, 36px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  text-shadow: 0 0 14px var(--accent-glow);
  line-height: 1.1;
}

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

/* 3D Flip Card for Secret Hero */
.card-flip-wrapper {
  perspective: 1000px;
  width: 100%;
  height: clamp(250px, 45vh, 310px);
  margin-bottom: 14px;
  cursor: pointer;
}

.card-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.card-flip-wrapper.flipped .card-flip-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  border: 2px solid var(--bg-card-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.card-front {
  background: linear-gradient(145deg, #182035, #0f1422);
  border-color: rgba(76, 201, 240, 0.3);
}

.card-back {
  background: linear-gradient(145deg, #1c2640, #131a2c);
  transform: rotateY(180deg);
  border-color: var(--primary);
  overflow: hidden;
}

.hero-img-box {
  width: 100%;
  flex: 1;
  min-height: 120px;
  max-height: 180px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
}

.hero-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-name {
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  line-height: 1.2;
}

.hero-role-tag {
  font-size: 12px;
  color: var(--success);
  margin-top: 2px;
  font-weight: 600;
}

/* Spy Card Styling */
.spy-card {
  border-color: var(--primary);
  background: linear-gradient(145deg, #2b1115, #140b0d);
  box-shadow: 0 0 25px var(--primary-glow);
}

.spy-icon {
  font-size: clamp(44px, 12vw, 56px);
  margin-bottom: 8px;
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 12px var(--primary)); }
  100% { transform: scale(1); }
}

.spy-title {
  font-size: clamp(20px, 6vw, 24px);
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 2px;
}

.spy-desc {
  font-size: 12px;
  color: #ffccd5;
  text-align: center;
  line-height: 1.4;
  margin-top: 6px;
  padding: 0 6px;
}

.hint-box {
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 10px;
  width: 100%;
}

/* Results Screen */
.results-hero-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
  width: 100%;
}

.results-hero-img {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
  margin-bottom: 8px;
}

.spies-list-box {
  background: rgba(230, 57, 70, 0.1);
  border: 1px solid var(--primary-glow);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 16px;
  text-align: center;
  width: 100%;
}

.spies-names {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  margin-top: 4px;
  word-break: break-word;
}

/* Toast Notification */
#toast {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 20px));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(22, 28, 44, 0.95);
  border: 1px solid var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  max-width: 90%;
  text-align: center;
  white-space: nowrap;
}

#toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Media Queries for Small Screens (< 360px) */
@media (max-width: 360px) {
  #app-container {
    padding: 10px;
  }

  .input-group {
    flex-direction: column;
  }

  .input-group .btn {
    width: 100%;
  }

  .card {
    padding: 12px 10px;
  }

  .btn {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Mafia Specific Styles */
.mafia-phase-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
  text-align: center;
}

.mafia-phase-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  background: rgba(76, 201, 240, 0.15);
  border: 1px solid var(--accent-glow);
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 4px;
}

.mafia-phase-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.card-face.team-radiant {
  border-color: var(--success);
  box-shadow: 0 0 20px rgba(46, 196, 182, 0.35);
}

.card-face.team-dire {
  border-color: var(--danger);
  box-shadow: 0 0 20px var(--primary-glow);
}

.card-face.team-neutral {
  border-color: #a855f7;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.35);
}

.mafia-log-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #cbd5e1;
  max-height: 120px;
  overflow-y: auto;
  padding: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
}

.mafia-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.mafia-target-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 52px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  word-break: break-word;
}

.mafia-target-btn:active, .mafia-target-btn.selected {
  border-color: var(--accent);
  background: rgba(76, 201, 240, 0.2);
  box-shadow: 0 0 10px var(--accent-glow);
}

.player-item.dead {
  opacity: 0.45;
  background: rgba(255, 0, 0, 0.08);
  border-color: rgba(230, 57, 70, 0.3);
}

.player-item.dead .player-name {
  text-decoration: line-through;
}

.team-badge-dire {
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

.team-badge-radiant {
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
}

/* Rules & Guidelines Styling */
.rules-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-main);
}

.rules-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
}

.rules-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  background: rgba(12, 15, 23, 0.5);
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-card-border);
}

.rules-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
}

.rules-desc {
  flex: 1;
  min-width: 0;
}

.rules-desc strong {
  color: #fff;
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.rules-desc p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Bunker Specific Styles */
.bunker-traits-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bunker-trait-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(12, 15, 23, 0.65);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
}

.bunker-trait-item.revealed {
  border-color: rgba(76, 201, 240, 0.35);
  background: rgba(22, 33, 56, 0.6);
}

.bunker-trait-info {
  flex: 1;
  min-width: 0;
}

.bunker-trait-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.bunker-trait-val {
  font-size: 13px;
  color: var(--text-main);
  margin-top: 2px;
  word-break: break-word;
}

.btn-reveal-trait {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  background: rgba(76, 201, 240, 0.15);
  border: 1px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-reveal-trait:active {
  background: var(--accent);
  color: #fff;
}

.bunker-players-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bunker-candidate-card {
  padding: 10px 12px;
  background: rgba(12, 15, 23, 0.6);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
}

.bunker-candidate-card.dead {
  opacity: 0.45;
  background: rgba(230, 57, 70, 0.08);
  border-color: rgba(230, 57, 70, 0.3);
}

.bunker-candidate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.bunker-candidate-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.candidate-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.candidate-tag.locked {
  color: var(--text-muted);
  opacity: 0.6;
}

.candidate-tag.highlight {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(244, 162, 97, 0.12);
}

/* ==========================================================================
   Рулетка 6 слотов Dota 2
   ========================================================================== */
.roulette-header-card {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.85), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
  margin-bottom: 12px;
}

.roulette-slots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

@media (min-width: 400px) {
  .roulette-slots-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.roulette-slot-card {
  position: relative;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 105px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.roulette-slot-card:hover {
  border-color: var(--gold);
  background: rgba(30, 41, 59, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 162, 97, 0.2);
}

.roulette-slot-card.locked {
  border-color: #3b82f6;
  background: rgba(30, 58, 138, 0.25);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.roulette-slot-card.rolling {
  animation: itemSpin 0.4s ease-out;
}

@keyframes itemSpin {
  0% { transform: scale(0.92) rotate(-3deg); opacity: 0.5; }
  50% { transform: scale(1.04) rotate(2deg); opacity: 0.9; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.roulette-slot-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.roulette-slot-icon {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.roulette-slot-actions {
  display: flex;
  gap: 4px;
}

.roulette-action-btn {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.roulette-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.roulette-action-btn.active {
  background: #3b82f6;
  border-color: #60a5fa;
  color: #fff;
}

.roulette-slot-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.roulette-slot-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-top: 4px;
}

.roulette-gold-badge {
  color: var(--gold);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 2px;
}

.roulette-category-badge {
  font-size: 9px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Карточки других игроков */
.roulette-player-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.roulette-player-card.is-me {
  border-color: rgba(76, 201, 240, 0.4);
  background: rgba(76, 201, 240, 0.05);
}

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

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

@media (min-width: 520px) {
  .roulette-mini-slots-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.roulette-mini-slot {
  background: rgba(10, 14, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 66px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.roulette-mini-slot:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: rgba(30, 41, 59, 0.9);
}

.roulette-mini-slot.is-locked {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.18);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.3);
}

.roulette-mini-slot.is-boot {
  border-color: rgba(244, 162, 97, 0.4);
}

.roulette-mini-slot-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  line-height: 1;
}

.roulette-mini-icon {
  font-size: 18px;
  line-height: 1.1;
  margin: 1px 0;
}

.roulette-mini-name {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  width: 100%;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.roulette-mini-gold {
  font-size: 9px;
  font-weight: 800;
  color: var(--gold);
  margin-top: 2px;
}

/* ==============================================================================
   DESKTOP & TABLET RESPONSIVE ADAPTIVITY (PC / WIDE SCREENS)
   ============================================================================== */

/* Sleek scrollbars for PC */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(12, 15, 23, 0.7);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Tablet (>= 640px) */
@media (min-width: 640px) {
  #app-container {
    max-width: 620px;
    padding: 16px 20px;
  }

  .roulette-mini-slots-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Desktop & Laptop (>= 768px) */
@media (min-width: 768px) {
  #app-container {
    max-width: 920px;
    padding: 20px 28px;
  }

  /* Header */
  .app-header {
    padding-bottom: 16px;
    margin-bottom: 22px;
  }
  .brand {
    gap: 12px;
  }
  .brand-icon {
    font-size: 26px;
    padding: 8px 12px;
    border-radius: 12px;
  }
  .brand-title {
    font-size: 20px;
  }
  .brand-sub {
    font-size: 11px;
    letter-spacing: 1px;
  }
  .user-badge {
    padding: 6px 14px;
    font-size: 13px;
    max-width: none;
    gap: 8px;
  }
  #user-name-display {
    max-width: 200px;
    font-size: 13px;
  }
  .user-avatar-circle {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  /* Home Screen (Game selection grid & Fast start) */
  #screen-home .games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .game-item {
    padding: 14px 16px;
  }
  .game-item-icon {
    width: 48px;
    height: 48px;
    font-size: 28px;
  }
  .game-item-title {
    font-size: 16px;
  }
  .game-item-desc {
    font-size: 12px;
  }

  /* Lobby Screen */
  .room-code-banner {
    padding: 18px 24px;
    margin-bottom: 20px;
  }
  .room-code-value {
    font-size: 34px;
    letter-spacing: 8px;
  }
  .player-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
  }
  .player-item {
    margin-bottom: 0;
    padding: 12px 14px;
  }

  /* Roulette Screen (6 slots) */
  .roulette-hero-agh-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
  }
  .roulette-hero-agh-grid .card {
    margin-bottom: 0 !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* My 6 slots HUD */
  .roulette-slots-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
  }
  .roulette-slot-card {
    min-height: 125px;
    padding: 12px 10px;
  }
  .roulette-slot-icon {
    font-size: 32px;
  }
  .roulette-slot-name {
    font-size: 13px;
    margin-bottom: 6px;
  }
  .roulette-gold-badge {
    font-size: 12px;
  }

  /* Connected Players builds grid */
  #roulette-other-players-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .roulette-player-card {
    margin-bottom: 0;
    padding: 12px 14px;
  }
  .roulette-mini-slots-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
  }
  .roulette-mini-slot {
    min-height: 72px;
    padding: 8px 6px;
  }
  .roulette-mini-icon {
    font-size: 20px;
  }
  .roulette-mini-name {
    font-size: 11px;
  }

  /* Bunker Screen */
  .bunker-traits-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .bunker-players-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .bunker-candidate-card {
    margin-bottom: 0;
  }
  #bunker-enemy-roster {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
  }

  /* Mafia Screen */
  .mafia-action-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .mafia-target-btn {
    min-height: 64px;
    font-size: 14px;
  }
  .mafia-log-box {
    max-height: 180px;
    font-size: 13px;
  }

  /* Spy / Civilian Screen */
  .card-flip-wrapper {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    height: 380px;
  }
  .timer-digits {
    font-size: 48px;
  }

  /* Modals */
  .modal-overlay {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  #modal-roulette-item .card, #modal-tg-login .card {
    max-width: 460px !important;
    padding: 24px;
  }
}

/* Large Desktop / Full HD (>= 1150px) */
@media (min-width: 1150px) {
  #app-container {
    max-width: 1180px;
    padding: 24px 36px;
  }

  /* 4-column game modes in Lobby */
  #screen-home .games-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* 3-column other players in Roulette */
  #roulette-other-players-list {
    grid-template-columns: repeat(3, 1fr);
  }

  /* 3-column candidates in Bunker */
  .bunker-players-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

