/* Werewolf Rooms — dark, mobile-first, big touch targets. */
:root {
  --bg: #14101f;
  --card: #1f1830;
  --accent: #8b5cf6;
  --accent2: #f59e0b;
  --green: #34d399;
  --red: #f87171;
  --text: #f1eefc;
  --muted: #a79fc4;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh; display: flex; justify-content: center;
}
#app { width: 100%; max-width: 480px; padding: 16px; }
.screen { display: none; }
.screen.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.card {
  background: var(--card); border-radius: 16px; padding: 24px 20px;
  margin-top: 24px; box-shadow: 0 8px 32px rgba(0,0,0,.4); text-align: center;
}
.logo { font-size: 56px; }
h1 { margin: 8px 0 4px; font-size: 32px; }
h2 { margin: 8px 0; }
h3 { margin: 16px 0 8px; color: var(--muted); font-size: 15px; text-transform: uppercase; letter-spacing: 1px; }
.tagline, .hint { color: var(--muted); line-height: 1.5; }
.code {
  font-size: 30px; letter-spacing: 8px; color: var(--accent2);
  font-weight: 800; font-variant-numeric: tabular-nums;
}
.btn {
  display: block; width: 100%; margin: 10px 0; padding: 15px;
  font-size: 17px; font-weight: 700; border: none; border-radius: 12px;
  background: #2c2347; color: var(--text); cursor: pointer;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); }
.btn.big { font-size: 19px; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn:disabled { opacity: .4; }
.btn.selected { background: var(--accent2); color: #1a1206; }
.btnrow { display: flex; gap: 10px; }
.btnrow .btn { flex: 1; }
.langbtn { font-size: 20px; padding: 10px; }
.setup { color: var(--accent2); font-weight: 700; }

/* Modal (rules / roles) */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--card); border-radius: 16px; padding: 24px 20px;
  max-width: 440px; width: 100%; max-height: 82vh; overflow-y: auto;
  text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,.5);
  animation: fade .2s ease;
}
.rules-list { text-align: left; line-height: 1.6; padding-left: 4px; list-style: none; }
.rules-list li { margin: 10px 0; }
.rolecard {
  display: flex; gap: 12px; align-items: center; text-align: left;
  margin: 10px 0; background: #2a2144; border-radius: 10px; padding: 10px;
}
.rolecard img {
  width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex-shrink: 0;
}
.rolecard-name { font-weight: 800; font-size: 16px; }
.rolecard-desc { color: var(--muted); font-size: 14px; margin-top: 4px; line-height: 1.4; }
.team { font-size: 11px; padding: 2px 8px; border-radius: 12px; margin-left: 6px; white-space: nowrap; }
.team-wolf { background: var(--red); color: #1a0606; }
.team-village { background: var(--green); color: #06281c; }

/* Game log */
.gamelog { margin: 16px 0 4px; text-align: left; }
.gamelog summary {
  cursor: pointer; color: var(--muted); font-weight: 700;
  padding: 10px; font-size: 16px; user-select: none;
}
.loglist { list-style: none; padding: 0; margin: 8px 0; max-height: 220px; overflow-y: auto; }
.loglist li {
  padding: 8px 12px; margin: 4px 0; background: #2a2144;
  border-radius: 8px; font-size: 14px; line-height: 1.4;
}
input {
  display: block; width: 100%; margin: 10px 0; padding: 15px;
  font-size: 18px; border-radius: 12px; border: 2px solid #2c2347;
  background: #171226; color: var(--text); text-align: center;
}
input:focus { outline: none; border-color: var(--accent); }
.divider { display: flex; align-items: center; color: var(--muted); margin: 14px 0; }
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: #2c2347; margin: 0 10px;
}
.plist { list-style: none; padding: 0; margin: 12px 0; text-align: left; }
.plist li {
  padding: 11px 14px; margin: 6px 0; background: #2a2144; border-radius: 10px;
  display: flex; justify-content: space-between; align-items: center; font-size: 16px;
}
.plist li.me { border: 2px solid var(--accent); }
.plist li.dead { opacity: .45; text-decoration: line-through; }
.plist li.offline { opacity: .6; }
.badge {
  font-size: 12px; padding: 3px 9px; border-radius: 20px; background: #3a2f5c;
  color: var(--muted); margin-left: 6px; white-space: nowrap;
}
.badge.host { background: var(--accent2); color: #1a1206; }
.badge.ready { background: var(--green); color: #06281c; }
.role-emoji { font-size: 72px; }
.role-art { width: 100%; max-width: 320px; border-radius: 12px; margin: 8px auto; display: block; }
.wolves { color: var(--red); font-weight: 700; }
.warn { color: var(--accent2); font-weight: 600; }
.dawn {
  background: #2a2144; border-radius: 12px; padding: 16px; margin: 12px 0;
  font-size: 17px; line-height: 1.6;
}
.votelist { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.votelist .btn { margin: 0; text-align: left; display: flex; justify-content: space-between; }
.votelist .btn .n { color: var(--accent2); font-weight: 800; }
.host-only { display: none; }
body.is-host .host-only { display: block; }
body.is-host .player-only, body.is-spectator .player-only { display: none; }
.vote:disabled { opacity: .55; }
.ok { color: var(--green); font-weight: 700; }
.warn-text { color: var(--accent2); font-weight: 700; }
.seer-big { font-size: 64px; margin: 8px 0; }
.stepper {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; font-size: 17px;
}
.stepbtns { display: flex; align-items: center; gap: 10px; }
.stepbtn {
  width: 38px; height: 38px; border-radius: 10px; border: none;
  background: #3a2f5c; color: var(--text); font-size: 22px; font-weight: 800;
  cursor: pointer;
}
.stepper b { min-width: 28px; text-align: center; font-size: 19px; }
#role-config { background: #241c3d; border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
#role-config h3 { margin: 0 0 4px; font-size: 16px; color: var(--muted); }
#control-offer .modal-card, #control-picker .modal-card { text-align: center; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #f87171; color: #1a0606; font-weight: 700;
  padding: 12px 20px; border-radius: 12px; max-width: 90%;
  box-shadow: 0 4px 16px rgba(0,0,0,.5); z-index: 50;
}
.toast.hidden { display: none; }
.reconnect {
  position: fixed; top: 0; left: 0; right: 0; background: var(--accent2);
  color: #1a1206; text-align: center; font-weight: 700; padding: 10px; z-index: 60;
}
.reconnect.hidden { display: none; }
.roleline { display: flex; justify-content: space-between; }
.roleline .r-werewolf { color: var(--red); font-weight: 700; }
.roleline .r-seer { color: var(--accent); font-weight: 700; }
.roleline .r-doctor { color: var(--green); font-weight: 700; }
.roleline .r-villager { color: var(--muted); }
