/* ==========================================================================
   Mafia — styles. Theme tokens and shared components come from shared/style.css.

   Night is dark, whatever the phone's theme: the whole game screen turns to
   night blue, so a room full of phones goes dark together. Your role card is
   face down until you tap it.
   ========================================================================== */

.mf { display: grid; gap: 1rem; max-width: 30rem; margin-inline: auto; padding-block: .75rem 2rem; }
.mf-top { display: flex; align-items: center; gap: .6rem; }
.mf-top .clock { margin-inline-start: auto; }
.mf-title { font-size: clamp(1.6rem, 7vw, 2.2rem); }
.mf-title--end { text-align: center; }
.mf-title--mafia { color: var(--tomato); }
.mf-subtitle { font-size: 1.2rem; }
.mf-note { font-size: 1.05rem; font-weight: 700; text-align: center; }
.mf-note:empty { display: none; }
.mf-result { font-size: 1.25rem; color: var(--text); }
.mf-center-btn { justify-self: center; }
.mf-hint { padding: .7rem .9rem; font-weight: 800; background: var(--surface-2); border: 3px dashed var(--line); border-radius: 14px 16px 13px 17px; }
.mf-banner { padding: .6rem .9rem; font-weight: 800; text-align: center; background: var(--surface-2); border-radius: 14px; }

/* ---------- Menu ---------- */

.mf-menu { display: grid; gap: .5rem; }
.mf-menu__art { font-size: 1.8rem; text-align: center; letter-spacing: .1em; }
.mf-tagline { font-size: 1.1rem; font-weight: 700; text-align: center; }

.howto { max-width: 30rem; margin: 1.5rem auto 0; padding: .25rem 1rem; }
.howto summary { min-height: var(--tap); display: flex; align-items: center; font-weight: 800; cursor: pointer; }
.howto ol { display: grid; gap: .5rem; padding: 0 0 1rem; padding-inline-start: 1.4rem; list-style: decimal; }

.host--small .host__teta { width: 76px; }
.host--small .bubble { padding: .65rem .9rem; font-weight: 700; }

/* ---------- The role card ---------- */

.mf-card { display: grid; min-height: 15rem; padding: 0; font: inherit; color: inherit; text-align: center; cursor: pointer; overflow: hidden; }
.mf-card > * { grid-area: 1 / 1; display: grid; place-content: center; justify-items: center; gap: .45rem; padding: 1.4rem 1.2rem; transition: opacity .25s, transform .25s; }
.mf-card__back { color: #f7ecd6; background: repeating-linear-gradient(45deg, #23305e 0 14px, #1d2851 14px 28px); }
.mf-card__back span { font-size: 3.4rem; line-height: 1; }
.mf-card__back b { font-size: 1.3rem; }
.mf-card__face { opacity: 0; transform: scale(.94); }
.mf-card.is-shown .mf-card__back { opacity: 0; transform: scale(1.04); pointer-events: none; }
.mf-card.is-shown .mf-card__face { opacity: 1; transform: none; }
.mf-card__icon { font-size: 4rem; line-height: 1; }
.mf-card__name { font-size: 2rem; font-weight: 900; }
.mf-card--mafia .mf-card__name { color: var(--tomato); }
.mf-card__text { max-width: 22rem; font-weight: 700; }
.mf-card__team { padding: .4rem .8rem; font-weight: 800; background: var(--surface-2); border-radius: 12px; }

/* ---------- Players ---------- */

.mf-people { display: grid; gap: .45rem; }
.mf-person { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem; width: 100%; min-height: 3.4rem; padding: .5rem .8rem; font: inherit; color: var(--text); text-align: start; background: var(--surface); border: 3px solid var(--line); border-radius: 14px 16px 13px 17px; }
button.mf-person { cursor: pointer; touch-action: manipulation; }
button.mf-person:active { transform: translateY(2px); }
.mf-person.is-picked { color: var(--ink); background: var(--sun); box-shadow: 0 3px 0 var(--line); }
.mf-person.is-out { opacity: .55; text-decoration: line-through; }
.mf-person__face { font-size: 1.6rem; }
.mf-person__name { min-width: 0; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.mf-person__name small { font-weight: 700; color: var(--muted); }
.mf-person.is-picked .mf-person__name small { color: inherit; }
.mf-person__mark { font-size: .9rem; font-weight: 800; text-align: end; }
.mf-votes { display: grid; justify-items: end; }
.mf-nobody.is-picked { --btn-bg: var(--sun); --btn-fg: var(--ink); }

.mf-checks { display: grid; gap: .5rem; padding: .9rem 1rem; }
.mf-checks ul { display: grid; gap: .3rem; font-weight: 800; }
.mf-checks .is-mafia { color: var(--tomato); }

/* ---------- News ---------- */

.mf-news { display: grid; justify-items: center; gap: .35rem; padding: 1.4rem 1rem; text-align: center; }
.mf-news__face { font-size: 3.4rem; line-height: 1; }
.mf-news b { font-size: 1.4rem; }
.mf-news.is-dead { background: var(--surface-2); }
.mf-log { display: grid; gap: .35rem; padding: .9rem 1rem .9rem 2.2rem; font-weight: 700; list-style: decimal; }

/* ---------- Night ---------- */

.mf--night {
  --surface: #1f2b52;
  --surface-2: #2a3866;
  --text: #f7ecd6;
  --muted: #aeb6d6;
  --line: #070b18;
  padding-inline: 1rem;
  color: var(--text);
  background: radial-gradient(circle at 80% 0%, #33427a 0, #141c38 55%, #0c1126 100%);
  border-radius: 22px;
  box-shadow: 0 0 0 100vmax #0c1126; /* the night reaches the edges of the screen */
  clip-path: inset(0 -100vmax);
}
.mf--night .mf-hint { border-color: #5a6aa8; }
@media (prefers-reduced-motion: reduce) { .mf-card > * { transition: none; } }
