/* Mafia-only styles. The theme and the shared controls are in ../shared/base.css.
   The players list, the door and the room parts are the same as Impostor's. */

/* Players */
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.players li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 8px 8px 12px;
}
.players .pname { flex: 1; font-weight: 600; }
.players .pscore { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.players .remove { background: none; border: 0; color: var(--muted); font-size: 20px; padding: 0 6px; }

.rules summary { font-weight: 700; cursor: pointer; }
.rules ol { margin: 8px 0 0; padding-left: 20px; color: var(--muted); line-height: 1.5; }

/* Reveal: the card sits behind a door that slides up while held */
.name { font-size: 32px; }

.vault {
  position: relative;
  height: 360px;
  border-radius: 24px;
  overflow: hidden;
  background: #0d0f1f;
  border: 3px solid var(--line);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}

.card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
}
.card .label { color: var(--muted); text-transform: uppercase; letter-spacing: 2px; font-size: 13px; }
.card .word { font-size: 40px; font-weight: 800; line-height: 1.1; word-break: break-word; }
.card .tag { font-size: 15px; color: var(--muted); }
.card .tag b { color: var(--text); }
.card.impostor .word { color: var(--red); font-size: 34px; }

.door {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(180deg, transparent 0 34px, rgba(0, 0, 0, 0.18) 34px 38px),
    linear-gradient(180deg, #ffd85c, #f2b705);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transform: translateY(0);
  transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.2, 1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.vault.open .door { transform: translateY(-100%); }

.door-label {
  color: #3a2c00;
  font-weight: 800;
  font-size: 22px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.door-handle {
  position: absolute;
  bottom: 22px;
  width: 90px;
  height: 14px;
  border-radius: 8px;
  background: #3a2c00;
  opacity: 0.6;
}

/* Votes */
.votes { display: flex; flex-direction: column; gap: 8px; }
.votes .vrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
}

/* ---------- Each on own phone (online.js) ---------- */
.group { display: flex; flex-direction: column; gap: 16px; }
code { font-size: 13px; color: var(--text); }
.pill {
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}
.code-input { text-transform: uppercase; letter-spacing: 6px; font-weight: 800; font-size: 20px; text-align: center; }
.wait { align-items: center; padding: 32px 16px; }
.spinner {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Lobby */
.room { align-items: center; text-align: center; }
.room-code { font-size: 44px; font-weight: 900; letter-spacing: 8px; color: var(--accent); }
.link-text { word-break: break-all; }
/* White behind the QR code so every phone camera reads it. */
.qr { width: 168px; max-width: 100%; margin: 6px auto; padding: 6px; background: #fff; border-radius: 10px; }
.qr svg { display: block; width: 100%; height: auto; }
.notice { margin: 0; color: var(--text); border: 1px solid var(--accent); line-height: 1.4; }
.players .tag { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--accent); color: #1b1b1b; }
.players .tag.you { background: var(--line); color: var(--text); }
.players li.away { opacity: 0.5; }
.chip:disabled { cursor: default; }
#o-settings.readonly .seg button:not(.on), #o-settings.readonly .chip:not(.on) { opacity: 0.6; }

/* Who has seen their card / who has voted */
.players.marks li { padding: 8px 12px; }
.players .mark { font-weight: 800; color: var(--muted); }
.players .mark.done { color: var(--green); }
.vault.waiting { cursor: default; }
.vault.waiting .door { filter: grayscale(0.7); }

.icon-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  width: 36px; height: 36px;
  font-size: 16px;
  flex: none;
}
#screen-o-game > .row.between > .pill { margin-left: auto; margin-right: 8px; }

/* Leave, resume and "forgot your word" sheets */
.o-sheet .stack { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.o-sheet .btn { width: 100%; }
.o-sheet .vault { height: 300px; margin-top: 8px; }

/* ---------- Mafia ---------- */
.settings .row.between > span { font-size: 15px; }
.settings .seg.toggle { min-width: 120px; }
.settings.readonly .seg button:not(.on) { opacity: 0.6; }
.settings .stepper { gap: 12px; }

/* Role card */
.card .role-icon { font-size: 54px; line-height: 1; }
.card.mafia .word { color: var(--red); }
.card .tag { line-height: 1.35; }
.night-tag { text-transform: uppercase; letter-spacing: 2px; font-size: 13px; }
.small-vault { height: 300px; }

/* Name chips of a night move or a vote: big targets, the same grid for every role */
.pick { justify-content: center; }
.pick .chip { padding: 12px 16px; font-size: 16px; color: var(--text); border-width: 2px; }
.pick .chip.on { color: #1b1b1b; border-color: var(--accent); }
.pick .chip:disabled { opacity: 0.3; }
.pick .chip.nobody { border-style: dashed; }

.done-box { min-height: 160px; justify-content: center; }
.done-text { font-size: 24px; font-weight: 800; margin: 0; line-height: 1.3; }

/* The narrator */
.say { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 24px 8px 8px; }
.say-icon { font-size: 64px; line-height: 1; min-height: 1em; }
.say-icon:empty { display: none; }
.say-title { font-size: 28px; }
.say-text { font-size: 20px; line-height: 1.4; }
.say-text .who { font-weight: 800; }
.role-reveal { margin-top: 8px; font-size: 17px; color: var(--muted); }
.small-say { padding-top: 8px; }
.small-say .say-icon { font-size: 40px; }
.small-say p { margin: 0; }
/* The timer's latest line ("30 seconds left", "Time's up"), big enough to read across a table */
.say-alert { margin: 0; padding: 8px 14px; border-radius: 12px; background: var(--bg); border: 2px solid var(--accent); font-size: 20px; font-weight: 800; }
.say-repeat { font-size: 15px; }

/* Day timer */
.timer { font-size: 64px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.timer.up { color: var(--red); font-size: 40px; }

/* End */
.roles-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.roles-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 16px; }
.roles-list li .who { font-weight: 700; }
.roles-list li.dead .who { text-decoration: line-through; opacity: 0.7; }
.roles-list li.mafia .role { color: var(--red); font-weight: 700; }
.log { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); line-height: 1.4; }
.log b { color: var(--text); }

.players li.dead .pname { text-decoration: line-through; opacity: 0.6; }
.players .mark.dead { color: var(--red); }

/* Settings: seven short timer choices fit on one line */
.settings .timer-seg button { padding-left: 2px; padding-right: 2px; min-width: 0; }

/* Role card: the no-showing rule; end: a win */
.card .tag.warn { font-size: 13px; margin-top: 4px; }
.roles-list li .win { color: var(--green); font-weight: 700; margin-left: auto; margin-right: 8px; }

/* Mute this phone: a corner button on every screen */
.mute-btn {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  right: calc(8px + env(safe-area-inset-right));
  z-index: 50;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  padding: 0;
  opacity: 0.9;
}
.mute-btn[aria-pressed="true"] { border-color: var(--accent); opacity: 1; }
/* Room the corner button needs in the rows at the top of the room screens */
#screen-o-lobby > .row.between:first-child,
#screen-o-game > .row.between:first-child { padding-right: 48px; }
.phone-muted .say-repeat::after { content: " · muted"; font-size: 12px; color: var(--muted); }
