/* ============================================
   PlayForFun — ультрасовременный дизайн
   Тема: онлайн-игры с друзьями
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

:root {
  --bg-deep: #08080c;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(0, 245, 212, 0.35);
  --accent: #00f5d4;
  --accent-dim: rgba(0, 245, 212, 0.15);
  --accent-gold: #ffd700;
  --accent-gold-dark: #e6c200;
  --success-green: #00c853;
  --error-red: #ff5252;
  --text-primary: #f0f0f5;
  --text-white: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --glow-cyan: 0 0 40px rgba(0, 245, 212, 0.12);
  --glow-gold: 0 0 30px rgba(255, 215, 0, 0.15);
  --shadow-sm: 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 48px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.45);
  --transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
}

[data-theme="light"] {
  --bg-deep: #f5f5f8;
  --bg-card: rgba(0,0,0,0.04);
  --bg-card-hover: rgba(0,0,0,0.08);
  --border-subtle: rgba(0,0,0,0.08);
  --text-primary: #1a1a2e;
  --text-muted: rgba(0,0,0,0.55);
}
[data-theme="light"] body::before {
  background: radial-gradient(ellipse 120% 80% at 50% -20%, rgba(0,245,212,0.08) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-deep) 0%, #e8e8f0 100%);
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(0, 245, 212, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 80% 60% at 100% 50%, rgba(120, 80, 255, 0.04) 0%, transparent 45%),
    linear-gradient(180deg, var(--bg-deep) 0%, #0c0c12 100%);
  z-index: -1;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: -1;
  opacity: 0.5;
  pointer-events: none;
}

/* ============================================
   КОНТЕЙНЕР И ХЕДЕР
   ============================================ */
   
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 56px 20px 40px;
  position: relative;
  z-index: 10;
}

.header {
  text-align: center;
  padding: 56px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 48px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
  z-index: 0;
}

.header-content {
  position: relative;
  z-index: 1;
}

.header h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInDown 0.6s ease-out;
}

.header-tagline,
.header p {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.6;
  font-weight: 400;
  animation: fadeInUp 0.6s ease-out 0.15s both;
}

/* ============================================
   СТАТУС ПОДКЛЮЧЕНИЯ
   ============================================ */
   
.header-controls {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
}
.icon-btn {
  width: 40px;
  height: 40px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.connection-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 20px;
  text-align: center;
  z-index: 10000;
  animation: slideDown 0.4s ease-out;
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(8, 8, 12, 0.85);
  backdrop-filter: blur(16px);
}

.connection-bar.connected {
  border-bottom-color: var(--border-accent);
}

.connection-bar.connected .connection-dot {
  background: var(--accent);
  box-shadow: var(--glow-cyan);
}

.connection-bar.disconnected .connection-dot {
  background: var(--error-red);
  box-shadow: 0 0 16px rgba(255, 82, 82, 0.4);
}

.connection-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

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

.connection-bar.connected .connection-text {
  color: var(--accent);
}

/* ============================================
   КОМНАТА И ИГРОКИ
   ============================================ */
   
.room-id {
  text-align: center;
  font-size: 1.25rem;
  background: var(--bg-card);
  padding: 16px 24px;
  border-radius: var(--radius);
  margin: 24px 0;
  word-break: break-all;
  font-weight: 600;
  letter-spacing: 0.08em;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  color: var(--accent);
}

.players {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0;
  justify-content: center;
  min-height: 70px;
  animation: fadeIn 0.5s ease-out;
}

.player {
  background: var(--bg-card);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  text-align: center;
  min-width: 120px;
  transition: var(--transition);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}
.player-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.player:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}

.player.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  border-color: var(--border-accent);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

.player.mafia {
  background: rgba(255, 68, 68, 0.15);
  border-color: rgba(255, 68, 68, 0.3);
  color: #ff4444;
}

.player.citizen {
  background: rgba(68, 255, 68, 0.15);
  border-color: rgba(68, 255, 68, 0.3);
  color: #44ff44;
}

.player.sheriff {
  background: rgba(68, 136, 255, 0.15);
  border-color: rgba(68, 136, 255, 0.3);
  color: #4488ff;
}

.player.doctor {
  background: rgba(255, 136, 68, 0.15);
  border-color: rgba(255, 136, 68, 0.3);
  color: #ff8844;
}

/* ============================================
   ИГРОВАЯ ЗОНА
   ============================================ */
   
.game-area {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 28px 0;
  text-align: center;
  min-height: 380px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.game-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
  z-index: 1;
}

.game-area > * {
  position: relative;
  z-index: 2;
}

.word {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin: 32px 0;
  min-height: 100px;
  background: var(--bg-card);
  padding: 24px 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.05em;
  border: 1px solid var(--border-subtle);
  animation: scaleIn 0.4s ease-out;
  position: relative;
  line-height: 1.2;
  color: var(--accent);
}

.timer {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--accent);
  margin: 24px 0;
  box-shadow: var(--glow-cyan);
  animation: pulse 1.5s ease-in-out infinite;
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  text-align: center;
}

/* ============================================
   КНОПКИ
   ============================================ */
   
.btn {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  margin: 10px 8px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  min-width: 160px;
  position: relative;
  letter-spacing: 0.02em;
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn.primary,
.btn.blue {
  background: var(--accent-dim);
  border-color: var(--border-accent);
  color: var(--accent);
}

.btn.primary:hover,
.btn.blue:hover {
  background: rgba(0, 245, 212, 0.2);
  box-shadow: var(--glow-cyan);
}

.btn.red {
  background: rgba(255, 82, 82, 0.12);
  border-color: rgba(255, 82, 82, 0.3);
  color: var(--error-red);
}

.btn.red:hover {
  background: rgba(255, 82, 82, 0.2);
  border-color: rgba(255, 82, 82, 0.45);
}

.btn.green {
  background: rgba(0, 200, 83, 0.12);
  border-color: rgba(0, 200, 83, 0.35);
  color: var(--success-green);
}

.btn.green:hover {
  background: rgba(0, 200, 83, 0.2);
}

.btn.purple {
  background: rgba(120, 80, 255, 0.12);
  border-color: rgba(120, 80, 255, 0.35);
  color: #a78bfa;
}

.btn.purple:hover {
  background: rgba(120, 80, 255, 0.2);
}

.btn.gray {
  background: var(--bg-card-hover);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.btn.gray:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
}

/* ============================================
   ФАЗА ИГРЫ И ОШИБКИ
   ============================================ */
   
.phase {
  font-size: 1.35rem;
  margin: 24px 0;
  color: var(--accent);
  font-weight: 600;
  animation: fadeIn 0.4s ease-out;
  position: relative;
}

.phase::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}

.error {
  color: var(--error-red);
  background: rgba(255, 82, 82, 0.1);
  padding: 14px 20px;
  border-radius: var(--radius);
  margin: 20px 0;
  border-left: 3px solid var(--error-red);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  animation: shake 0.5s;
  position: relative;
}

/* ============================================
   ЧАТ
   ============================================ */
   
.chat {
  background: var(--bg-card);
  border-radius: var(--radius);
  height: 300px;
  overflow-y: auto;
  padding: 20px;
  margin: 24px 0;
  border: 1px solid var(--border-subtle);
}

.message {
  margin: 10px 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--bg-card-hover);
  animation: fadeIn 0.3s;
  transition: var(--transition);
  border-left: 2px solid var(--border-subtle);
}

.message:hover {
  border-left-color: var(--border-accent);
}

.system {
  color: var(--text-muted);
  font-style: italic;
  border-left-color: var(--accent);
  background: var(--accent-dim);
}

.system strong {
  color: var(--accent);
}

.input-area {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.input-area input {
  flex: 1;
  padding: 14px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
}

.input-area input:focus {
  outline: none;
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

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

/* ============================================
   ЛОББИ И ВЫБОР ИГР
   ============================================ */
   
.lobby {
  text-align: center;
  padding: 48px 24px;
}

.lobby-online {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.lobby-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  max-width: 900px;
  margin: 0 auto 32px;
  align-items: start;
}

.lobby-games { text-align: center; }

.lobby-preview {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-subtle);
  min-height: 200px;
  text-align: left;
  position: sticky;
  top: 100px;
}

.lobby-preview-hint {
  font-size: 1.2rem;
  color: var(--text-muted);
  text-align: center;
  padding: 40px 20px 0;
}

.lobby-preview-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  opacity: 0.8;
}

.lobby-preview-title {
  font-size: 1.35rem;
  margin-bottom: 12px;
  color: var(--accent);
}

.lobby-preview-desc {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.lobby-preview-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.lobby-preview-rules {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.btn-sm { padding: 10px 20px; font-size: 0.9rem; }

.game-card-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.tooltip-wrap {
  cursor: help;
  margin-left: 6px;
  opacity: 0.7;
  font-size: 1rem;
}

.lobby-actions { position: relative; }

.last-rooms-dropdown {
  max-width: 400px;
  margin: 12px auto 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--border-subtle);
}

.last-room-btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  margin: 4px 0;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1rem;
  text-align: left;
  transition: var(--transition);
}

.last-room-btn:hover {
  background: var(--accent-dim);
  border-color: var(--border-accent);
}

.name-input-container {
  max-width: 420px;
  margin: 0 auto 36px;
}

.name-input-container label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.name-input-container input {
  width: 100%;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1.15rem;
  text-align: center;
  transition: var(--transition);
  font-weight: 500;
}

.name-input-container input:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.name-input-container input::placeholder {
  color: var(--text-muted);
}

.name-input-container p {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.game-select-title {
  font-size: 1.35rem;
  margin: 36px 0 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.game-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 32px 0;
  padding: 0;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.game-card {
  background: var(--bg-card);
  padding: 24px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.game-card-rules {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-hover);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}
.game-card-rules:hover {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent);
}
.game-select-title-secondary {
  margin-top: 24px;
  font-size: 1.1rem;
  color: var(--text-muted);
}
.game-select-popular { margin-bottom: 0; }

.game-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}

.game-card.selected {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--glow-cyan);
  z-index: 10;
}

.game-card div:first-child {
  font-size: 2.5rem;
  margin-bottom: 12px;
  line-height: 1;
  transition: var(--transition);
}

.game-card:hover div:first-child {
  transform: scale(1.1);
}

.game-card div:last-child {
  font-size: 1rem;
  font-weight: 600;
  color: inherit;
}

.game-card-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.lobby-buttons {
  margin-top: 36px;
}

.room-id-container {
  margin-top: 36px;
  padding: 28px;
  background: var(--bg-card);
  border-radius: var(--radius);
  display: none;
  border: 1px solid var(--border-subtle);
}

.room-id-container p {
  font-size: 1.1rem;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.room-id-container .room-id {
  font-size: 1.75rem;
  padding: 16px 24px;
  margin: 16px 0;
  color: var(--accent);
  letter-spacing: 0.15em;
}

.room-id-container p:last-child {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.room-url-hint {
  font-size: 0.9rem !important;
  color: var(--accent) !important;
  word-break: break-all;
  margin: 12px 0 !important;
}
.room-copy-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.donation-collapse { margin-top: 28px; max-width: 400px; margin-left: auto; margin-right: auto; }
.donation-collapse-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}
.donation-collapse-trigger:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255,215,0,0.3);
}
.donation-arrow { margin-left: auto; font-size: 0.7rem; }
.donation-block-collapsed {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0;
  margin: 0;
  transition: max-height 0.35s, opacity 0.3s;
}
.donation-block:not(.donation-block-collapsed) {
  max-height: 200px;
  opacity: 1;
  padding: 24px 20px;
  margin-top: 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,215,0,0.2);
  background: rgba(255,215,0,0.05);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.hidden { display: none !important; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.modal-content {
  position: relative;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalSlide 0.3s ease-out;
}
@keyframes modalSlide {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-header h2 { font-size: 1.35rem; font-weight: 700; }
.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-card-hover);
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { background: var(--error-red); color: #fff; }
.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: 60vh;
  white-space: pre-line;
  line-height: 1.7;
}
.leaderboard-list { margin-top: 12px; padding-left: 24px; }

.screen-exit { animation: screenExit 0.25s ease-out forwards; }
@keyframes screenExit {
  to { opacity: 0; transform: translateY(-15px); }
}
.screen-enter { animation: screenEnter 0.4s ease-out; }
@keyframes screenEnter {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-section .header-tagline {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.1rem;
  line-height: 1.7;
}

/* ============================================
   ИГРОВЫЕ ЭЛЕМЕНТЫ
   ============================================ */
   
.word-input {
  width: 100%;
  padding: 16px 20px;
  margin: 16px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1.25rem;
  text-align: center;
  transition: var(--transition);
  font-weight: 500;
}

.word-input:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

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

.words-count {
  font-size: 1rem;
  color: var(--accent);
  margin-top: 10px;
  font-weight: 600;
}

#drawingCanvas, #viewCanvas {
  background: #fff;
  border-radius: var(--radius);
  margin: 24px auto;
  display: block;
  max-width: 100%;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
  width: 100%;
  height: auto;
  max-height: 480px;
}

/* Chrome Win11: курсор может пропадать над canvas — используем кастомный crosshair */
#drawingCanvas {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" stroke="black" stroke-width="1.5" d="M12 2v20M2 12h20"/></svg>') 12 12, crosshair;
}

.canvas-wrapper:not(.view-only) {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" stroke="black" stroke-width="1.5" d="M12 2v20M2 12h20"/></svg>') 12 12, crosshair;
}

.canvas-wrapper.view-only canvas {
  cursor: default;
}

.drawing-header, .guessing-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.word-display {
  font-size: 1.4rem;
  font-weight: 700;
  flex: 1;
  min-width: 120px;
}

.timer-display {
  font-size: 1.5rem;
  font-weight: 800;
  min-width: 48px;
  text-align: center;
}

.round-indicator, .round-badge {
  font-size: 0.95rem;
  opacity: 0.9;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
}

.tools-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-group.shapes { align-items: center; gap: 6px; }
.tool-group.shapes .shape-btn { padding: 8px 12px; font-size: 1.1rem; }
.tool-group.shapes .shape-btn.active { border-color: var(--accent); background: var(--accent-dim); }
.tool-group.colors {
  flex-wrap: wrap;
}

.color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.color-btn.active, .color-btn.eraser-active {
  box-shadow: 0 0 0 3px var(--accent);
}

.color-picker {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.size-slider {
  width: 90px;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-btn {
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.tool-btn.danger { background: rgba(255, 82, 82, 0.15); border-color: rgba(255, 82, 82, 0.3); }
.tool-btn.warning { background: var(--accent-dim); border-color: var(--border-accent); }

@media (max-width: 600px) {
  .tools-panel { gap: 12px; padding: 12px; }
  .color-btn, .color-picker { width: 36px; height: 36px; }
  .tool-btn { padding: 12px 16px; min-height: 44px; }
  .size-slider { width: 100px; }
}

.crocodile-score-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  min-width: 180px;
}

.score-panel-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.score-panel-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.score-panel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.95rem;
}

.score-panel-row-me {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.score-panel-rank {
  width: 20px;
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.score-panel-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-panel-points {
  font-weight: 700;
  color: var(--accent);
  min-width: 28px;
  text-align: right;
}

.player-score {
  margin-left: 6px;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9em;
}

.settings-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.setting-btn {
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.setting-btn:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.setting-btn.active {
  background: var(--accent-dim);
  border-color: var(--border-accent);
  color: var(--accent);
  font-weight: 600;
}

.crocodile-settings .settings-group {
  margin-bottom: 18px;
}

.crocodile-settings select {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.guess-list {
  text-align: left;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius);
  margin: 20px 0;
  border: 1px solid var(--border-subtle);
}

.guess-item {
  padding: 10px 14px;
  margin: 8px 0;
  border-left: 3px solid var(--accent);
  background: var(--bg-card-hover);
  border-radius: var(--radius);
  transition: var(--transition);
}

.guess-item:hover {
  border-left-color: var(--accent);
  transform: translateX(4px);
}

.role-card {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius);
  margin: 24px 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
  color: var(--accent);
}

/* Шляпа */
.hat-input-area {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}
.hat-input-area h3 { margin-bottom: 12px; font-size: 1.3rem; }
.hat-hint { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 16px; }
.hat-game-area { margin-top: 20px; }
.hat-score-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.hat-score-list { display: flex; flex-direction: column; gap: 6px; }
.hat-score-item { font-size: 0.95rem; padding: 6px 0; }
.hat-score-item.active { color: var(--accent); font-weight: 600; }
.hat-pool-info { font-size: 0.9rem; color: var(--text-muted); margin-top: 10px; }
.hat-word-display {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  padding: 24px;
  text-align: center;
  background: var(--accent-dim);
  border-radius: var(--radius);
  border: 1px solid var(--border-accent);
  margin: 20px 0;
  color: var(--accent);
}
.hat-timer {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin: 16px 0;
}
.hat-timer.urgent { color: var(--error-red); animation: pulse 0.5s infinite; }
.hat-explainer-view, .hat-guesser-view { margin-top: 20px; }
.hat-explainer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  align-items: center;
}
.hat-phase-text { font-size: 1.2rem; margin-bottom: 12px; }
.hat-guess-input-area {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  align-items: center;
}
.hat-guess-input-area .word-input { flex: 1; min-width: 0; }
.hat-waiting { padding: 24px; text-align: center; color: var(--text-muted); }

/* Ассоциации */
.associations-container { margin-top: 20px; }
.assoc-lobby { text-align: center; margin-bottom: 20px; }
.assoc-lobby-hint { margin-bottom: 12px; color: var(--text-muted); }
.associations-score-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.assoc-score-list { display: flex; flex-direction: column; gap: 6px; }
.assoc-score-item { font-size: 0.95rem; padding: 6px 0; }
.assoc-score-item.active { color: var(--accent); font-weight: 600; }
.assoc-phase { margin-bottom: 24px; }
.assoc-word-display {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  padding: 20px;
  text-align: center;
  background: var(--accent-dim);
  border-radius: var(--radius);
  border: 1px solid var(--border-accent);
  margin: 16px 0;
  color: var(--accent);
}
.assoc-hint { font-size: 1.1rem; margin-bottom: 12px; color: var(--text-muted); }
.assoc-timer { font-size: 2rem; font-weight: 700; color: var(--accent-gold); margin: 12px 0; }
.assoc-timer.urgent { color: var(--error-red); animation: pulse 0.5s infinite; }
.assoc-choices { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 20px 0; }
.assoc-choice-btn { min-width: 140px; }
.assoc-choice-card {
  padding: 14px 20px;
  background: var(--bg-card-hover);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  font-size: 1.1rem;
}
.assoc-result-text { font-size: 1.2rem; font-weight: 600; color: var(--accent); }

/* Смех без правил */
.laugh-container { margin-top: 20px; }
.laugh-score-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.laugh-score-list { display: flex; flex-direction: column; gap: 6px; }
.laugh-score-item { font-size: 0.95rem; padding: 6px 0; }
.laugh-phase { margin-bottom: 24px; }
.laugh-lobby-settings {
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}
.laugh-lobby-settings h3 { margin-bottom: 16px; font-size: 1.2rem; }
.laugh-setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.laugh-setting-row label { min-width: 180px; font-size: 0.95rem; }
.laugh-setting-row input { width: 80px; padding: 8px 12px; border-radius: 8px; }
.laugh-ready-area { margin: 20px 0; }
.laugh-hint { font-size: 1rem; color: var(--text-muted); margin: 8px 0; }
.laugh-prompt-display {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  padding: 24px;
  text-align: center;
  background: var(--accent-dim);
  border-radius: var(--radius);
  border: 1px solid var(--border-accent);
  margin: 16px 0;
  color: var(--accent);
}
.laugh-timer { font-size: 2rem; font-weight: 700; color: var(--accent-gold); margin: 12px 0; }
.laugh-timer.urgent { color: var(--error-red); animation: pulse 0.5s infinite; }
.laugh-answer-area { margin: 20px 0; }
.laugh-answer-area .word-input { width: 100%; max-width: 500px; margin-bottom: 8px; }
.laugh-char-count { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 12px; }
.laugh-sent { font-size: 1.1rem; color: var(--success-green); font-weight: 600; }
.laugh-vote-choices { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 20px 0; }
.laugh-vote-btn { min-width: 180px; text-align: center; white-space: normal; }
.laugh-winner-card {
  font-size: 1.4rem;
  font-weight: 700;
  padding: 20px;
  background: var(--accent-dim);
  border-radius: var(--radius);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  margin: 16px 0;
}
.laugh-winner-author { font-size: 1.1rem; color: var(--text-muted); }
.laugh-final-scores { margin: 20px 0; }
.laugh-final-item { font-size: 1.1rem; padding: 8px 0; }
.laugh-final-item.winner { color: var(--accent-gold); font-weight: 700; }

/* Мафия */
.mafia-lobby {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}
.mafia-lobby-hint { margin-bottom: 16px; font-size: 1rem; color: var(--text-muted); }
.mafia-add-bots {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  flex-direction: column; align-items: stretch;
}
.mafia-add-bots label { font-size: 1rem; }
.mafia-add-bots input[type="range"] { width: 100%; max-width: 300px; margin: 8px 0; }
.mafia-role-settings {
  display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin: 12px 0;
}
.mafia-role-settings-label { font-size: 0.9rem; color: var(--text-muted); margin-right: 4px; }
.mafia-role-settings label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.95rem; }
.mafia-vote-choice { font-size: 1.1rem; color: var(--accent); margin: 12px 0; font-weight: 600; }
.mafia-container { margin-top: 20px; }
.mafia-role-card {
  background: var(--bg-card);
  padding: 20px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border-accent);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 20px;
}
.mafia-timer {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 20px;
}
.mafia-timer.urgent { color: var(--error-red); animation: pulse 0.5s infinite; }
.mafia-phase-view { margin-bottom: 24px; }
.mafia-phase-hint, .mafia-action-title { font-size: 1.2rem; margin-bottom: 16px; }
.mafia-targets { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.mafia-target-btn { min-width: 120px; }
.mafia-target-btn.selected { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-dim); }
.mafia-result-text { font-size: 1.25rem; font-weight: 600; color: var(--accent); }
.mafia-players-panel {
  background: var(--bg-card);
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  margin-top: 24px;
}
.mafia-players-panel h4 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 10px; }
.mafia-players-list { display: flex; flex-wrap: wrap; gap: 8px; }
.mafia-player-item { padding: 6px 12px; border-radius: 8px; font-size: 0.95rem; }
.mafia-player-item.alive { background: var(--accent-dim); color: var(--accent); }
.mafia-player-item.dead { opacity: 0.5; color: var(--text-muted); }
.mafia-intro-actions { display: flex; gap: 12px; margin: 16px 0; }
.mafia-player-item.speaking { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-dim); }
.mafia-moderator-panel {
  margin-top: 20px; padding: 16px; background: rgba(120, 80, 255, 0.1); border: 1px solid rgba(120, 80, 255, 0.3); border-radius: var(--radius);
}
.mafia-moderator-panel h4 { margin-bottom: 12px; color: var(--accent-gold); }
.mafia-mod-players { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; font-size: 0.9rem; }
.mafia-mod-player { padding: 4px 10px; border-radius: 6px; display: flex; align-items: center; gap: 8px; }
.mafia-mod-player .btn-sm { padding: 2px 8px; font-size: 0.8rem; }
.mafia-mod-player.alive { background: rgba(0, 200, 83, 0.15); color: var(--success-green); }
.mafia-mod-player.dead { background: rgba(255, 82, 82, 0.15); color: var(--error-red); opacity: 0.8; }
.mafia-mod-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.message.moderator-msg { border-left: 3px solid var(--accent-gold); background: rgba(255, 215, 0, 0.08); }
.message.mafia-chat { border-left: 3px solid #c62828; background: rgba(198, 40, 40, 0.08); }
.message.dead-chat { border-left: 3px solid var(--text-muted); background: rgba(255,255,255,0.03); }
.mafia-moderator-opt { margin: 12px 0; }

/* ============================================
   БЛОК ПОДДЕРЖКИ (DONATIONALERTS)
   ============================================ */
.donation-block {
  margin-top: 32px;
  padding: 32px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 180, 0, 0.02) 50%, rgba(255, 215, 0, 0.05) 100%);
  border: 1px solid rgba(255, 215, 0, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}
.donation-block::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 215, 0, 0.06) 0%, transparent 50%);
  pointer-events: none;
}
.donation-block:hover {
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 0 60px rgba(255, 215, 0, 0.08);
}
.donation-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.4));
  animation: donation-pulse 3s ease-in-out infinite;
}
@keyframes donation-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}
.donation-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.donation-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: 1.6;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
.donation-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  color: #1a1a1a;
  background: linear-gradient(135deg, #ffd700 0%, #f0c000 40%, #ffd700 100%);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
  transition: var(--transition);
  position: relative;
}
.donation-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 28px rgba(255, 215, 0, 0.5);
  color: #1a1a1a;
}
.donation-btn-arrow {
  transition: transform 0.3s ease;
}
.donation-btn:hover .donation-btn-arrow {
  transform: translateX(4px);
}
.donation-widget iframe {
  max-width: 100%;
  border: none;
  border-radius: 8px;
}
.mafia-voice-panel { margin-top: 16px; padding: 12px; background: var(--bg-card); border-radius: var(--radius); }
.mafia-voice-btn { font-size: 0.9rem; }
.mafia-voice-hint { display: block; margin-top: 8px; font-size: 0.85rem; color: var(--text-muted); }

/* ============================================
   МОНОПОЛИЯ
   ============================================ */
.monopoly-container { display: flex; flex-direction: column; gap: 16px; }
.monopoly-lobby { text-align: center; }
.monopoly-lobby-hint { margin-bottom: 12px; color: var(--text-muted); }
.monopoly-game { display: flex; gap: 20px; flex-wrap: wrap; }
.monopoly-board-wrap { flex: 1; min-width: 300px; min-height: 280px; overflow-x: auto; }
.monopoly-board {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px;
  background: var(--bg-card); padding: 8px; border-radius: var(--radius);
  min-height: 260px;
}
.monopoly-cell {
  padding: 8px; font-size: 0.75rem; border-radius: 6px; min-height: 50px;
  border: 1px solid var(--border-subtle); color: var(--text-primary);
}
.monopoly-cell-tokens { display: block; font-size: 1rem; margin-top: 4px; }
.monopoly-sidebar { width: 220px; display: flex; flex-direction: column; gap: 12px; }
.monopoly-players { background: var(--bg-card); padding: 12px; border-radius: var(--radius); }
.monopoly-player { padding: 6px 0; font-size: 0.9rem; }
.monopoly-player.current { color: var(--accent); font-weight: 600; }
.monopoly-player.bankrupt { opacity: 0.5; text-decoration: line-through; }
.monopoly-actions { display: flex; flex-direction: column; gap: 8px; }
.monopoly-dice { font-size: 1.2rem; font-weight: 600; }
.monopoly-log { max-height: 120px; overflow-y: auto; font-size: 0.85rem; color: var(--text-muted); }
.monopoly-log-item { padding: 2px 0; }
.monopoly-token-select { text-align: center; }
.monopoly-tokens { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.monopoly-token-btn { font-size: 1.5rem; padding: 12px 20px; }
.monopoly-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 10001;
}
.monopoly-modal-content {
  background: var(--bg-deep); padding: 24px; border-radius: var(--radius); border: 1px solid var(--border-subtle);
  max-width: 400px; display: flex; flex-direction: column; gap: 12px;
}
.monopoly-modal-content h4 { margin: 0; }
.monopoly-modal-content input { padding: 10px; border-radius: 8px; }

/* K.O.Wall */
.kowall-container { display: flex; flex-direction: column; gap: 16px; }
.kowall-lobby { text-align: center; }
.kowall-lobby-hint { margin-bottom: 12px; color: var(--text-muted); }
.kowall-game { display: flex; flex-direction: column; gap: 16px; }
.kowall-hud {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  background: var(--bg-card); padding: 12px; border-radius: var(--radius); border: 1px solid var(--border-subtle);
}
.kowall-hud-current, .kowall-hud-dice { font-weight: 600; }
.kowall-log { max-height: 100px; overflow-y: auto; font-size: 0.85rem; color: var(--text-muted); }
.kowall-log-item { padding: 2px 0; }
.kowall-board-wrap {
  position: relative; width: 100%; max-width: 900px; margin: 0 auto;
  aspect-ratio: 4/3; min-height: 400px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border-subtle); box-shadow: var(--shadow-md);
}
.kowall-board {
  position: relative; width: 100%; height: 100%; background: #1a2a1a;
}
.kowall-board-img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.kowall-chips {
  position: absolute; inset: 0; pointer-events: none;
}
.kowall-chip {
  position: absolute; width: 4%; height: 4%; min-width: 24px; min-height: 24px; max-width: 36px; max-height: 36px;
  transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: #000;
  box-shadow: var(--shadow-sm); transition: left 0.3s ease, top 0.3s ease;
}
.kowall-dice-canvas-wrap {
  display: flex; align-items: center; gap: 12px; padding: 8px;
}
.kowall-dice-result {
  font-size: 1.5rem; font-weight: 700; color: var(--accent);
}

.hidden {
  display: none;
}

/* ============================================
   ТОСТЫ И УВЕДОМЛЕНИЯ
   ============================================ */
   
.toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 12, 18, 0.95);
  color: var(--text-primary);
  padding: 16px 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-accent);
  z-index: 10000;
  animation: slideIn 0.4s ease-out, fadeOut 0.5s 2.8s forwards;
  font-weight: 600;
  font-size: 1rem;
  backdrop-filter: blur(16px);
  text-align: center;
  min-width: 280px;
  position: relative;
}

.toast::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.8;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* ============================================
   ФУТЕР С КОПИРАЙТОМ
   ============================================ */
   
.footer {
  text-align: center;
  padding: 32px 20px;
  margin-top: 48px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: var(--transition);
  border-top: 1px solid var(--border-subtle);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}

.footer:hover {
  color: var(--text-primary);
}

.footer p {
  margin: 6px 0;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  justify-content: center;
  margin-top: 12px;
}
.footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.footer a:hover {
  text-decoration: underline;
  color: var(--text-primary);
}

/* ============================================
   АНИМАЦИИ
   ============================================ */
   
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideUp {
  to {
    transform: translateY(-100%);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-8px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(8px);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(500px) translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateX(0) translateY(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateX(100px) translateY(-50px);
  }
}

/* ============================================
   УЛУЧШЕНИЯ UX
   ============================================ */

/* Плавная прокрутка */
html {
  scroll-behavior: smooth;
}

/* Улучшенный скроллбар для чата */
.chat::-webkit-scrollbar {
  width: 8px;
}

.chat::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.chat::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.chat::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Улучшенный скроллбар для списка догадок */
.guess-list::-webkit-scrollbar {
  width: 8px;
}

.guess-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.guess-list::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.3);
  border-radius: 10px;
}

.guess-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 0.5);
}

/* Анимация появления игроков */
.player {
  animation: fadeIn 0.4s ease-out;
}

/* Улучшенная видимость кнопок на мобильных */
@media (hover: none) {
  .btn {
    min-height: 48px;
    padding: 16px 28px;
    font-size: 1.05rem;
  }
  .btn:active {
    transform: scale(0.95);
    opacity: 0.8;
  }
  .game-card {
    min-height: 100px;
    padding: 20px 16px;
  }
  .game-card-rules {
    min-width: 36px;
    min-height: 36px;
    width: 36px;
    height: 36px;
  }
  
  .game-card:active {
    transform: scale(0.98);
  }
}

/* Улучшенная видимость инпутов */
input:focus,
textarea:focus {
  transform: scale(1.02);
  transition: transform 0.2s ease;
}

/* Индикатор загрузки */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent-gold);
  animation: spin 1s ease-in-out infinite;
}

/* ============================================
   АДАПТИВНЫЙ ДИЗАЙН
   ============================================ */
   
@media (max-width: 768px) {
  .lobby-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    order: 1;
  }
  
  .lobby-preview {
    order: 2;
    position: static;
    min-height: 140px;
  }
  
  .lobby-buttons {
    order: 3;
  }
  
  .header h1 {
    font-size: 2.6rem;
  }
  
  .header p {
    font-size: 1.1rem;
  }
  
  .game-select {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .word {
    font-size: 2.5rem;
    padding: 20px;
  }
  
  .timer {
    font-size: 2.6rem;
  }
  
  .btn {
    padding: 14px 30px;
    font-size: 1.1rem;
    margin: 10px 8px;
    min-width: 140px;
  }
  
  .player {
    padding: 12px 18px;
    min-width: 110px;
    font-size: 0.9rem;
  }
  
  .game-area {
    padding: 25px 15px;
    min-height: 350px;
  }
  
  .chat {
    height: 280px;
  }
  
  .role-card {
    font-size: 1.7rem;
    padding: 25px;
  }
  
  .connection-bar h1 {
    font-size: 2.8rem;
  }
  
  .toast {
    min-width: 250px;
    padding: 15px 30px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 15px;
  }
  
  .header {
    padding: 30px 15px;
  }
  
  .header h1 {
    font-size: 2.3rem;
  }
  
  .game-select {
    grid-template-columns: 1fr;
  }
  
  .word {
    font-size: 2rem;
    padding: 15px;
  }
  
  .timer {
    font-size: 2.2rem;
  }
  
  .btn {
    padding: 12px 25px;
    font-size: 1rem;
    margin: 8px 5px;
    min-width: 130px;
  }
  
  .player {
    padding: 10px 15px;
    min-width: 100px;
    font-size: 0.85rem;
  }
  
  .game-area {
    padding: 20px 10px;
    min-height: 320px;
  }
  
  .chat {
    height: 250px;
    padding: 15px;
  }
  
  .input-area input {
    padding: 14px 20px;
    font-size: 1rem;
  }
  
  .name-input-container input {
    font-size: 1.2rem;
    padding: 16px;
  }
  
  .room-id {
    font-size: 1.3rem;
    padding: 15px;
  }
  
  .footer {
    padding: 25px 15px;
    font-size: 0.85rem;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 10px;
  }
  
  .footer-links a {
    justify-content: center;
  }
}

/* ============================================
   СПЕЦИАЛЬНЫЕ ЭФФЕКТЫ
   ============================================ */
   
/* Уникальные эффекты для уведомлений */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* Эффект для игры Шляпа */
.hat-game {
  animation: pulse 1.5s infinite;
}

.hat-game::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle, rgba(255,215,0,0.1) 0%, transparent 70%);
  z-index: -1;
  animation: spin 6s linear infinite;
}

/* Эффект для игры Крокодил */
.crocodile-game {
  animation: float 2s ease-in-out infinite;
}

/* Эффект для игры Мафия */
/* Убрана анимация rotate — мешала интерфейсу */

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Эффект для игры Правда/Действие */
.truth-game {
  animation: pulse 1.2s infinite;
}

/* Эффект для игры Ассоциации */
.associations-game {
  animation: float 1.5s ease-in-out infinite;
}

/* Уникальные элементы для уведомлений */
.toast::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}