:root {
  color-scheme: dark;
  --ink: #e8e7e1;
  --muted: #96a2a7;
  --line: rgba(192, 212, 217, .12);
  --panel: rgba(10, 19, 24, .88);
  --panel-soft: rgba(16, 29, 35, .78);
  --teal: #8daeb0;
  --ember: #e38c4c;
  --ember-light: #ffc080;
  --danger: #c57968;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #0a1116; }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: hidden; background: #0a1116; color: var(--ink); font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
canvas { position: fixed; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; }
.scene-wash { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(5, 12, 17, .84) 0%, rgba(6, 13, 18, .48) 46%, rgba(5, 11, 16, .74) 100%), linear-gradient(0deg, rgba(5, 10, 14, .58), transparent 44%, rgba(5, 10, 14, .45)); }
.topbar { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; width: min(1440px, 100%); min-height: 86px; margin: 0 auto; padding: 0 5.1vw; border-bottom: 1px solid rgba(216, 228, 228, .1); }
.brand { display: inline-flex; align-items: center; gap: 13px; padding: 0; border: 0; background: transparent; text-align: right; cursor: pointer; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(230, 151, 91, .5); border-radius: 50%; color: var(--ember-light); font-size: 20px; box-shadow: 0 0 24px rgba(225, 127, 59, .12); }
.brand strong { display: block; color: #f4eee4; font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 500; letter-spacing: .04em; }
.brand small { display: block; margin-top: 2px; color: #849397; direction: ltr; font-size: 9px; letter-spacing: .2em; text-align: right; }
.topbar-actions { display: flex; align-items: center; gap: 24px; }
.connection-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.connection-state i, .live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #caa368; box-shadow: 0 0 12px currentColor; }
.connection-state.is-connected i, .live-pill i { background: #79b78e; }
.player-chip { display: flex; align-items: center; gap: 9px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 30px; background: rgba(11, 22, 28, .58); cursor: pointer; }
.avatar-mark { color: var(--ember); font-size: 13px; }
.player-chip span:last-child { max-width: 130px; overflow: hidden; color: #d7dfdc; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
#appMain { position: relative; z-index: 3; width: min(1440px, 100%); min-height: calc(100vh - 86px); margin: 0 auto; padding: 0 5.1vw; }
.view[hidden] { display: none !important; }
.install-overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; overflow-y: auto; padding: 24px; background: radial-gradient(ellipse at 50% 5%, rgba(33, 58, 67, .46), transparent 55%), #070c10; }
.install-overlay[hidden] { display: none !important; }
.install-card { width: min(650px, 100%); padding: clamp(24px, 6vw, 48px); border: 1px solid rgba(219, 229, 221, .13); border-radius: 22px; background: linear-gradient(145deg, rgba(19, 31, 36, .96), rgba(9, 16, 20, .98)); box-shadow: 0 30px 100px rgba(0, 0, 0, .45); }
.install-mark { display: grid; width: 56px; height: 56px; margin-bottom: 22px; place-items: center; border: 1px solid rgba(230, 151, 91, .5); border-radius: 50%; color: var(--ember-light); font-size: 26px; }
.install-card h1 { margin: 14px 0; color: #f4eee4; font-size: clamp(23px, 5vw, 34px); line-height: 1.55; }
.install-card > p:not(.eyebrow) { color: #b5c0bf; line-height: 1.9; }
.install-help { display: grid; gap: 12px; margin-top: 26px; }
.install-help article { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .025); }
.install-help strong { color: var(--ember-light); direction: ltr; display: block; text-align: right; }
.install-help p { margin: 8px 0 0; color: #a9b5b5; font-size: 13px; line-height: 1.8; }
html.mobile-install-required .topbar, html.mobile-install-required #appMain, html.mobile-install-required .match-intro, html.mobile-install-required .role-reveal, html.mobile-install-required .match-hud, html.mobile-install-required .winner-screen, html.mobile-install-required .forfeit-dialog, html.mobile-install-required .modal-backdrop, html.mobile-install-required .toast, html.mobile-install-required .scene-wash { display: none !important; }
html.mobile-install-required #installOverlay { display: grid !important; }
.settings-audio, .settings-microphone { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.settings-audio h3, .settings-microphone h3 { margin: 0 0 12px; color: #e8d8c8; font-size: 15px; }
.audio-setting { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 12px; margin: 10px 0; color: #b9c3c0; font-size: 13px; }
.audio-setting input { width: 100%; accent-color: var(--ember); }
.audio-mute { margin-top: 12px; }
.settings-microphone > p { color: #9ba9a8; font-size: 12px; line-height: 1.7; }
.mic-setup-status { min-height: 22px; color: #e5b484 !important; }
.mic-diagnostics { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .025); }
.mic-diagnostics strong { font-size: 12px; }
.mic-diagnostics p { overflow-wrap: anywhere; line-height: 1.8; }
.home-view { position: relative; display: grid; min-height: calc(100vh - 86px); grid-template-columns: minmax(0, 1.2fr) minmax(310px, .72fr); align-items: center; gap: 10%; padding: 5vh 2.5vw 8vh; }
.hero-copy { max-width: 680px; padding-bottom: 24px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 19px; color: #b1bdbb; direction: ltr; font-size: 10px; letter-spacing: .2em; }
.eyebrow > span:first-child { display: inline-block; width: 22px; height: 1px; background: var(--ember); }
.hero-copy h1 { margin: 0; color: #f3eee5; font-family: Georgia, "Times New Roman", serif; font-size: clamp(52px, 7vw, 98px); font-weight: 400; line-height: 1.08; letter-spacing: -.045em; text-shadow: 0 5px 50px rgba(0, 0, 0, .4); }
.hero-copy h1 em { color: #e7a26a; font-weight: 400; }
.hero-description { max-width: 450px; margin: 24px 0 32px; color: #b2b9b5; font-size: 15px; line-height: 2; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button { display: inline-flex; min-height: 47px; align-items: center; justify-content: center; gap: 18px; padding: 0 22px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { border-color: rgba(255, 188, 127, .56); background: linear-gradient(120deg, #dc874b, #a95435); color: #160e0a; font-weight: 700; box-shadow: 0 9px 34px rgba(176, 84, 43, .22); }
.button-primary:hover { background: linear-gradient(120deg, #efa064, #c46942); }
.button-primary b { font-size: 18px; }
.button-quiet { border-color: rgba(211, 224, 225, .2); background: rgba(10, 20, 26, .5); color: #e5e7e2; }
.button-outline { border-color: rgba(218, 226, 225, .23); background: rgba(9, 19, 25, .48); color: #dfe6e2; }
.button-outline:hover, .button-quiet:hover { border-color: rgba(229, 157, 102, .68); background: rgba(23, 37, 42, .82); }
.button-icon { width: 44px; min-height: 44px; padding: 0; border-color: var(--line); background: rgba(13, 25, 30, .85); font-size: 21px; }
.button-danger { width: 100%; min-height: 42px; margin-top: 18px; border-color: rgba(197, 121, 104, .32); background: rgba(99, 43, 39, .25); color: #d99b8b; }
.text-button { border: 0; background: transparent; color: #b2bfbe; cursor: pointer; }
.text-button:hover { color: var(--ember-light); }
.hero-meta { display: flex; align-items: center; gap: 12px; margin-top: 38px; color: #9aa7a5; font-size: 11px; }
.ember-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 15px var(--ember); }
.meta-divider { width: 1px; height: 14px; background: rgba(210, 222, 219, .2); }
.home-rail { align-self: center; max-width: 420px; padding: 18px 22px 12px; border: 1px solid rgba(180, 202, 207, .17); border-radius: 10px; background: linear-gradient(145deg, rgba(10, 22, 28, .88), rgba(9, 19, 24, .73)); box-shadow: 0 24px 80px rgba(0, 0, 0, .28); backdrop-filter: blur(15px); }
.rail-label { margin: 0 0 9px; color: #849397; font-size: 10px; letter-spacing: .12em; }
.rail-item { display: grid; width: 100%; min-height: 73px; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 12px 5px; border: 0; border-bottom: 1px solid rgba(190, 207, 209, .1); background: transparent; text-align: right; cursor: pointer; }
.rail-item:hover { background: rgba(202, 130, 79, .07); }
.rail-item > span:nth-child(2) strong, .rail-item > span:nth-child(2) small { display: block; }
.rail-item strong { color: #e5e7e2; font-size: 13px; font-weight: 600; }
.rail-item small { margin-top: 5px; color: #859396; font-size: 10px; }
.rail-item > b { color: #c98b5d; font-weight: 400; }
.rail-icon { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(210, 157, 115, .28); border-radius: 50%; color: #d59a68; font-size: 17px; }
.rail-featured .rail-icon { background: rgba(210, 133, 76, .13); }
.rail-bottom { display: flex; gap: 9px; padding: 13px 0 0; }
.rail-small { display: flex; flex: 1; align-items: center; justify-content: space-between; padding: 10px; border: 1px solid rgba(180, 202, 207, .12); border-radius: 5px; background: rgba(14, 27, 33, .54); color: #aeb9b5; font-size: 11px; cursor: pointer; }
.rail-small:hover { color: var(--ember-light); }
.hero-caption { position: absolute; right: 2.5vw; bottom: 26px; left: 2.5vw; display: flex; justify-content: space-between; color: rgba(177, 192, 191, .65); font-size: 9px; letter-spacing: .15em; }
.content-view { width: min(1050px, 100%); margin: 0 auto; padding: clamp(42px, 7vh, 82px) 0 70px; }
.view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.view-heading h2, .modal-card h2 { margin: 0; color: #f0eee7; font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 4vw, 52px); font-weight: 400; }
.view-heading > div > p:last-child, .modal-card > div > p:not(.eyebrow) { margin: 9px 0 0; color: #a4b0ae; font-size: 13px; line-height: 1.8; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.searchbox { display: flex; flex: 1; min-width: 150px; align-items: center; gap: 9px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: rgba(8, 17, 22, .78); color: #94a2a3; }
.searchbox > span { font-size: 22px; }
.searchbox input { width: 100%; min-height: 44px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.toolbar select, .field input, .field select { min-height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 6px; background: rgba(9, 19, 24, .92); color: #e0e5df; }
.rooms-list { display: grid; gap: 9px; }
.room-row { display: grid; grid-template-columns: minmax(170px, 1.6fr) minmax(110px, .8fr) minmax(104px, .7fr) minmax(104px, .7fr) auto; align-items: center; gap: 17px; min-height: 84px; padding: 13px 18px; border: 1px solid rgba(184, 204, 207, .13); border-radius: 8px; background: linear-gradient(100deg, rgba(10, 20, 26, .88), rgba(16, 30, 35, .75)); backdrop-filter: blur(10px); }
.room-name strong, .room-name small { display: block; }
.room-name strong { overflow: hidden; color: #e8e8e2; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.room-name small, .room-data small { margin-top: 5px; color: #91a09f; font-size: 10px; }
.room-data { color: #d1d9d4; font-size: 12px; }
.room-data small { display: block; }
.room-status { display: inline-flex; align-items: center; gap: 7px; width: fit-content; padding: 6px 9px; border: 1px solid rgba(148, 193, 164, .18); border-radius: 30px; background: rgba(88, 145, 106, .1); color: #a7c9ad; font-size: 10px; white-space: nowrap; }
.room-status::before { width: 6px; height: 6px; border-radius: 50%; background: #88bd92; content: ""; }
.room-status.full { border-color: rgba(204, 150, 104, .2); background: rgba(171, 106, 58, .12); color: #d3ad84; }
.room-status.full::before { background: #d69a61; }
.room-privacy { color: #a3aeaa; font-size: 11px; }
.room-join { min-width: 83px; min-height: 37px; padding: 0 14px; border: 1px solid rgba(220, 154, 100, .42); border-radius: 5px; background: rgba(190, 102, 53, .12); color: #edbd91; cursor: pointer; }
.room-join:hover:not(:disabled) { background: rgba(205, 119, 65, .26); }
.room-join:disabled { border-color: var(--line); color: #738184; cursor: not-allowed; }
.empty-state { padding: 55px 20px; border: 1px dashed rgba(186, 207, 209, .2); border-radius: 8px; background: rgba(9, 19, 24, .48); text-align: center; }
.empty-state > span { display: block; margin-bottom: 12px; color: var(--ember); font-size: 27px; }
.empty-state strong { color: #e5e7e1; }
.empty-state p { margin: 8px 0 18px; color: #94a2a3; font-size: 12px; }
.form-card, .lobby-card { border: 1px solid rgba(183, 204, 208, .15); border-radius: 10px; background: linear-gradient(140deg, rgba(10, 21, 27, .91), rgba(13, 26, 31, .81)); box-shadow: 0 22px 80px rgba(0, 0, 0, .22); backdrop-filter: blur(14px); }
.form-card { padding: clamp(18px, 4vw, 36px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
.field { display: grid; gap: 8px; color: #c1cbc6; font-size: 12px; }
.field > span, .visibility-field legend { color: #c1cbc6; }
.field input, .field select { width: 100%; }
.field input::placeholder { color: #647579; }
.field input[type=number] { direction: ltr; text-align: right; }
.field-wide { grid-column: 1 / -1; }
.visibility-field { display: flex; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.visibility-field legend { margin-bottom: 9px; font-size: 12px; }
.radio-card { position: relative; display: flex; flex: 1; align-items: center; gap: 10px; min-height: 64px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: rgba(10, 20, 26, .7); cursor: pointer; }
.radio-card:has(input:checked) { border-color: rgba(220, 142, 83, .55); background: rgba(169, 88, 48, .1); }
.radio-card input, .check-field input { accent-color: var(--ember); }
.radio-card strong, .radio-card small, .check-field strong, .check-field small { display: block; }
.radio-card strong, .check-field strong { color: #e0e4de; font-size: 12px; }
.radio-card small, .check-field small { margin-top: 5px; color: #8e9c9b; font-size: 10px; }
.check-field { display: flex; align-items: flex-start; gap: 10px; }
.check-field input { margin-top: 3px; }
.unavailable-setting { padding: 13px; border: 1px dashed var(--line); border-radius: 6px; }
.unavailable-setting p { margin: 0; color: #7f8d8f; font-size: 11px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 25px; padding-top: 19px; border-top: 1px solid var(--line); }
.form-footer p { margin: 0; color: #8c9a9b; font-size: 10px; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 16px; }
.lobby-card { padding: 22px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.card-heading h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-heading p, .card-kicker { margin: 5px 0 0; color: #8e9b9b; font-size: 10px; }
.seat-count { color: var(--ember); font-size: 22px; }
.member-list { display: grid; gap: 7px; margin-top: 11px; }
.member-item { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 7px 9px; border: 1px solid rgba(181, 202, 205, .08); border-radius: 5px; background: rgba(6, 15, 20, .37); }
.member-voice { display: inline-grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; border: 1px solid rgba(180,202,205,.12); border-radius: 50%; color: #718184; font-size: 11px; }
.member-voice.is-enabled { border-color: rgba(112,184,143,.32); color: #8dcc9f; }
.member-voice.is-speaking { background: rgba(112,184,143,.2); box-shadow: 0 0 0 3px rgba(112,184,143,.08), 0 0 14px rgba(112,184,143,.36); animation: lobby-speaking 1.1s ease-in-out infinite; }
@keyframes lobby-speaking { 50% { box-shadow: 0 0 0 5px rgba(112,184,143,.06), 0 0 19px rgba(112,184,143,.5); } }
.member-seat { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: rgba(220, 141, 80, .12); color: #dfa06c; font-size: 10px; }
.member-avatar { display: grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; border: 1px solid rgba(141,174,176,.2); border-radius: 50%; background: linear-gradient(145deg,rgba(75,104,107,.4),rgba(20,34,39,.9)); color: #9db3ad; font-size: 10px; }
.member-name { flex: 1; overflow: hidden; color: #d7dfda; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.member-host { color: #d6a47c; font-size: 9px; }
.member-you { color: #7fae91; font-size: 9px; }
.empty-seats { padding: 12px 8px; color: #637376; font-size: 10px; }
.lobby-note { display: flex; gap: 9px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: #d09a6f; }
.lobby-note p { margin: 0; color: #909d9b; font-size: 10px; }
.settings-summary { display: grid; gap: 12px; margin: 17px 0 19px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid rgba(186, 203, 204, .08); color: #95a3a1; font-size: 11px; }
.setting-row strong { color: #dce1dc; font-size: 11px; font-weight: 500; }
.invite-panel { margin-top: 18px; padding: 14px; border: 1px solid rgba(221, 149, 92, .25); border-radius: 6px; background: rgba(145, 76, 43, .11); }
.invite-panel > span { color: #c4a181; font-size: 10px; }
.invite-panel > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.invite-panel code { color: #ffc587; direction: ltr; font-size: 18px; letter-spacing: .2em; }
.copy-button { padding: 6px 9px; border: 1px solid rgba(220, 154, 100, .4); border-radius: 4px; background: transparent; color: #eabd91; font-size: 10px; cursor: pointer; }
.engine-note { margin: 18px 0 0; color: #7f8d8e; font-size: 10px; line-height: 1.8; }
.lobby-voice { display: flex; min-height: 62px; align-items: center; gap: 10px; margin: -9px 0 17px; padding: 8px 12px; border: 1px solid rgba(177,205,207,.13); border-radius: 9px; background: linear-gradient(110deg,rgba(12,24,29,.9),rgba(14,24,27,.72)); box-shadow: 0 8px 24px #0003; }
.lobby-voice[hidden] { display: none !important; }
.lobby-voice-copy { display: grid; min-width: 130px; gap: 2px; }
.lobby-voice-copy strong { color: #e6d8c8; font-size: 11px; }
.lobby-voice-copy span { color: #d5a374; font-size: 10px; }
.lobby-voice-copy small { color: #839394; font-size: 9px; }
.lobby-voice-button, .lobby-speaker-button { min-height: 38px; padding: 0 12px; border: 1px solid rgba(183,203,204,.17); border-radius: 7px; background: rgba(5,13,17,.57); color: #c5d0cc; font-size: 10px; cursor: pointer; touch-action: manipulation; }
.lobby-voice-button.is-enabled { border-color: rgba(112,184,143,.42); background: rgba(54,103,73,.21); color: #a9ddb5; }
.lobby-voice-button:disabled { opacity: .6; cursor: wait; }
.lobby-speaker-button[aria-pressed="true"] { color: #e1a97d; border-color: rgba(227,140,76,.32); }
.lobby-voice-count { margin-inline-start: auto; color: #93a4a2; font-size: 10px; white-space: nowrap; }
.lobby-readiness { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -10px 0 20px; padding: 14px 18px; border: 1px solid rgba(227, 140, 76, .2); border-radius: 7px; background: rgba(20, 28, 30, .72); }
.lobby-readiness strong { color: #efb17d; font-size: 13px; }
.lobby-readiness > span { color: #9ca9a8; font-size: 11px; }
.countdown-panel { display: flex; align-items: center; gap: 12px; margin-right: auto; color: #f4d3b1; font-size: 11px; }
.countdown-panel[hidden] { display: none; }
.countdown-panel strong { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(227, 140, 76, .5); border-radius: 50%; background: rgba(191, 95, 43, .16); color: #ffd2a0; font: 700 18px Georgia, serif; }
.game-grid { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(0, 1.2fr); gap: 18px; }
.role-card h3 { margin: 14px 0 8px; color: #f1bd8e; font-size: 30px; }
.role-card > p:not(.card-kicker) { color: #a8b2ae; font-size: 12px; line-height: 1.8; }
.role-team { display: inline-block; margin-top: 10px; padding: 5px 10px; border: 1px solid rgba(227, 140, 76, .22); border-radius: 20px; color: #e8b387; font-size: 10px; }
.game-note { margin-top: 18px; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; padding: 5px 8px; border: 1px solid rgba(130, 187, 145, .2); border-radius: 20px; color: #9bc5a2; font-size: 9px; letter-spacing: 0; }
.live-pill i { width: 5px; height: 5px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(2, 8, 11, .72); backdrop-filter: blur(8px); }
.modal-backdrop[hidden] { display: none; }
.modal-card { position: relative; width: min(460px, 100%); padding: 34px; border: 1px solid rgba(188, 209, 211, .18); border-radius: 10px; background: linear-gradient(145deg, #101d23, #0b151a); box-shadow: 0 24px 100px rgba(0, 0, 0, .48); }
.modal-card h2 { font-size: 34px; }
.modal-card form { display: grid; gap: 18px; margin-top: 24px; }
.modal-close { position: absolute; top: 12px; left: 13px; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: #9eabaa; font-size: 20px; cursor: pointer; }
.privacy-note { display: block; margin-top: 18px; color: #839192; font-size: 10px; line-height: 1.8; }
.runtime-notice:not([hidden]) { position: fixed; right: 12px; bottom: 12px; z-index: 100; max-width: min(600px, calc(100vw - 24px)); padding: 12px 16px; border: 1px solid #a65948; border-radius: 5px; background: #2b1716; color: #ffd2c5; direction: ltr; font: 12px monospace; }
.toast { position: fixed; right: 50%; bottom: 25px; z-index: 30; max-width: calc(100vw - 30px); padding: 11px 18px; transform: translate(50%, 20px); border: 1px solid rgba(200, 218, 218, .17); border-radius: 6px; background: rgba(13, 26, 31, .96); color: #e1e5df; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translate(50%, 0); opacity: 1; }

/* Installed mobile game shell: keep the document fixed while allowing deliberate
   internal scrolling in long panels and forms. */
html, body { width: 100%; height: 100%; min-height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: manipulation; }
body { position: fixed; inset: 0; }
#appMain { height: calc(var(--app-height, 100dvh) - 86px); min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
#appMain::-webkit-scrollbar { display: none; }
.modal-backdrop { padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
.modal-backdrop { height: var(--app-height, 100dvh); }
.modal-card { display: flex; flex-direction: column; width: min(560px, 100%); max-height: calc(var(--app-height, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px); overflow: auto; overscroll-behavior: contain; padding: clamp(16px, 3vw, 28px); }
.modal-card > [hidden] { display: none !important; }
.modal-card form { gap: 12px; margin-top: 16px; }
.forfeit-dialog { width: min(470px, calc(100vw - 24px)); max-height: calc(var(--app-height, 100dvh) - 20px); overflow: auto; padding: clamp(16px, 3vw, 26px); border: 1px solid rgba(188,209,211,.18); border-radius: 12px; background: #101d23; color: var(--ink); }
.forfeit-dialog::backdrop { background: rgba(2,8,11,.76); backdrop-filter: blur(7px); }
.forfeit-dialog form > p { line-height: 1.9; }
.forfeit-dialog form > div { display: flex; flex-wrap: wrap; gap: 10px; }
.forfeit-dialog form > div .button { flex: 1; }
.forfeit-dialog form > div .button-danger { width: auto; min-width: 0; margin-top: 0; }
.profile-identity { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); }
.profile-identity span { color: var(--muted); font-size: 12px; }
.profile-identity strong { color: #f0c08d; }
.createView { padding-top: clamp(12px, 3vh, 42px); padding-bottom: 16px; }
.createView .view-heading { margin-bottom: 12px; }
.createView .view-heading h2 { font-size: clamp(25px, 4vw, 42px); }
.createView .form-card { max-height: calc(var(--app-height, 100dvh) - 160px); overflow-y: auto; overscroll-behavior: contain; padding: clamp(12px, 2vw, 22px); }
.createView .form-footer { position: sticky; bottom: -1px; z-index: 1; padding: 10px 0 0; background: linear-gradient(180deg, rgba(11,21,26,0), rgba(11,21,26,.98) 32%); }
input, select, textarea { touch-action: manipulation; }

@media (max-width: 900px) and (orientation: landscape), (max-height: 500px) and (pointer: coarse) {
  .topbar { min-height: 52px; height: 52px; padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
  #appMain { height: calc(var(--app-height, 100dvh) - 52px); padding-inline: 14px; }
  .createView { padding-top: 7px; }
  .createView .view-heading { align-items: center; margin-bottom: 7px; }
  .createView .view-heading .eyebrow, .createView .view-heading > div > p:last-child { display: none; }
  .createView .view-heading h2 { font-size: 23px; }
  .createView .form-card { max-height: calc(var(--app-height, 100dvh) - 92px); padding: 10px 12px; }
  .createView .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .createView .field-wide { grid-column: 1 / -1; }
  .createView .field { gap: 4px; }
  .createView .field > span, .createView .field legend { font-size: 11px; }
  .createView .field input, .createView .field select { min-height: 38px; padding-inline: 9px; }
  .createView .visibility-field { display: flex; gap: 8px; }
  .createView .radio-card { min-height: 40px; padding: 6px 8px; }
  .createView .radio-card small, .createView .check-field small, .createView .form-footer > p { display: none; }
  .createView .form-footer { display: flex; justify-content: flex-end; padding-top: 7px; }
  .createView .form-footer .button { min-height: 40px; }
  .modal-backdrop { place-items: center; }
  .modal-card { width: min(700px, 100%); padding: 14px 18px; }
  .modal-card h2 { font-size: 25px; }
  .modal-card > div > p:not(.eyebrow) { margin-top: 4px; font-size: 12px; }
  .modal-card form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 9px; }
  .modal-card form .button { align-self: end; min-height: 42px; }
  .settings-audio, .settings-microphone { margin-top: 10px; padding-top: 8px; }
  .settings-microphone > p, .mic-diagnostics { display: none; }
}
@media (max-width: 900px) {
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; }
}
@media (max-width: 680px) and (orientation: portrait) {
  #appMain { height: calc(var(--app-height, 100dvh) - 70px); }
}

@media (max-width: 900px) {
  .home-view { gap: 5%; padding-right: 0; padding-left: 0; }
  .room-row { grid-template-columns: minmax(150px, 1.5fr) minmax(90px, .7fr) auto auto; gap: 12px; }
  .room-privacy { display: none; }
}
@media (max-width: 680px) {
  .topbar { min-height: 70px; padding: 0 18px; }
  .brand-mark { width: 33px; height: 33px; }
  .brand strong { font-size: 19px; }
  .topbar-actions { gap: 10px; }
  .connection-state { font-size: 0; }
  .connection-state i { width: 8px; height: 8px; }
  .player-chip { padding: 7px 10px; }
  #appMain { min-height: calc(100vh - 70px); padding: 0 18px; }
  .home-view { min-height: calc(100svh - 70px); grid-template-columns: 1fr; align-content: center; gap: 26px; padding: 38px 0 62px; }
  .hero-copy { padding: 0; }
  .hero-copy h1 { font-size: clamp(49px, 13vw, 74px); }
  .hero-description { max-width: 370px; margin: 17px 0 23px; font-size: 13px; }
  .hero-meta { margin-top: 23px; font-size: 9px; }
  .home-rail { width: 100%; max-width: none; padding: 12px 16px 9px; }
  .rail-item { min-height: 62px; }
  .hero-caption { right: 0; bottom: 19px; left: 0; font-size: 8px; }
  .content-view { padding: 37px 0 50px; }
  .lobby-voice { display: grid; grid-template-columns: minmax(90px,1fr) auto auto; gap: 6px; margin: 0 0 12px; padding: 7px; }
  .lobby-voice-copy { min-width: 0; }
  .lobby-voice-button, .lobby-speaker-button { min-height: 42px; padding: 0 9px; font-size: 9px; }
  .lobby-voice-button { width: 44px; padding: 0; font-size: 15px; }
  .lobby-voice-button span { display: none; }
  .lobby-voice-count { grid-column: 1 / -1; margin: 0; text-align: left; }
  .view-heading { align-items: flex-start; margin-bottom: 21px; }
  .view-heading h2 { font-size: 35px; }
  .view-heading > .button, .view-heading > .text-button { margin-top: 5px; white-space: nowrap; }
  .view-heading > .button { min-height: 39px; padding: 0 11px; font-size: 11px; }
  .toolbar { flex-wrap: wrap; }
  .searchbox { flex-basis: 100%; }
  .toolbar select { flex: 1; min-width: 0; font-size: 10px; }
  .button-icon { flex: 0 0 44px !important; }
  .room-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 13px; }
  .room-name { grid-column: 1; }
  .room-status { grid-column: 2; grid-row: 1; }
  .room-data { grid-column: 1; grid-row: 2; }
  .room-join { grid-column: 2; grid-row: 2; }
  .form-grid { grid-template-columns: 1fr; gap: 18px; }
  .field-wide { grid-column: auto; }
  .visibility-field { flex-direction: column; }
  .form-footer { align-items: flex-start; flex-direction: column; }
  .form-footer .button { width: 100%; }
  .lobby-grid { grid-template-columns: 1fr; }
  .game-grid { grid-template-columns: 1fr; }
  .lobby-card { padding: 17px; }
  .modal-card { padding: 29px 21px 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }

/* A portrait phone is held at the threshold screen until it is rotated. */
.orientation-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow: hidden; padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); background: radial-gradient(ellipse at 50% 44%, rgba(34, 66, 75, .48), transparent 58%), radial-gradient(ellipse at 50% 100%, rgba(185, 94, 47, .2), transparent 47%), #070d11; color: #edf0e8; text-align: center; }
.orientation-overlay[hidden] { display: none; }
.orientation-card { display: grid; justify-items: center; gap: 12px; width: min(440px, 100%); }
.orientation-card .eyebrow { margin: 0; }
.orientation-card h1 { margin: 3px 0 0; font-size: clamp(22px, 6vw, 32px); font-weight: 600; }
.orientation-card > p:not(.eyebrow) { margin: 0; color: #b7c1bd; font-size: 15px; line-height: 1.9; }
.phone-rotate { position: relative; width: 68px; height: 104px; margin-bottom: 8px; border: 2px solid #d7b38d; border-radius: 13px; box-shadow: 0 0 24px rgba(221, 160, 105, .16), inset 0 0 14px rgba(80, 135, 151, .12); animation: rotate-phone 2.8s ease-in-out infinite; }
.phone-rotate::before { position: absolute; top: 7px; left: 50%; width: 20px; height: 3px; transform: translateX(-50%); border-radius: 4px; background: #81989b; content: ""; }
.phone-rotate::after { position: absolute; bottom: 7px; left: 50%; width: 5px; height: 5px; transform: translateX(-50%); border: 1px solid #81989b; border-radius: 50%; content: ""; }
.phone-rotate span { position: absolute; inset: 18px 7px; border-radius: 4px; background: linear-gradient(150deg, rgba(63, 111, 124, .32), rgba(223, 140, 77, .12)); }
.phone-rotate i { position: absolute; top: 50%; right: -30px; width: 22px; height: 22px; border-top: 2px solid #e1a66f; border-right: 2px solid #e1a66f; border-radius: 0 14px 0 0; transform: translateY(-50%) rotate(45deg); }
.orientation-lock { min-height: 48px; margin-top: 8px; padding: 0 18px; border: 1px solid rgba(224, 171, 119, .48); border-radius: 8px; background: rgba(18, 35, 40, .8); color: #f1c59a; font: inherit; }
@keyframes rotate-phone { 0%, 20% { transform: rotate(0deg); } 66%, 88% { transform: rotate(90deg); } 100% { transform: rotate(90deg); } }
html.phone-portrait-blocked, html.phone-portrait-blocked body { width: 100%; height: 100%; min-height: 100%; overflow: hidden; overscroll-behavior: none; }
html.phone-portrait-blocked body > :not(#orientationOverlay) { visibility: hidden !important; pointer-events: none !important; }
html.phone-portrait-blocked #orientationOverlay { visibility: visible !important; pointer-events: auto !important; }

.mobile-roster-toggle, .mobile-player-list, .mobile-chat-toggle, .mobile-chat-panel { display: none; }
@media (any-pointer: coarse) and (orientation: landscape) {
  html, body { min-height: 100%; min-height: 100dvh; }
  body { overscroll-behavior: none; }
  canvas { width: 100vw; height: 100vh; height: 100dvh; touch-action: none; }
  .match-hud { padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .hud-top { width: 100%; min-height: 38px; gap: 8px; padding: 5px 9px; border: 1px solid rgba(199, 214, 210, .12); border-radius: 9px; background: rgba(7, 15, 19, .65); backdrop-filter: blur(9px); font-size: 11px; }
  .hud-exit { min-width: 48px; min-height: 44px; padding: 0 12px; font-size: 12px; }
  .hud-role { position: absolute; top: 54px; right: max(10px, env(safe-area-inset-right)); margin: 0; font-size: 11px; }
  .hud-turn { position: absolute; top: 50%; left: max(10px, env(safe-area-inset-left)); min-width: 112px; gap: 3px; padding: 8px 12px; transform: translateY(-50%); background: rgba(6, 13, 16, .62); }
  .hud-turn small { font-size: 10px; }.hud-turn strong { font-size: 13px; }.hud-timer { font-size: 18px; }
  .hud-skip { right: auto; bottom: max(12px, env(safe-area-inset-bottom)); left: max(10px, env(safe-area-inset-left)); min-width: 112px; min-height: 48px; transform: none; font-size: 13px; }
  .game-action-panel { bottom: max(10px, env(safe-area-inset-bottom)); left: 50%; width: min(390px, 48vw); max-height: min(43dvh, 220px); overflow-y: auto; padding: 10px; transform: translateX(-50%); }
  #gameActionTargets { gap: 8px; }
  .action-target { min-width: 88px; min-height: 48px; padding: 8px 12px; font-size: 14px; touch-action: manipulation; }
  #gameActionFeedback { font-size: 12px; }
  .hud-rematch { top: 58px; right: max(10px, env(safe-area-inset-right)); min-height: 44px; }
  .game-event-banner { top: 62px; max-width: min(540px, 64vw); padding: 8px 12px; font-size: 12px; }
  .hud-look-hint { display: none; }
  .mobile-roster-toggle { position: absolute; top: 52px; left: max(10px, env(safe-area-inset-left)); z-index: 2; display: inline-flex; min-width: 100px; min-height: 44px; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(199, 214, 210, .18); border-radius: 8px; background: rgba(7, 15, 19, .78); color: #e6e8de; font: inherit; font-size: 13px; pointer-events: auto; }
  .mobile-roster-toggle span { color: #e9b681; font-variant-numeric: tabular-nums; }
  .mobile-player-list { position: absolute; top: 102px; left: max(10px, env(safe-area-inset-left)); z-index: 3; display: grid; width: min(220px, 32vw); max-height: 54dvh; gap: 7px; overflow-y: auto; padding: 11px; border: 1px solid rgba(199, 214, 210, .18); border-radius: 10px; background: rgba(6, 14, 18, .91); box-shadow: 0 12px 34px #0007; backdrop-filter: blur(12px); pointer-events: auto; }
  .mobile-player-list[hidden] { display: none; }
  #mobilePlayerItems { display: grid; gap: 5px; }
  .mobile-player-entry { display: flex; min-height: 34px; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 7px; border-radius: 5px; background: rgba(255, 255, 255, .04); color: #dde1d9; font-size: 12px; }
  .mobile-player-entry.is-active { outline: 1px solid rgba(231, 173, 112, .5); color: #f0c593; }
  .mobile-player-entry.is-dead { color: #77827f; text-decoration: line-through; }
  .mobile-chat-toggle { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 2; display: inline-flex; min-width: 94px; min-height: 48px; align-items: center; justify-content: center; border: 1px solid rgba(199, 214, 210, .18); border-radius: 8px; background: rgba(7, 15, 19, .82); color: #e6e8de; font: inherit; font-size: 13px; pointer-events: auto; }
  .mobile-chat-panel { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: max(68px, calc(env(safe-area-inset-bottom) + 62px)); z-index: 3; display: grid; width: min(300px, 42vw); max-height: 52dvh; grid-template-rows: auto minmax(46px, 1fr) auto; gap: 7px; padding: 10px; border: 1px solid rgba(199, 214, 210, .18); border-radius: 10px; background: rgba(6, 14, 18, .93); box-shadow: 0 12px 34px #0007; backdrop-filter: blur(12px); pointer-events: auto; }
  .mobile-chat-panel[hidden] { display: none; }
  .mobile-chat-heading { display: grid; gap: 3px; color: #e9c193; font-size: 13px; }.mobile-chat-heading small { color: #9fadaa; font-size: 10px; }
  .mobile-chat-messages { display: grid; align-content: end; gap: 5px; overflow-y: auto; min-height: 45px; max-height: 30dvh; }
  .mobile-chat-message { display: grid; gap: 2px; padding: 5px 7px; border-radius: 5px; background: rgba(255, 255, 255, .045); color: #d8ded7; font-size: 11px; overflow-wrap: anywhere; }
  .mobile-chat-message strong { color: #eab985; font-size: 10px; }
  .mobile-chat-form { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
  .mobile-chat-form input { min-width: 0; min-height: 44px; padding: 0 9px; border: 1px solid rgba(198, 214, 210, .2); border-radius: 6px; background: rgba(14, 26, 30, .9); color: #e9eee6; font: inherit; font-size: 12px; }
  .mobile-chat-form button { min-width: 58px; min-height: 44px; border: 1px solid rgba(222, 164, 108, .38); border-radius: 6px; background: rgba(120, 70, 39, .45); color: #f0c292; font: inherit; font-size: 12px; }
  .mobile-chat-form button:disabled, .mobile-chat-form input:disabled { opacity: .52; }
  .mobile-chat-toggle[aria-expanded="true"] { border-color: rgba(228, 168, 112, .52); color: #f1c394; }
}
@media (any-pointer: coarse) and (orientation: landscape) and (max-height: 480px) {
  .topbar { min-height: 54px; padding-inline: max(12px, env(safe-area-inset-left)); }
  #appMain { min-height: calc(100dvh - 54px); padding-inline: 14px; }
  .home-view { min-height: calc(100dvh - 54px); gap: 5%; padding: 10px 2vw; }
  .hero-copy { padding-bottom: 0; }.hero-copy h1 { font-size: clamp(30px, 7vh, 46px); }
  .hero-description { margin: 10px 0 14px; font-size: 12px; }.hero-meta { margin-top: 12px; }
  .home-rail { padding: 15px 20px; }.rail-item { min-height: 52px; padding: 7px 4px; }
  .mobile-player-list { max-height: 48dvh; }
}
@media (any-pointer: coarse) { button, select, input, .action-target { min-height: 44px; touch-action: manipulation; } }

/* Focused match presentation: the world remains visible while all site chrome is removed. */
.in-match { overflow: hidden; }
.in-match .topbar, .in-match #appMain, .in-match .scene-wash { display: none !important; }
.match-intro, .role-reveal, .match-hud { position: fixed; z-index: 8; color: #f5eee2; }
.match-intro[hidden], .role-reveal[hidden], .match-hud[hidden] { display: none; }
.match-intro { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 12vh; pointer-events: none; text-align: center; background: radial-gradient(ellipse at center, transparent 25%, rgba(1, 7, 10, .36) 100%); animation: intro-arrive 1.4s ease both; }
.match-overline { color: #e3a36c; font: 10px Georgia, serif; letter-spacing: .28em; }
.match-intro h1 { margin: 8vh 0 8px; color: #f4ead8; font: 400 clamp(35px, 6vw, 68px) Georgia, serif; text-shadow: 0 4px 28px #000; }
.match-intro > span { color: rgba(237, 222, 197, .8); font-size: 12px; }
.role-reveal { inset: 0; display: grid; place-items: center; pointer-events: none; background: radial-gradient(ellipse at center, rgba(6, 12, 15, .14), rgba(2, 7, 9, .62)); animation: role-shroud .8s ease both; }
.role-reveal::before, .role-reveal::after { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #ffc17e; box-shadow: 0 0 22px 7px rgba(238, 143, 70, .5); content: ""; animation: ember-drift 3.2s ease-in-out infinite alternate; }
.role-reveal::before { top: 32%; left: 24%; }.role-reveal::after { right: 21%; bottom: 27%; animation-delay: -1.6s; }
.role-card-visual { min-width: min(340px, calc(100vw - 48px)); padding: 30px 34px 28px; border: 1px solid rgba(231, 178, 122, .44); border-radius: 10px; background: linear-gradient(145deg, rgba(14, 24, 27, .96), rgba(7, 14, 17, .94)); box-shadow: 0 20px 90px rgba(0, 0, 0, .62), 0 0 48px color-mix(in srgb, var(--role-accent, #e2a36b) 19%, transparent); text-align: center; animation: card-enter .85s cubic-bezier(.2,.85,.2,1) both; }
.role-card-visual small { color: #aeb8b2; font-size: 11px; letter-spacing: .08em; }
.role-card-visual h2 { margin: 15px 0 8px; color: var(--role-accent, #e6b57e); font: 400 clamp(32px, 6vw, 48px) Georgia, "Vazirmatn", serif; }
.role-card-visual p { max-width: 290px; margin: 0 auto; color: #c4cbc4; font-size: 12px; line-height: 1.9; }
.role-card-sigil { display: grid; width: 47px; height: 47px; margin: 0 auto 15px; place-items: center; border: 1px solid color-mix(in srgb, var(--role-accent, #e2a36b) 55%, transparent); border-radius: 50%; color: var(--role-accent, #e2a36b); box-shadow: 0 0 24px color-mix(in srgb, var(--role-accent, #e2a36b) 22%, transparent); }
.role-card-visual[data-role="mafia"] { --role-accent: #d47762; }.role-card-visual[data-role="detective"] { --role-accent: #8ab7d0; }.role-card-visual[data-role="doctor"] { --role-accent: #8fc6a0; }.role-card-visual[data-role="citizen"] { --role-accent: #e5b875; }
.match-hud { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: max(18px, env(safe-area-inset-top)) clamp(16px, 4vw, 54px) max(18px, env(safe-area-inset-bottom)); pointer-events: none; background: linear-gradient(180deg, rgba(3, 9, 12, .42), transparent 22%, transparent 68%, rgba(2, 7, 9, .38)); }
.hud-top { display: flex; width: min(100%, 1150px); align-items: center; justify-content: space-between; gap: 12px; color: #e8e5db; font-size: 11px; text-shadow: 0 2px 9px #000; }
.hud-exit { padding: 6px 10px; border: 1px solid rgba(220, 225, 220, .2); border-radius: 5px; background: rgba(8, 16, 19, .5); color: #bdc8c1; font-size: 10px; pointer-events: auto; cursor: pointer; }
.hud-phase, .hud-status { color: #edc18f; }.hud-alive { display: flex; align-items: center; gap: 7px; color: #c5d2c6; }.hud-alive i { width: 7px; height: 7px; border-radius: 50%; background: #90c995; box-shadow: 0 0 10px #83c488; }
.hud-role { align-self: flex-start; margin-top: 14px; padding: 7px 11px; border: 1px solid rgba(217, 161, 103, .3); border-radius: 20px; background: rgba(8, 16, 19, .6); color: #e6b47d; font-size: 10px; backdrop-filter: blur(8px); }
.hud-turn { display: grid; min-width: 178px; justify-items: center; gap: 5px; padding: 13px 22px; border: 1px solid rgba(224, 184, 139, .3); border-radius: 9px; background: rgba(6, 13, 16, .65); box-shadow: 0 6px 30px rgba(0, 0, 0, .28); backdrop-filter: blur(10px); transition: box-shadow .3s ease, border-color .3s ease; }
.hud-turn.is-active { border-color: rgba(239, 169, 102, .65); box-shadow: 0 0 30px rgba(221, 133, 71, .2); }.hud-turn small { color: #9ba9a7; font-size: 9px; }.hud-turn strong { color: #f0e6d7; font-size: 14px; }.hud-timer { color: #f1b77d; font: 18px Georgia, serif; font-variant-numeric: tabular-nums; }
.hud-skip { position: absolute; bottom: max(76px, calc(env(safe-area-inset-bottom) + 65px)); right: 50%; transform: translateX(50%); padding: 9px 15px; border: 1px solid rgba(222, 153, 96, .4); border-radius: 5px; background: rgba(9, 18, 21, .8); color: #eac297; pointer-events: auto; cursor: pointer; }.hud-skip[hidden] { display: none; }.hud-skip span { margin-right: 10px; }
.game-action-panel { position: absolute; bottom: max(112px, calc(env(safe-area-inset-bottom) + 102px)); left: 50%; transform: translateX(-50%); width: min(440px, calc(100vw - 28px)); padding: 12px; display: grid; gap: 9px; border: 1px solid rgba(214, 159, 110, .28); border-radius: 10px; background: rgba(7, 15, 19, .86); backdrop-filter: blur(12px); box-shadow: 0 12px 34px rgba(0,0,0,.26); pointer-events: auto; }
.hud-rematch { position: absolute; top: 76px; right: clamp(16px, 4vw, 54px); border: 1px solid rgba(214, 159, 110, .35); border-radius: 6px; padding: 8px 12px; color: #f1d5b5; background: rgba(9, 18, 21, .85); pointer-events: auto; cursor: pointer; }
.hud-rematch[hidden] { display: none; }
.game-action-panel[hidden], .game-event-banner[hidden] { display: none; }
#gameActionTargets { display: flex; flex-wrap: wrap; gap: 7px; }
.action-target { border: 1px solid rgba(212, 161, 111, .3); border-radius: 6px; padding: 7px 10px; background: rgba(38, 48, 50, .75); color: #f3e8d8; cursor: pointer; }
.action-target:hover { border-color: #e2a466; background: rgba(91, 63, 41, .72); }
#gameActionFeedback { color: #dbb88e; font-size: 11px; }
.game-event-banner { position: absolute; top: 82px; left: 50%; transform: translateX(-50%); max-width: min(760px, calc(100vw - 28px)); padding: 12px 16px; border: 1px solid rgba(214, 159, 110, .24); border-radius: 8px; background: rgba(7, 15, 19, .8); color: #f4e9d8; text-align: center; font-size: 13px; line-height: 1.8; pointer-events: none; }
.hud-voice { position: absolute; top: max(76px, calc(env(safe-area-inset-top) + 58px)); right: max(18px, env(safe-area-inset-right)); display: grid; gap: 5px; min-width: 150px; padding: 8px 10px; border: 1px solid rgba(219, 158, 107, .26); border-radius: 9px; background: rgba(5, 12, 15, .76); color: #e8d9c6; font-size: 11px; pointer-events: auto; backdrop-filter: blur(10px); }
.hud-voice button { min-height: 38px; border: 1px solid rgba(226, 170, 118, .36); border-radius: 7px; background: rgba(29, 43, 44, .84); color: #f1c89e; font: inherit; cursor: pointer; }
.hud-voice small { color: #e4a873; }
.investigation-panel { position: absolute; left: max(18px, env(safe-area-inset-left)); top: max(76px, calc(env(safe-area-inset-top) + 58px)); width: min(280px, 36vw); max-height: 36vh; overflow: auto; padding: 12px; border: 1px solid rgba(219, 158, 107, .26); border-radius: 9px; background: rgba(5, 12, 15, .84); color: #f0e4d4; font-size: 12px; pointer-events: auto; }
.investigation-panel strong { display: block; margin-bottom: 7px; color: #e6b481; }
.investigation-panel div { display: grid; gap: 5px; }
.investigation-entry { padding: 5px 0; border-top: 1px solid rgba(255,255,255,.08); }
.winner-screen { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 20px; color: #f7eee1; background: radial-gradient(ellipse at 50% 48%, rgba(105, 57, 27, .34), transparent 46%), rgba(2, 5, 7, .95); animation: winner-appear .8s ease-out both; }
.mobile-player-entry.is-speaking { border-color: rgba(230, 167, 105, .55); box-shadow: 0 0 18px rgba(230, 167, 105, .15); }
.winner-screen[hidden] { display: none; }
.winner-card { width: min(620px, 94vw); padding: clamp(24px, 6vw, 54px); border: 1px solid rgba(218, 161, 112, .3); border-radius: 18px; background: linear-gradient(145deg, rgba(18, 29, 31, .96), rgba(7, 12, 14, .96)); box-shadow: 0 25px 110px #000, 0 0 70px rgba(192, 105, 47, .16); text-align: center; animation: winner-rise 1s cubic-bezier(.2,.75,.3,1) both; }
.winner-sigil { display: inline-grid; place-items: center; width: 54px; height: 54px; border: 1px solid rgba(234, 181, 130, .55); border-radius: 50%; color: #e9b57d; box-shadow: 0 0 28px rgba(231, 139, 66, .32); font-size: 26px; }
.winner-card p { color: #a5b0ab; letter-spacing: .15em; font-size: 11px; }
.winner-card h1 { margin: 14px 0; color: #f3c28f; font-size: clamp(28px, 7vw, 52px); }
.winner-card div { margin: 20px 0; color: #d8d5ce; font-size: 13px; line-height: 2; }
.winner-card small { color: #89928d; }
@keyframes winner-appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes winner-rise { from { opacity: 0; transform: translateY(22px) scale(.97); } to { opacity: 1; transform: none; } }
.forfeit-dialog { width: min(440px, calc(100vw - 32px)); border: 1px solid rgba(219, 158, 107, .35); border-radius: 14px; background: #10191c; color: #f2e8dd; box-shadow: 0 20px 80px #000; }
.forfeit-dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
.forfeit-dialog form { padding: 18px; }
.forfeit-dialog form > div { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@media (max-width: 720px) { .hud-voice { top: auto; bottom: max(90px, calc(env(safe-area-inset-bottom) + 82px)); right: max(10px, env(safe-area-inset-right)); min-width: 136px; } .investigation-panel { top: auto; bottom: max(90px, calc(env(safe-area-inset-bottom) + 82px)); left: max(10px, env(safe-area-inset-left)); width: min(225px, 43vw); font-size: 11px; } }
.hud-look-hint { margin: 0; color: rgba(221, 227, 218, .62); font-size: 9px; text-shadow: 0 2px 8px #000; }
@keyframes intro-arrive { from { opacity: 0; } to { opacity: 1; } } @keyframes role-shroud { from { opacity: 0; backdrop-filter: blur(0); } to { opacity: 1; backdrop-filter: blur(5px); } } @keyframes card-enter { from { opacity: 0; transform: translateY(22px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } } @keyframes ember-drift { from { transform: translate3d(0, 8px, 0) scale(.8); opacity: .45; } to { transform: translate3d(12px, -14px, 0) scale(1.2); opacity: .95; } }
@media (max-width: 600px) { .match-intro { padding-top: 9vh; }.match-intro h1 { margin-top: 6vh; }.hud-top { font-size: 9px; }.hud-turn { margin-bottom: 4vh; }.hud-look-hint { max-width: 80vw; text-align: center; line-height: 1.6; } }

/* In-match viewport and HUD system */
html:has(body.in-match), html:has(body.in-match) body { width: 100%; height: 100%; min-height: 100%; overflow: hidden; overscroll-behavior: none; }
body.in-match { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh; min-width: 0; min-height: 100dvh; touch-action: none; }
body.in-match canvas { width: 100vw; height: 100vh; height: 100dvh; }
.match-hud { display: grid; grid-template-rows: auto 1fr auto; align-items: stretch; justify-items: stretch; gap: 0; padding: max(14px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); background: linear-gradient(180deg, rgba(2, 8, 11, .58), transparent 20%, transparent 78%, rgba(2, 7, 9, .46)); }
.hud-top { width: 100%; min-height: 54px; display: flex; justify-content: flex-start; gap: clamp(12px, 2vw, 28px); padding: 7px 13px; border: 1px solid rgba(199, 214, 210, .14); border-radius: 12px; background: rgba(6, 13, 17, .76); box-shadow: 0 12px 34px rgba(0,0,0,.2); backdrop-filter: blur(14px); text-shadow: none; }
.hud-room { display: flex; align-items: center; gap: 9px; min-width: 175px; margin-inline-end: auto; }
.hud-brand-mark { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid rgba(227,140,76,.35); border-radius: 50%; color: var(--ember-light); }
.hud-room > span:last-child { display: grid; gap: 2px; }
.hud-room small, .hud-clock small { color: #809095; font-size: 9px; }
.hud-room strong { max-width: 190px; overflow: hidden; color: #e8e7e1; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.hud-phase { display: flex; align-items: center; gap: 8px; color: #edc18f; font-size: 12px; }
.hud-role { position: absolute; top: max(82px, calc(env(safe-area-inset-top) + 72px)); right: max(18px, env(safe-area-inset-right)); align-self: auto; margin: 0; }
.hud-phase i { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 12px rgba(227,140,76,.6); }
.hud-clock { display: grid; justify-items: center; min-width: 54px; line-height: 1; }
.hud-clock strong { color: #f3c18b; font: 18px Georgia, serif; font-variant-numeric: tabular-nums; }
.hud-alive { font-size: 11px; }
.hud-connection { display: flex; align-items: center; gap: 7px; color: #96a2a7; font-size: 10px; }
.hud-connection i { width: 7px; height: 7px; border-radius: 50%; background: #c57968; }
.hud-connection.is-connected i { background: #83be91; box-shadow: 0 0 9px #83be9180; }
.hud-icon-button { width: 38px; min-height: 38px; border: 1px solid rgba(199,214,210,.14); border-radius: 8px; background: rgba(255,255,255,.035); color: #bbc7c3; cursor: pointer; pointer-events: auto; }
.hud-icon-button:hover { border-color: rgba(227,140,76,.5); color: #f0c08d; }
.hud-exit { min-width: 56px; padding: 6px 11px; border-radius: 8px; background: rgba(110,45,39,.2); color: #d9a093; }
.desktop-roster { position: absolute; top: max(82px, calc(env(safe-area-inset-top) + 72px)); left: max(18px, env(safe-area-inset-left)); width: clamp(205px, 17vw, 250px); max-height: min(62dvh, 540px); overflow: hidden; padding: 10px; border: 1px solid rgba(199,214,210,.13); border-radius: 11px; background: rgba(5,12,16,.72); box-shadow: 0 16px 42px rgba(0,0,0,.22); backdrop-filter: blur(12px); pointer-events: auto; }
.roster-heading { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 9px; border-bottom: 1px solid rgba(255,255,255,.08); color: #d9dfd9; font-size: 11px; }
.roster-heading span { color: #8c9a99; font-size: 9px; }
#desktopPlayerItems { display: grid; max-height: calc(min(62dvh, 540px) - 46px); gap: 3px; overflow-y: auto; padding-top: 6px; scrollbar-width: thin; scrollbar-color: rgba(188,204,199,.24) transparent; }
.roster-player { display: flex; min-height: 38px; align-items: center; gap: 8px; padding: 4px 5px; border-radius: 7px; color: #d8dfd9; transition: background .18s ease, opacity .18s ease; }
.roster-avatar { position: relative; display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border: 1px solid rgba(199,214,210,.16); border-radius: 50%; background: rgba(85,111,113,.2); color: #c2cfca; font-size: 10px; }
.roster-avatar i { position: absolute; right: -1px; bottom: -1px; width: 7px; height: 7px; border: 1px solid #091014; border-radius: 50%; background: #83be91; }
.roster-player-copy { display: grid; min-width: 0; flex: 1; gap: 2px; }
.roster-player-copy strong { overflow: hidden; font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.roster-player-copy small { color: #82908f; font-size: 8px; }
.roster-mic { color: #72807f; font-size: 15px; }
.roster-player.is-active { background: rgba(221,151,89,.1); }.roster-player.is-active .roster-player-copy strong { color: #f0c391; }
.roster-player.is-speaking { background: rgba(221,151,89,.15); box-shadow: inset 2px 0 #e8a263; animation: roster-pulse 1.6s ease-in-out infinite; }.roster-player.is-speaking .roster-mic { color: #f0b477; }
.roster-player.is-self .roster-avatar { border-color: rgba(227,140,76,.48); }
.roster-player.is-dead { opacity: .48; }.roster-player.is-dead .roster-avatar i { background: #78827e; }.roster-player.is-dead .roster-player-copy strong { text-decoration: line-through; }
.roster-player.is-disconnected .roster-avatar i { background: #c57968; }
.hud-turn { position: absolute; top: auto; bottom: max(28px, calc(env(safe-area-inset-bottom) + 24px)); left: 50%; min-width: 210px; transform: translateX(-50%); background: rgba(5,12,16,.78); }
.hud-voice { top: auto; right: auto; bottom: max(18px, env(safe-area-inset-bottom)); left: max(18px, env(safe-area-inset-left)); grid-template-columns: auto 1fr; align-items: center; column-gap: 9px; min-width: 170px; padding: 8px; border-color: rgba(199,214,210,.15); background: rgba(5,12,16,.83); }
.hud-voice button { grid-row: span 2; min-width: 84px; min-height: 40px; border-radius: 8px; }.hud-voice > span { font-size: 10px; }.hud-voice small { font-size: 8px; }
.mobile-chat-toggle { position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; justify-content: center; min-width: 86px; min-height: 42px; border: 1px solid rgba(199,214,210,.16); border-radius: 8px; background: rgba(5,12,16,.82); color: #d8dfd9; font-size: 11px; pointer-events: auto; cursor: pointer; }
.mobile-chat-panel { right: max(18px, env(safe-area-inset-right)); bottom: max(70px, calc(env(safe-area-inset-bottom) + 58px)); }
.mobile-chat-panel:not([hidden]) { display: grid; animation: panel-arrive .18s ease-out both; }
.game-action-panel { top: 50%; right: max(18px, env(safe-area-inset-right)); bottom: auto; left: auto; width: min(320px, 24vw); max-height: min(56dvh, 520px); overflow-y: auto; transform: translateY(-50%); border-color: rgba(199,214,210,.16); background: rgba(5,12,16,.9); }
.game-action-panel:not([hidden]) { animation: panel-arrive .2s ease-out both; }
.hud-skip { right: auto; bottom: max(105px, calc(env(safe-area-inset-bottom) + 95px)); left: 50%; transform: translateX(-50%); }
.investigation-panel { top: auto; bottom: max(104px, calc(env(safe-area-inset-bottom) + 94px)); left: max(18px, env(safe-area-inset-left)); }
.hud-rematch { top: max(82px, calc(env(safe-area-inset-top) + 72px)); }
.mobile-roster-toggle, .mobile-player-list { display: none; }
.mobile-player-list:not([hidden]) { display: grid; animation: panel-arrive .18s ease-out both; }
.mobile-player-entry { display: flex; min-height: 38px; align-items: center; gap: 8px; padding: 4px 7px; border-radius: 7px; background: rgba(255,255,255,.035); color: #d8dfd9; font-size: 11px; }
.mobile-player-entry .roster-player-copy small { font-size: 8px; }
@keyframes roster-pulse { 50% { background: rgba(221,151,89,.22); } }
@keyframes panel-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 960px) and (orientation: landscape) {
  .match-hud { grid-template-rows: auto 1fr; padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .hud-top { min-height: 38px; gap: clamp(7px, 1.4vw, 13px); padding: 4px 8px; border-radius: 9px; }
  .hud-room { display: none; }.hud-phase { flex: 1; font-size: 10px; }.hud-alive { gap: 5px; font-size: 9px; }.hud-clock { min-width: 35px; }.hud-clock small { display: none; }.hud-clock strong { font-size: 15px; }
  .hud-connection span { display: none; }.hud-icon-button { width: 34px; min-height: 34px; }.hud-exit { min-width: 45px; min-height: 34px; padding: 0 8px; font-size: 10px; }
  .desktop-roster { display: none; }.mobile-roster-toggle { position: absolute; top: max(48px, calc(env(safe-area-inset-top) + 43px)); left: max(8px, env(safe-area-inset-left)); z-index: 2; display: inline-flex; min-width: 84px; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 0 10px; border: 1px solid rgba(199,214,210,.17); border-radius: 8px; background: rgba(5,12,16,.82); color: #dce2dc; font: inherit; font-size: 10px; pointer-events: auto; }
  .mobile-roster-toggle span { color: #e9b681; }.mobile-player-list { position: absolute; top: max(92px, calc(env(safe-area-inset-top) + 86px)); left: max(8px, env(safe-area-inset-left)); z-index: 3; width: min(210px, 31vw); max-height: 54dvh; gap: 5px; overflow-y: auto; padding: 9px; border: 1px solid rgba(199,214,210,.18); border-radius: 10px; background: rgba(5,12,16,.95); box-shadow: 0 12px 34px #0008; backdrop-filter: blur(12px); pointer-events: auto; }
  .mobile-player-list[hidden] { display: none; }.mobile-player-list > strong { color: #e8b37b; font-size: 10px; }
  .hud-turn { top: max(49px, calc(env(safe-area-inset-top) + 45px)); bottom: auto; left: 50%; min-width: 128px; gap: 2px; padding: 5px 10px; transform: translateX(-50%); }.hud-turn small { font-size: 8px; }.hud-turn strong { font-size: 10px; }.hud-timer { font-size: 14px; }
  .hud-voice { bottom: max(8px, env(safe-area-inset-bottom)); left: max(8px, env(safe-area-inset-left)); min-width: 0; grid-template-columns: auto; padding: 4px; border: 0; background: transparent; box-shadow: none; backdrop-filter: none; }.hud-voice button { grid-row: auto; width: 48px; min-width: 48px; min-height: 44px; overflow: hidden; padding: 0 5px; font-size: 0; }.hud-voice button span { font-size: 17px; }.hud-voice > span, .hud-voice small { display: none; }
  .mobile-chat-toggle { right: max(8px, env(safe-area-inset-right)); bottom: max(8px, env(safe-area-inset-bottom)); min-width: 58px; min-height: 44px; padding: 0 8px; font-size: 10px; }
  .mobile-chat-panel { right: max(8px, env(safe-area-inset-right)); bottom: max(60px, calc(env(safe-area-inset-bottom) + 54px)); width: min(280px, 43vw); max-height: 66dvh; }
  .game-action-panel { top: auto; right: max(8px, env(safe-area-inset-right)); bottom: max(58px, calc(env(safe-area-inset-bottom) + 51px)); left: auto; width: min(310px, 38vw); max-height: min(52dvh, 220px); padding: 8px; transform: none; gap: 6px; }
  .action-target { min-width: 70px; min-height: 40px; padding: 6px 8px; font-size: 11px; }
  .hud-skip { right: auto; bottom: max(8px, env(safe-area-inset-bottom)); left: 50%; min-width: 96px; min-height: 42px; transform: translateX(-50%); font-size: 10px; }
  .investigation-panel { top: auto; bottom: max(58px, calc(env(safe-area-inset-bottom) + 51px)); left: max(8px, env(safe-area-inset-left)); width: min(200px, 32vw); max-height: 36dvh; padding: 8px; font-size: 9px; }
  .hud-rematch { top: max(48px, calc(env(safe-area-inset-top) + 43px)); right: max(8px, env(safe-area-inset-right)); min-height: 38px; font-size: 10px; }
  .game-event-banner { top: max(51px, calc(env(safe-area-inset-top) + 46px)); max-width: 50vw; padding: 6px 8px; font-size: 10px; }
  .hud-look-hint { display: none; }
}
@media (max-width: 960px) and (orientation: landscape) and (max-height: 390px) {
  .hud-top { min-height: 34px; }.mobile-roster-toggle { top: max(41px, calc(env(safe-area-inset-top) + 38px)); min-height: 34px; }.mobile-player-list { top: max(80px, calc(env(safe-area-inset-top) + 76px)); max-height: 48dvh; }
  .hud-turn { top: max(42px, calc(env(safe-area-inset-top) + 39px)); }.game-action-panel { max-height: 47dvh; }.mobile-chat-panel { max-height: 56dvh; }
}
@media (prefers-reduced-motion: reduce) { .roster-player.is-speaking { animation: none; }.mobile-player-list:not([hidden]), .mobile-chat-panel:not([hidden]), .game-action-panel:not([hidden]) { animation: none; } }

/* Compact landscape room browser and single-line game HUD */
.topbar-settings { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(192,212,217,.14); border-radius: 9px; background: rgba(9,19,24,.72); color: #b9c7c5; cursor: pointer; }
.rooms-status { min-height: 17px; margin: 0; color: #8fa1a3; font-size: 10px; }
.rooms-status[data-state="error"] { color: #e1ad8d; }
.rooms-status[data-state="loading"]::before { display: inline-block; width: 6px; height: 6px; margin-inline-end: 7px; border-radius: 50%; background: #78a9d3; content: ""; animation: connection-pulse 1s ease-in-out infinite; }
.hud-connection.is-connected i { background: #78a9d3; box-shadow: 0 0 9px #78a9d380; }
.hud-status { color: #aab9b5; font-size: 10px; }
@keyframes connection-pulse { 50% { opacity: .35; } }
@keyframes speaker-flash { 0% { filter: brightness(1.7); box-shadow: 0 0 24px rgba(227,140,76,.34); } 100% { filter: brightness(1); } }
@media (max-width: 960px) and (orientation: landscape) { .hud-turn.speaker-changed { animation: speaker-flash .48s ease-out; } }
@media (prefers-reduced-motion: reduce) { .hud-turn.speaker-changed { animation: none; } }
@media (max-width: 960px) and (orientation: landscape) {
  html:has(body.is-servers-view), html:has(body.is-room-lobby) { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
  body.is-servers-view, body.is-room-lobby { position: fixed; inset: 0; display: grid; width: 100%; height: 100vh; height: 100dvh; min-width: 0; min-height: 0; grid-template-rows: max(48px, calc(env(safe-area-inset-top) + 44px)) minmax(0, 1fr); overflow: hidden; overscroll-behavior: none; }
  body.is-servers-view .topbar, body.is-room-lobby .topbar { width: 100%; min-height: 0; padding: 3px max(12px, env(safe-area-inset-right)) 3px max(12px, env(safe-area-inset-left)); border-bottom-color: rgba(199,214,210,.1); }
  body.is-servers-view .brand, body.is-room-lobby .brand { gap: 8px; }
  body.is-servers-view .brand-mark, body.is-room-lobby .brand-mark { width: 30px; height: 30px; font-size: 15px; }
  body.is-servers-view .brand strong, body.is-room-lobby .brand strong { font-size: 16px; }
  body.is-servers-view .brand small, body.is-room-lobby .brand small { display: none; }
  body.is-servers-view .topbar-actions, body.is-room-lobby .topbar-actions { gap: 7px; }
  body.is-servers-view .connection-state, body.is-room-lobby .connection-state { gap: 5px; font-size: 9px; }
  body.is-servers-view .player-chip, body.is-room-lobby .player-chip { gap: 5px; padding: 5px 8px; }
  body.is-servers-view #appMain, body.is-room-lobby #appMain { width: 100%; height: 100%; min-height: 0; padding: 0 max(12px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); overflow: hidden; }
  body.is-servers-view #serversView:not([hidden]) { display: grid; width: 100%; height: 100%; grid-template-rows: auto auto auto minmax(0,1fr); gap: 5px; margin: 0; padding: 8px 0 2px; overflow: hidden; }
  body.is-servers-view #serversView .view-heading { min-height: 28px; align-items: center; gap: 8px; margin: 0; }
  body.is-servers-view #serversView .view-heading .eyebrow { display: none; }
  body.is-servers-view #serversView .view-heading h2 { font: 600 15px/1.2 "Vazirmatn", sans-serif; }
  body.is-servers-view #serversView .view-heading > div > p:last-child { display: none; }
  body.is-servers-view #serversView .view-heading > .button { min-height: 34px; margin: 0; padding: 0 11px; border-radius: 8px; font-size: 10px; }
  body.is-servers-view #serversView .toolbar { display: grid; grid-template-columns: minmax(130px,1fr) minmax(95px,.42fr) minmax(100px,.48fr) 38px; gap: 6px; margin: 0; }
  body.is-servers-view #serversView .searchbox { min-width: 0; min-height: 36px; gap: 5px; padding: 0 9px; border-radius: 8px; }
  body.is-servers-view #serversView .searchbox > span { font-size: 16px; }
  body.is-servers-view #serversView .searchbox input { min-height: 34px; font-size: 10px; }
  body.is-servers-view #serversView .toolbar select { width: 100%; min-width: 0; min-height: 36px; padding: 0 7px; border-radius: 8px; font-size: 9px; }
  body.is-servers-view #serversView .button-icon { width: 38px; min-height: 36px; }
  body.is-servers-view #serversView .rooms-status { min-height: 15px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  body.is-servers-view #serversView .rooms-list { min-height: 0; align-content: start; gap: 5px; overflow-x: hidden; overflow-y: auto; padding: 1px 1px 4px; scrollbar-width: thin; scrollbar-color: rgba(188,204,199,.24) transparent; }
  body.is-servers-view #serversView .rooms-list:empty { display: none; }
  body.is-servers-view #serversView .room-row { display: grid; min-height: 54px; grid-template-columns: minmax(100px,1fr) 58px auto 58px; gap: 7px; padding: 6px 9px; border-radius: 9px; background: rgba(8,17,22,.88); }
  body.is-servers-view #serversView .room-name { min-width: 0; }
  body.is-servers-view #serversView .room-name strong { font-size: 10px; }
  body.is-servers-view #serversView .room-name small { margin-top: 2px; font-size: 8px; }
  body.is-servers-view #serversView .room-data { font-size: 10px; white-space: nowrap; }
  body.is-servers-view #serversView .room-data small { display: none; }
  body.is-servers-view #serversView .room-status { gap: 4px; padding: 4px 6px; font-size: 8px; }
  body.is-servers-view #serversView .room-status::before { width: 5px; height: 5px; }
  body.is-servers-view #serversView .room-join { min-width: 58px; min-height: 34px; padding: 0 7px; border-radius: 7px; font-size: 9px; }
  body.is-servers-view #serversView .empty-state { align-self: center; width: min(420px,100%); justify-self: center; padding: 20px 14px; border-radius: 11px; }
  body.is-servers-view #serversView .empty-state > span { margin-bottom: 4px; font-size: 18px; }
  body.is-servers-view #serversView .empty-state strong { font-size: 12px; }
  body.is-servers-view #serversView .empty-state p { margin: 4px 0 9px; font-size: 9px; }
  body.is-servers-view #serversView .empty-state .button { min-height: 34px; font-size: 10px; }
  body.is-room-lobby #lobbyView:not([hidden]) { width: 100%; height: 100%; margin: 0; padding: 9px 0; overflow: auto; }
  body.is-room-lobby #lobbyView .view-heading { margin-bottom: 8px; }
  body.is-room-lobby #lobbyView .view-heading h2 { font-size: 18px; }
  body.is-room-lobby #lobbyView .view-heading > div > p:last-child { display: none; }
  body.is-room-lobby #lobbyView .lobby-readiness { gap: 5px 10px; margin: 0 0 8px; padding: 7px 10px; font-size: 10px; }
  body.is-room-lobby #lobbyView .lobby-grid { grid-template-columns: minmax(0,1.2fr) minmax(210px,.8fr); gap: 8px; }
  body.is-room-lobby #lobbyView .lobby-card { padding: 10px; border-radius: 10px; }
  body.is-room-lobby #lobbyView .member-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; margin-top: 7px; }
  body.is-room-lobby #lobbyView .member-item { min-height: 32px; gap: 6px; padding: 4px 6px; }
  body.is-room-lobby #lobbyView .lobby-note, body.is-room-lobby #lobbyView .engine-note { display: none; }
  body.is-room-lobby #lobbyView .lobby-voice { min-height: 43px; gap: 6px; margin: 0 0 7px; padding: 4px 7px; }
  body.is-room-lobby #lobbyView .lobby-voice-copy { min-width: 96px; gap: 0; }
  body.is-room-lobby #lobbyView .lobby-voice-copy strong { font-size: 9px; }
  body.is-room-lobby #lobbyView .lobby-voice-copy span, body.is-room-lobby #lobbyView .lobby-voice-copy small { font-size: 8px; }
  body.is-room-lobby #lobbyView .lobby-voice-button, body.is-room-lobby #lobbyView .lobby-speaker-button { min-height: 33px; padding: 0 8px; font-size: 8px; }
  body.is-room-lobby #lobbyView .lobby-voice-count { font-size: 8px; }
  body.is-room-lobby #lobbyView #lobbyVoiceHint { display: none; }
  body.is-room-lobby #lobbyView .member-avatar, body.is-room-lobby #lobbyView .member-voice { width: 21px; height: 21px; flex-basis: 21px; font-size: 8px; }
  .hud-status { padding-inline: 7px; border-inline-start: 1px solid rgba(199,214,210,.1); }
  .hud-turn { top: max(48px, calc(env(safe-area-inset-top) + 44px)); bottom: auto; left: 50%; display: grid; width: max-content; min-width: 0; max-width: min(225px,42vw); grid-template-columns: 27px minmax(40px,1fr) auto; grid-template-rows: auto auto; align-items: center; justify-items: start; gap: 1px 7px; padding: 5px 9px; transform: translateX(-50%); border-color: rgba(199,214,210,.12); border-radius: 24px; background: rgba(5,12,16,.78); box-shadow: 0 8px 22px #0004; }
  .hud-turn::before { content: ""; grid-column: 1; grid-row: 1 / 3; width: 25px; height: 25px; border: 1px solid rgba(227,140,76,.35); border-radius: 50%; background: radial-gradient(circle at 50% 38%, #dca87b 0 18%, transparent 20%), radial-gradient(ellipse at 50% 110%, #667b80 0 48%, transparent 50%); }
  .hud-turn small { grid-column: 2; grid-row: 1; color: #99a7a5; font-size: 7px; }.hud-turn strong { grid-column: 2; grid-row: 2; max-width: 120px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }.hud-turn .hud-timer { grid-column: 3; grid-row: 1 / 3; font-size: 14px; }
  .hud-turn.is-active { border-color: rgba(239,169,102,.48); box-shadow: 0 0 18px rgba(221,133,71,.15); }
}
@media (max-width: 960px) and (orientation: landscape) and (max-height: 375px) {
  body.is-servers-view, body.is-room-lobby { grid-template-rows: max(44px, calc(env(safe-area-inset-top) + 40px)) minmax(0,1fr); }
  body.is-servers-view #serversView:not([hidden]) { gap: 3px; padding-top: 5px; }
  body.is-servers-view #serversView .room-row { min-height: 48px; }
  .hud-turn { top: max(43px, calc(env(safe-area-inset-top) + 39px)); }
}
