/* ============================================================
   Werewolf — role dealer for an in-person werewolf game.
   Imports the shared pris.la tokens; everything below is local
   to /who and consumes those tokens only (no raw hex/fonts).
   ============================================================ */

@import "../tokens/fonts.css";
@import "../tokens/colors.css";
@import "../tokens/typography.css";
@import "../tokens/spacing.css";

:root {
  --card: var(--surface-card);
  --hair: var(--line);
  --muted: var(--soft);
  --wolf: var(--viz-red);
  --safe: var(--ok);
  --accent-soft: rgba(240, 168, 184, 0.12); /* matches typeme's accent-tint alias */
}

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

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  display: flex;
  justify-content: center;
  padding: 28px 16px 56px;
  -webkit-font-smoothing: antialiased;
}

#app { width: 100%; max-width: 460px; }

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ── brand ── */
.who-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
}
.who-brand .glyph { color: var(--accent); font-size: 20px; }
.who-brand h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: var(--tracking-display);
  margin: 0;
}
.who-brand .tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
}

.lede {
  font-size: var(--text-lede);
  line-height: 1.6;
  color: var(--soft);
  margin: 0 0 24px;
}

/* ── generic card / panel ── */
.panel {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--radius-panel);
  padding: 22px;
  margin-bottom: 16px;
}
.panel-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 6px;
}
.panel-sub {
  font-size: var(--text-body-sm);
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

/* ── buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-button);
  font-family: var(--font-mono);
  font-size: var(--text-button);
  letter-spacing: var(--tracking-button);
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: opacity var(--ease-lift), transform var(--ease-lift), border-color var(--ease-lift), color var(--ease-lift);
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--hair); }
.btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-outline:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }

/* ── form ── */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--hair);
  border-radius: var(--radius-input);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px; /* ≥16px stops iOS zooming the page on focus */
  outline: none;
  transition: border-color var(--ease-lift);
}
.field input:focus { border-color: var(--accent); }
.field input::placeholder { color: var(--muted); }
.error-msg {
  color: var(--wolf);
  font-size: var(--text-body-sm);
  margin: -6px 0 14px;
}

/* ── landing choice cards ── */
.choice-row { display: flex; flex-direction: column; gap: 14px; }
.choice-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--radius-panel);
  padding: 20px;
  color: var(--ink);
  transition: border-color var(--ease-lift), transform var(--ease-lift);
}
.choice-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.choice-card h3 { font-family: var(--font-display); font-size: 19px; font-weight: 500; margin: 0 0 4px; }
.choice-card p { font-size: var(--text-body-sm); color: var(--muted); margin: 0; line-height: 1.5; }

/* ── room code + share link ── */
.room-code {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--accent);
  margin: 4px 0 14px;
}
.share-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px dashed var(--hair);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
  margin-bottom: 16px;
}
.share-link button {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--hair);
  color: var(--ink);
  border-radius: var(--radius-button);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}
.share-link button:hover { border-color: var(--accent); color: var(--accent); }

/* ── roster ── */
.player-list { list-style: none; margin: 0; padding: 0; }
.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 15px;
}
.player-row:last-child { border-bottom: none; }
.player-row .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--safe); flex-shrink: 0;
}
.player-row .role-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: auto;
}
.player-row .role-tag.mod { color: var(--accent); }
.player-row .role-tag.kick {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.player-row .role-tag.kick:hover { color: var(--wolf); }
.player-row.role-werewolf .dot { background: var(--wolf); }
.player-row.role-werewolf .role-tag { color: var(--wolf); }

/* ── section label (reused as a small caps heading) ── */
.progress-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ── role card ── */
.role-card {
  text-align: center;
  padding: 30px 22px;
  border-radius: var(--radius-panel);
  border: 1px solid transparent;
}
.role-card .role-glyph { font-size: 36px; margin-bottom: 10px; color: var(--ink); line-height: 1; }
.role-card h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  margin: 0 0 8px;
}
.role-card p { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: 0; }
.role-card.is-werewolf { border-color: var(--wolf); }
.role-card.is-werewolf h2, .role-card.is-werewolf .role-glyph { color: var(--wolf); }
.role-card.is-moderator { border-color: var(--accent); }
.role-card.is-moderator h2, .role-card.is-moderator .role-glyph { color: var(--accent); }

/* ── tap-to-reveal (keeps a role off-screen until the player is ready) ── */
.reveal-card {
  display: block;
  width: 100%;
  text-align: center;
  padding: 46px 22px;
  border-style: dashed;
  color: var(--ink);
  transition: border-color var(--ease-lift), transform var(--ease-lift);
}
.reveal-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.reveal-card .role-glyph {
  font-family: var(--font-display);
  font-size: 44px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
}
.reveal-card h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 8px;
}
.reveal-card p { color: var(--muted); font-size: 14px; margin: 0; }

/* ── moderator script ── */
.script-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--ease-lift);
}
.script-toggle:hover { color: var(--accent); }
.script-toggle .chev {
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
  color: var(--accent);
}
.script-body { margin-top: 18px; }

.script-list {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}
.script-step {
  counter-increment: step;
  position: relative;
  padding: 0 0 12px 26px;
  border-bottom: 1px solid var(--hair);
  margin-bottom: 12px;
}
.script-step:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.script-step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.script-step .say {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink);
}
.script-step .note {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 5px;
}
.script-end {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}

.guide-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-button);
  letter-spacing: var(--tracking-button);
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color var(--ease-lift);
}
.guide-link:hover { border-bottom-color: var(--accent); }
.script-body .guide-link { margin-top: 20px; }

/* ── guide page ── */
.guide-list {
  margin: 0;
  padding-left: 18px;
  list-style: none;
}
.guide-list li {
  position: relative;
  font-size: 15px;
  line-height: 1.6;
  color: var(--soft);
  margin-bottom: 10px;
}
.guide-list li:last-child { margin-bottom: 0; }
.guide-list li::before {
  content: "—";
  position: absolute;
  left: -18px;
  color: var(--accent);
}
.guide-list strong { color: var(--ink); font-weight: 600; }
a.back-link { text-decoration: none; }

/* ── misc ── */
.hint { font-size: 13px; color: var(--muted); text-align: center; margin: 10px 0 0; line-height: 1.5; }
.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 18px;
  background: none;
  border: none;
  padding: 0;
}
.back-link:hover { color: var(--accent); }
