:root {
    color-scheme:dark;
    --bg:#10141e;
    --surface:#191f2c;
    --surface-2:#202837;
    --line:#30394a;
    --text:#f4f5f7;
    --muted:#a2adbf;
    --lime:#c9f567;
    --red:#ff716f;
    --blue:#79aeff;
    --radius:18px;
    font-family:"Segoe UI",Arial,sans-serif;
    font-size:16px
}

* {
    box-sizing:border-box
}

body {
    margin:0;
    background:var(--bg);
    color:var(--text);
    line-height:1.55
}

button,input,select {
    font:inherit
}

button,a,input,select {
    -webkit-tap-highlight-color:transparent
}

button,a {
    touch-action:manipulation
}

button {
    cursor:pointer
}

button:disabled {
    cursor:not-allowed;
    opacity:.45
}

a {
    color:inherit;
    text-decoration:none
}

button {
    color:inherit
}

h1,h2,h3,p {
    margin:0
}

h1,h2,h3 {
    line-height:1.18;
    letter-spacing:-.035em
}

h1 {
    font-size:2.6rem;
    font-weight:750
}

h2 {
    font-size:1.6rem
}

h3 {
    font-size:1.05rem;
    letter-spacing:-.015em
}

img {
    max-width:100%
}

[hidden] {
    display:none!important
}

:focus-visible {
    outline:3px solid var(--lime);
    outline-offset:4px
}

::selection {
    background:#c9f567;
    color:#10141e
}

.topbar {
    height:100px;
    border-bottom:1px solid #ffffff0c;
    padding:0 clamp(24px,5vw,90px);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:25px
}

.brand {
    display:flex;
    align-items:center;
    gap:13px;
    font-size:.95rem;
    font-weight:800;
    letter-spacing:.09em;
    line-height:1.25
}

.brand-mark {
    background:var(--lime);
    color:#131a1c;
    width:45px;
    height:45px;
    border-radius:12px;
    display:grid;
    place-items:center;
    font-size:2rem;
    font-weight:500
}

.brand small {
    font-size:.67rem;
    letter-spacing:.32em;
    display:block;
    color:var(--muted);
    margin-top:5px
}

.topbar nav {
    display:flex;
    align-items:center;
    gap:28px
}

.header-note {
    font-size:.85rem;
    color:var(--muted)
}

.text-button {
    border:0;
    background:none;
    padding:8px 0;
    color:var(--muted);
    font-size:.9rem
}

.text-button:hover {
    color:var(--text)
}

.user-name {
    display:flex;
    align-items:center;
    gap:10px;
    font-size:.9rem
}

.avatar {
    width:32px;
    height:32px;
    flex-shrink:0;
    display:grid;
    place-items:center;
    background:#ffffff0c;
    border:1px solid #ffffff0c;
    border-radius:50%;
    font-size:.8rem;
    font-weight:700
}

.eyebrow {
    font-size:.72rem;
    letter-spacing:.16em;
    color:var(--muted);
    font-weight:700;
    line-height:1.5
}

.accent {
    color:var(--lime)
}

.muted {
    color:var(--muted);
    font-size:.9rem;
    line-height:1.7
}

.lead {
    color:var(--muted);
    font-size:1.1rem;
    line-height:1.75;
    max-width:510px
}

.button {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:47px;
    padding:11px 22px;
    border-radius:9px;
    border:1px solid transparent;
    font-weight:650;
    font-size:.9rem;
    transition:background .15s,transform .15s
}

.button:hover:not(:disabled) {
    transform:translateY(-1px)
}

.primary {
    background:var(--lime);
    color:#172013
}

.primary:hover:not(:disabled) {
    background:#d7ff85
}

.secondary {
    background:#ffffff04;
    border-color:var(--line);
    color:var(--text)
}

.secondary:hover:not(:disabled) {
    background:#ffffff0a;
    border-color:#59657a
}

.wide {
    width:100%
}

.small {
    min-height:38px;
    font-size:.83rem;
    padding:8px 15px
}

label {
    display:block;
    font-size:.86rem;
    font-weight:600;
    margin:20px 0 9px
}

input:not([type=checkbox]):not([type=hidden]),select {
    display:block;
    width:100%;
    min-width:0;
    color:var(--text);
    background:#111722;
    border:1px solid var(--line);
    border-radius:8px;
    min-height:47px;
    padding:11px 14px;
    font-size:.9rem;
    transition:border-color .15s
}

input::placeholder {
    color:#738096
}

input:focus,select:focus {
    border-color:var(--lime);
    outline:none;
    box-shadow:0 0 0 2px #c9f56718
}

select {
    appearance:none;
    padding-right:34px;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23a2adbf' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 14px center
}

input[type=checkbox] {
    accent-color:var(--lime);
    width:17px;
    height:17px;
    flex-shrink:0
}

.field-help {
    display:block;
    font-size:.73rem;
    color:var(--muted);
    margin-top:8px
}

.check-label {
    display:flex;
    align-items:center;
    gap:10px;
    cursor:pointer;
    font-weight:400;
    margin:22px 0
}

.check-label small {
    display:block;
    color:var(--muted);
    font-size:.73rem
}

.lock-icon {
    margin-left:auto;
    color:var(--muted)
}

.panel {
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:24px
}

.landing {
    max-width:1440px;
    margin:auto;
    display:grid;
    grid-template-columns:1.4fr 1fr;
    align-items:center;
    gap:90px;
    padding:64px clamp(24px,5vw,80px) 44px;
    min-height:calc(100vh - 170px)
}

.landing-story>.eyebrow {
    color:var(--lime);
    margin-bottom:24px
}

.tiny-diamond {
    font-size:.7rem;
    margin-right:8px
}

.landing h1 {
    font-size:clamp(2.5rem,3.8vw,3.8rem);
    line-height:1.14;
    font-weight:750;
    letter-spacing:-.055em
}

.landing h1 em {
    font-style:normal;
    color:var(--lime)
}

.landing .lead {
    margin-top:23px;
    max-width:495px
}

.picture-scene {
    height:315px;
    position:relative;
    margin:20px -10px 10px;
    isolation:isolate;
    max-width:610px
}

.scene-grid {
    position:absolute;
    inset:10px -20px -5px;
    background-image:linear-gradient(#ffffff04 1px,transparent 1px),linear-gradient(90deg,#ffffff04 1px,transparent 1px);
    background-size:35px 35px;
    mask-image:radial-gradient(ellipse,#000 30%,transparent 72%);
    z-index:-1
}

.sample-card {
    position:absolute;
    width:170px;
    height:210px;
    background:#fafaf7;
    border:6px solid #f6f6ef;
    border-radius:14px;
    color:#343944;
    box-shadow:0 18px 35px #0004;
    padding:9px 7px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:space-between;
    top:55px
}

.sample-card>span {
    font-size:.53rem;
    letter-spacing:.12em;
    font-weight:800
}

.sample-card img {
    width:140px;
    height:139px;
    object-fit:contain;
    mix-blend-mode:multiply
}

.sample-card small {
    font-size:.44rem;
    letter-spacing:.08em;
    font-weight:700
}

.sample-blue {
    left:3%;
    transform:rotate(-13deg);
    border-color:#81adf1;
    background:#b6d2ff
}

.sample-white {
    left:31%;
    top:29px;
    transform:rotate(4deg);
    z-index:2
}

.sample-red {
    left:60%;
    transform:rotate(14deg);
    border-color:#ef8b84;
    background:#ffc2bc
}

.clue-bubble {
    position:absolute;
    left:34%;
    bottom:1px;
    border:1px solid #536340;
    background:#273126;
    padding:10px 25px;
    border-radius:11px;
    box-shadow:0 10px 25px #0004;
    z-index:3;
    transform:rotate(-3deg)
}

.clue-bubble>span {
    font-size:.66rem;
    color:#bdc9b0
}

.clue-bubble strong {
    display:flex;
    align-items:center;
    gap:24px;
    font-size:1.3rem;
    line-height:1.5
}

.clue-bubble b {
    font-size:1rem;
    background:var(--lime);
    color:#263321;
    padding:0 9px;
    border-radius:5px
}

.game-facts {
    display:flex;
    gap:32px;
    margin-top:28px;
    font-size:.8rem;
    color:var(--muted)
}

.game-facts span+span {
    border-left:1px solid var(--line);
    padding-left:32px
}

.game-facts strong {
    font-size:1.15rem;
    color:var(--text);
    margin-right:5px
}

.auth-panel {
    background:linear-gradient(135deg,#202735,#191f2b);
    border:1px solid #37404f;
    border-radius:22px;
    padding:38px;
    max-width:450px;
    box-shadow:0 20px 100px #0002
}

.auth-panel>.eyebrow {
    font-size:.65rem;
    color:#b4becd
}

.auth-panel h2 {
    font-size:1.95rem;
    margin:15px 0 12px
}

.auth-panel .muted {
    font-size:.9rem
}

.segmented {
    display:flex;
    padding:4px;
    background:#111722;
    border-radius:9px;
    margin:28px 0 25px;
    gap:4px
}

.segmented button {
    flex:1;
    background:none;
    border:0;
    border-radius:6px;
    padding:10px;
    font-size:.85rem;
    color:var(--muted)
}

.segmented .active {
    background:#303a4a;
    color:var(--text);
    box-shadow:0 2px 5px #0003
}

.auth-panel .primary {
    margin-top:28px
}

.auth-foot {
    display:flex;
    gap:14px;
    align-items:center;
    border-top:1px solid var(--line);
    margin-top:28px;
    padding-top:23px
}

.auth-foot>span {
    color:var(--lime);
    font-size:1.7rem
}

.auth-foot p {
    font-size:.78rem;
    color:var(--muted);
    line-height:1.65
}

.page-footer {
    display:flex;
    justify-content:space-between;
    gap:15px;
    padding:25px 5vw;
    color:#778296;
    font-size:.72rem;
    border-top:1px solid #ffffff08
}

.validation {
    color:#ffaba6;
    font-size:.85rem;
    background:#ff716f10;
    border-radius:8px
}

.validation ul {
    padding:12px 20px 12px 30px;
    margin:0
}

.validation-summary-valid {
    display:none
}

.error-banner {
    padding:14px 20px;
    border:1px solid #ff716f40;
    margin:0 0 24px
}

.page-shell {
    max-width:1440px;
    margin:auto;
    padding:48px clamp(24px,5vw,80px) 70px
}

.page-heading {
    display:flex;
    justify-content:space-between;
    gap:25px;
    align-items:center;
    margin-bottom:38px
}

.page-heading .eyebrow {
    margin-bottom:12px
}

.page-heading h1 {
    margin-bottom:15px
}

.connection-badge {
    font-size:.73rem;
    color:#e0b77b;
    white-space:nowrap
}

.connection-badge:before {
    content:"";
    display:inline-block;
    width:6px;
    height:6px;
    background:currentColor;
    border-radius:50%;
    margin-right:7px;
    vertical-align:middle
}

.connection-badge.connected {
    color:#a0c586
}

.rooms-layout {
    display:grid;
    grid-template-columns:1fr 345px;
    gap:32px
}

.section-heading {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px
}

.section-heading h2 {
    font-size:1.2rem;
    white-space:nowrap
}

.count-badge {
    font-size:.7rem;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:24px;
    height:24px;
    background:#ffffff08;
    color:var(--muted);
    border-radius:6px;
    padding:0 6px;
    margin-left:5px;
    letter-spacing:0
}

.search-field {
    margin:0;
    max-width:270px;
    width:48%
}

.search-field input {
    font-size:.78rem!important;
    min-height:41px!important
}

.filter-row {
    display:flex;
    gap:9px;
    margin:22px 0
}

.filter {
    border:1px solid transparent;
    border-radius:7px;
    background:none;
    color:var(--muted);
    font-size:.8rem;
    padding:7px 13px
}

.filter.active {
    background:#c9f56712;
    color:var(--lime);
    border-color:#c9f56725
}

.room-list {
    min-height:350px;
    display:flex;
    flex-direction:column;
    gap:12px
}

.room-card {
    display:flex;
    gap:17px;
    align-items:center;
    background:var(--surface);
    border:1px solid var(--line);
    padding:20px;
    border-radius:12px
}

.room-emblem {
    width:48px;
    height:48px;
    display:grid;
    place-items:center;
    flex-shrink:0;
    border-radius:12px;
    background:#c9f56710;
    color:var(--lime);
    font-size:1.65rem
}

.room-emblem.locked {
    background:#ab91e315;
    color:#c0a4f1
}

.room-card-body {
    min-width:0;
    flex:1
}

.room-card h3 {
    font-size:1rem;
    overflow-wrap:anywhere
}

.room-meta {
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    color:var(--muted);
    font-size:.72rem;
    margin-top:10px
}

.room-meta span:first-child {
    font-family:monospace;
    letter-spacing:.04em
}

.room-card-end {
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:12px;
    flex-shrink:0
}

.room-phase {
    font-size:.7rem;
    color:var(--muted)
}

.room-phase.waiting {
    color:#b5d98d
}

.empty-state {
    border:1px dashed var(--line);
    border-radius:14px;
    min-height:350px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    gap:12px;
    padding:30px
}

.empty-icon {
    display:grid;
    place-items:center;
    color:#72805d;
    font-size:3rem;
    width:90px;
    height:90px;
    border-radius:24px;
    background:#c9f56706;
    margin-bottom:4px
}

.empty-state h3 {
    font-size:1.25rem
}

.empty-state p {
    color:var(--muted);
    font-size:.86rem;
    line-height:1.7
}

.create-panel {
    padding:27px;
    height:fit-content
}

.panel-icon {
    width:39px;
    height:39px;
    display:grid;
    place-items:center;
    border:1px solid #c9f56730;
    border-radius:10px;
    background:#c9f56710;
    color:var(--lime);
    font-size:1.5rem;
    margin-bottom:18px
}

.create-panel h2 {
    font-size:1.45rem;
    margin-bottom:9px
}

.create-panel>.muted {
    font-size:.83rem
}

.create-panel .primary {
    margin-top:8px
}

.invite-panel {
    border-top:1px solid var(--line);
    margin-top:30px;
    padding-top:27px
}

.invite-panel h3 {
    margin-bottom:5px
}

.join-code {
    display:grid;
    grid-template-columns:100px 1fr auto;
    gap:9px;
    margin-top:17px
}

.join-code input {
    font-size:.8rem!important
}

.join-code input:first-of-type {
    font-family:monospace;
    text-transform:uppercase
}

.game-page {
    max-width:1760px;
    margin:auto;
    padding:27px 35px 40px
}

.game-heading {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    margin-bottom:26px
}

.game-heading h1 {
    font-size:1.55rem;
    margin-top:5px;
    overflow-wrap:anywhere
}

.game-heading .eyebrow {
    font-size:.63rem
}

.game-heading .eyebrow span {
    color:var(--lime);
    font-family:monospace;
    margin-left:7px;
    font-size:.78rem
}

.game-heading-actions {
    display:flex;
    gap:22px;
    align-items:center
}

.game-layout {
    display:grid;
    grid-template-columns:205px minmax(0,1fr) 240px;
    gap:20px;
    align-items:start
}

.team-sidebar {
    display:flex;
    flex-direction:column;
    gap:17px
}

.team-panel {
    border:1px solid var(--line);
    background:var(--surface);
    border-radius:14px;
    padding:18px
}

.team-panel.red {
    --team:var(--red)
}

.team-panel.blue {
    --team:var(--blue)
}

.team-panel.current {
    border-color:var(--team);
    box-shadow:0 0 0 1px color-mix(in srgb,var(--team) 15%,transparent)
}

.team-title {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding-bottom:18px;
    border-bottom:1px solid #ffffff0d
}

.team-title h2 {
    font-size:1.15rem;
    color:var(--team)
}

.team-score {
    color:var(--team);
    font-size:2rem;
    line-height:1;
    text-align:right;
    font-weight:750
}

.team-score small {
    display:block;
    font-size:.58rem;
    color:var(--muted);
    font-weight:400;
    margin-top:5px
}

.role-label {
    font-size:.63rem;
    color:var(--muted);
    font-weight:650;
    letter-spacing:.1em;
    margin:18px 0 10px
}

.role-label>span {
    float:right
}

.player-row {
    display:flex;
    align-items:center;
    gap:9px;
    font-size:.82rem;
    margin:12px 0;
    overflow-wrap:anywhere
}

.player-row>span:last-child {
    min-width:0
}

.player-row small {
    font-size:.65rem;
    color:var(--muted);
    font-weight:400
}

.player-row>span>small:last-child {
    display:block
}

.player-row.offline {
    opacity:.5
}

.player-row .avatar {
    color:var(--team);
    background:color-mix(in srgb,var(--team) 9%,transparent);
    border-color:color-mix(in srgb,var(--team) 15%,transparent)
}

.empty-slot {
    font-size:.72rem;
    line-height:1.6;
    color:#8792a4;
    margin:7px 0 12px
}

.role-button {
    width:100%;
    min-height:36px;
    border:1px solid color-mix(in srgb,var(--team) 25%,transparent);
    border-radius:7px;
    background:color-mix(in srgb,var(--team) 7%,transparent);
    color:var(--team);
    font-size:.76rem
}

.role-button:hover:not(:disabled) {
    background:color-mix(in srgb,var(--team) 15%,transparent)
}

.spectators {
    padding:0 10px
}

.spectators p {
    font-size:.76rem;
    color:var(--muted);
    overflow-wrap:anywhere
}

.turn-banner {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:13px;
    padding:17px 22px;
    margin-bottom:17px;
    min-height:87px
}

.turn-banner h2 {
    font-size:1.15rem;
    margin-top:5px
}

.turn-banner.red {
    border-left:4px solid var(--red);
    background:linear-gradient(90deg,#ff716f12,var(--surface))
}

.turn-banner.blue {
    border-left:4px solid var(--blue);
    background:linear-gradient(90deg,#79aeff12,var(--surface))
}

.turn-banner.red .eyebrow {
    color:var(--red)
}

.turn-banner.blue .eyebrow {
    color:var(--blue)
}

.turn-banner .eyebrow {
    font-size:.62rem
}

.timer-block {
    text-align:center;
    min-width:80px;
    border-left:1px solid var(--line);
    padding-left:20px
}

.timer-block>span {
    font-size:1.6rem;
    line-height:1;
    font-variant-numeric:tabular-nums;
    font-weight:700
}

.timer-block small {
    font-size:.57rem;
    display:block;
    color:var(--muted);
    margin-top:6px;
    white-space:nowrap
}

.urgent {
    color:var(--red)
}

.lobby-board {
    min-height:430px;
    border:1px dashed #3a4657;
    border-radius:14px;
    background:radial-gradient(ellipse at 50% 25%,#2b363322,transparent 70%);
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    text-align:center;
    padding:30px 15px
}

.lobby-art {
    display:flex;
    margin-bottom:28px
}

.lobby-art span {
    display:grid;
    place-items:center;
    width:75px;
    height:96px;
    background:#202b36;
    border:1px solid #546274;
    border-radius:10px;
    color:#7aa2dc;
    font-size:2.5rem;
    transform:rotate(-16deg)
}

.lobby-art span:nth-child(2) {
    background:#2f3830;
    color:var(--lime);
    transform:translateY(-14px);
    z-index:1
}

.lobby-art span:last-child {
    transform:rotate(16deg);
    color:#e89991;
    background:#392b30
}

.lobby-board>.eyebrow {
    font-size:.6rem;
    color:var(--lime);
    margin-bottom:12px
}

.lobby-board h2 {
    font-size:1.5rem;
    line-height:1.35
}

.lobby-board p {
    color:var(--muted);
    font-size:.85rem;
    line-height:1.8;
    margin-top:14px
}

.lobby-checks {
    display:flex;
    gap:22px;
    font-size:.74rem;
    color:#8e98a8;
    margin-top:25px
}

.lobby-checks .ready {
    color:var(--lime)
}

.board {
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:10px
}

.game-card {
    position:relative;
    aspect-ratio:1.11;
    border-radius:10px;
    background:#fff;
    padding:7px;
    border:3px solid #e7e8e5;
    overflow:hidden;
    transition:transform .15s,box-shadow .15s;
    isolation:isolate
}

.game-card img {
    width:100%;
    height:100%;
    object-fit:contain;
    display:block
}

.game-card:hover {
    transform:translateY(-3px);
    box-shadow:0 6px 15px #0004
}

.card-number {
    position:absolute;
    top:5px;
    left:6px;
    background:#17202be8;
    color:#fff;
    border-radius:4px;
    min-width:20px;
    font-size:.6rem;
    line-height:1.6;
    padding:0 4px
}

.card-identity {
    position:absolute;
    bottom:0;
    left:0;
    right:0;
    padding:3px 1px;
    font-size:.59rem;
    font-weight:650;
    background:var(--card-color);
    color:var(--card-text,#fff);
    white-space:nowrap
}

.game-card.red {
    --card-color:#df514e;
    border-color:#df514e
}

.game-card.blue {
    --card-color:#467fd6;
    border-color:#467fd6
}

.game-card.neutral {
    --card-color:#8b9485;
    --card-text:#101810;
    border-color:#8b9485
}

.game-card.assassin {
    --card-color:#232732;
    border-color:#696e7c
}

.game-card.revealed:after {
    content:"";
    position:absolute;
    inset:0;
    background:var(--card-color);
    opacity:.7;
    z-index:1
}

.game-card.revealed img {
    opacity:.55
}

.game-card.revealed .card-identity,.game-card.revealed .card-number {
    z-index:3
}

.revealed-mark {
    position:absolute;
    inset:0;
    display:grid;
    place-items:center;
    color:white;
    font-size:2.7rem;
    font-weight:700;
    z-index:2;
    text-shadow:0 2px 3px #0003
}

.key-notice {
    font-size:.75rem;
    padding:9px 12px;
    margin-bottom:12px;
    border-radius:7px;
    background:#c9f5670a;
    border:1px solid #c9f56720;
    color:#c4d6a5
}

.game-controls {
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    align-items:center;
    gap:14px;
    margin-top:19px;
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:13px;
    padding:20px
}

.game-controls>.muted {
    font-size:.78rem;
    text-align:center;
    flex-basis:100%
}

.clue-form {
    width:100%
}

.clue-form>label {
    margin-top:0
}

.clue-inputs {
    display:grid;
    grid-template-columns:1fr 68px auto;
    gap:9px
}

.clue-inputs .button {
    padding:10px 16px
}

.clue-display {
    width:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:18px;
    flex-wrap:wrap
}

.clue-display>.eyebrow {
    font-size:.61rem
}

.clue-display strong {
    font-size:1.6rem
}

.clue-display b {
    background:var(--lime);
    color:#192318;
    padding:2px 10px;
    border-radius:7px;
    margin-left:7px;
    font-size:1.15rem
}

.clue-display>.muted {
    font-size:.77rem
}

.details-sidebar {
    display:flex;
    flex-direction:column;
    gap:17px
}

.details-sidebar .panel {
    padding:18px;
    border-radius:14px
}

.settings-panel h3,.history-panel h3 {
    font-size:.93rem
}

.settings-panel label {
    font-size:.73rem;
    margin-top:15px
}

.settings-panel select {
    min-height:39px;
    font-size:.76rem;
    padding:8px 32px 8px 11px
}

.settings-panel .check-label {
    margin:18px 0
}

.settings-panel .field-help {
    font-size:.66rem;
    line-height:1.6;
    margin-top:13px
}

.settings-panel .section-heading>span {
    color:var(--muted)
}

.history {
    list-style:none;
    padding:0;
    margin:17px 0 0;
    max-height:340px;
    overflow-y:auto;
    scrollbar-width:thin
}

.history li {
    border-left:2px solid #576172;
    padding:0 0 0 10px;
    margin:0 0 17px;
    font-size:.72rem;
    line-height:1.65;
    overflow-wrap:anywhere
}

.history .event-red {
    border-color:var(--red)
}

.history .event-blue {
    border-color:var(--blue)
}

.history time {
    display:block;
    color:#7c889c;
    font-size:.6rem;
    margin-top:2px
}

.modal {
    color:var(--text);
    background:#1b2230;
    border:1px solid #4b5669;
    border-radius:20px;
    box-shadow:0 30px 100px #0008;
    padding:30px;
    width:calc(100% - 32px);
    max-width:660px;
    max-height:88vh;
    overflow:auto
}

.modal::backdrop {
    background:#070b15c9;
    backdrop-filter:blur(5px)
}

.modal-top {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:16px
}

.icon-button {
    display:grid;
    place-items:center;
    background:#ffffff06;
    border:1px solid var(--line);
    border-radius:8px;
    width:32px;
    height:32px;
    font-size:1.35rem;
    color:var(--muted)
}

.modal h2 {
    font-size:1.6rem;
    margin-bottom:18px
}

.modal p {
    font-size:.9rem;
    line-height:1.8;
    color:#bcc6d5
}

.modal .primary.wide {
    margin-top:24px
}

.compact-modal {
    max-width:420px
}

.rules-list {
    padding-left:22px;
    color:#bcc6d5;
    font-size:.9rem;
    line-height:1.8
}

.rules-list li {
    padding-left:6px;
    margin:16px 0
}

.rules-list strong {
    color:var(--text)
}

details {
    padding:16px 0;
    border-top:1px solid var(--line);
    border-bottom:1px solid var(--line);
    margin-bottom:20px
}

summary {
    cursor:pointer;
    font-size:.88rem;
    font-weight:600
}

details p {
    margin-top:14px
}

.card-modal {
    max-width:450px
}

.card-modal>img {
    display:block;
    width:100%;
    max-height:45vh;
    object-fit:contain;
    background:white;
    border-radius:12px;
    padding:12px;
    margin-bottom:18px
}

.card-modal p {
    font-size:.83rem
}

.dialog-actions {
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:22px
}

.toast {
    position:fixed;
    left:50%;
    bottom:26px;
    transform:translateX(-50%);
    background:#344032;
    color:#f2f8ed;
    border:1px solid #697d56;
    box-shadow:0 8px 30px #0005;
    padding:14px 23px;
    border-radius:12px;
    font-size:.88rem;
    z-index:100;
    width:max-content;
    max-width:calc(100% - 30px);
    text-align:center
}

.error-page {
    padding:90px 8vw
}

.error-page h1 {
    margin:20px 0
}

.error-page p {
    color:var(--muted);
    margin-bottom:30px
}

.sr-only {
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
    border:0
}

@media(min-width:1600px) {
    .game-layout {
        grid-template-columns:230px minmax(0,1fr) 270px;
        gap:25px
    }
    .board {
        gap:14px
    }
    .card-identity {
        font-size:.7rem
    }
    .game-page {
        padding:32px 55px
    }
    .team-panel {
        padding:22px
    }
}

@media(max-width:1200px) {
    .landing {
        gap:45px;
        padding-top:45px
    }
    .landing h1 {
        font-size:3rem
    }
    .auth-panel {
        padding:28px
    }
    .sample-card {
        width:145px;
        height:190px
    }
    .sample-card img {
        width:115px;
        height:125px
    }
    .sample-card>span {
        font-size:.45rem
    }
    .sample-card small {
        font-size:.38rem
    }
    .picture-scene {
        height:290px
    }
    .game-layout {
        grid-template-columns:175px minmax(0,1fr) 205px;
        gap:14px
    }
    .game-page {
        padding:24px 20px
    }
    .team-panel {
        padding:15px
    }
    .team-title h2 {
        font-size:1rem
    }
    .details-sidebar .panel {
        padding:15px
    }
    .board {
        gap:7px
    }
    .card-identity {
        font-size:.48rem
    }
    .turn-banner {
        padding:15px
    }
    .turn-banner h2 {
        font-size:1rem
    }
    .game-facts {
        gap:17px
    }
    .game-facts span+span {
        padding-left:17px
    }
    .game-facts strong {
        font-size:1rem
    }
}

@media(max-width:1000px) {
    .topbar {
        padding:0 28px;
        height:84px
    }
    .landing {
        gap:30px;
        padding:42px 28px
    }
    .landing h1 {
        font-size:2.55rem
    }
    .landing .lead {
        font-size:.95rem
    }
    .auth-panel {
        padding:25px
    }
    .auth-panel h2 {
        font-size:1.65rem
    }
    .sample-card {
        width:125px;
        height:170px
    }
    .sample-card img {
        width:100px;
        height:110px
    }
    .sample-card small {
        display:none
    }
    .picture-scene {
        height:260px;
        margin-left:-12px
    }
    .game-facts {
        font-size:.7rem;
        gap:10px
    }
    .game-facts span+span {
        padding-left:10px
    }
    .game-facts strong {
        font-size:.9rem
    }
    .page-shell {
        padding:35px 28px
    }
    .rooms-layout {
        grid-template-columns:1fr 300px;
        gap:23px
    }
    .section-heading {
        flex-wrap:wrap
    }
    .search-field {
        width:100%;
        max-width:none
    }
    .room-card {
        gap:12px;
        padding:15px
    }
    .room-emblem {
        display:none
    }
    .join-code {
        grid-template-columns:100px 1fr
    }
    .join-code .button {
        grid-column:1/-1
    }
    .game-layout {
        grid-template-columns:180px minmax(0,1fr)
    }
    .details-sidebar {
        grid-column:1/-1;
        display:grid;
        grid-template-columns:1fr 2fr
    }
    .settings-panel form {
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:7px 12px
    }
    .settings-panel form label {
        grid-column:1/-1
    }
    .settings-panel form select {
        grid-column:1/-1
    }
    .history {
        max-height:280px
    }
    .card-identity {
        font-size:.58rem
    }
    .game-heading-actions {
        gap:12px
    }
    .game-heading-actions .connection-badge {
        display:none
    }
}

@media(max-width:740px) {
    .topbar {
        height:76px;
        padding:0 20px
    }
    .brand {
        font-size:.78rem;
        gap:9px
    }
    .brand-mark {
        width:37px;
        height:37px;
        font-size:1.65rem
    }
    .brand small {
        font-size:.56rem
    }
    .header-note {
        display:none
    }
    .topbar nav {
        gap:16px
    }
    .user-name {
        font-size:0
    }
    .user-name .avatar {
        font-size:.8rem
    }
    .landing {
        grid-template-columns:1fr;
        padding:38px 24px;
        gap:38px;
        max-width:540px
    }
    .landing h1 {
        font-size:2.8rem
    }
    .landing .lead {
        max-width:450px;
        font-size:1rem
    }
    .landing-story>.eyebrow {
        font-size:.62rem
    }
    .picture-scene {
        margin:15px auto 0;
        height:270px;
        width:100%;
        max-width:420px
    }
    .sample-card {
        width:135px;
        height:180px
    }
    .sample-card img {
        width:110px;
        height:120px
    }
    .sample-card>span {
        font-size:.43rem
    }
    .sample-blue {
        left:2%
    }
    .sample-white {
        left:32%
    }
    .sample-red {
        left:61%
    }
    .clue-bubble {
        left:33%
    }
    .game-facts {
        justify-content:center;
        font-size:.75rem;
        gap:20px
    }
    .game-facts span+span {
        padding-left:20px
    }
    .auth-panel {
        max-width:none;
        width:100%;
        padding:28px
    }
    .page-footer {
        flex-direction:column;
        text-align:center;
        font-size:.64rem
    }
    .page-heading {
        align-items:flex-start
    }
    .page-heading h1 {
        font-size:2rem
    }
    .page-heading>.connection-badge {
        display:none
    }
    .rooms-layout {
        grid-template-columns:1fr
    }
    .create-panel {
        order:-1
    }
    .create-panel form {
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:0 17px
    }
    .create-panel form>* {
        grid-column:1/-1
    }
    .create-panel .panel-icon {
        float:right
    }
    .page-shell {
        padding:30px 20px
    }
    .section-heading {
        flex-wrap:nowrap
    }
    .search-field {
        width:48%
    }
    .room-emblem {
        display:grid
    }
    .room-list,.empty-state {
        min-height:260px
    }
    .game-page {
        padding:20px 14px
    }
    .game-heading {
        flex-direction:column;
        align-items:flex-start;
        gap:12px;
        margin-bottom:18px
    }
    .game-heading-actions {
        width:100%;
        justify-content:space-between
    }
    .game-heading-actions .connection-badge {
        display:inline-block;
        font-size:.65rem
    }
    .game-heading h1 {
        font-size:1.4rem
    }
    .game-layout {
        display:flex;
        flex-direction:column;
        gap:18px
    }
    .play-area {
        width:100%;
        order:0
    }
    .team-sidebar {
        width:100%;
        display:grid;
        grid-template-columns:1fr 1fr;
        order:1;
        gap:12px
    }
    .spectators {
        grid-column:1/-1
    }
    .team-sidebar>.text-button {
        grid-column:1/-1
    }
    .details-sidebar {
        order:2;
        width:100%;
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:12px
    }
    .team-panel {
        padding:16px
    }
    .team-title h2 {
        font-size:1.1rem
    }
    .team-score {
        font-size:1.7rem
    }
    .player-row {
        font-size:.8rem
    }
    .lobby-board {
        min-height:310px;
        padding:30px 15px
    }
    .lobby-art {
        margin-bottom:20px
    }
    .lobby-art span {
        width:58px;
        height:72px;
        font-size:2rem
    }
    .lobby-board h2 {
        font-size:1.3rem
    }
    .lobby-board p {
        font-size:.78rem
    }
    .turn-banner {
        min-height:80px;
        margin-bottom:12px
    }
    .turn-banner h2 {
        font-size:1rem
    }
    .timer-block>span {
        font-size:1.4rem
    }
    .timer-block {
        min-width:70px;
        padding-left:13px
    }
    .board {
        gap:6px
    }
    .game-card {
        border-radius:7px;
        border-width:2px;
        padding:3px
    }
    .card-number {
        font-size:.48rem;
        left:2px;
        top:2px;
        min-width:15px;
        padding:0 3px
    }
    .card-identity {
        font-size:0;
        height:7px;
        padding:0
    }
    .game-card.revealed .card-identity {
        font-size:0
    }
    .revealed-mark {
        font-size:1.8rem
    }
    .key-notice {
        font-size:.67rem
    }
    .game-controls {
        padding:16px;
        margin-top:12px
    }
    .clue-inputs {
        grid-template-columns:1fr 60px
    }
    .clue-inputs .button {
        grid-column:1/-1
    }
    .clue-display {
        gap:8px 15px
    }
    .clue-display strong {
        font-size:1.4rem
    }
    .clue-display>.muted {
        flex-basis:100%;
        text-align:center
    }
    .history li {
        font-size:.68rem
    }
    .details-sidebar .panel {
        padding:15px
    }
    .settings-panel h3,.history-panel h3 {
        font-size:.85rem
    }
    .modal {
        padding:23px
    }
    .modal h2 {
        font-size:1.35rem
    }
    .rules-list {
        font-size:.83rem
    }
    .dialog-actions .button {
        font-size:.8rem;
        padding:10px 13px
    }
}

@media(max-width:390px) {
    .landing h1 {
        font-size:2.35rem
    }
    .sample-card {
        width:113px;
        height:155px
    }
    .sample-card img {
        width:90px;
        height:100px
    }
    .picture-scene {
        height:245px
    }
    .game-facts {
        gap:12px;
        font-size:.65rem
    }
    .game-facts span+span {
        padding-left:12px
    }
    .section-heading {
        flex-wrap:wrap
    }
    .search-field {
        width:100%
    }
    .room-emblem {
        display:none
    }
    .details-sidebar {
        grid-template-columns:1fr
    }
    .game-heading-actions {
        gap:8px
    }
    .game-heading-actions .connection-badge {
        display:none
    }
    .turn-banner h2 {
        font-size:.9rem
    }
    .filter {
        font-size:.7rem;
        padding:7px 10px
    }
}

.host-status-bar {
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:10px 20px;
    margin:-5px 0 22px;
    font-size:.875rem;
}
.host-status-bar strong { font-weight:600; overflow-wrap:anywhere; }
.host-status-bar .muted { font-size:.875rem; }
.host-badge {
    display:inline-block;
    border:1px solid #c9f56740;
    background:#c9f56712;
    color:var(--lime);
    padding:2px 6px;
    border-radius:5px;
    font-size:.7rem;
    font-weight:700;
    letter-spacing:.05em;
    vertical-align:middle;
}
.join-status { margin-left:auto; color:#a0c586; }
.join-status.locked, .join-locked-label { color:#e0b77b; }
.host-panel > .button { margin-top:12px; font-size:.875rem; padding:10px; }
.host-panel .section-heading { flex-wrap:wrap; }
.host-player-details { margin:16px 0 4px; padding:12px 0; }
.host-player-details summary { font-size:.875rem; }
.host-player-row { display:flex; align-items:center; gap:10px; margin-top:14px; font-size:.875rem; }
.host-player-row > span { flex:1; min-width:0; overflow-wrap:anywhere; }
.host-player-row small { display:block; color:var(--muted); font-size:.75rem; }
.remove-player { color:#ffaba6; font-size:.875rem; }
.button.danger { color:#ffaba6; background:#ff716f12; border-color:#ff716f50; }
.button.danger:hover:not(:disabled) { background:#ff716f22; }
@media(max-width:740px) {
    .host-status-bar { align-items:flex-start; margin:0 0 18px; }
    .host-status-bar > span:nth-child(2):not(:empty) { order:2; flex-basis:100%; }
    .host-panel { grid-column:1/-1; }
}
@media(prefers-reduced-motion:reduce) {
    *,*:before,*:after {
        transition:none!important;
        scroll-behavior:auto!important
    }
}
