/* 🐝 Путь Шмеля — стили */

:root {
  --bg: #1a1a2e;
  --bg-card: #16213e;
  --bg-light: #0f3460;
  --gold: #e94560;
  --accent: #f5b041;
  --text: #eee;
  --text-dim: #888;
  --green: #2ecc71;
  --red: #e74c3c;
  --blue: #3498db;
  --purple: #9b59b6;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== HOST ===== */

.host-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.host-header {
  text-align: center;
  margin-bottom: 24px;
}

.host-header h1 {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.host-header .subtitle {
  color: var(--text-dim);
  font-size: 1rem;
}

.host-header .code {
  display: inline-block;
  background: var(--bg-light);
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 1.8rem;
  font-weight: bold;
  letter-spacing: 6px;
  color: var(--accent);
  margin-top: 12px;
}

.host-header .round-info {
  color: var(--gold);
  font-size: 1.1rem;
  margin-top: 8px;
}

#host-waiting {
  text-align: center;
  padding: 60px 20px;
}

#host-waiting h2 {
  color: var(--accent);
  font-size: 1.6rem;
  margin-bottom: 20px;
}

.player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 20px 0;
}

.player-chip {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.95rem;
}

.host-btn {
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px 40px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
  transition: transform 0.1s, background 0.2s;
}

.host-btn:hover { background: #ff5e80; transform: scale(1.03); }
.host-btn:disabled { opacity: 0.4; cursor: not-allowed; }

#host-progress {
  text-align: center;
  margin: 20px 0;
  font-size: 1.1rem;
  color: var(--text-dim);
}

#host-progress .picked {
  color: var(--accent);
  font-weight: bold;
}

/* Leaderboard */
.leaderboard {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.leaderboard h3 {
  color: var(--accent);
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.lb-row {
  display: grid;
  grid-template-columns: 30px 1fr 60px;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.lb-rank {
  font-weight: bold;
  color: var(--text-dim);
}

.lb-rank.top { color: var(--accent); }

.lb-name { font-size: 1rem; }

.lb-bar {
  height: 14px;
  background: rgba(255,255,255,0.1);
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}

.lb-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--red));
  border-radius: 7px;
  transition: width 0.5s ease;
}

.lb-pct {
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Reveal */
.reveal-section {
  display: none;
}

.reveal-event {
  background: var(--bg-light);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.reveal-event .evt-icon { font-size: 1.5rem; margin-right: 8px; }
.reveal-event .evt-title { font-weight: bold; color: var(--accent); }
.reveal-event .evt-desc { color: var(--text-dim); margin-top: 4px; font-size: 0.9rem; }

.reveal-picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.pick-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.1);
}

.pick-card .pc-name {
  font-weight: bold;
  margin-bottom: 6px;
  color: var(--text);
}

.pick-card .pc-card {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pick-card .pc-icon { font-size: 1.5rem; }
.pick-card .pc-title { font-size: 0.95rem; color: var(--accent); }

.pick-card .pc-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
}

.eff-chip {
  border-radius: 4px;
  padding: 2px 8px;
}

.eff-pos { background: rgba(46,204,113,0.15); color: var(--green); }
.eff-neg { background: rgba(231,76,60,0.15); color: var(--red); }

/* Game Over */
#host-gameover {
  text-align: center;
  padding: 40px 20px;
}

#host-gameover h2 {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 12px;
}

#host-gameover .winner-name {
  font-size: 3rem;
  color: var(--gold);
  font-weight: bold;
}

#host-gameover .subtitle {
  color: var(--text-dim);
  margin-top: 8px;
  font-size: 1.1rem;
}

/* ===== PLAYER ===== */

.player-container {
  max-width: 460px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}

.join-screen, .lobby-screen, .cards-screen, .reveal-screen, .gameover-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 80vh;
  justify-content: center;
}

.join-screen h1 {
  color: var(--accent);
  font-size: 2rem;
  text-align: center;
  margin-bottom: 8px;
}

.join-screen .bee { font-size: 3rem; }

.join-screen .subtitle {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 24px;
  text-align: center;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 300px;
}

.input-group label {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.input-group input {
  background: var(--bg-card);
  border: 2px solid var(--bg-light);
  border-radius: 8px;
  color: var(--text);
  padding: 12px 16px;
  font-size: 1.1rem;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus { border-color: var(--accent); }

.input-group input.code-input {
  letter-spacing: 6px;
  text-transform: uppercase;
  font-weight: bold;
}

.join-btn {
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.2s, transform 0.1s;
}

.join-btn:hover { background: #ff5e80; transform: scale(1.02); }

.error-msg {
  color: var(--red);
  font-size: 0.9rem;
  margin-top: 8px;
  text-align: center;
}

/* Lobby */
.lobby-screen h2 { color: var(--accent); margin-bottom: 12px; }
.lobby-screen .waiting { color: var(--text-dim); margin-top: 16px; font-size: 0.95rem; }

.player-list-small {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
}

.player-list-small .chip {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 0.85rem;
}

/* Stats bar */
.my-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.stat-box {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 10px 12px;
}

.stat-box .stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.stat-box .stat-value {
  font-size: 1.4rem;
  font-weight: bold;
}

.stat-expulsion { color: var(--red); }
.stat-joy { color: var(--accent); }
.stat-knowledge { color: var(--blue); }
.stat-reputation { color: var(--purple); }

.stat-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.stat-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.fill-expulsion { background: var(--red); }
.fill-joy { background: var(--accent); }
.fill-knowledge { background: var(--blue); }
.fill-reputation { background: var(--purple); }

/* Cards */
.cards-header {
  text-align: center;
  margin-bottom: 16px;
}

.cards-header .round {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.cards-header h3 {
  color: var(--accent);
  font-size: 1.1rem;
  margin-top: 4px;
}

.card-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.action-card {
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}

.action-card:hover { border-color: var(--accent); transform: scale(1.01); }
.action-card:active { transform: scale(0.99); }
.action-card.selected { border-color: var(--accent); background: rgba(233,69,96,0.1); }

.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.card-icon { font-size: 2rem; }
.card-title { font-weight: bold; color: var(--accent); font-size: 1rem; }
.card-desc { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 8px; }

.card-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Wait */
.wait-screen { text-align: center; }
.wait-screen .spinner { font-size: 2rem; margin-bottom: 12px; }
.wait-screen p { color: var(--text-dim); }

/* Reveal */
.reveal-my-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  text-align: center;
}

.reveal-my-card .rc-icon { font-size: 2.5rem; }
.reveal-my-card .rc-title { color: var(--accent); font-weight: bold; margin: 6px 0; }

.reveal-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}

.reveal-event-box {
  background: var(--bg-light);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  text-align: center;
}

.reveal-event-box .rev-icon { font-size: 1.5rem; }
.reveal-event-box .rev-title { color: var(--accent); font-weight: bold; margin-top: 4px; }
.reveal-event-box .rev-desc { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }

.reveal-lb {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.reveal-lb h4 { color: var(--accent); margin-bottom: 8px; font-size: 0.95rem; }

.lb-mini-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.9rem;
}

.lb-mini-row .name { color: var(--text); }
.lb-mini-row .pct { color: var(--text-dim); }
.lb-mini-row.me .name { color: var(--accent); font-weight: bold; }

/* Game Over */
.gameover-screen .bee { font-size: 3rem; }
.gameover-screen h2 {
  color: var(--accent);
  font-size: 1.8rem;
  margin: 12px 0;
  text-align: center;
}
.gameover-screen .win-msg { color: var(--gold); font-size: 1.3rem; text-align: center; }
.gameover-screen .lose-msg { color: var(--text-dim); font-size: 1rem; text-align: center; margin-top: 8px; }
.gameover-screen .final-pct { color: var(--red); font-size: 1.5rem; font-weight: bold; margin-top: 12px; }
