/* Kofe Mafia
 *
 * One table in a dark room. The lamp over the table is the only warm light;
 * at night it nearly goes out, in the morning it comes back. Gold is for what
 * you can choose, ember for what is lost. Nothing flashes.
 *
 * Order: the door on Rooms, the hub, the form, the table frame, seats, the
 * middle, actions, the side (talk), overlays (role card, game over), lobby, phone.
 */

/* ------------------------------------------------------------------ the door on Rooms */
.mafia-door { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--s-4); margin: var(--s-5) 0 0; padding: 22px 24px; min-height: 120px; border-radius: var(--r-lg); overflow: hidden; text-decoration: none; color: #f4eee2; background: #120e0c; border: 1px solid rgba(203, 166, 96, 0.22); isolation: isolate; }
.mafia-door .md-pic { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #120e0c 30%, rgba(18, 14, 12, 0.55) 62%, rgba(18, 14, 12, 0.2)), url(../art/rooms/law.webp) right 30% / cover no-repeat; transition: transform 1.2s var(--ease); }
.mafia-door:hover .md-pic { transform: scale(1.03); }
.mafia-door .md-text { display: grid; gap: 2px; }
.mafia-door small { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: #cba660; font-weight: 700; }
.mafia-door b { font-family: var(--display); font-size: clamp(28px, 3.4vw, 38px); font-weight: 500; line-height: 1.05; }
.mafia-door .md-text span { color: #dcd3c3; font-size: var(--t-sm); }
.mafia-door .ar-act { background: #e3ad54; color: #2a1c05; }

/* ------------------------------------------------------------------ hub */
.mf-hub { display: grid; gap: var(--s-7); }
.mf-hero { position: relative; border-radius: var(--r-lg); overflow: hidden; min-height: clamp(360px, 52vh, 520px); display: grid; align-items: end; background: #0c0a09; color: #f4eee2; isolation: isolate; }
.mf-hero-pic { position: absolute; inset: 0; z-index: -1; background: url(../art/rooms/law.webp) center 35% / cover no-repeat; filter: brightness(0.5) saturate(0.85); animation: mf-drift 24s ease-in-out infinite alternate; }
.mf-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 50% 30%, transparent 0 30%, rgba(8, 6, 5, 0.85) 75%), linear-gradient(0deg, rgba(8, 6, 5, 0.95), transparent 60%); }
.mf-hero-in { padding: clamp(24px, 5vw, 56px); max-width: 720px; }
.mf-kicker { font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: #cba660; font-weight: 700; }
.mf-hero h1 { font-family: var(--display); font-size: var(--t-hero); font-weight: 500; line-height: 0.95; letter-spacing: -0.01em; margin: 6px 0 14px; }
.mf-lead { font-size: var(--t-md); color: #dcd3c3; max-width: 34em; line-height: 1.5; }
.mf-note { margin-top: var(--s-4); color: #cba660; }
.mf-hero-go { margin-top: var(--s-5); }
.mf-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.mf-how > div { display: grid; gap: var(--s-3); align-content: start; padding: var(--s-5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.mf-how svg { width: 34px; height: 34px; color: var(--door); }
.mf-how p { color: var(--ink-2); line-height: 1.5; }
.mf-list h2 { font-family: var(--display); font-size: var(--t-xl); font-weight: 500; margin-bottom: var(--s-4); }
.mf-rows { display: grid; gap: var(--s-2); }
.mf-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: var(--s-4); align-items: center; padding: 10px 14px 10px 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color var(--fast), transform var(--fast); }
.mf-row:hover { border-color: var(--line-2); transform: translateY(-1px); }
.mf-row img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.mf-row-t { display: grid; gap: 2px; min-width: 0; }
.mf-row-t b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-row-t small { color: var(--muted); }
.mf-row-faces { display: flex; }
.mf-row-faces .mf-av { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.mf-row-act { font-weight: 700; font-size: var(--t-sm); color: var(--lamp); }
.mf-empty { display: grid; gap: var(--s-2); justify-items: start; padding: var(--s-6); border-radius: var(--r-lg); border: 1px dashed var(--line-2); color: var(--muted); }
.mf-empty b { color: var(--ink); font-size: var(--t-md); }
.mf-empty .btn { margin-top: var(--s-3); }
.mf-empty.centre { justify-items: center; text-align: center; margin: 12vh auto; max-width: 420px; border: 0; }
.mf-loading { padding: 18vh 0; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------------ the form */
.mf-form-page { max-width: 680px; margin: 0 auto; }
.mf-form { display: grid; gap: var(--s-5); margin-top: var(--s-3); }
.mf-form h1 { font-family: var(--display); font-size: var(--t-3xl); font-weight: 500; line-height: 1.02; }
.mf-fs { border: 0; padding: 0; margin: 0; display: grid; gap: var(--s-3); min-width: 0; }
.mf-fs legend { font-weight: 700; font-size: var(--t-sm); margin-bottom: var(--s-3); padding: 0; }
.mf-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.mf-form select, .mf-form textarea { width: 100%; }
.mf-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.mf-theme { display: grid; gap: 6px; cursor: pointer; }
.mf-theme input { position: absolute; opacity: 0; pointer-events: none; }
.mf-theme span { aspect-ratio: 4 / 3; border-radius: 12px; background: center / cover no-repeat; outline: 2px solid transparent; outline-offset: 2px; transition: outline-color var(--fast), filter var(--fast); filter: brightness(0.8); }
.mf-theme input:checked + span { outline-color: var(--door); filter: none; }
.mf-theme input:focus-visible + span { outline-color: var(--ink); }
.mf-theme small { font-size: 12.5px; color: var(--muted); }
.mf-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--sunk); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; justify-self: start; }
.mf-seg label { cursor: pointer; }
.mf-seg input { position: absolute; opacity: 0; pointer-events: none; }
.mf-seg span { display: block; padding: 9px 18px; border-radius: 999px; font-weight: 600; font-size: var(--t-sm); color: var(--muted); text-align: center; transition: background var(--fast), color var(--fast); white-space: nowrap; }
.mf-seg input:checked + span { background: var(--raised); color: var(--ink); }
.mf-seg input:focus-visible + span { outline: 2px solid var(--door); }
.mf-hint { color: var(--muted); font-size: var(--t-sm); }
.mf-balance { display: grid; gap: 2px; padding: 12px 16px; border-radius: var(--r); background: var(--door-soft); }
.mf-balance b { font-weight: 700; }
.mf-balance small { color: var(--muted); }
.mf-switches { display: grid; gap: var(--s-3); }
.mf-switch { display: grid; grid-template-columns: 44px 1fr; gap: var(--s-3); align-items: center; cursor: pointer; }
.mf-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mf-switch i { width: 44px; height: 26px; border-radius: 99px; background: var(--raised); position: relative; transition: background var(--fast); }
.mf-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: transform var(--med) var(--ease); }
.mf-switch input:checked + i { background: var(--door); }
.mf-switch input:checked + i::after { transform: translateX(18px); background: var(--door-ink); }
.mf-switch input:focus-visible + i { outline: 2px solid var(--ink); outline-offset: 2px; }
.mf-switch span { display: grid; }
.mf-switch b { font-weight: 600; }
.mf-switch small { color: var(--muted); font-size: var(--t-sm); }
.mf-form-go { display: flex; gap: var(--s-3); justify-content: flex-end; }

/* ------------------------------------------------------------------ the table: frame */
.mf-full .main { max-width: none; padding: 0; }
.mf-play { --ink: #f4eee2; --ink-2: #dcd3c3; --muted: #a69d8f; --line: rgba(244, 238, 226, 0.09); --line-2: rgba(244, 238, 226, 0.18); --surface: #25201b; --raised: #302a23; --sunk: #151210;
  --ember: #e0654f; --red: #d65a4a; --blackteam: #0b0a0a;
  position: relative; min-height: calc(100dvh - var(--top-h)); color: var(--ink); background: #0c0a09; overflow: hidden; isolation: isolate; color-scheme: dark; }
.mf-sky { position: absolute; inset: -20px; z-index: -2; background: #1a1410 center / cover no-repeat; filter: brightness(0.32) saturate(0.85) blur(3px); transform: scale(1.04); transition: filter 1.8s var(--ease); }
.mf-dark { position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse 70% 60% at 50% 42%, rgba(12, 10, 9, 0.15), rgba(12, 10, 9, 0.9) 75%); transition: background 1.8s var(--ease); }
.mf-play[data-state="NIGHT"] .mf-sky { filter: brightness(0.12) saturate(0.35) blur(4px) hue-rotate(185deg); }
.mf-play[data-state="NIGHT"] .mf-dark { background: radial-gradient(ellipse 70% 60% at 50% 42%, rgba(8, 12, 24, 0.55), rgba(4, 6, 12, 0.96) 75%); }
.mf-play[data-state="MORNING"] .mf-sky { filter: brightness(0.5) saturate(1) blur(2px) sepia(0.2); }
.mf-play[data-state="MORNING"] .mf-dark::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 214, 150, 0.12) 50%, transparent 70%) -100% 0 / 200% 100% no-repeat; animation: mf-dawn 3.2s var(--ease) forwards; }
.mf-play[data-state="GAME_OVER"] .mf-sky { filter: brightness(0.4) saturate(0.9) blur(3px); }

.mf-bar { position: relative; z-index: 3; display: flex; align-items: center; gap: var(--s-3); padding: 12px var(--gutter); }
.mf-back, .mf-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--ink); background: rgba(244, 238, 226, 0.06); border: 1px solid var(--line); cursor: pointer; flex: none; }
.mf-back svg, .mf-icon svg { width: 20px; height: 20px; }
.mf-back:hover, .mf-icon:hover { background: rgba(244, 238, 226, 0.12); }
.mf-bar-t { display: grid; min-width: 0; flex: 1; }
.mf-bar-t b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-bar-t small { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: #cba660; font-weight: 700; }
.mf-rolechip { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(244, 238, 226, 0.06); color: var(--ink); font-weight: 700; font-size: var(--t-sm); cursor: pointer; }
.mf-rolechip i { width: 12px; height: 12px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(214, 90, 74, 0.25); }
.mf-rolechip.team-black i { background: #050505; box-shadow: 0 0 0 1px rgba(244, 238, 226, 0.5), 0 0 0 4px rgba(224, 101, 79, 0.25); }
.mf-trouble { position: relative; z-index: 3; margin: 0 auto; width: max-content; padding: 6px 14px; border-radius: 99px; background: rgba(224, 101, 79, 0.16); color: #f2b3a8; font-size: var(--t-sm); font-weight: 600; }
.mf-body { position: relative; z-index: 2; }

.mf-game { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: var(--s-5); max-width: 1360px; margin: 0 auto; padding: 0 var(--gutter) var(--s-5); align-items: start; }
.mf-stage { display: grid; gap: var(--s-4); justify-items: center; min-width: 0; }
.mf-table { position: relative; width: min(100%, 900px); aspect-ratio: 16 / 11; }
.mf-felt { position: absolute; inset: 16% 13%; border-radius: 50%; background: radial-gradient(ellipse at 50% 30%, #3b2b1f, #21180f 62%, #140f0b); border: 1px solid rgba(203, 166, 96, 0.2); box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.65), inset 0 2px 0 rgba(255, 230, 190, 0.06), 0 40px 90px rgba(0, 0, 0, 0.55); transition: filter 1.8s var(--ease); }
.mf-felt i { position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle at 50% 50%, rgba(227, 173, 84, 0.22), transparent 55%); transition: opacity 1.8s var(--ease); pointer-events: none; }
.mf-play[data-state="NIGHT"] .mf-felt { filter: brightness(0.55) saturate(0.6); }
.mf-play[data-state="NIGHT"] .mf-felt i { opacity: 0.15; }

/* ------------------------------------------------------------------ seats */
.mf-seats { position: absolute; inset: 0; }
.mf-seat { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); width: 104px; display: grid; justify-items: center; gap: 3px; padding: 4px; background: none; border: 0; color: var(--ink); font: inherit; cursor: default; transition: transform var(--med) var(--ease), opacity var(--slow) var(--ease); -webkit-tap-highlight-color: transparent; }
.mf-face { position: relative; width: 64px; height: 64px; display: grid; place-items: center; }
.mf-av { width: var(--s, 56px); height: var(--s, 56px); border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none; background: hsl(var(--h, 30) 26% 30%); color: #f4eee2; font-weight: 700; font-size: calc(var(--s, 56px) * 0.34); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.mf-av img { width: 100%; height: 100%; object-fit: cover; }
.mf-av-free { background: transparent; border: 1.5px dashed var(--line-2); box-shadow: none; }
.mf-seat .mf-av { --s: 60px; transition: filter var(--slow), box-shadow var(--med); }
.mf-ring { position: absolute; inset: 0; width: 64px; height: 64px; transform: rotate(-90deg); pointer-events: none; }
.mf-ring circle { fill: none; stroke: var(--lamp); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 188.5; stroke-dashoffset: 188.5; opacity: 0; transition: opacity var(--med); }
.mf-no { position: absolute; top: 0; left: 14px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; background: #151210; color: #dcd3c3; border: 1px solid var(--line-2); }
.mf-name { font-size: 13.5px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }
.mf-name small { font-weight: 600; color: #cba660; }
.mf-tag { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 800; color: var(--muted); }
.mf-crown { position: absolute; top: -4px; right: -2px; width: 18px; height: 18px; color: #cba660; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6)); }
.mf-crown svg { width: 100%; height: 100%; }
.mf-voted { position: absolute; bottom: -2px; right: -2px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #cba660; color: #1d1406; animation: mf-pop 0.35s var(--ease); }
.mf-voted svg { width: 14px; height: 14px; }
.mf-count { position: absolute; top: 2px; right: 12px; min-width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; background: #e3ad54; color: #2a1c05; font-weight: 800; font-size: 13px; animation: mf-pop 0.5s var(--ease) backwards; }
.mf-marks { display: flex; gap: 3px; }
.mf-marks i { font-style: normal; font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 99px; background: rgba(224, 101, 79, 0.2); color: #f2b3a8; }

.mf-seat.is-me .mf-av { box-shadow: 0 0 0 2px rgba(244, 238, 226, 0.55), 0 6px 18px rgba(0, 0, 0, 0.35); }
.mf-seat.is-speaking { transform: translate(-50%, -50%) scale(1.08); z-index: 2; }
.mf-seat.is-speaking .mf-ring circle { opacity: 1; }
.mf-seat.is-speaking .mf-av { box-shadow: 0 0 0 4px rgba(227, 173, 84, 0.22), 0 0 34px rgba(227, 173, 84, 0.45); }
.mf-seat.is-away { opacity: 0.6; }
.mf-seat.is-out .mf-av { filter: grayscale(1) brightness(0.45); box-shadow: none; }
.mf-seat.is-out .mf-name { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(224, 101, 79, 0.6); }
.mf-seat.is-out .mf-tag { color: #e0654f; }
.mf-seat.is-ally .mf-av { box-shadow: 0 0 0 2px #050505, 0 0 0 4px rgba(224, 101, 79, 0.55); }
.mf-seat.is-ally .mf-tag { color: #f2b3a8; }
.mf-seat.is-pickable { cursor: pointer; }
.mf-seat.is-pickable .mf-av { box-shadow: 0 0 0 2px rgba(227, 173, 84, 0.45); }
.mf-seat.is-pickable:hover .mf-av, .mf-seat.is-pickable:focus-visible .mf-av { box-shadow: 0 0 0 3px #e3ad54, 0 0 26px rgba(227, 173, 84, 0.4); }
.mf-seat.is-picked { transform: translate(-50%, -50%) scale(1.1); z-index: 2; }
.mf-seat.is-picked .mf-av { box-shadow: 0 0 0 3px #e3ad54, 0 0 38px rgba(227, 173, 84, 0.55); }
.mf-seats[data-mode="kill"] .mf-seat.is-pickable .mf-av { box-shadow: 0 0 0 2px rgba(224, 101, 79, 0.5); }
.mf-seats[data-mode="kill"] .mf-seat.is-picked .mf-av, .mf-seats[data-mode="kill"] .mf-seat.is-pickable:hover .mf-av { box-shadow: 0 0 0 3px #e0654f, 0 0 38px rgba(224, 101, 79, 0.5); }
.mf-seat.has-voted .mf-av { filter: brightness(0.85); }
.mf-seat.team-black .mf-tag { color: #f4eee2; background: #050505; border: 1px solid rgba(244, 238, 226, 0.25); padding: 2px 8px; border-radius: 99px; }
.mf-seat.team-red .mf-tag { color: #fff2ee; background: #8f2a20; padding: 2px 8px; border-radius: 99px; }
.mf-react { position: absolute; top: 0; left: 50%; width: 0; height: 0; pointer-events: none; }
.mf-react i { position: absolute; left: -14px; top: 0; font-size: 26px; font-style: normal; animation: mf-float 2.2s var(--ease) forwards; }
.mf-play[data-state="NIGHT"] .mf-seat:not(.is-pickable):not(.is-me):not(.is-ally) { opacity: 0.55; }

/* ------------------------------------------------------------------ the middle */
.mf-centre { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46%; display: grid; place-items: center; text-align: center; }
.mf-c-in { display: grid; justify-items: center; gap: 8px; }
.mf-c-in.is-new { animation: mf-in 0.6s var(--ease); }
.mf-c-label { font-size: 11.5px; letter-spacing: 0.22em; text-transform: uppercase; color: #cba660; font-weight: 800; }
.mf-c-head { font-family: var(--display); font-size: clamp(22px, 2.6vw, 32px); font-weight: 500; line-height: 1.12; text-wrap: balance; }
.mf-c-sub { color: var(--ink-2); font-size: var(--t-sm); max-width: 28em; text-wrap: balance; }
.mf-c-news { font-family: var(--display); font-size: clamp(20px, 2.2vw, 26px); animation: mf-in 1s var(--ease) 0.8s backwards; }
.mf-c-news.is-loss { color: #f2b3a8; }
.mf-c-news small { display: block; font-family: var(--body); font-size: var(--t-sm); color: var(--muted); }
.mf-clock { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.mf-clock svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.mf-clock circle { fill: none; stroke-width: 3; }
.mf-clock-bg { stroke: rgba(244, 238, 226, 0.1); }
.mf-clock-fg { stroke: #e3ad54; stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: 0; transition: stroke-dashoffset 0.25s linear, stroke 0.3s; }
.mf-clock span { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 19px; letter-spacing: 0.02em; }
.mf-clock.is-warn .mf-clock-fg { stroke: #e0654f; }
.mf-clock.is-warn span { color: #f2b3a8; animation: mf-beat 1s ease-in-out infinite; }
.mf-tally { list-style: none; padding: 0; margin: 4px 0 0; width: min(280px, 100%); display: grid; gap: 6px; }
.mf-tally li { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px; border-radius: 8px; overflow: hidden; font-size: var(--t-sm); isolation: isolate; }
.mf-tally li::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); z-index: -1; background: rgba(227, 173, 84, 0.18); border-radius: 8px; animation: mf-bar 0.9s var(--ease) calc(var(--i) * 0.15s + 0.2s) backwards; }
.mf-tally li.is-out::before { background: rgba(224, 101, 79, 0.32); }
.mf-tally b { font-weight: 700; }

/* ------------------------------------------------------------------ what you can do */
.mf-act { display: grid; justify-items: center; gap: var(--s-3); min-height: 56px; width: min(100%, 560px); text-align: center; }
.mf-act:empty { min-height: 0; }
.mf-pick { display: grid; justify-items: center; gap: 10px; }
.mf-pick p { display: grid; gap: 2px; font-weight: 700; font-size: var(--t-md); }
.mf-pick small { font-weight: 500; color: var(--muted); font-size: var(--t-sm); }
.mf-a-note { color: var(--muted); font-style: italic; }
.mf-result { display: grid; gap: 4px; justify-items: center; padding: 16px 28px; border-radius: var(--r); background: rgba(214, 90, 74, 0.16); border: 1px solid rgba(214, 90, 74, 0.4); animation: mf-in 0.7s var(--ease); }
.mf-result.team-black { background: #050505; border-color: rgba(244, 238, 226, 0.3); }
.mf-result b { font-family: var(--display); font-size: 34px; letter-spacing: 0.08em; font-weight: 600; }
.mf-checks { width: 100%; text-align: left; font-size: var(--t-sm); }
.mf-checks summary { cursor: pointer; color: var(--muted); font-weight: 700; padding: 6px 0; }
.mf-checks ul { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; }
.mf-checks li { display: grid; grid-template-columns: 80px 1fr auto; gap: 8px; padding: 6px 10px; border-radius: 8px; background: rgba(244, 238, 226, 0.05); }
.mf-checks b.team-black { color: #f4eee2; }
.mf-checks b.team-red { color: #f2b3a8; }

/* ------------------------------------------------------------------ the side: talk */
.mf-side { position: sticky; top: calc(var(--top-h) + 12px); display: grid; gap: var(--s-3); max-height: calc(100dvh - var(--top-h) - 96px); min-height: 0; }
.mf-talk, .mf-team { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 10px; min-height: 0; padding: 14px; border-radius: 20px; background: rgba(21, 18, 16, 0.72); border: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.mf-talk { min-height: 320px; }
.mf-team { grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(8, 6, 6, 0.86); border-color: rgba(224, 101, 79, 0.35); max-height: 260px; }
.mf-team[hidden] { display: none; }
.mf-side h3 { font-size: 11.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.mf-team h3 { color: #f2b3a8; }
.mf-feed { list-style: none; margin: 0; padding: 0 2px 0 0; overflow-y: auto; display: grid; align-content: start; gap: 10px; min-height: 0; overscroll-behavior: contain; }
.mf-msg { display: grid; gap: 2px; }
.mf-msg.is-new, .mf-event.is-new, .mf-lseat.is-new { animation: mf-in 0.4s var(--ease); }
.mf-msg b { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.mf-msg b i { font-style: normal; font-size: 10.5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; display: grid; place-items: center; background: rgba(244, 238, 226, 0.08); }
.mf-msg.is-me b { color: #cba660; }
.mf-msg p { font-size: var(--t-base); line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
.mf-event { display: grid; justify-items: center; gap: 2px; text-align: center; padding: 8px 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: var(--t-sm); color: var(--ink-2); }
.mf-event small { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: #cba660; font-weight: 800; }
.mf-event.is-private { border: 1px solid rgba(203, 166, 96, 0.35); border-radius: 10px; background: rgba(203, 166, 96, 0.08); }
.mf-event.kind-over { color: var(--ink); font-weight: 700; }
.mf-reacts { display: flex; gap: 6px; }
.mf-reacts[hidden] { display: none; }
.mf-reacts button { width: 38px; height: 34px; border-radius: 99px; border: 1px solid var(--line); background: rgba(244, 238, 226, 0.05); font-size: 17px; cursor: pointer; transition: transform var(--fast), background var(--fast); }
.mf-reacts button:hover { background: rgba(244, 238, 226, 0.12); }
.mf-reacts button:active { transform: scale(0.9); }
.mf-say { display: flex; gap: 8px; align-items: flex-end; }
.mf-say textarea, .mf-say input { flex: 1; min-width: 0; resize: none; min-height: 44px; max-height: 120px; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35); color: var(--ink); font: inherit; font-size: var(--t-base); line-height: 1.35; }
.mf-say textarea:focus, .mf-say input:focus { outline: none; border-color: rgba(203, 166, 96, 0.55); }
.mf-say .mf-icon { width: 44px; height: 44px; background: #e3ad54; color: #2a1c05; border: 0; }
.mf-say.is-off { opacity: 0.55; }
.mf-say.is-off .mf-icon { background: rgba(244, 238, 226, 0.1); color: var(--muted); pointer-events: none; }
.mf-say :disabled { cursor: not-allowed; }

/* ------------------------------------------------------------------ overlays: role card, game over */
.mf-layer { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 20px; }
.mf-layer.is-on { display: grid; }
.mf-veil { position: absolute; inset: 0; background: rgba(5, 4, 3, 0.74); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: mf-fade 0.6s ease; }
.mf-card { position: relative; width: min(380px, 90vw); min-height: min(520px, 76vh); display: grid; align-content: center; justify-items: center; gap: 14px; padding: 36px 28px; border-radius: 28px; text-align: center; color: #f4eee2; overflow: hidden; isolation: isolate; animation: mf-card 1s var(--ease); box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7); }
.mf-card::before { content: ""; position: absolute; inset: 10px; border-radius: 20px; border: 1px solid rgba(244, 238, 226, 0.14); pointer-events: none; }
.mf-card.team-red { background: radial-gradient(ellipse at 50% 0%, #6d1e18, #2a0b09 70%); }
.mf-card.team-black { background: radial-gradient(ellipse at 50% 0%, #2a2522, #050404 70%); }
.mf-card.team-black::before { border-color: rgba(224, 101, 79, 0.3); }
.mf-card-k { font-size: 11.5px; letter-spacing: 0.26em; text-transform: uppercase; color: #cba660; font-weight: 800; }
.mf-card h2 { font-family: var(--display); font-size: clamp(40px, 9vw, 54px); font-weight: 500; line-height: 1; letter-spacing: 0.02em; animation: mf-letters 1.4s var(--ease) 0.3s backwards; }
.mf-card-team { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 800; color: rgba(244, 238, 226, 0.7); }
.mf-card-line { font-family: var(--display); font-style: italic; font-size: 20px; line-height: 1.35; color: #f4eee2; max-width: 16em; animation: mf-in 1s var(--ease) 0.8s backwards; }
.mf-card-mates { display: grid; gap: 8px; justify-items: center; padding-top: 6px; }
.mf-card-mates small { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: #f2b3a8; font-weight: 800; }
.mf-card-mates span { display: flex; align-items: center; gap: 8px; }
.mf-card-mates i { font-style: normal; font-size: 12px; color: var(--muted); }
.mf-card .btn { margin-top: 8px; color: #f4eee2; }

.mf-over { position: relative; width: min(760px, 94vw); max-height: 92dvh; overflow-y: auto; display: grid; justify-items: center; gap: 16px; padding: clamp(28px, 5vw, 48px); border-radius: 28px; text-align: center; color: #f4eee2; background: radial-gradient(ellipse at 50% 0%, #2a2018, #0c0a09 70%); border: 1px solid rgba(203, 166, 96, 0.22); animation: mf-card 1s var(--ease); box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7); }
.mf-over.win-red { background: radial-gradient(ellipse at 50% 0%, #5c1a14, #120807 70%); }
.mf-over.win-black { background: radial-gradient(ellipse at 50% 0%, #26211e, #030303 70%); }
.mf-over h2 { font-family: var(--display); font-size: clamp(40px, 7vw, 72px); font-weight: 500; line-height: 1; animation: mf-letters 1.6s var(--ease) 0.2s backwards; }
.mf-o-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; text-align: left; }
.mf-o-team { padding: 14px; border-radius: 18px; background: rgba(244, 238, 226, 0.05); border: 1px solid var(--line); animation: mf-in 0.9s var(--ease) 0.9s backwards; }
.mf-o-team.is-win { border-color: rgba(203, 166, 96, 0.45); background: rgba(203, 166, 96, 0.08); }
.mf-o-team h3 { font-size: 11.5px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 800; margin-bottom: 10px; color: #cba660; }
.mf-o-team.team-red h3 { color: #f2b3a8; }
.mf-o-team ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mf-o-team li { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; }
.mf-o-team li small { color: var(--muted); font-size: 12px; }
.mf-o-team li.is-out .mf-av { filter: grayscale(1) brightness(0.6); }
.mf-o-time { font-family: var(--display); font-style: italic; font-size: 20px; color: var(--ink-2); animation: mf-in 1s var(--ease) 1.4s backwards; }
.mf-o-next { color: #cba660; font-weight: 700; }
.mf-o-go { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; animation: mf-in 1s var(--ease) 1.6s backwards; }
.mf-o-go .btn-quiet { color: var(--muted); }

/* ------------------------------------------------------------------ lobby */
.mf-lobby-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: var(--s-5); max-width: 1360px; margin: 0 auto; padding: var(--s-3) var(--gutter) var(--s-6); align-items: start; }
.mf-lobby { display: grid; gap: var(--s-5); }
.mf-l-head { display: grid; gap: 10px; }
.mf-l-head h1 { font-family: var(--display); font-size: var(--t-3xl); font-weight: 500; line-height: 1.02; overflow-wrap: anywhere; }
.mf-rules { font-family: var(--display); font-style: italic; font-size: var(--t-md); color: var(--ink-2); max-width: 40em; }
.mf-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.mf-chips li { padding: 6px 12px; border-radius: 99px; background: rgba(244, 238, 226, 0.06); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.mf-lseats { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.mf-lseat { position: relative; display: grid; justify-items: center; gap: 6px; padding: 16px 8px 14px; border-radius: 18px; background: rgba(21, 18, 16, 0.6); border: 1px solid var(--line); }
.mf-lseat .mf-av { --s: 64px; }
.mf-lseat.is-ready { border-color: rgba(203, 166, 96, 0.4); }
.mf-lseat.is-ready .mf-tag { color: #cba660; }
.mf-lseat.is-me { background: rgba(203, 166, 96, 0.08); }
.mf-lseat.is-free { background: transparent; border-style: dashed; }
.mf-lseat.is-free .mf-name { color: var(--faint, #7d7469); font-weight: 500; }
.mf-x { position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.mf-x:hover { background: rgba(244, 238, 226, 0.08); color: var(--ink); }
.mf-watchers { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--t-sm); }
.mf-watchers span { margin-right: 6px; }
.mf-l-go { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mf-l-go .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.mf-why { color: var(--muted); font-size: var(--t-sm); }
.mf-l-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-left: -12px; }
.mf-l-tools .btn svg { width: 16px; height: 16px; }
.mf-l-tools .btn { gap: 8px; color: var(--muted); }
.mf-lobby-wrap .mf-talk { min-height: 420px; }

/* ------------------------------------------------------------------ motion */
@keyframes mf-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes mf-fade { from { opacity: 0; } }
@keyframes mf-pop { from { transform: scale(0.4); opacity: 0; } }
@keyframes mf-bar { from { width: 0; } }
@keyframes mf-beat { 50% { opacity: 0.55; } }
@keyframes mf-float { 0% { transform: translateY(0) scale(0.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-16px) scale(1.1); } 100% { transform: translateY(-70px) scale(1); opacity: 0; } }
@keyframes mf-card { from { opacity: 0; transform: perspective(900px) rotateY(-24deg) scale(0.94); filter: blur(10px); } }
@keyframes mf-letters { from { letter-spacing: 0.3em; opacity: 0; filter: blur(8px); } }
@keyframes mf-dawn { to { background-position: 100% 0; } }
@keyframes mf-drift { to { transform: scale(1.06) translateX(-1.5%); } }
@media (prefers-reduced-motion: reduce) {
  .mf-play *, .mf-hub *, .mf-layer * { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------ tablet and phone */
@media (max-width: 1080px) {
  .mf-game, .mf-lobby-wrap { grid-template-columns: minmax(0, 1fr); }
  .mf-side { position: static; max-height: none; }
  .mf-talk { max-height: 520px; }
}
@media (max-width: 760px) {
  .mf-full .tabbar { display: none; }
  .mf-play { min-height: calc(100dvh - var(--top-h)); }
  .mf-how { grid-template-columns: 1fr; }
  .mf-row { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .mf-row img { width: 52px; height: 52px; }
  .mf-row-faces { display: none; }
  .mf-grid2 { grid-template-columns: 1fr; }
  .mf-bar { padding: 10px 14px; }
  .mf-rolechip span { display: none; }
  .mf-rolechip { width: 42px; padding: 0; justify-content: center; }
  .mf-game { padding: 0 12px 16px; gap: 14px; }
  /* the table becomes: what is happening, then everyone in a compact grid */
  .mf-table { aspect-ratio: auto; display: grid; gap: 14px; width: 100%; }
  .mf-felt { display: none; }
  .mf-centre { position: static; transform: none; width: 100%; padding: 18px 14px; border-radius: 20px; background: radial-gradient(ellipse at 50% 0%, rgba(59, 43, 31, 0.85), rgba(20, 15, 11, 0.85)); border: 1px solid rgba(203, 166, 96, 0.18); }
  .mf-play[data-state="NIGHT"] .mf-centre { background: radial-gradient(ellipse at 50% 0%, rgba(20, 26, 44, 0.85), rgba(6, 8, 14, 0.9)); border-color: rgba(140, 160, 210, 0.16); }
  .mf-clock { width: 70px; height: 70px; }
  .mf-clock span { font-size: 16px; }
  .mf-seats { position: static; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 4px; }
  .mf-seats[data-wide="1"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mf-seat { position: relative; left: auto; top: auto; transform: none; width: auto; min-width: 0; padding: 4px 0; }
  .mf-seat.is-speaking, .mf-seat.is-picked { transform: scale(1.06); }
  .mf-face, .mf-ring { width: 56px; height: 56px; }
  .mf-seat .mf-av { --s: 52px; }
  .mf-no { left: -2px; }
  .mf-name { font-size: 12.5px; }
  .mf-tag { font-size: 9.5px; letter-spacing: 0.08em; }
  .mf-act { width: 100%; }
  .mf-talk { min-height: 280px; max-height: 60dvh; }
  .mf-lobby-wrap { padding: 4px 14px 20px; }
  .mf-lseats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .mf-lseat .mf-av { --s: 54px; }
  .mf-o-teams { grid-template-columns: 1fr; }
  .mf-over .btn { flex: 1 1 100%; }
  .mafia-door { grid-template-columns: 1fr; padding: 18px; }
  .mafia-door .ar-act { justify-self: start; }
}

/* Armenian capitals read better without letter-spaced capitals */
html[lang="hy"] .mf-c-label, html[lang="hy"] .mf-bar-t small, html[lang="hy"] .mf-side h3, html[lang="hy"] .mf-event small, html[lang="hy"] .mf-tag,
html[lang="hy"] .mf-card-k, html[lang="hy"] .mf-card-team, html[lang="hy"] .mf-o-team h3, html[lang="hy"] .mf-kicker, html[lang="hy"] .mf-card-mates small, html[lang="hy"] .mafia-door small { text-transform: none; letter-spacing: 0.02em; }
.mf-say input:disabled + .mf-icon, .mf-say textarea:disabled + .mf-icon { background: rgba(244, 238, 226, 0.1); color: var(--muted); pointer-events: none; }
