:root {
    --bg: #080914;
    --panel: #171827;
    --card: #202235;
    --card-2: #272a3f;
    --gold: #f5c542;
    --red: #c0392b;
    --purple: #7d3c98;
    --blue: #5dade2;
    --green: #75b36a;
    --text: #f4f4f4;
    --muted: #b8b8c8;
    --line: rgba(255, 255, 255, 0.12);
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

/* Polished social surface */
body.social-body .social-shell {
    width: min(1240px, calc(100vw - 2rem));
    padding: 1.4rem 0 2rem;
}

body.social-body .social-header {
    margin-bottom: 0.8rem;
}

body.social-body .social-header h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 3.1rem;
    line-height: 1;
}

.social-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

body.social-body .social-presence-strip {
    min-width: 0;
    display: grid;
    grid-template-columns: auto auto auto;
    grid-template-areas:
        "dot count label"
        "dot meta meta";
    justify-items: start;
    align-items: center;
    column-gap: 0.45rem;
    row-gap: 0.05rem;
    border-color: rgba(117, 179, 106, 0.28);
    padding: 0.52rem 0.7rem;
    background: rgba(16, 32, 26, 0.72);
}

body.social-body .social-presence-strip .presence-dot {
    grid-area: dot;
}

body.social-body .social-presence-strip strong {
    grid-area: count;
    font-size: 1rem;
}

body.social-body .social-presence-strip span:not(.presence-dot) {
    grid-area: label;
    color: rgba(255, 245, 219, 0.82);
    font-size: 0.76rem;
    text-transform: none;
}

body.social-body .social-presence-strip em {
    grid-area: meta;
    color: rgba(255, 245, 219, 0.52);
    font-size: 0.68rem;
    font-style: normal;
}

body.social-body .social-layout {
    min-height: min(760px, calc(100dvh - 132px));
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 0.85rem;
}

body.social-body .social-sidebar,
body.social-body .direct-chat-panel {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(10, 11, 24, 0.88);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

body.social-body .social-sidebar {
    grid-template-rows: minmax(0, 1fr) minmax(180px, auto);
    gap: 0.9rem;
    padding: 0.75rem;
}

.social-sidebar-section {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.55rem;
}

.social-sidebar-section:last-child {
    grid-template-rows: auto auto minmax(84px, auto);
}

.soft-count {
    min-width: 1.6rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    padding: 0.08rem 0.45rem;
    color: rgba(255, 245, 219, 0.72);
    font-size: 0.72rem;
    text-align: center;
}

body.social-body .conversation-list,
body.social-body .suggestion-list {
    gap: 0.45rem;
}

body.social-body .conversation-row {
    min-height: 64px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 0.72rem;
    align-items: center;
    border-color: rgba(255, 255, 255, 0.08);
    padding: 0.62rem;
    background: rgba(255, 255, 255, 0.035);
}

body.social-body .conversation-row.active,
body.social-body .conversation-row:hover,
body.social-body .suggestion-row:hover {
    border-color: rgba(245, 197, 66, 0.34);
    background: rgba(245, 197, 66, 0.075);
}

.conversation-avatar,
.direct-peer-avatar {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(245, 197, 66, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    object-fit: cover;
}

.conversation-avatar.fallback {
    display: block;
}

.conversation-copy {
    min-width: 0;
    display: grid;
    gap: 0.15rem;
}

body.social-body .conversation-copy strong {
    display: block;
    overflow: hidden;
    color: #fff7dd;
    font-size: 0.95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.social-body .conversation-copy span {
    display: block;
    overflow: hidden;
    color: rgba(255, 245, 219, 0.58);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-meta {
    display: grid;
    justify-items: end;
    gap: 0.25rem;
}

body.social-body .conversation-meta em {
    color: rgba(255, 245, 219, 0.58);
    font-size: 0.66rem;
    font-style: normal;
    text-transform: uppercase;
}

body.social-body .social-search-form {
    margin: 0;
}

body.social-body .suggestion-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 0.65rem;
}

body.social-body .suggestion-row strong a {
    overflow: hidden;
    color: #fff7dd;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.social-body .suggestion-row strong a:hover,
#direct-peer-link:hover {
    color: #f5c542;
}

body.social-body .suggestion-actions .btn {
    min-height: 34px;
}

body.social-body .direct-chat-panel {
    grid-template-rows: auto minmax(0, 1fr) auto auto;
}

body.social-body .direct-chat-header {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.72rem 0.85rem;
    background: rgba(255, 255, 255, 0.025);
}

.direct-peer-avatar {
    width: 52px;
    height: 52px;
}

.direct-peer-heading {
    min-width: 0;
}

body.social-body .direct-chat-header h2 {
    overflow: hidden;
    font-size: 1.18rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#direct-peer-link {
    color: #fff7dd;
    text-decoration: none;
}

#direct-peer-link[aria-disabled="true"] {
    pointer-events: none;
}

body.social-body #direct-presence {
    min-height: 1rem;
    color: rgba(255, 245, 219, 0.66);
    font-size: 0.72rem;
    text-transform: none;
}

body.social-body #direct-presence span:not(.presence-dot) {
    color: rgba(255, 245, 219, 0.5);
}

body.social-body .direct-request-note:empty {
    display: none;
}

body.social-body .direct-message-list {
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
    padding: 1rem 0.85rem;
}

body.social-body .direct-message {
    width: min(72%, 660px);
}

body.social-body .direct-message p {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.045);
}

body.social-body .direct-message.from-me p {
    border-color: rgba(93, 173, 226, 0.3);
    background: rgba(31, 55, 82, 0.82);
}

body.social-body .direct-message.from-peer p {
    border-color: rgba(245, 197, 66, 0.2);
    background: rgba(44, 36, 30, 0.84);
}

.direct-typing-indicator {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    padding: 0 0.95rem;
    color: rgba(255, 245, 219, 0.58);
    font-size: 0.78rem;
}

.direct-typing-indicator:empty {
    visibility: hidden;
}

.direct-typing-indicator i {
    width: 0.24rem;
    height: 0.24rem;
    display: inline-block;
    border-radius: 50%;
    background: rgba(245, 197, 66, 0.72);
    animation: typingPulse 1.15s infinite ease-in-out;
}

.direct-typing-indicator i:nth-child(3) {
    animation-delay: 0.16s;
}

.direct-typing-indicator i:nth-child(4) {
    animation-delay: 0.32s;
}

@keyframes typingPulse {
    0%, 80%, 100% {
        opacity: 0.34;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

body.social-body .direct-chat-form {
    padding: 0.72rem 0.85rem;
}

@media (max-width: 860px) {
    body.social-body .social-shell {
        width: min(100vw - 1rem, 1240px);
        padding-top: 0.9rem;
    }

    body.social-body .social-header {
        display: grid;
        grid-template-columns: 1fr;
        align-items: start;
    }

    body.social-body .social-header h1 {
        font-size: 2.25rem;
    }

    .social-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    body.social-body .social-layout {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    body.social-body .social-sidebar {
        grid-template-rows: auto auto;
    }

    body.social-body .conversation-list,
    body.social-body .suggestion-list {
        max-height: 250px;
    }

    body.social-body .direct-chat-panel {
        min-height: 560px;
    }

    body.social-body .direct-message {
        width: min(92%, 680px);
    }
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.profile-shell,
.leaderboard-shell {
    width: min(1120px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 2rem 0 3rem;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.profile-header h1 {
    margin: 0;
}

.profile-hero {
    position: relative;
    min-height: 248px;
    padding: 1.1rem;
    border: 1px solid rgba(245, 197, 66, 0.2);
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(8, 9, 20, 0.92), rgba(8, 9, 20, 0.68)),
        radial-gradient(circle at 88% 18%, rgba(192, 57, 43, 0.38), transparent 18rem),
        linear-gradient(135deg, rgba(32, 34, 53, 0.98), rgba(13, 22, 36, 0.94));
    box-shadow: var(--shadow);
}

.banner-old_square {
    background:
        linear-gradient(90deg, rgba(8, 9, 20, 0.92), rgba(8, 9, 20, 0.68)),
        radial-gradient(circle at 18% 76%, rgba(117, 179, 106, 0.22), transparent 18rem),
        linear-gradient(135deg, rgba(28, 31, 46, 0.98), rgba(15, 30, 34, 0.94));
}

.banner-red_moon {
    background:
        linear-gradient(90deg, rgba(8, 9, 20, 0.94), rgba(8, 9, 20, 0.62)),
        radial-gradient(circle at 84% 20%, rgba(192, 57, 43, 0.62), transparent 17rem),
        linear-gradient(135deg, rgba(34, 19, 25, 0.98), rgba(15, 16, 31, 0.94));
}

.banner-ranked_standard {
    background:
        linear-gradient(90deg, rgba(8, 9, 20, 0.94), rgba(8, 9, 20, 0.64)),
        radial-gradient(circle at 82% 18%, rgba(93, 173, 226, 0.36), transparent 18rem),
        linear-gradient(135deg, rgba(23, 24, 39, 0.98), rgba(20, 34, 48, 0.94));
}

.profile-hero-main {
    display: grid;
    grid-template-columns: 142px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.profile-bio {
    max-width: 62ch;
    margin: 0.65rem 0 0;
    color: rgba(255, 245, 219, 0.82);
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 1rem;
    align-items: start;
}

.profile-summary {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.profile-avatar-frame {
    width: 120px;
    height: 120px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(245, 197, 66, 0.34);
    border-radius: 8px;
    background: rgba(8, 13, 20, 0.58);
}

.profile-avatar-frame img {
    width: 88px;
    height: 88px;
    object-fit: contain;
}

.frame-ember {
    border-color: #ef8f44;
}

.frame-silverthorn {
    border-color: #a9d5d0;
}

.frame-eclipse {
    border-color: #9f7aea;
}

.frame-elder {
    border-color: #f5c542;
    box-shadow: 0 0 0 1px rgba(245, 197, 66, 0.32), 0 0 24px rgba(245, 197, 66, 0.18);
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.profile-badge {
    border: 1px solid rgba(245, 197, 66, 0.24);
    border-radius: 999px;
    padding: 0.26rem 0.56rem;
    color: #f7e8b7;
    background: rgba(245, 197, 66, 0.08);
    font-size: 0.78rem;
}

.badge.ranked {
    border-color: rgba(159, 122, 234, 0.42);
    color: #decfff;
}

.profile-nav {
    position: sticky;
    top: 0.6rem;
    z-index: 4;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 1rem 0;
    padding: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(8, 9, 20, 0.82);
    backdrop-filter: blur(12px);
}

.profile-nav a {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0 0.75rem;
    color: #f7e8b7;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 800;
    background: rgba(245, 197, 66, 0.08);
}

.profile-hub .panel {
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: rgba(23, 24, 39, 0.88);
}

.profile-overview-grid,
.playstyle-grid,
.memory-grid,
.badge-grid {
    margin-bottom: 1rem;
}

.profile-level-panel,
.profile-rank-panel,
.profile-coach-panel {
    min-height: 100%;
}

.progression-track,
.role-bars span {
    position: relative;
    display: block;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.progression-track span,
.role-bars span::before {
    content: "";
    display: block;
    width: var(--value);
    max-width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f5c542, #75b36a);
}

.profile-metric-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.8rem;
    color: var(--muted);
    font-size: 0.86rem;
}

.profile-metric-row strong {
    color: #f7e8b7;
}

.profile-stat-grid,
.memory-score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.profile-stat-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-stat-grid > div,
.memory-score-grid > div,
.rank-emblem {
    min-height: 78px;
    display: grid;
    align-content: center;
    gap: 0.2rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    padding: 0.75rem;
    background: rgba(8, 9, 20, 0.42);
}

.profile-stat-grid span,
.memory-score-grid span,
.rank-emblem span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.profile-stat-grid strong,
.memory-score-grid strong,
.rank-emblem strong {
    color: #fff7dd;
    font-size: 1.45rem;
    line-height: 1;
}

.profile-stat-grid em {
    color: rgba(255, 245, 219, 0.6);
    font-size: 0.74rem;
    font-style: normal;
}

.rank-emblem {
    min-height: 128px;
    place-items: center;
    text-align: center;
    background:
        radial-gradient(circle at 50% 35%, rgba(159, 122, 234, 0.2), transparent 6rem),
        rgba(8, 9, 20, 0.42);
}

.rank-emblem strong {
    font-size: 2.35rem;
}

.profile-note-list,
.memory-event-list,
.relationship-list,
.role-stat-list,
.match-history-list {
    display: grid;
    gap: 0.65rem;
}

.profile-note-list {
    margin: 0;
    padding-left: 1rem;
    color: rgba(255, 245, 219, 0.8);
}

.memory-summary-card {
    margin-top: 1rem;
    padding: 0.8rem;
    border: 1px solid rgba(117, 179, 106, 0.22);
    border-radius: 8px;
    background: rgba(117, 179, 106, 0.08);
}

.memory-summary-card > span {
    display: block;
    color: #bfe5b8;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.memory-summary-card p {
    margin: 0.45rem 0 0;
}

.memory-disabled-state {
    margin-top: 1rem;
    border: 1px solid rgba(245, 197, 66, 0.24);
    border-radius: 8px;
    padding: 1rem;
    background: rgba(245, 197, 66, 0.08);
}

.memory-disabled-state strong {
    display: block;
    color: #fff7dd;
}

.memory-disabled-state p {
    margin: 0.45rem 0 0;
    color: rgba(255, 245, 219, 0.76);
}

.role-stat-row,
.relationship-row,
.memory-event,
.match-row,
.achievement-card,
.memory-layer {
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    padding: 0.75rem;
    background: rgba(8, 9, 20, 0.38);
}

.role-stat-row {
    display: grid;
    grid-template-columns: minmax(130px, 0.45fr) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
}

.role-stat-row strong,
.relationship-row strong,
.achievement-card strong,
.match-row strong {
    display: block;
    color: #fff7dd;
}

.role-stat-row span,
.relationship-row span,
.achievement-card span,
.match-row span,
.memory-event span,
.memory-layer span {
    color: var(--muted);
    font-size: 0.78rem;
}

.role-bars {
    display: grid;
    gap: 0.45rem;
}

.role-bars span {
    height: 22px;
}

.role-bars b {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center start;
    padding-left: 0.5rem;
    color: #fff7dd;
    font-size: 0.72rem;
}

.memory-panel-wide {
    grid-column: 1 / -1;
}

.memory-layer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.memory-layer strong {
    display: block;
    margin-top: 0.25rem;
    color: #f7e8b7;
}

.memory-layer p,
.relationship-row p,
.memory-event p,
.achievement-card p {
    margin: 0.35rem 0 0;
    color: rgba(255, 245, 219, 0.76);
    font-size: 0.88rem;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.65rem;
}

.achievement-card span {
    display: inline-flex;
    width: fit-content;
    margin-top: 0.55rem;
    border-radius: 999px;
    padding: 0.18rem 0.48rem;
    color: #f7e8b7;
    background: rgba(245, 197, 66, 0.08);
}

.match-history-panel {
    margin-bottom: 1rem;
}

.match-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    border-left: 3px solid rgba(192, 57, 43, 0.7);
}

.match-row.won {
    border-left-color: rgba(117, 179, 106, 0.9);
}

.match-row > div:last-child {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}

.match-row > div:last-child span {
    border-radius: 999px;
    padding: 0.22rem 0.5rem;
    background: rgba(255, 255, 255, 0.07);
}

.rank-current-card {
    min-width: 180px;
    border: 1px solid rgba(245, 197, 66, 0.24);
    border-radius: 8px;
    padding: 0.85rem;
    background: rgba(8, 9, 20, 0.42);
}

.rank-current-card span,
.ranking-row span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.rank-current-card strong {
    display: block;
    color: #fff7dd;
    font-size: 1.25rem;
}

.rankings-panel {
    overflow: hidden;
}

.ranking-table {
    display: grid;
    gap: 0.35rem;
}

.ranking-row {
    display: grid;
    grid-template-columns: 72px minmax(130px, 0.45fr) 130px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    background: rgba(8, 9, 20, 0.34);
}

.ranking-row.heading {
    background: rgba(245, 197, 66, 0.08);
}

.ranking-row.current {
    border-color: rgba(245, 197, 66, 0.42);
    background: rgba(245, 197, 66, 0.1);
}

.ranking-row strong {
    color: #fff7dd;
}

.ranking-row p {
    margin: 0;
    color: rgba(255, 245, 219, 0.78);
}

.profile-loadout-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-loadout-form .profile-bio-field,
.profile-loadout-form .badge-picker,
.profile-loadout-form .profile-privacy-actions,
.profile-loadout-form > button {
    grid-column: 1 / -1;
}

.profile-privacy-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid rgba(245, 197, 66, 0.18);
    border-radius: 8px;
    padding: 0.7rem;
    background: rgba(8, 9, 20, 0.36);
}

.profile-privacy-actions span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-picker {
    display: grid;
    gap: 0.45rem;
}

.badge-picker > span {
    color: #f7e8b7;
    font-weight: 700;
}

.leaderboard-panel {
    overflow: hidden;
}

.leaderboard-player {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: inherit;
    text-decoration: none;
}

.leaderboard-player span span {
    display: block;
    color: rgba(255, 245, 219, 0.64);
    font-size: 0.78rem;
}

.player-row-actions,
.mobile-player-side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
}

.social-add-button {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(245, 197, 66, 0.22);
    border-radius: 999px;
    color: #f7e8b7;
    background: rgba(245, 197, 66, 0.08);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.social-add-button:hover,
.social-add-button.added {
    border-color: rgba(117, 179, 106, 0.5);
    color: #d9ffd5;
    background: rgba(117, 179, 106, 0.16);
}

.social-add-button.mobile {
    width: 28px;
    height: 28px;
}

.social-shell {
    width: min(1180px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 2rem 0 3rem;
}

.social-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.social-presence-strip {
    min-width: 110px;
    display: grid;
    justify-items: end;
    gap: 0.1rem;
    border: 1px solid rgba(117, 179, 106, 0.28);
    border-radius: 8px;
    padding: 0.58rem 0.72rem;
    background: rgba(117, 179, 106, 0.08);
}

.social-presence-strip strong {
    color: #d9ffd1;
    font-size: 1.15rem;
    line-height: 1;
}

.social-presence-strip span {
    color: rgba(255, 245, 219, 0.64);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.social-header h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 5vw, 4rem);
}

.social-layout {
    min-height: min(720px, calc(100dvh - 150px));
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 1rem;
}

.social-sidebar,
.direct-chat-panel {
    min-height: 0;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(23, 24, 39, 0.9), rgba(8, 9, 20, 0.84));
    box-shadow: var(--shadow);
}

.social-sidebar {
    display: grid;
    grid-template-rows: auto minmax(150px, 0.7fr) auto minmax(140px, 0.55fr);
    gap: 0.7rem;
    padding: 0.9rem;
}

.conversation-list,
.suggestion-list,
.direct-message-list {
    min-height: 0;
    overflow-y: auto;
}

.conversation-list,
.suggestion-list {
    display: grid;
    align-content: start;
    gap: 0.55rem;
}

.conversation-row,
.suggestion-row {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    padding: 0.72rem;
    color: var(--text);
    background: rgba(8, 9, 20, 0.42);
}

.conversation-row {
    display: grid;
    gap: 0.2rem;
    text-align: left;
    cursor: pointer;
}

.conversation-row.active,
.conversation-row:hover,
.suggestion-row:hover {
    border-color: rgba(245, 197, 66, 0.38);
    background: rgba(245, 197, 66, 0.08);
}

.conversation-row strong,
.suggestion-row strong {
    display: flex;
    min-width: 0;
    gap: 0.4rem;
    align-items: center;
    color: #fff7dd;
}

.conversation-row strong em {
    margin-left: auto;
    color: rgba(117, 179, 106, 0.9);
    font-size: 0.68rem;
    font-style: normal;
    text-transform: uppercase;
}

.presence-dot {
    width: 0.58rem;
    height: 0.58rem;
    flex: 0 0 0.58rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 0 0 2px rgba(8, 9, 20, 0.45);
}

.presence-dot.online {
    background: #68d391;
    border-color: rgba(104, 211, 145, 0.7);
}

.presence-dot.in-game {
    background: #f5c542;
    border-color: rgba(245, 197, 66, 0.7);
}

.conversation-row span,
.suggestion-row span,
.empty-state {
    overflow: hidden;
    color: rgba(255, 245, 219, 0.62);
    font-size: 0.82rem;
    text-overflow: ellipsis;
}

.suggestion-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.social-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.suggestion-actions {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
}

.suggestion-avatar {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(245, 197, 66, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    object-fit: cover;
}

.suggestion-avatar.fallback {
    display: block;
    background:
        radial-gradient(circle at 50% 38%, rgba(245, 197, 66, 0.42), transparent 18px),
        rgba(255, 255, 255, 0.08);
}

.suggestion-row div {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
}

.suggestion-row .suggestion-actions {
    display: inline-flex;
    gap: 0.4rem;
}

.social-suggestions-title {
    margin-top: 0.2rem;
}

.direct-chat-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.direct-chat-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.9rem 1rem;
}

.direct-chat-header h2 {
    margin: 0;
}

#direct-presence {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
}

.direct-request-note {
    min-height: 1.1rem;
    margin: 0.25rem 0 0;
    color: rgba(255, 245, 219, 0.62);
    font-size: 0.78rem;
}

.direct-message-list {
    display: grid;
    align-content: end;
    gap: 0.72rem;
    padding: 1rem;
}

.direct-message {
    width: min(76%, 680px);
    display: grid;
    gap: 0.28rem;
}

.direct-message.from-me {
    justify-self: end;
}

.direct-message span {
    color: rgba(255, 245, 219, 0.58);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.direct-message p {
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    padding: 0.72rem 0.82rem;
    background: rgba(8, 9, 20, 0.5);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.45;
}

.direct-message.from-me p {
    border-color: rgba(93, 173, 226, 0.24);
    background: rgba(93, 173, 226, 0.12);
}

.direct-message.from-peer p {
    border-color: rgba(245, 197, 66, 0.18);
    background: rgba(245, 197, 66, 0.08);
}

.direct-chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.8rem;
    background: rgba(8, 9, 20, 0.38);
}

.direct-chat-form input {
    min-width: 0;
}

@media (max-width: 820px) {
    .social-layout {
        grid-template-columns: 1fr;
    }

    .social-sidebar {
        grid-template-rows: auto auto auto auto;
    }

    .conversation-list,
    .suggestion-list {
        max-height: 220px;
    }

    .direct-chat-panel {
        min-height: 560px;
    }

    .direct-chat-header {
        grid-template-columns: 1fr;
    }

    .direct-message {
        width: min(92%, 680px);
    }
}

@media (max-width: 820px) {
    .site-header {
        width: min(100vw - 1rem, 980px);
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.55rem;
        padding-top: 0.45rem;
    }

    .site-brand {
        padding-left: 0.55rem;
    }

    .site-brand strong {
        font-size: 1.05rem;
    }

    .site-nav {
        grid-column: 1 / -1;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 0.5rem 0.08rem;
        scrollbar-width: none;
    }

    .site-nav::-webkit-scrollbar {
        display: none;
    }

    .site-actions {
        padding-right: 0.5rem;
    }

    .profile-header {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-grid,
    .profile-summary,
    .profile-hero-main,
    .role-stat-row,
    .match-row,
    .ranking-row,
    .profile-loadout-form {
        grid-template-columns: 1fr;
    }

    .profile-nav {
        position: static;
    }

    .profile-stat-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .match-row > div:last-child {
        justify-content: flex-start;
    }

    .profile-privacy-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 760px), (max-height: 520px) and (max-width: 940px) {
    body.dashboard-body .dashboard-play-card.dashboard-landscape-btn {
        display: grid;
    }

    body.dashboard-body .dashboard-mini-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        margin-top: 0.65rem;
    }

    body.dashboard-body .dashboard-play-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        margin-top: 0.75rem;
    }

    body.dashboard-body .dashboard-play-card {
        min-height: 70px;
        border-radius: 12px;
        padding: 0.58rem;
    }

    body.dashboard-body .dashboard-play-card span,
    body.dashboard-body .dashboard-play-card em {
        font-size: 0.58rem;
    }

    body.dashboard-body .dashboard-play-card strong {
        font-size: 0.92rem;
    }

    body.dashboard-body .dashboard-route-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        margin-top: 0.6rem;
    }

    body.dashboard-body .dashboard-route-actions .btn {
        width: 100%;
        min-height: 38px;
        min-width: 0;
        border-radius: 12px;
        padding: 0.48rem 0.52rem;
        font-size: 0.7rem;
        font-weight: 900;
    }

    body.dashboard-body .dashboard-panel-head {
        align-items: stretch;
        flex-direction: column;
        gap: 0.55rem;
        margin-bottom: 0.55rem;
    }

    body.dashboard-body .dashboard-panel-tabs {
        width: 100%;
    }

    body.dashboard-body .dashboard-panel-tabs button {
        flex: 1;
        min-height: 32px;
        padding: 0.34rem 0.5rem;
        font-size: 0.68rem;
    }

    @media (orientation: landscape) {
        body.dashboard-body .dashboard-topbar {
            display: none;
        }

        body.dashboard-body .dashboard-player-head {
            grid-template-columns: 58px minmax(0, 1fr);
            gap: 0.6rem;
        }

        body.dashboard-body .dashboard-avatar-frame {
            width: 58px;
            height: 58px;
        }

        body.dashboard-body .dashboard-avatar-frame img {
            width: 50px;
            height: 50px;
        }

        body.dashboard-body .dashboard-mini-metrics {
            grid-template-columns: repeat(6, minmax(0, 1fr));
            gap: 0.32rem;
            margin-top: 0.45rem;
        }

        body.dashboard-body .dashboard-mini-metrics div {
            padding: 0.38rem 0.42rem;
        }

        body.dashboard-body .dashboard-mini-metrics span {
            font-size: 0.52rem;
        }

        body.dashboard-body .dashboard-mini-metrics strong {
            font-size: 0.72rem;
        }

        body.dashboard-body .dashboard-play-actions {
            align-self: end;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 0.36rem;
            margin-top: 0.5rem;
        }

        body.dashboard-body .dashboard-play-card {
            min-height: 56px;
            border-radius: 10px;
            padding: 0.4rem;
        }

        body.dashboard-body .dashboard-play-card strong {
            font-size: 0.72rem;
        }

        body.dashboard-body .dashboard-route-actions {
            display: none;
        }

        body.dashboard-body .player-dashboard-hero {
            grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
        }
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    background: #080914;
    overflow-y: auto;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 75% 15%, rgba(192, 57, 43, 0.34), transparent 20rem),
        radial-gradient(circle at 20% 88%, rgba(93, 173, 226, 0.13), transparent 22rem),
        linear-gradient(145deg, #080914 0%, #111224 58%, #070811 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
}

a {
    color: var(--gold);
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

main {
    position: relative;
    z-index: 2;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 35;
    width: min(1180px, calc(100vw - 2rem));
    min-height: 62px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    margin: 0 auto;
    padding: 0.62rem 0;
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(245, 197, 66, 0.16);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background:
        linear-gradient(180deg, rgba(12, 13, 25, 0.94), rgba(12, 13, 25, 0.78));
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(16px);
}

.site-brand,
.site-nav,
.site-actions {
    position: relative;
    z-index: 1;
}

.site-brand {
    min-width: 0;
    display: grid;
    padding-left: 0.75rem;
    color: #fff7dd;
    line-height: 1;
}

.site-brand span {
    color: var(--gold);
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.site-brand strong {
    margin-top: 0.12rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.28rem;
}

.site-nav {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.38rem;
}

.site-nav a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 0.44rem 0.74rem;
    color: rgba(255, 245, 219, 0.84);
    background: rgba(255, 255, 255, 0.045);
    font-size: 0.78rem;
    font-weight: 800;
}

.site-nav a:hover {
    border-color: rgba(245, 197, 66, 0.4);
    color: #fff7dd;
    background: rgba(245, 197, 66, 0.12);
}

.site-actions {
    display: flex;
    justify-content: flex-end;
    padding-right: 0.6rem;
}

.site-actions form {
    margin: 0;
}

#firefly-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    opacity: 0.72;
}

.ambient-moon {
    position: fixed;
    top: 5vh;
    right: 9vw;
    width: clamp(150px, 19vw, 280px);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle at 36% 36%, rgba(255, 195, 169, 0.95), rgba(192, 57, 43, 0.9) 42%, rgba(86, 16, 28, 0.88) 70%, transparent 72%),
        #c0392b;
    box-shadow:
        0 0 42px rgba(192, 57, 43, 0.75),
        0 0 130px rgba(192, 57, 43, 0.35);
    z-index: 0;
    animation: moonPulse 6s ease-in-out infinite;
}

.fog {
    position: fixed;
    left: -20vw;
    width: 140vw;
    height: 38vh;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(220, 226, 238, 0.12), transparent 38%),
        radial-gradient(ellipse at 55% 60%, rgba(220, 226, 238, 0.10), transparent 32%),
        radial-gradient(ellipse at 80% 44%, rgba(220, 226, 238, 0.08), transparent 36%);
    filter: blur(18px);
    opacity: 0.55;
    z-index: 0;
}

.fog-a {
    bottom: 0;
    animation: fogDrift 42s linear infinite;
}

.fog-b {
    top: 18vh;
    opacity: 0.28;
    animation: fogDriftReverse 56s linear infinite;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0.72rem 1rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: rgba(245, 197, 66, 0.55);
}

.btn.primary {
    color: #16100a;
    background: linear-gradient(135deg, var(--gold), #dc8f37);
    border-color: rgba(245, 197, 66, 0.75);
    font-weight: 800;
}

.btn.ghost {
    background: rgba(32, 34, 53, 0.82);
}

.btn.linklike {
    background: transparent;
}

.btn.wide {
    width: 100%;
}

.btn.compact {
    min-height: 34px;
    padding: 0.45rem 0.7rem;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.kicker {
    margin: 0 0 0.35rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0;
    font-size: 0.78rem;
    font-weight: 800;
}

.muted {
    color: var(--muted);
}

.alert {
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(192, 57, 43, 0.55);
    border-radius: 7px;
    color: #ffd6d2;
    background: rgba(192, 57, 43, 0.15);
}

.notice {
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(117, 179, 106, 0.48);
    border-radius: 7px;
    color: #dcffd8;
    background: rgba(117, 179, 106, 0.14);
}

.toast-region {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 50;
    display: grid;
    gap: 0.5rem;
}

.toast {
    max-width: min(360px, calc(100vw - 2rem));
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(23, 24, 39, 0.96);
    box-shadow: var(--shadow);
}

.landing-shell {
    min-height: 100vh;
    width: min(1180px, calc(100vw - 2rem));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 430px);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
    padding: 4rem 0;
}

.player-dashboard-shell {
    width: min(1240px, calc(100vw - 2rem));
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    grid-template-rows: auto minmax(0, auto);
    gap: clamp(1rem, 3vw, 2.4rem);
    align-items: stretch;
    padding: 1.4rem 0 2.6rem;
}

.dashboard-topbar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    min-height: 58px;
    border: 1px solid rgba(245, 197, 66, 0.16);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    background:
        linear-gradient(180deg, rgba(23, 24, 39, 0.82), rgba(8, 9, 20, 0.72));
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(16px);
}

.dashboard-brand {
    min-width: 0;
    display: grid;
    color: #fff7dd;
    line-height: 1;
}

.dashboard-brand span {
    color: var(--gold);
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.dashboard-brand strong {
    margin-top: 0.12rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.28rem;
}

.dashboard-nav-links {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
}

.dashboard-nav-links a,
.dashboard-panel-tabs button {
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 0.45rem 0.74rem;
    color: rgba(255, 245, 219, 0.82);
    background: rgba(255, 255, 255, 0.045);
    font-size: 0.78rem;
    font-weight: 800;
}

.dashboard-nav-links a:hover,
.dashboard-panel-tabs button:hover,
.dashboard-panel-tabs button.is-active {
    border-color: rgba(245, 197, 66, 0.4);
    color: #fff7dd;
    background: rgba(245, 197, 66, 0.12);
}

.dashboard-signout-form {
    margin: 0;
}

.dashboard-player-head {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.dashboard-avatar-frame {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(245, 197, 66, 0.28);
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 28%, rgba(245, 197, 66, 0.18), transparent 3.4rem),
        rgba(8, 9, 20, 0.64);
    overflow: hidden;
}

.dashboard-avatar-frame img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.landing-title {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3.3rem, 8vw, 7.6rem);
    line-height: 0.88;
    letter-spacing: 0;
    text-shadow: 0 0 38px rgba(192, 57, 43, 0.5);
}

.landing-subtitle {
    margin: 0.4rem 0 1rem;
    color: var(--gold);
    font-size: clamp(1.35rem, 3vw, 2.35rem);
    font-weight: 800;
}

.landing-text {
    max-width: 58ch;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.6rem;
}

.account-strip {
    width: fit-content;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin: 1rem 0 0;
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(245, 197, 66, 0.22);
    border-radius: 7px;
    color: var(--muted);
    background: rgba(8, 9, 20, 0.42);
}

.account-strip strong {
    color: var(--text);
}

.account-strip form {
    margin: 0;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    max-width: 640px;
    margin-top: 1rem;
}

.dashboard-stats article {
    min-width: 0;
    border: 1px solid rgba(245, 197, 66, 0.18);
    border-radius: 8px;
    padding: 0.72rem 0.78rem;
    background:
        linear-gradient(180deg, rgba(32, 34, 53, 0.78), rgba(8, 9, 20, 0.72));
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.dashboard-stats span,
.dashboard-stats em {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 800;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.dashboard-stats strong {
    display: block;
    margin: 0.18rem 0;
    overflow: hidden;
    color: var(--gold);
    font-size: clamp(1.3rem, 3vw, 2rem);
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-landscape-btn {
    display: none;
}

.dashboard-mini-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
    max-width: 760px;
    margin-top: 0.65rem;
}

.dashboard-mini-metrics div {
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.55rem 0.6rem;
    background: rgba(8, 9, 20, 0.46);
}

.dashboard-mini-metrics span,
.dashboard-mini-metrics strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-mini-metrics span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-mini-metrics strong {
    margin-top: 0.2rem;
    color: #fff7dd;
    font-size: 0.94rem;
}

.dashboard-play-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.7rem;
    max-width: 920px;
    margin-top: 1rem;
}

.dashboard-play-form {
    min-width: 0;
    margin: 0;
}

.dashboard-play-card {
    width: 100%;
    min-width: 0;
    min-height: 92px;
    display: grid;
    align-content: center;
    gap: 0.24rem;
    border: 1px solid rgba(245, 197, 66, 0.18);
    border-radius: 8px;
    padding: 0.8rem;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(32, 34, 53, 0.84), rgba(8, 9, 20, 0.74));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
    cursor: pointer;
    text-align: left;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.dashboard-play-card:hover,
.dashboard-play-card.is-active {
    transform: translateY(-1px);
    border-color: rgba(245, 197, 66, 0.58);
    background:
        radial-gradient(circle at 86% 10%, rgba(192, 57, 43, 0.25), transparent 5rem),
        linear-gradient(180deg, rgba(42, 36, 42, 0.94), rgba(12, 12, 23, 0.86));
}

.dashboard-play-card span,
.dashboard-play-card em {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 800;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.dashboard-play-card strong {
    overflow: hidden;
    color: #fff7dd;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-route-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    max-width: 760px;
    margin-top: 0.8rem;
}

.dashboard-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.dashboard-panel-tabs {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(8, 9, 20, 0.48);
}

.dashboard-panel-tabs button {
    cursor: pointer;
}

.dashboard-landscape-prompt {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: grid;
    place-items: center;
    padding: 1rem;
    background:
        radial-gradient(circle at 70% 18%, rgba(192, 57, 43, 0.34), transparent 18rem),
        rgba(2, 3, 8, 0.88);
    backdrop-filter: blur(14px);
}

.dashboard-landscape-prompt.hidden {
    display: none;
}

.dashboard-landscape-prompt > div {
    width: min(360px, calc(100vw - 2rem));
    border: 1px solid rgba(245, 197, 66, 0.34);
    border-radius: 14px;
    padding: 1rem;
    background:
        linear-gradient(180deg, rgba(23, 24, 39, 0.98), rgba(8, 9, 20, 0.98));
    box-shadow: var(--shadow);
    text-align: center;
}

.dashboard-landscape-prompt h2 {
    margin: 0.2rem 0 1rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.2rem;
    letter-spacing: 0;
}

.dashboard-prompt-actions {
    display: grid;
    gap: 0.55rem;
}

.landing-panel,
.panel,
.game-panel,
.game-stage,
.bottom-role,
.content-shell {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(23, 24, 39, 0.86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.landing-panel {
    display: none;
    padding: 1.35rem;
}

.landing-panel.active {
    display: block;
}

.landing-panel h2,
.panel h2,
.game-panel h2,
.content-shell h1,
.content-shell h2 {
    margin: 0;
}

.stacked-form {
    display: grid;
    gap: 0.9rem;
}

.stacked-form label {
    display: grid;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.field-note {
    margin: -0.35rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.resend-form {
    margin-top: 0.75rem;
}

input,
select {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0.72rem 0.8rem;
    color: var(--text);
    background: rgba(8, 9, 20, 0.68);
    outline: none;
}

input:focus,
select:focus {
    border-color: rgba(245, 197, 66, 0.68);
}

.setting-grid,
.timer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.check-row {
    grid-template-columns: auto 1fr !important;
    align-items: center;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
}

.content-shell {
    width: min(1100px, calc(100vw - 2rem));
    margin: 3rem auto;
    padding: clamp(1rem, 3vw, 2rem);
}

.top-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.rule-band {
    margin-top: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--line);
}

.rule-band p {
    color: var(--muted);
    line-height: 1.7;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.3rem;
}

.role-preview {
    min-height: 210px;
    display: grid;
    align-content: start;
    gap: 0.6rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(32, 34, 53, 0.92), rgba(17, 18, 36, 0.92));
    overflow: hidden;
}

.role-preview-art {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border: 1px solid rgba(245, 197, 66, 0.22);
    border-radius: 7px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

.role-preview h2,
.role-preview p {
    margin: 0;
}

.role-preview h2 {
    margin-top: 0.15rem;
}

.role-symbol {
    display: grid;
    place-items: center;
    width: 48px;
    aspect-ratio: 1;
    border-radius: 50%;
    color: #160f08;
    background: var(--gold);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.role-preview .team {
    color: var(--gold);
    font-weight: 800;
}

.lobby-shell,
.game-shell {
    width: min(1480px, calc(100vw - 1.5rem));
    margin: 0 auto;
    padding: 1rem 0 1.25rem;
}

.room-header,
.stage-header,
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.room-header {
    padding: 0.8rem 0 1rem;
}

.room-header h1 {
    margin: 0;
    font-size: clamp(2.2rem, 7vw, 4.4rem);
    letter-spacing: 0.08em;
}

.header-actions,
.host-controls,
.stage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.game-exit-button {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(245, 197, 66, 0.24);
    border-radius: 8px;
    color: var(--text);
    background: rgba(32, 34, 53, 0.82);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.game-exit-button:hover {
    transform: translateY(-1px);
    border-color: rgba(245, 197, 66, 0.62);
    background: rgba(84, 39, 43, 0.62);
}

.game-exit-button svg,
.game-over-main-room svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.phase-timer-card {
    min-width: 94px;
    display: grid;
    justify-items: center;
    gap: 0.15rem;
    border: 1px solid rgba(245, 197, 66, 0.22);
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    background: rgba(8, 9, 20, 0.42);
}

.phase-timer-card span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.phase-timer-card strong {
    color: var(--gold);
    font-size: 1.2rem;
}

.timer-low .phase-timer-card,
.timer-low .mobile-timer {
    border-color: rgba(192, 57, 43, 0.7);
    color: #ffd8d4;
    animation: selectedPulse 1s ease-in-out infinite;
}

.lobby-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
    gap: 1rem;
}

.panel {
    padding: 1rem;
}

.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.seat-card,
.player-row {
    position: relative;
    min-height: 74px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(32, 34, 53, 0.86);
    overflow: hidden;
}

.seat-card {
    padding: 0.8rem;
}

.seat-card.empty {
    display: grid;
    place-items: center;
    color: rgba(244, 244, 244, 0.48);
    border-style: dashed;
    background: rgba(255, 255, 255, 0.035);
}

.seat-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-weight: 800;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.65rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 0.55rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.76rem;
    font-weight: 800;
}

.badge.host {
    color: #1c1205;
    background: var(--gold);
}

.chat-panel {
    min-height: 600px;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.chat-list,
.log-list,
.private-log {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-color: rgba(245, 197, 66, 0.42) transparent;
    overscroll-behavior: contain;
}

.chat-list {
    min-height: 0;
    padding: 0.55rem 0.2rem 0.7rem;
}

.log-list,
.private-log {
    padding: 0.15rem 0.2rem 0.7rem;
}

.chat-message,
.log-entry,
.private-entry {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 7px;
    background: rgba(8, 9, 20, 0.48);
    overflow: visible;
}

.chat-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
}

.chat-meta span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-meta span:last-child {
    flex-shrink: 0;
}

.chat-message p,
.log-entry,
.private-entry {
    margin: 0;
    color: var(--text);
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.chat-mention {
    display: inline;
    color: var(--gold);
    font-weight: 900;
}

.chat-form {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.55rem;
}

.mention-menu {
    position: absolute;
    left: 0;
    right: 5.3rem;
    bottom: calc(100% + 0.35rem);
    z-index: 8;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid rgba(245, 197, 66, 0.24);
    border-radius: 7px;
    padding: 0.45rem;
    background: rgba(10, 11, 24, 0.96);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
}

.mention-menu.hidden {
    display: none;
}

.mention-option {
    min-height: 28px;
    border: 1px solid rgba(245, 197, 66, 0.22);
    border-radius: 999px;
    padding: 0 0.55rem;
    color: var(--gold);
    background: rgba(245, 197, 66, 0.08);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
}

.mention-option:hover {
    border-color: rgba(245, 197, 66, 0.58);
    background: rgba(245, 197, 66, 0.16);
}

.game-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-columns: clamp(230px, 18vw, 310px) minmax(430px, 1fr) clamp(300px, 23vw, 390px);
    grid-template-rows: 1fr auto;
    gap: 0.65rem;
    overflow: hidden;
}

.game-panel,
.game-stage {
    min-height: 0;
    height: calc(100vh - 112px);
    height: calc(100dvh - 112px);
    padding: 0.75rem;
    overflow: hidden;
}

.game-stage {
    display: grid;
    grid-template-rows: auto minmax(260px, 1fr) auto minmax(0, auto);
    gap: 0.65rem;
}

.player-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.player-list {
    display: grid;
    align-content: start;
    gap: 0.45rem;
    margin-top: 0.8rem;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.player-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: center;
    min-height: 58px;
    padding: 0.5rem 0.58rem;
}

.player-row-main,
.mobile-player-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.55rem;
    align-items: center;
    min-width: 0;
}

.player-mini-avatar {
    position: relative;
    width: 36px;
    aspect-ratio: 1;
    display: grid;
    place-items: end center;
    overflow: hidden;
    border: 1px solid rgba(245, 197, 66, 0.18);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 62%, rgba(245, 197, 66, 0.15), transparent 58%),
        rgba(8, 9, 20, 0.62);
}

.player-mini-avatar img {
    width: 62px;
    max-width: none;
    transform: translateY(15px);
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
}

.player-row.dead {
    opacity: 0.52;
}

.player-row.has-voted {
    border-color: rgba(245, 197, 66, 0.65);
    background:
        linear-gradient(90deg, rgba(245, 197, 66, 0.08), transparent 62%),
        rgba(32, 34, 53, 0.86);
}

.player-row strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.94rem;
}

.player-row .badges {
    gap: 0.25rem;
    margin-top: 0.35rem;
}

.player-row .badge {
    min-height: 20px;
    padding: 0 0.42rem;
    font-size: 0.68rem;
}

.vote-dot {
    width: 12px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 10px rgba(192, 57, 43, 0.8);
}

.voted-badge,
.voted-pill {
    color: #181006;
    background: var(--gold);
}

#phase-pill {
    min-height: 28px;
    border-radius: 999px;
    padding: 0.3rem 0.62rem;
    color: var(--gold);
    background: rgba(245, 197, 66, 0.1);
    font-size: 0.78rem;
    font-weight: 900;
}

.village-scene {
    position: relative;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(to top, rgba(8, 9, 20, 0.95) 0 22%, transparent 48%),
        radial-gradient(circle at 72% 18%, rgba(192, 57, 43, 0.5), transparent 17rem),
        linear-gradient(180deg, #0a0b18, #15182a 62%, #16131d);
}

.scene-bg-art,
.story-bg-art,
.scene-character-lineup,
.story-role-art,
.role-reveal-lineup {
    display: block;
    user-select: none;
    pointer-events: none;
}

.scene-bg-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.86;
    filter: saturate(0.92) contrast(1.08) brightness(0.78);
    transform: scale(1.04);
    animation: sceneArtDrift 24s ease-in-out infinite;
}

.game-body.phase-day_discussion .scene-bg-art,
.game-body.phase-voting .scene-bg-art,
.game-body.phase-vote_reveal .scene-bg-art {
    opacity: 0.78;
    filter: saturate(0.95) contrast(1.04) brightness(0.94) sepia(0.08);
}

.game-body.phase-night .scene-bg-art {
    opacity: 0.9;
    filter: saturate(1.08) contrast(1.14) brightness(0.7);
}

.game-body.phase-day_discussion .village-scene,
.game-body.phase-voting .village-scene,
.game-body.phase-vote_reveal .village-scene {
    background:
        linear-gradient(to top, rgba(25, 21, 26, 0.85) 0 22%, transparent 50%),
        radial-gradient(circle at 72% 18%, rgba(245, 197, 66, 0.24), transparent 17rem),
        linear-gradient(180deg, #182238, #202d3c 62%, #2b2530);
}

.scene-moon {
    position: absolute;
    top: 34px;
    right: clamp(28px, 7vw, 90px);
    z-index: 2;
    width: clamp(90px, 12vw, 150px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffd1c8, #c0392b 58%, #51111a 77%);
    box-shadow: 0 0 44px rgba(192, 57, 43, 0.72);
    opacity: 0.85;
    mix-blend-mode: screen;
    animation: moonGlower 5.8s ease-in-out infinite;
}

.game-body.phase-day_discussion .scene-moon,
.game-body.phase-voting .scene-moon,
.game-body.phase-vote_reveal .scene-moon {
    background: radial-gradient(circle at 38% 36%, #fff4ca, #f5c542 64%, #ac6c2d 78%);
    box-shadow: 0 0 46px rgba(245, 197, 66, 0.42);
}

.scene-square {
    position: absolute;
    inset: auto 0 0;
    z-index: 2;
    height: 42%;
    background:
        linear-gradient(45deg, transparent 0 20%, rgba(0, 0, 0, 0.35) 20% 24%, transparent 24% 42%, rgba(0, 0, 0, 0.28) 42% 45%, transparent 45%),
        linear-gradient(to top, #10111e, #242132);
    clip-path: polygon(0 52%, 10% 42%, 18% 52%, 28% 30%, 38% 56%, 50% 22%, 62% 56%, 74% 32%, 86% 54%, 100% 40%, 100% 100%, 0 100%);
    opacity: 0.42;
}

.scene-character-lineup {
    position: absolute;
    left: clamp(-60px, -4vw, -16px);
    bottom: clamp(-78px, -7vh, -32px);
    z-index: 4;
    width: min(660px, 56%);
    opacity: 0.72;
    filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.46)) saturate(0.9) brightness(0.9);
    mask-image: linear-gradient(to right, transparent 0, black 10%, black 78%, transparent 100%);
    animation: lineupIdle 6s ease-in-out infinite;
}

.village-scene.has-player-crowd .scene-character-lineup {
    opacity: 0.13;
    filter: blur(1px) saturate(0.52) brightness(0.56);
}

.scene-player-crowd {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.scene-player {
    position: absolute;
    left: var(--avatar-x);
    top: var(--avatar-y);
    width: clamp(76px, 8.5vw, 142px);
    transform: translate(-50%, -100%) scale(var(--avatar-scale));
    transform-origin: 50% 100%;
    opacity: 0.94;
    animation: avatarEnter 620ms ease both;
}

.scene-player-shadow {
    position: absolute;
    left: 50%;
    bottom: -3px;
    width: 72%;
    height: 15%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.58), transparent 68%);
    transform: translateX(-50%);
    filter: blur(3px);
    animation: avatarShadowPulse 2.6s ease-in-out infinite;
    animation-delay: var(--avatar-delay);
}

.avatar-motion {
    position: relative;
    transform-origin: 50% 100%;
    animation:
        avatarBreathe 2.6s ease-in-out infinite,
        avatarStep 1.35s steps(3, end) infinite;
    animation-delay: var(--avatar-delay), calc(var(--avatar-delay) - 0.14s);
}

.avatar-motion::before,
.avatar-motion::after {
    content: "";
    position: absolute;
    inset: 9% 17% 4%;
    z-index: 2;
    pointer-events: none;
}

.avatar-motion::before {
    background: linear-gradient(115deg, transparent 20%, rgba(255, 233, 178, 0.14) 46%, transparent 68%);
    mix-blend-mode: screen;
    opacity: 0;
    transform: translateX(-30%);
    animation: avatarLightSweep 4.8s ease-in-out infinite;
    animation-delay: calc(var(--avatar-delay) - 1.2s);
}

.avatar-motion::after {
    border-radius: 42%;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 246, 201, 0.18), transparent 20%),
        radial-gradient(ellipse at 50% 100%, rgba(245, 197, 66, 0.12), transparent 58%);
    mix-blend-mode: screen;
    opacity: 0.38;
    animation: avatarVideoFlicker 1.2s steps(4, end) infinite;
}

.avatar-aura {
    position: absolute;
    inset: 8% 18% 2%;
    z-index: 0;
    border-radius: 45%;
    background: radial-gradient(ellipse at 50% 48%, rgba(245, 197, 66, 0.15), transparent 65%);
    filter: blur(14px);
    opacity: 0.52;
    animation: avatarAuraPulse 3.2s ease-in-out infinite;
    animation-delay: var(--avatar-delay);
}

.scene-player-art {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    max-width: none;
    transform-origin: 50% 100%;
    filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.46)) saturate(0.96) brightness(0.94);
    mask-image: linear-gradient(to bottom, black 0 92%, transparent 100%);
    animation: avatarFrameJitter 1.1s steps(4, end) infinite;
    animation-delay: var(--avatar-delay);
}

.scene-player-name {
    position: absolute;
    left: 50%;
    bottom: calc(100% - 12px);
    z-index: 4;
    max-width: 116px;
    transform: translateX(-50%);
    border: 1px solid rgba(245, 197, 66, 0.22);
    border-radius: 999px;
    padding: 0.18rem 0.48rem;
    color: var(--text);
    background: rgba(8, 9, 20, 0.66);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
    font-size: 0.68rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scene-player.is-you .scene-player-name {
    color: #160f08;
    background: var(--gold);
}

.scene-player.is-speaking .avatar-motion {
    animation:
        avatarSpeak 880ms ease-in-out infinite,
        avatarStep 1.1s steps(3, end) infinite;
}

.scene-player.is-speaking .scene-player-name {
    border-color: rgba(245, 197, 66, 0.72);
    box-shadow: 0 0 24px rgba(245, 197, 66, 0.2);
}

.scene-player.has-voted .avatar-motion {
    animation:
        avatarVote 1.1s ease-in-out infinite,
        avatarStep 1.25s steps(3, end) infinite;
}

.scene-player.has-voted .avatar-aura {
    background: radial-gradient(ellipse at 50% 48%, rgba(192, 57, 43, 0.24), transparent 65%);
}

.scene-player.dead {
    opacity: 0.38;
}

.scene-player.dead .avatar-motion {
    animation: avatarDown 900ms ease both;
}

.scene-player.dead .scene-player-art {
    filter: grayscale(0.9) brightness(0.56) drop-shadow(0 14px 16px rgba(0, 0, 0, 0.55));
}

.game-body.phase-night .scene-player {
    opacity: 0.68;
}

.game-body.phase-night .scene-player:not(.dead) .avatar-motion {
    animation:
        avatarNightSway 2.4s ease-in-out infinite,
        avatarStep 1.6s steps(3, end) infinite;
}

.game-body.phase-night .scene-player:not(.dead) .scene-player-art {
    filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.6)) saturate(0.72) brightness(0.64);
}

.game-body.phase-voting .scene-player.has-voted .scene-player-name,
.game-body.phase-vote_reveal .scene-player.has-voted .scene-player-name {
    color: #160f08;
    border-color: rgba(245, 197, 66, 0.82);
    background: var(--gold);
}

.game-body.phase-night .scene-character-lineup {
    opacity: 0.48;
    filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.54)) saturate(0.72) brightness(0.7);
}

.game-body.phase-voting .scene-character-lineup,
.game-body.phase-vote_reveal .scene-character-lineup {
    opacity: 0.82;
    filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.5)) saturate(1) brightness(0.94);
}

.scene-fog-bank {
    position: absolute;
    left: -12%;
    right: -12%;
    bottom: -7%;
    z-index: 5;
    height: 42%;
    background:
        radial-gradient(ellipse at 16% 54%, rgba(226, 231, 238, 0.2), transparent 38%),
        radial-gradient(ellipse at 50% 68%, rgba(226, 231, 238, 0.17), transparent 44%),
        radial-gradient(ellipse at 88% 58%, rgba(226, 231, 238, 0.16), transparent 34%);
    filter: blur(13px);
    opacity: 0.58;
    animation: sceneFogSweep 18s linear infinite;
}

.scene-lanterns {
    position: absolute;
    inset: 0;
    z-index: 3;
    background:
        radial-gradient(circle at 13% 67%, rgba(245, 197, 66, 0.52), transparent 2.4rem),
        radial-gradient(circle at 84% 63%, rgba(220, 143, 55, 0.42), transparent 2.8rem),
        radial-gradient(circle at 57% 57%, rgba(245, 197, 66, 0.22), transparent 2rem);
    opacity: 0.7;
    mix-blend-mode: screen;
    animation: lanternFlicker 2.4s steps(3, end) infinite;
}

.scene-vignette {
    position: absolute;
    inset: 0;
    z-index: 6;
    background:
        linear-gradient(to top, rgba(5, 5, 11, 0.78), transparent 38%),
        radial-gradient(circle at center, transparent 38%, rgba(2, 3, 8, 0.62));
}

.announcement {
    position: absolute;
    left: 50%;
    bottom: 1.1rem;
    z-index: 8;
    width: min(760px, calc(100% - 2rem));
    transform: translateX(-50%);
    padding: 0.9rem 1rem;
    border: 1px solid rgba(245, 197, 66, 0.32);
    border-radius: 7px;
    background: rgba(8, 9, 20, 0.72);
    text-align: center;
    font-weight: 800;
    line-height: 1.35;
}

.mobile-stage-log {
    display: none;
}

.mobile-stage-log button {
    font: inherit;
}

.action-panel {
    display: grid;
    gap: 0.7rem;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(8, 9, 20, 0.35);
}

.vote-status-card,
.werewolf-coordination {
    display: grid;
    gap: 0.55rem;
    border: 1px solid rgba(245, 197, 66, 0.2);
    border-radius: 8px;
    padding: 0.7rem;
    background: rgba(8, 9, 20, 0.5);
}

.werewolf-coordination {
    border-color: rgba(192, 57, 43, 0.35);
    background: rgba(54, 13, 20, 0.48);
}

.vote-status-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.vote-status-head strong {
    color: var(--gold);
}

.vote-status-head span,
.vote-waiting {
    color: var(--muted);
    font-size: 0.82rem;
}

.vote-status-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.vote-reveal-list,
.mobile-vote-reveal {
    display: grid;
    gap: 0.35rem;
}

.vote-reveal-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem;
    min-height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 7px;
    padding: 0.35rem 0.45rem;
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.82rem;
}

.vote-reveal-row span,
.vote-reveal-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vote-reveal-row b {
    color: var(--muted);
    font-size: 0.78rem;
}

.vote-reveal-row strong {
    color: var(--gold);
}

.voted-pill {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    border-radius: 999px;
    padding: 0 0.55rem;
    font-size: 0.76rem;
    font-weight: 900;
}

.vote-waiting {
    margin: 0;
    line-height: 1.35;
}

.action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: center;
}

.private-log {
    max-height: 88px;
    min-height: 0;
}

.social-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto minmax(0, 0.82fr);
    gap: 0.65rem;
    min-height: 0;
    overflow: hidden;
}

.log-title {
    margin-top: 0.2rem;
}

.log-list {
    min-height: 0;
    max-height: 100%;
}

.bottom-role {
    grid-column: 1 / -1;
    height: 98px;
    padding: 0.65rem;
    overflow: hidden;
}

.own-role-card {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 0.9rem;
    align-items: center;
}

.own-role-image {
    width: 58px;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border: 1px solid rgba(245, 197, 66, 0.26);
    border-radius: 7px;
    background: rgba(8, 9, 20, 0.56);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.own-role-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.own-role-card h2 {
    margin: 0 0 0.2rem;
}

.own-role-card p {
    margin: 0;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-overlay,
.role-reveal-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    background: #05050b;
}

.hidden {
    display: none !important;
}

.skip-intro {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 43;
}

.story-scene {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 50% 30%, rgba(192, 57, 43, 0.25), transparent 20rem),
        linear-gradient(#060711, #11101c 72%, #05050b);
}

.story-bg-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.56;
    filter: saturate(0.9) brightness(0.68) contrast(1.1);
    transform: scale(1.06);
    animation: storyArtPush 72s ease-in-out both;
}

.story-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to bottom, rgba(5, 5, 11, 0.24), rgba(5, 5, 11, 0.62) 70%, #05050b 100%),
        radial-gradient(circle at 50% 28%, rgba(192, 57, 43, 0.28), transparent 24rem);
    pointer-events: none;
}

.story-moon {
    position: absolute;
    left: 50%;
    top: 68%;
    z-index: 2;
    width: min(34vw, 360px);
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle at 35% 35%, #ffd4ca, #c0392b 58%, #4b1018 78%);
    box-shadow: 0 0 70px rgba(192, 57, 43, 0.78), 0 0 170px rgba(192, 57, 43, 0.38);
}

.story-village {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    height: 31vh;
    background: linear-gradient(to top, #030307, #090912);
    clip-path: polygon(0 58%, 8% 46%, 15% 60%, 23% 34%, 32% 60%, 42% 38%, 50% 58%, 58% 28%, 66% 60%, 74% 42%, 83% 58%, 92% 36%, 100% 54%, 100% 100%, 0 100%);
    opacity: 0.72;
}

.story-role-art {
    position: absolute;
    right: min(4vw, 58px);
    bottom: -6vh;
    z-index: 4;
    width: min(780px, 72vw);
    opacity: 0.34;
    filter: saturate(0.75) brightness(0.72) drop-shadow(0 24px 34px rgba(0, 0, 0, 0.5));
    mask-image: linear-gradient(to right, transparent 0, black 16%, black 82%, transparent 100%);
    animation: lineupIdle 7s ease-in-out infinite;
}

.story-line,
.story-title {
    position: absolute;
    left: 50%;
    z-index: 5;
    width: min(820px, calc(100vw - 2rem));
    transform: translateX(-50%);
    text-align: center;
}

.story-line {
    top: 18vh;
    margin: 0;
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.25rem, 3vw, 2.95rem);
    line-height: 1.2;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.9);
}

.story-title {
    top: 36vh;
    margin: 0;
    color: var(--gold);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.6rem, 8vw, 7rem);
    opacity: 0;
    text-shadow: 0 0 42px rgba(192, 57, 43, 0.65);
}

.role-reveal-overlay {
    perspective: 1400px;
    overflow: hidden;
    background:
        radial-gradient(circle at center, rgba(192, 57, 43, 0.18), transparent 24rem),
        #05050b;
}

.role-reveal-lineup {
    position: absolute;
    left: 50%;
    bottom: -5vh;
    z-index: 0;
    width: min(1180px, 118vw);
    opacity: 0.2;
    filter: saturate(0.62) brightness(0.6) blur(0.2px);
    transform: translateX(-50%);
    mask-image: linear-gradient(to right, transparent 0, black 14%, black 86%, transparent 100%);
}

.game-over-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 1rem;
    overflow-y: auto;
    background:
        radial-gradient(circle at center, rgba(245, 197, 66, 0.16), transparent 24rem),
        rgba(5, 5, 11, 0.9);
}

.game-over-card {
    width: min(760px, 100%);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: clamp(1.2rem, 4vw, 2rem);
    border: 1px solid rgba(245, 197, 66, 0.42);
    border-radius: 8px;
    background: rgba(23, 24, 39, 0.96);
    box-shadow: var(--shadow);
    text-align: center;
}

.game-over-card h1 {
    margin: 0.2rem 0 0.6rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.2rem, 7vw, 4.5rem);
    letter-spacing: 0;
}

.game-over-card p {
    color: var(--muted);
}

.post-game-recap {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
    text-align: left;
}

.recap-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.6rem;
}

.recap-summary-grid article,
.recap-unlocks article,
.memory-recap,
.recap-memory-list > div,
.recap-relationship-list > div {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    background: rgba(8, 9, 20, 0.46);
}

.recap-summary-grid span,
.recap-unlocks span,
.memory-recap span,
.recap-memory-list span {
    color: rgba(255, 245, 219, 0.62);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.recap-summary-grid strong,
.recap-unlocks strong,
.memory-recap strong,
.recap-relationship-list strong {
    display: block;
    margin-top: 0.2rem;
    color: #fff7dd;
}

.recap-summary-grid strong {
    font-size: 1.35rem;
}

.recap-summary-grid p,
.recap-unlocks p,
.memory-recap p,
.recap-memory-list p,
.recap-relationship-list p {
    margin: 0.32rem 0 0;
    color: rgba(255, 245, 219, 0.75);
    font-size: 0.86rem;
}

.recap-unlocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.55rem;
}

.recap-unlocks article {
    border-color: rgba(245, 197, 66, 0.24);
    background:
        linear-gradient(135deg, rgba(245, 197, 66, 0.1), transparent),
        rgba(8, 9, 20, 0.46);
}

.recap-breakdown,
.recap-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.recap-breakdown span,
.recap-tags span {
    border-radius: 999px;
    padding: 0.22rem 0.52rem;
    color: #f7e8b7;
    background: rgba(245, 197, 66, 0.09);
    font-size: 0.76rem;
}

.memory-recap {
    display: grid;
    gap: 0.7rem;
    border-color: rgba(117, 179, 106, 0.22);
    background:
        linear-gradient(135deg, rgba(117, 179, 106, 0.09), transparent),
        rgba(8, 9, 20, 0.46);
}

.recap-memory-list,
.recap-relationship-list {
    display: grid;
    gap: 0.55rem;
}

.recap-relationship-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.game-over-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.game-over-main-room {
    gap: 0.45rem;
}

.winner-werewolves {
    background:
        radial-gradient(circle at center, rgba(192, 57, 43, 0.38), transparent 25rem),
        rgba(5, 5, 11, 0.92);
}

.winner-trickster {
    background:
        radial-gradient(circle at 45% 45%, rgba(125, 60, 152, 0.38), transparent 22rem),
        radial-gradient(circle at 55% 50%, rgba(245, 197, 66, 0.2), transparent 20rem),
        rgba(5, 5, 11, 0.92);
}

.role-card-reveal {
    position: relative;
    z-index: 2;
    width: min(360px, calc(100vw - 2rem));
    aspect-ratio: 0.68;
    transform-style: preserve-3d;
}

.role-card-face {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.8rem;
    border: 1px solid rgba(245, 197, 66, 0.36);
    border-radius: 8px;
    padding: 1.2rem;
    backface-visibility: hidden;
    box-shadow: 0 22px 80px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.role-card-back {
    background:
        linear-gradient(135deg, rgba(245, 197, 66, 0.12), rgba(192, 57, 43, 0.16)),
        repeating-linear-gradient(45deg, rgba(245, 197, 66, 0.09) 0 8px, transparent 8px 18px),
        #151525;
}

.role-card-front {
    position: absolute;
    transform: rotateY(180deg);
    background: linear-gradient(160deg, #202235, #10111f);
    text-align: center;
    padding: 0;
}

.reveal-card-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) contrast(1.04);
}

.reveal-card-copy {
    position: absolute;
    left: 0.7rem;
    right: 0.7rem;
    bottom: 0.7rem;
    z-index: 2;
    display: grid;
    justify-items: center;
    gap: 0.28rem;
    border: 1px solid rgba(245, 197, 66, 0.28);
    border-radius: 8px;
    padding: 0.62rem;
    background:
        linear-gradient(180deg, rgba(8, 9, 20, 0.78), rgba(8, 9, 20, 0.94)),
        rgba(8, 9, 20, 0.88);
    backdrop-filter: blur(8px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
}

.reveal-card-copy h2,
.reveal-card-copy p {
    margin: 0;
}

.reveal-card-copy h2 {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--gold);
    font-size: clamp(1.55rem, 5vw, 2.45rem);
    line-height: 1;
}

.reveal-card-copy p {
    color: rgba(244, 244, 244, 0.86);
    line-height: 1.28;
    font-size: 0.78rem;
}

.reveal-icon {
    display: grid;
    place-items: center;
    width: 42px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--gold);
    color: #120c05;
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
}

.mobile-game-hud,
.mobile-control-deck,
.mobile-host-actions,
.mobile-sheet,
.mobile-sheet-backdrop,
.orientation-prompt,
.target-modal,
.audio-settings-panel {
    display: none;
}

.gameplay-toggle[aria-pressed="true"] {
    border-color: rgba(245, 197, 66, 0.65);
    color: var(--gold);
    background: rgba(245, 197, 66, 0.12);
}

.orientation-prompt {
    position: fixed;
    inset: 0;
    z-index: 90;
    place-items: center;
    padding: 1rem;
    background: rgba(2, 3, 8, 0.82);
    backdrop-filter: blur(12px);
}

.orientation-prompt:not(.hidden) {
    display: grid;
}

.orientation-prompt > div {
    width: min(340px, calc(100vw - 2rem));
    display: grid;
    gap: 0.4rem;
    border: 1px solid rgba(245, 197, 66, 0.35);
    border-radius: 10px;
    padding: 1rem;
    background: rgba(23, 24, 39, 0.96);
    box-shadow: var(--shadow);
    text-align: center;
}

.orientation-prompt strong {
    color: var(--gold);
}

.orientation-prompt span {
    color: var(--muted);
    line-height: 1.4;
}

.orientation-actions {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.35rem;
}

body.gameplay-mode {
    overflow: hidden;
    background: #050610;
}

body.gameplay-mode main {
    min-height: 100dvh;
}

body.gameplay-mode .ambient-moon,
body.gameplay-mode .fog {
    opacity: 0.16;
}

body.gameplay-mode #firefly-canvas {
    opacity: 0.3;
}

body.gameplay-mode .game-shell {
    position: fixed;
    inset: 0;
    z-index: 20;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding:
        max(0.55rem, env(safe-area-inset-top))
        max(0.55rem, env(safe-area-inset-right))
        max(0.55rem, env(safe-area-inset-bottom))
        max(0.55rem, env(safe-area-inset-left));
    background:
        radial-gradient(circle at 70% 12%, rgba(192, 57, 43, 0.22), transparent 18rem),
        linear-gradient(145deg, rgba(5, 6, 16, 0.98), rgba(12, 13, 25, 0.98));
}

body.gameplay-mode .game-panel,
body.gameplay-mode .game-stage {
    height: auto;
    max-height: 100%;
}

body.gameplay-mode .game-stage {
    grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 76px);
}

body.gameplay-mode .village-scene {
    min-height: 0;
}

body.gameplay-mode .bottom-role {
    height: auto;
    min-height: 82px;
}

.modal-open,
.mobile-sheet-open {
    overflow: hidden;
}

.target-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    place-items: end center;
    padding: 1rem;
    background: rgba(2, 3, 8, 0.76);
    backdrop-filter: blur(12px);
}

.target-modal:not(.hidden) {
    display: grid;
}

.audio-toggle {
    min-width: 82px;
}

.audio-muted .audio-toggle,
.audio-muted #mobile-audio-settings-toggle {
    border-color: rgba(192, 57, 43, 0.5);
    color: #ffd9d6;
}

.audio-settings-panel {
    position: fixed;
    inset: 0;
    z-index: 80;
    place-items: center;
    padding: 1rem;
    background: rgba(2, 3, 8, 0.78);
    backdrop-filter: blur(12px);
}

.audio-settings-panel:not(.hidden) {
    display: grid;
}

.audio-settings-card {
    width: min(720px, 100%);
    max-height: min(820px, calc(100dvh - 2rem));
    display: grid;
    gap: 0.95rem;
    overflow-y: auto;
    border: 1px solid rgba(245, 197, 66, 0.35);
    border-radius: 10px;
    padding: 1rem;
    background:
        linear-gradient(160deg, rgba(32, 34, 53, 0.98), rgba(10, 11, 24, 0.98)),
        #171827;
    box-shadow: var(--shadow);
}

.audio-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.audio-settings-header h2 {
    margin: 0;
}

.audio-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.6rem;
}

.switch-row {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.65rem 0.7rem;
    background: rgba(8, 9, 20, 0.52);
    font-weight: 850;
}

.switch-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--gold);
}

.audio-volume-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.audio-volume-grid label {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    padding: 0.7rem;
    background: rgba(8, 9, 20, 0.42);
}

.audio-volume-grid span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    color: var(--muted);
    font-size: 0.83rem;
    font-weight: 900;
}

.audio-volume-grid b {
    color: var(--gold);
}

.audio-volume-grid input[type="range"] {
    width: 100%;
    accent-color: var(--gold);
}

.target-dialog {
    width: min(720px, 100%);
    max-height: min(760px, calc(100dvh - 2rem));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.9rem;
    border: 1px solid rgba(245, 197, 66, 0.35);
    border-radius: 10px;
    padding: 1rem;
    background: rgba(23, 24, 39, 0.98);
    box-shadow: var(--shadow);
}

.target-header,
.mobile-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.target-header h2,
.mobile-sheet-header h2 {
    margin: 0;
}

.sheet-close {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0.45rem 0.7rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.target-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.65rem;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.target-player-card {
    min-height: 94px;
    display: grid;
    align-content: center;
    gap: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.85rem;
    color: var(--text);
    background: linear-gradient(145deg, rgba(32, 34, 53, 0.95), rgba(8, 9, 20, 0.84));
    text-align: left;
    cursor: pointer;
}

.target-player-card.selected {
    border-color: rgba(245, 197, 66, 0.82);
    background:
        linear-gradient(145deg, rgba(245, 197, 66, 0.18), rgba(192, 57, 43, 0.14)),
        rgba(32, 34, 53, 0.96);
    box-shadow: 0 0 0 2px rgba(245, 197, 66, 0.16), 0 0 28px rgba(245, 197, 66, 0.14);
}

.target-name {
    font-weight: 900;
}

.target-meta,
.target-role {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.3;
}

.target-role {
    color: var(--gold);
    font-weight: 800;
}

.admin-login-shell {
    min-height: 100vh;
    width: min(1080px, calc(100vw - 2rem));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: clamp(2rem, 6vw, 4rem);
    align-items: center;
    padding: 4rem 0;
}

.admin-login-title {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 7vw, 6.4rem);
    line-height: 0.9;
    letter-spacing: 0;
    text-shadow: 0 0 38px rgba(192, 57, 43, 0.5);
}

.admin-login-panel {
    display: block;
}

.admin-shell {
    width: min(1480px, calc(100vw - 1.5rem));
    margin: 0 auto;
    padding: 1rem 0 1.5rem;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0 1rem;
}

.admin-header h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.1rem, 5vw, 4rem);
    letter-spacing: 0;
}

.admin-header form {
    margin: 0;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.operation-progress-panel,
.form-progress {
    display: grid;
    gap: 0.45rem;
    border: 1px solid rgba(229, 187, 97, 0.28);
    border-radius: 8px;
    padding: 0.75rem;
    background: rgba(8, 9, 20, 0.72);
}

.operation-progress-panel {
    margin-bottom: 1rem;
}

.operation-progress-panel.hidden,
.form-progress.hidden {
    display: none;
}

.operation-progress-panel > div:first-child,
.form-progress > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--text);
    font-weight: 800;
}

.operation-progress-track {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
}

.operation-progress-track span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #75b36a, #e5bb61);
    transition: width 180ms ease;
}

.operation-progress-panel.is-active .operation-progress-track span,
.form-progress.is-active .operation-progress-track span {
    min-width: 8%;
}

.operation-progress-panel p,
.form-progress p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.is-submitting {
    opacity: 0.72;
    pointer-events: none;
}

.admin-stat-card {
    min-height: 112px;
    display: grid;
    align-content: space-between;
    gap: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.9rem;
    background: rgba(23, 24, 39, 0.86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.admin-stat-card span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.admin-stat-card strong {
    color: var(--text);
    font-size: clamp(1.7rem, 4vw, 2.8rem);
    line-height: 1;
}

.admin-stat-card.live {
    border-color: rgba(117, 179, 106, 0.5);
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
    gap: 1rem;
}

.admin-panel-wide {
    grid-row: span 2;
}

.admin-subtitle {
    margin-top: 1rem;
}

.admin-table-wrap {
    margin-top: 0.85rem;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--gold);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.admin-table td strong,
.admin-table td b {
    display: block;
}

.admin-table td span {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.admin-message-list {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.85rem;
    max-height: 560px;
    overflow-y: auto;
}

.admin-message {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 7px;
    padding: 0.7rem 0.8rem;
    background: rgba(8, 9, 20, 0.48);
}

.admin-message div {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.admin-message span {
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: right;
}

.admin-message p {
    margin: 0;
    color: var(--text);
    line-height: 1.45;
    word-break: break-word;
}

.admin-breakdown {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.85rem;
}

.admin-breakdown div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 7px;
    padding: 0.55rem 0.7rem;
    background: rgba(8, 9, 20, 0.42);
}

.admin-breakdown span {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-breakdown b {
    color: var(--gold);
}

.admin-actor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.8rem;
    margin-top: 0.85rem;
    max-height: 650px;
    overflow-y: auto;
}

.admin-actor-card {
    display: grid;
    gap: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    padding: 0.85rem;
    background: rgba(8, 9, 20, 0.48);
}

.admin-actor-card.status-watched {
    border-color: rgba(229, 187, 97, 0.55);
}

.admin-actor-card.status-pending {
    border-color: rgba(124, 167, 255, 0.55);
}

.admin-actor-card.status-banned {
    border-color: rgba(215, 82, 92, 0.65);
    opacity: 0.88;
}

.admin-actor-head,
.admin-actor-meta,
.admin-moderation-form,
.inline-admin-form {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.admin-actor-head {
    justify-content: space-between;
}

.admin-actor-head strong,
.admin-actor-head span {
    display: block;
}

.admin-actor-head span,
.admin-actor-meta {
    color: var(--muted);
    font-size: 0.82rem;
}

.admin-actor-head b {
    color: var(--gold);
    font-size: 1.35rem;
}

.admin-actor-card p {
    margin: 0;
    color: var(--text);
    line-height: 1.45;
}

.completion-meter {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.completion-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #75b36a, #e5bb61);
}

.admin-actor-meta {
    flex-wrap: wrap;
}

.admin-actor-meta span {
    padding: 0.2rem 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
}

.admin-moderation-form {
    align-items: stretch;
    flex-wrap: wrap;
}

.admin-moderation-form select,
.admin-moderation-form input,
.inline-admin-form input {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0.45rem 0.55rem;
    color: var(--text);
    background: rgba(9, 10, 20, 0.75);
}

.admin-moderation-form input {
    flex: 1 1 160px;
}

.inline-admin-form {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.inline-admin-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
}

.inline-admin-form input {
    width: 80px;
}

.profile-identity-lock {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.profile-identity-lock span {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    background: rgba(8, 9, 20, 0.42);
    color: var(--muted);
    font-size: 0.9rem;
}

.profile-identity-lock strong {
    color: var(--text);
}

.profile-completion-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem 0.8rem;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--muted);
    font-weight: 800;
}

.profile-completion-row .completion-meter {
    grid-column: 1 / -1;
}

.profile-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
}

.profile-image-slot {
    display: grid;
    gap: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    padding: 0.7rem;
    background: rgba(8, 9, 20, 0.46);
}

.profile-image-slot img,
.profile-image-empty {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 7px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
}

.profile-image-empty {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.profile-image-slot form {
    display: grid;
    gap: 0.45rem;
}

.profile-image-slot input[type="file"] {
    width: 100%;
    color: var(--muted);
    font-size: 0.78rem;
}

@media (max-width: 1080px) {
    .landing-shell,
    .admin-login-shell,
    .lobby-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-panel-wide {
        grid-row: auto;
    }
}

@media (min-width: 761px) and (max-width: 1180px) {
    body.game-body {
        min-height: 100vh;
        min-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    body.game-body main {
        min-height: 100vh;
        min-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .game-shell {
        width: min(100%, calc(100vw - 1rem));
        height: 100vh;
        height: 100dvh;
        grid-template-columns: minmax(410px, 1fr) minmax(246px, 31vw);
        grid-template-rows: minmax(170px, 0.38fr) minmax(0, 0.62fr) 96px;
        grid-template-areas:
            "stage players"
            "stage social"
            "role role";
        gap: 0.6rem;
        padding: 0.7rem 0;
        overflow: hidden;
    }

    .player-panel {
        grid-area: players;
    }

    .game-stage {
        grid-area: stage;
        grid-template-rows: auto minmax(240px, 1fr) auto minmax(0, 72px);
    }

    .social-panel {
        grid-area: social;
        grid-template-rows: auto minmax(0, 1fr) auto auto minmax(0, 0.58fr);
    }

    .bottom-role {
        grid-area: role;
        grid-column: auto;
        height: auto;
        min-height: 0;
    }

    .game-panel,
    .game-stage {
        height: auto;
        min-height: 0;
        padding: 0.65rem;
    }

    .stage-header {
        align-items: flex-start;
    }

    .stage-header h1 {
        margin: 0;
        font-size: clamp(1.45rem, 2.8vw, 2.15rem);
        line-height: 1.05;
    }

    .stage-actions {
        justify-content: flex-end;
        gap: 0.45rem;
    }

    .stage-actions .btn {
        min-height: 36px;
        padding: 0.5rem 0.65rem;
        font-size: 0.78rem;
    }

    .phase-timer-card {
        min-width: 78px;
        padding: 0.42rem 0.55rem;
    }

    .phase-timer-card strong {
        font-size: 1rem;
    }

    .player-row {
        min-height: 52px;
        padding: 0.45rem 0.5rem;
    }

    .player-mini-avatar {
        width: 32px;
    }

    .player-row .badge {
        min-height: 18px;
        font-size: 0.64rem;
    }

    .chat-message,
    .log-entry,
    .private-entry {
        padding: 0.55rem 0.62rem;
    }

    .announcement {
        width: min(620px, calc(100% - 1.2rem));
        padding: 0.72rem 0.8rem;
        font-size: 0.92rem;
    }

    .scene-player {
        width: clamp(66px, 8.2vw, 108px);
    }

    .own-role-card {
        height: 100%;
    }
}

@media (min-width: 761px) and (max-width: 900px) {
    .game-shell {
        grid-template-columns: minmax(380px, 1fr) minmax(220px, 29vw);
        gap: 0.5rem;
    }

    .stage-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .phase-timer-card {
        justify-self: end;
    }

    .stage-actions {
        grid-column: 1 / -1;
        justify-content: start;
    }

    .social-panel {
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    .social-panel .chat-form {
        grid-template-columns: 1fr;
    }

    .log-title,
    .social-panel .log-list {
        display: none;
    }
}

@media (max-width: 760px), (max-height: 520px) and (max-width: 940px) {
    html {
        min-height: 100%;
    }

    .admin-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-message div {
        display: grid;
    }

    .admin-message span {
        text-align: left;
    }

    body.game-body {
        min-height: 100vh;
        min-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        overflow-x: hidden;
        overflow-y: hidden;
        background:
            radial-gradient(circle at 50% 8%, rgba(192, 57, 43, 0.34), transparent 15rem),
            linear-gradient(180deg, #050610, #111323 62%, #070811);
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y pinch-zoom;
    }

    body.game-body main {
        min-height: 100vh;
        min-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .orientation-prompt {
        justify-items: start;
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }

    .orientation-prompt > div {
        width: min(340px, calc(100vw - 2rem));
        padding: 0.95rem;
    }

    .game-body .ambient-moon {
        width: 118px;
        top: 54px;
        right: -24px;
        opacity: 0.48;
    }

    .game-body .fog {
        opacity: 0.28;
    }

    .game-shell {
        width: 100vw;
        max-width: none;
        margin: 0;
        min-height: 100vh;
        min-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr);
        gap: 0.75rem;
        padding: calc(72px + env(safe-area-inset-top)) 0.5rem calc(100px + env(safe-area-inset-bottom));
        overflow: hidden;
    }

    .mobile-game-hud {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 25;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto auto auto;
        align-items: center;
        gap: 0.45rem;
        min-height: calc(64px + env(safe-area-inset-top));
        padding: calc(0.55rem + env(safe-area-inset-top)) 0.65rem 0.55rem;
        background:
            linear-gradient(180deg, rgba(5, 6, 16, 0.96), rgba(5, 6, 16, 0.62) 78%, transparent);
        backdrop-filter: blur(10px);
    }

    .mobile-game-hud > * {
        min-width: 0;
    }

    .mobile-game-hud div {
        min-width: 0;
        display: grid;
        gap: 0.1rem;
    }

    #mobile-day-label {
        color: var(--gold);
        font-size: 0.72rem;
        font-weight: 900;
        text-transform: uppercase;
    }

    #mobile-phase-title {
        max-width: 38vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 1.05rem;
    }

    .mobile-chip {
        min-width: 0;
        min-height: 38px;
        border: 1px solid rgba(245, 197, 66, 0.22);
        border-radius: 999px;
        padding: 0 0.75rem;
        color: var(--text);
        background: rgba(32, 34, 53, 0.72);
        font-weight: 800;
        white-space: nowrap;
    }

    .gameplay-toggle,
    #mobile-audio-settings-toggle {
        min-width: 42px;
        padding: 0 0.5rem;
    }

    .mobile-exit-button {
        width: 38px;
        height: 38px;
        border-radius: 999px;
        background: rgba(23, 24, 39, 0.78);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
    }

    .mobile-exit-button svg {
        width: 17px;
        height: 17px;
    }

    .mobile-timer {
        min-width: 58px;
        min-height: 38px;
        display: grid;
        place-items: center;
        border: 1px solid rgba(245, 197, 66, 0.32);
        border-radius: 999px;
        color: var(--gold);
        background: rgba(8, 9, 20, 0.58);
        font-size: 0.9rem;
        font-weight: 900;
    }

    @media (max-width: 420px) {
        .mobile-game-hud {
            gap: 0.34rem;
            padding-left: 0.5rem;
            padding-right: 0.5rem;
        }

        #mobile-phase-title {
            max-width: 34vw;
            font-size: 0.96rem;
        }

        .mobile-chip {
            padding: 0 0.58rem;
        }

        .mobile-player-chip .mobile-chip-label {
            display: none;
        }

        .mobile-timer {
            min-width: 52px;
            font-size: 0.82rem;
        }

        .mobile-exit-button {
            width: 36px;
            height: 36px;
        }
    }

    .social-panel,
    .player-panel,
    .bottom-role {
        display: none;
    }

    .game-stage {
        order: 1;
        width: 100%;
        height: 100%;
        min-height: 0;
        display: grid;
        grid-template-rows: minmax(0, 1fr);
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .stage-header,
    .action-panel,
    .private-log {
        display: none;
    }

    .village-scene {
        min-height: 0;
        height: 100%;
        border: 1px solid var(--line);
        border-radius: 8px;
        background:
            linear-gradient(to top, rgba(8, 9, 20, 0.98) 0 21%, transparent 52%),
            radial-gradient(circle at 70% 17%, rgba(192, 57, 43, 0.56), transparent 11rem),
            linear-gradient(180deg, #080914, #15172a 58%, #11101a);
    }

    .game-body.phase-day_discussion .village-scene,
    .game-body.phase-voting .village-scene,
    .game-body.phase-vote_reveal .village-scene {
        background:
            linear-gradient(to top, rgba(25, 21, 26, 0.9) 0 22%, transparent 54%),
            radial-gradient(circle at 70% 17%, rgba(245, 197, 66, 0.28), transparent 11rem),
            linear-gradient(180deg, #172036, #202c3c 58%, #221e2a);
    }

    .scene-moon {
        top: 86px;
        right: 28px;
        width: clamp(106px, 36vw, 150px);
    }

    .scene-square {
        height: 48%;
        clip-path: polygon(0 58%, 7% 48%, 14% 59%, 24% 36%, 34% 60%, 44% 40%, 52% 57%, 62% 30%, 70% 61%, 80% 43%, 88% 58%, 100% 44%, 100% 100%, 0 100%);
    }

    .scene-bg-art {
        transform: scale(1.08);
        object-position: center;
    }

    .scene-character-lineup {
        left: -30%;
        bottom: -34px;
        width: 118%;
        opacity: 0.44;
        mask-image: linear-gradient(to right, transparent 0, black 16%, black 72%, transparent 100%);
    }

    .scene-player {
        width: clamp(58px, 20vw, 92px);
    }

    .scene-player-name {
        max-width: 86px;
        font-size: 0.58rem;
        padding: 0.12rem 0.34rem;
    }

    .scene-player:nth-child(n + 10) .scene-player-name {
        display: none;
    }

    .game-body.phase-voting .scene-character-lineup,
    .game-body.phase-vote_reveal .scene-character-lineup {
        opacity: 0.58;
    }

    .scene-fog-bank {
        height: 36%;
        opacity: 0.48;
    }

    .announcement {
        bottom: 1rem;
        width: calc(100% - 1.2rem);
        max-height: 112px;
        overflow-y: auto;
        padding: 0.75rem 0.85rem;
        border-color: rgba(245, 197, 66, 0.28);
        background: rgba(8, 9, 20, 0.74);
        font-size: 0.92rem;
    }

    .mobile-host-actions {
        position: fixed;
        left: 0.75rem;
        right: 0.75rem;
        bottom: calc(86px + env(safe-area-inset-bottom));
        z-index: 26;
        display: flex;
        justify-content: center;
        gap: 0.45rem;
        pointer-events: none;
    }

    .mobile-host-actions:empty {
        display: none;
    }

    .mobile-host-btn {
        min-height: 34px;
        border: 1px solid rgba(245, 197, 66, 0.28);
        border-radius: 999px;
        padding: 0 0.65rem;
        color: var(--text);
        background: rgba(23, 24, 39, 0.84);
        font-size: 0.74rem;
        font-weight: 900;
        pointer-events: auto;
    }

    .mobile-host-btn.danger {
        border-color: rgba(192, 57, 43, 0.45);
        background: rgba(192, 57, 43, 0.24);
    }

    .mobile-host-btn:disabled {
        display: none;
    }

    .mobile-control-deck {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 27;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: end;
        gap: 0.34rem;
        min-height: calc(76px + env(safe-area-inset-bottom));
        padding: 0.5rem 0.45rem calc(0.55rem + env(safe-area-inset-bottom));
        background:
            linear-gradient(180deg, transparent, rgba(5, 6, 16, 0.84) 18%, rgba(5, 6, 16, 0.98));
    }

    .mobile-control,
    .mobile-action-button {
        position: relative;
        min-width: 0;
        min-height: 52px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 12px;
        color: var(--text);
        background:
            linear-gradient(180deg, rgba(32, 34, 53, 0.94), rgba(12, 13, 24, 0.96));
        font-size: 0.7rem;
        font-weight: 900;
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
        overflow: hidden;
        text-overflow: ellipsis;
        touch-action: manipulation;
    }

    .mobile-control span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-action-button {
        min-height: 68px;
        border-radius: 50%;
        aspect-ratio: 1;
        justify-self: center;
        margin-bottom: 0.08rem;
        color: #160d08;
        background:
            radial-gradient(circle at 35% 28%, #ffe28b, #f5c542 50%, #b95c25);
        border-color: rgba(245, 197, 66, 0.82);
        font-size: 0.74rem;
        text-transform: uppercase;
    }

    .mobile-action-button.has-action {
        animation: selectedPulse 1.6s ease-in-out infinite;
    }

    .mobile-action-button:disabled {
        opacity: 0.58;
        animation: none;
    }

    .mobile-count {
        position: absolute;
        top: -5px;
        right: -4px;
        min-width: 20px;
        min-height: 20px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        color: #160d08;
        background: var(--gold);
        font-size: 0.66rem;
        font-weight: 900;
    }

    .mobile-sheet-backdrop {
        position: fixed;
        inset: 0;
        z-index: 65;
        background: rgba(2, 3, 8, 0.55);
        backdrop-filter: blur(8px);
    }

    .mobile-sheet-backdrop:not(.hidden) {
        display: block;
    }

    .mobile-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 66;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        max-height: min(78dvh, 720px);
        border: 1px solid rgba(245, 197, 66, 0.22);
        border-bottom: 0;
        border-radius: 18px 18px 0 0;
        padding: 0.8rem 0.85rem calc(0.9rem + env(safe-area-inset-bottom));
        background: rgba(23, 24, 39, 0.98);
        box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.48);
    }

    .mobile-sheet.hidden {
        display: none;
    }

    .mobile-sheet-content {
        min-height: 0;
        overflow-y: auto;
        padding-top: 0.75rem;
    }

    .mobile-player-grid {
        display: grid;
        gap: 0.55rem;
    }

    .mobile-player-card {
        min-height: 72px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.7rem;
        align-items: center;
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 0.75rem;
        background: rgba(32, 34, 53, 0.84);
    }

    .mobile-player-card.dead {
        opacity: 0.55;
    }

    .mobile-player-card.has-voted {
        border-color: rgba(245, 197, 66, 0.62);
        background:
            linear-gradient(90deg, rgba(245, 197, 66, 0.1), transparent 70%),
            rgba(32, 34, 53, 0.88);
    }

    .mobile-player-card span:not(.player-mini-avatar),
    .mobile-player-card em {
        display: block;
        color: var(--muted);
        font-size: 0.78rem;
        font-style: normal;
    }

    .mobile-player-side {
        display: grid;
        justify-items: end;
        gap: 0.2rem;
        color: var(--gold);
        font-size: 0.78rem;
    }

    .mobile-vote-status {
        position: sticky;
        top: 0;
        z-index: 2;
        margin-bottom: 0.65rem;
        border: 1px solid rgba(245, 197, 66, 0.24);
        border-radius: 10px;
        padding: 0.7rem 0.8rem;
        color: var(--gold);
        background: rgba(8, 9, 20, 0.78);
        font-weight: 900;
    }

    .mobile-chat-stream,
    .mobile-log-stream {
        display: grid;
        gap: 0.55rem;
        max-height: calc(78dvh - 130px);
        overflow-y: auto;
        padding-bottom: 0.75rem;
    }

    .mobile-chat-form {
        position: sticky;
        bottom: 0;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 0.45rem;
        padding-top: 0.55rem;
        background: rgba(23, 24, 39, 0.98);
    }

    .mobile-role-card {
        display: grid;
        gap: 0.75rem;
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 1rem;
        background: rgba(32, 34, 53, 0.86);
    }

    .mobile-role-art {
        width: min(220px, 68vw);
        aspect-ratio: 2 / 3;
        object-fit: cover;
        justify-self: center;
        border: 1px solid rgba(245, 197, 66, 0.24);
        border-radius: 8px;
        box-shadow: 0 18px 34px rgba(0, 0, 0, 0.36);
    }

    .mobile-role-card h3,
    .mobile-role-card p,
    .mobile-role-card ul {
        margin: 0;
    }

    .mobile-role-card p,
    .mobile-role-card li {
        color: var(--muted);
        line-height: 1.48;
    }

    .target-modal {
        padding: 0;
        place-items: end center;
    }

    .target-dialog {
        width: 100vw;
        max-height: min(84dvh, 760px);
        border-radius: 18px 18px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        padding: 0.9rem 0.85rem calc(0.95rem + env(safe-area-inset-bottom));
    }

    .target-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem;
    }

    .target-player-card {
        min-height: 108px;
        border-radius: 12px;
        padding: 0.85rem;
    }

    .target-submit {
        min-height: 52px;
        border-radius: 12px;
    }

    .audio-settings-panel {
        padding: 0;
        place-items: end center;
    }

    .audio-settings-card {
        width: 100vw;
        max-height: min(86dvh, 760px);
        border-radius: 18px 18px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        padding: 0.9rem 0.85rem calc(0.95rem + env(safe-area-inset-bottom));
    }

    .audio-volume-grid {
        grid-template-columns: 1fr;
    }

    body.gameplay-mode.game-body {
        touch-action: none;
    }

    body.gameplay-mode .game-shell {
        grid-template-rows: auto minmax(0, 1fr) auto;
        gap: 0.45rem;
        padding:
            max(0.4rem, env(safe-area-inset-top))
            max(0.4rem, env(safe-area-inset-right))
            max(0.4rem, env(safe-area-inset-bottom))
            max(0.4rem, env(safe-area-inset-left));
    }

    body.gameplay-mode .mobile-game-hud {
        position: static;
        min-height: 46px;
        border: 1px solid rgba(245, 197, 66, 0.16);
        border-radius: 10px;
        padding: 0.35rem 0.45rem;
        background: rgba(8, 9, 20, 0.78);
    }

    body.gameplay-mode .mobile-control-deck {
        position: static;
        min-height: 58px;
        border: 1px solid rgba(245, 197, 66, 0.14);
        border-radius: 10px;
        padding: 0.35rem;
        background: rgba(8, 9, 20, 0.78);
    }

    body.gameplay-mode .mobile-control,
    body.gameplay-mode .mobile-action-button {
        min-height: 46px;
        border-radius: 8px;
        box-shadow: none;
    }

    body.gameplay-mode .mobile-action-button {
        min-height: 56px;
    }

    body.gameplay-mode .game-stage,
    body.gameplay-mode .village-scene {
        height: 100%;
    }

    body.gameplay-mode .mobile-host-actions {
        bottom: calc(70px + env(safe-area-inset-bottom));
    }

    @media (orientation: landscape) {
        body.game-body:not(.gameplay-mode) .game-shell {
            padding: calc(54px + env(safe-area-inset-top)) 0.5rem calc(74px + env(safe-area-inset-bottom));
        }

        body.game-body:not(.gameplay-mode) .mobile-game-hud {
            min-height: calc(48px + env(safe-area-inset-top));
            padding: calc(0.35rem + env(safe-area-inset-top)) 0.85rem 0.35rem;
        }

        body.game-body:not(.gameplay-mode) .mobile-control-deck {
            min-height: calc(62px + env(safe-area-inset-bottom));
            padding: 0.36rem 0.55rem calc(0.4rem + env(safe-area-inset-bottom));
        }

        body.game-body:not(.gameplay-mode) .mobile-action-button {
            min-height: 58px;
        }

        body.game-body:not(.gameplay-mode) .scene-moon {
            top: 22px;
            width: clamp(70px, 16vw, 112px);
        }

        body.game-body:not(.gameplay-mode) .scene-player {
            width: clamp(42px, 9vw, 72px);
        }

        body.game-body:not(.gameplay-mode) .scene-player-name {
            max-width: 68px;
            font-size: 0.52rem;
        }

        body.game-body:not(.gameplay-mode) .announcement {
            bottom: 0.55rem;
            max-height: 58px;
            padding: 0.55rem 0.65rem;
            font-size: 0.78rem;
        }

        body.gameplay-mode .game-shell {
            grid-template-columns: minmax(0, 1fr) clamp(168px, 24vw, 250px);
            grid-template-rows: auto minmax(0, 1fr);
            grid-template-areas:
                "hud hud"
                "stage controls";
        }

        body.gameplay-mode .mobile-game-hud {
            grid-area: hud;
        }

        body.gameplay-mode .game-stage {
            grid-area: stage;
        }

        body.gameplay-mode .mobile-control-deck {
            grid-area: controls;
            grid-template-columns: 1fr;
            align-content: center;
            align-items: stretch;
            min-height: 0;
            height: 100%;
        }

        body.gameplay-mode .mobile-action-button {
            width: 100%;
            aspect-ratio: auto;
            margin: 0;
            border-radius: 10px;
        }

        body.gameplay-mode .scene-moon {
            top: 20px;
            width: clamp(74px, 14vw, 118px);
        }

        body.gameplay-mode .scene-player {
            width: clamp(42px, 7.5vw, 74px);
        }

        body.gameplay-mode .announcement {
            bottom: 0.7rem;
            max-height: 66px;
            padding: 0.55rem 0.7rem;
            font-size: 0.82rem;
        }

        body.gameplay-mode .mobile-host-actions {
            left: max(0.7rem, env(safe-area-inset-left));
            right: calc(clamp(168px, 24vw, 250px) + 1rem);
            bottom: max(0.7rem, env(safe-area-inset-bottom));
        }

        body.gameplay-mode .mobile-sheet {
            top: max(0.45rem, env(safe-area-inset-top));
            right: max(0.45rem, env(safe-area-inset-right));
            bottom: max(0.45rem, env(safe-area-inset-bottom));
            left: auto;
            width: min(380px, 48vw);
            max-height: none;
            border: 1px solid rgba(245, 197, 66, 0.22);
            border-radius: 14px;
            padding: 0.75rem;
        }

        body.gameplay-mode .mobile-chat-stream,
        body.gameplay-mode .mobile-log-stream {
            max-height: none;
        }
    }

    .story-line {
        top: 16vh;
        font-size: clamp(1.15rem, 7vw, 2rem);
    }

    .story-title {
        top: 40vh;
    }

    .story-role-art {
        right: -38vw;
        bottom: -3vh;
        width: 142vw;
        opacity: 0.18;
    }

    .toast-region {
        left: 0.75rem;
        right: 0.75rem;
        bottom: calc(88px + env(safe-area-inset-bottom));
    }

    .toast {
        max-width: none;
    }
}

@media (max-width: 1080px) {
    .player-dashboard-shell {
        width: min(980px, calc(100vw - 2rem));
    }

    .dashboard-topbar {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .dashboard-nav-links {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .dashboard-mini-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .dashboard-topbar {
        position: sticky;
        top: 0.5rem;
        z-index: 20;
        gap: 0.55rem;
        min-height: 52px;
        border-radius: 14px;
        padding: 0.48rem;
    }

    .dashboard-brand strong {
        font-size: 1.05rem;
    }

    .dashboard-nav-links {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.08rem;
        scrollbar-width: none;
    }

    .dashboard-nav-links::-webkit-scrollbar {
        display: none;
    }

    .dashboard-player-head {
        grid-template-columns: 62px minmax(0, 1fr);
        gap: 0.7rem;
    }

    .dashboard-avatar-frame {
        width: 62px;
        height: 62px;
    }

    .dashboard-avatar-frame img {
        width: 54px;
        height: 54px;
    }

    .dashboard-mini-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .dashboard-play-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .dashboard-play-card {
        min-height: 74px;
        border-radius: 12px;
        padding: 0.62rem;
    }

    .dashboard-play-card strong {
        font-size: 0.96rem;
    }

    .dashboard-route-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .dashboard-route-actions .btn {
        width: 100%;
        min-width: 0;
        border-radius: 12px;
        padding: 0.52rem 0.55rem;
        font-size: 0.76rem;
        font-weight: 900;
    }

    .dashboard-panel-head {
        align-items: stretch;
        flex-direction: column;
        gap: 0.7rem;
        margin-bottom: 0.7rem;
    }

    .dashboard-panel-tabs {
        width: 100%;
    }

    .dashboard-panel-tabs button {
        flex: 1;
    }
}

@media (max-width: 760px), (max-height: 520px) and (max-width: 940px) {
    body.game-body .target-dialog {
        height: min(88vh, 88dvh);
        max-height: min(88vh, 88dvh);
        min-height: 0;
        grid-template-rows: auto minmax(0, 1fr) auto;
        gap: 0.62rem;
        overflow: hidden;
    }

    body.game-body .target-grid {
        min-height: 0;
        grid-template-columns: 1fr;
        align-content: start;
        gap: 0.42rem;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding: 0.05rem 0.18rem 0.2rem 0.02rem;
    }

    body.game-body .target-player-card {
        min-height: 58px;
        min-width: 0;
        align-content: stretch;
        border-radius: 10px;
        padding: 0.48rem 0.55rem;
        overflow: hidden;
    }

    body.game-body .target-player-main {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 0.5rem;
        min-width: 0;
    }

    body.game-body .target-copy {
        display: grid;
        gap: 0.16rem;
        min-width: 0;
    }

    body.game-body .target-name,
    body.game-body .target-meta,
    body.game-body .target-role {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.game-body .target-avatar {
        width: 34px;
    }

    body.game-body .target-avatar img {
        width: 58px;
        transform: translateY(13px);
    }

    @media (orientation: landscape) {
        body.game-body .target-dialog {
            width: min(400px, 48vw);
            height: 100%;
            max-height: none;
        }

        body.game-body .target-grid {
            gap: 0.34rem;
        }

        body.game-body .target-player-card {
            min-height: 50px;
            padding: 0.38rem 0.48rem;
        }

        body.game-body .target-avatar {
            width: 30px;
        }

        body.game-body .target-avatar img {
            width: 52px;
            transform: translateY(12px);
        }
    }
}

.target-dialog,
.target-grid {
    min-height: 0;
}

.target-dialog {
    overflow: hidden;
}

.target-grid {
    align-content: start;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.target-player-card {
    min-width: 0;
    overflow: hidden;
}

.target-player-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.62rem;
    min-width: 0;
}

.target-copy {
    display: grid;
    gap: 0.16rem;
    min-width: 0;
}

.target-name,
.target-meta,
.target-role {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.target-avatar {
    position: relative;
    width: 40px;
    aspect-ratio: 1;
    display: grid;
    place-items: end center;
    overflow: hidden;
    border: 1px solid rgba(245, 197, 66, 0.18);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 62%, rgba(245, 197, 66, 0.15), transparent 58%),
        rgba(8, 9, 20, 0.62);
}

.target-avatar img {
    width: 68px;
    max-width: none;
    transform: translateY(16px);
    filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.45));
}

@media (max-width: 760px), (max-height: 520px) and (max-width: 940px) {
    .target-modal {
        padding: 0;
        place-items: end center;
    }

    .target-dialog {
        width: 100vw;
        height: min(88vh, 88dvh);
        max-height: min(88vh, 88dvh);
        grid-template-rows: auto minmax(0, 1fr) auto;
        gap: 0.62rem;
        border-radius: 16px 16px 0 0;
        padding: 0.72rem 0.68rem calc(0.75rem + env(safe-area-inset-bottom));
    }

    .target-header {
        align-items: flex-start;
        gap: 0.55rem;
    }

    .target-header h2 {
        font-size: 1.1rem;
        line-height: 1.08;
    }

    .target-grid {
        grid-template-columns: 1fr;
        gap: 0.42rem;
        overflow-y: auto;
        padding: 0.05rem 0.18rem 0.2rem 0.02rem;
    }

    .target-player-card {
        min-height: 58px;
        align-content: stretch;
        border-radius: 10px;
        padding: 0.48rem 0.55rem;
    }

    .target-player-main {
        gap: 0.5rem;
    }

    .target-avatar {
        width: 34px;
    }

    .target-avatar img {
        width: 58px;
        transform: translateY(13px);
    }

    .target-meta,
    .target-role {
        font-size: 0.74rem;
    }

    .target-submit {
        min-height: 46px;
        border-radius: 10px;
    }

    .mobile-player-grid {
        gap: 0.42rem;
    }

    .mobile-player-card {
        min-height: 60px;
        gap: 0.45rem;
        border-radius: 10px;
        padding: 0.55rem 0.6rem;
    }

    .mobile-player-main {
        gap: 0.45rem;
    }

    .mobile-player-card span:not(.player-mini-avatar),
    .mobile-player-card em {
        font-size: 0.72rem;
    }

    .mobile-player-card strong {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-player-side {
        max-width: 34vw;
        overflow: hidden;
        font-size: 0.72rem;
    }

    .mobile-vote-status {
        margin-bottom: 0.45rem;
        padding: 0.58rem 0.65rem;
        border-radius: 9px;
        font-size: 0.8rem;
    }

    @media (orientation: landscape) {
        .target-modal {
            place-items: stretch end;
            padding:
                max(0.4rem, env(safe-area-inset-top))
                max(0.4rem, env(safe-area-inset-right))
                max(0.4rem, env(safe-area-inset-bottom))
                0;
        }

        .target-dialog {
            width: min(400px, 48vw);
            height: 100%;
            max-height: none;
            border: 1px solid rgba(245, 197, 66, 0.28);
            border-radius: 14px 0 0 14px;
            padding: 0.7rem;
        }

        .target-grid {
            grid-template-columns: 1fr;
            gap: 0.34rem;
        }

        .target-player-card {
            min-height: 50px;
            padding: 0.38rem 0.48rem;
        }

        .target-avatar {
            width: 30px;
        }

        .target-avatar img {
            width: 52px;
            transform: translateY(12px);
        }
    }
}

@media (max-width: 640px) {
    .setting-grid,
    .timer-grid,
    .chat-form,
    .action-row,
    .audio-settings-grid {
        grid-template-columns: 1fr;
    }

    .mobile-game-hud {
        gap: 0.35rem;
        grid-template-columns: minmax(0, 1fr) auto auto auto auto;
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }

    .mobile-chip {
        min-height: 34px;
        padding: 0 0.5rem;
        font-size: 0.72rem;
    }

    #mobile-audio-settings-toggle {
        min-width: 52px;
        padding: 0 0.42rem;
    }

    .mobile-player-chip {
        min-width: 48px;
        justify-content: center;
    }

    .mobile-chip-label {
        display: none;
    }

    .mobile-timer {
        min-width: 50px;
        min-height: 34px;
        font-size: 0.8rem;
    }

    #mobile-phase-title {
        max-width: 32vw;
        font-size: 0.95rem;
    }

    .room-header,
    .stage-header,
    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .landing-shell {
        padding: 2.5rem 0;
    }

    .ambient-moon {
        right: -3rem;
    }
}

@media (max-width: 760px), (max-height: 520px) and (max-width: 940px) {
    body.game-body {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        overscroll-behavior: none;
        touch-action: manipulation;
        background:
            radial-gradient(circle at 74% 12%, rgba(192, 57, 43, 0.32), transparent 13rem),
            linear-gradient(180deg, #050610 0%, #111323 62%, #060711 100%);
    }

    body.game-body main {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    .game-shell,
    body.gameplay-mode .game-shell {
        position: fixed;
        inset: 0;
        width: 100vw;
        max-width: none;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "hud"
            "stage"
            "deck";
        gap: 0.45rem;
        margin: 0;
        padding:
            max(0.5rem, env(safe-area-inset-top))
            max(0.5rem, env(safe-area-inset-right))
            max(0.5rem, env(safe-area-inset-bottom))
            max(0.5rem, env(safe-area-inset-left));
        overflow: hidden;
        background:
            linear-gradient(180deg, rgba(5, 6, 16, 0.7), rgba(5, 6, 16, 0.22) 36%, rgba(5, 6, 16, 0.78)),
            transparent;
    }

    .mobile-game-hud,
    body.gameplay-mode .mobile-game-hud {
        grid-area: hud;
        position: relative;
        inset: auto;
        z-index: 25;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto auto auto;
        align-items: center;
        gap: 0.42rem;
        min-height: 48px;
        border: 1px solid rgba(245, 197, 66, 0.16);
        border-radius: 12px;
        padding: 0.42rem 0.5rem;
        background:
            linear-gradient(180deg, rgba(23, 24, 39, 0.9), rgba(10, 11, 24, 0.82));
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
        backdrop-filter: blur(14px);
    }

    .mobile-game-hud div {
        min-width: 0;
    }

    #mobile-day-label {
        font-size: 0.66rem;
    }

    #mobile-phase-title {
        max-width: none;
        font-size: clamp(0.98rem, 4vw, 1.18rem);
        line-height: 1.05;
    }

    .mobile-chip,
    .mobile-timer {
        min-height: 36px;
        border-radius: 10px;
        box-shadow: none;
    }

    .mobile-chip {
        min-width: 0;
        padding: 0 0.58rem;
        font-size: 0.74rem;
    }

    .mobile-player-chip {
        min-width: 64px;
        justify-content: center;
    }

    .mobile-chip-label {
        display: inline;
    }

    .gameplay-toggle {
        min-width: 50px;
        padding: 0 0.5rem;
    }

    .mobile-timer {
        min-width: 52px;
        padding: 0 0.45rem;
        font-size: 0.82rem;
    }

    .social-panel,
    .player-panel,
    .bottom-role {
        display: none;
    }

    .game-stage,
    body.gameplay-mode .game-stage {
        grid-area: stage;
        width: 100%;
        height: auto;
        min-height: 0;
        display: grid;
        grid-template-rows: minmax(0, 1fr);
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: hidden;
    }

    .stage-header,
    .action-panel,
    .private-log {
        display: none;
    }

    .village-scene,
    body.gameplay-mode .village-scene {
        height: 100%;
        min-height: 0;
        border: 1px solid rgba(245, 197, 66, 0.16);
        border-radius: 14px;
        box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
    }

    .scene-bg-art {
        transform: scale(1.05);
        object-position: center;
    }

    .scene-moon,
    body.gameplay-mode .scene-moon {
        top: clamp(24px, 8vh, 74px);
        right: clamp(18px, 8vw, 54px);
        width: clamp(82px, 28vw, 142px);
    }

    .scene-character-lineup {
        left: -34%;
        bottom: -30px;
        width: 125%;
        opacity: 0.34;
    }

    .scene-player,
    body.gameplay-mode .scene-player {
        width: clamp(52px, 17vw, 86px);
    }

    .scene-player-name,
    body.gameplay-mode .scene-player-name {
        max-width: 78px;
        padding: 0.12rem 0.34rem;
        font-size: 0.56rem;
    }

    .announcement,
    body.gameplay-mode .announcement {
        bottom: 0.72rem;
        width: calc(100% - 1rem);
        max-height: 78px;
        overflow-y: auto;
        border-radius: 10px;
        padding: 0.58rem 0.68rem;
        background: rgba(8, 9, 20, 0.78);
        font-size: 0.78rem;
        line-height: 1.25;
    }

    .mobile-host-actions,
    body.gameplay-mode .mobile-host-actions {
        position: absolute;
        left: 50%;
        right: auto;
        bottom: calc(76px + max(0.8rem, env(safe-area-inset-bottom)));
        z-index: 28;
        max-width: calc(100vw - 1rem);
        transform: translateX(-50%);
        display: flex;
        justify-content: center;
        gap: 0.35rem;
        pointer-events: none;
    }

    .mobile-host-actions:empty {
        display: none;
    }

    .mobile-host-btn {
        min-height: 30px;
        border-radius: 999px;
        padding: 0 0.58rem;
        font-size: 0.66rem;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
        pointer-events: auto;
    }

    .mobile-control-deck,
    body.gameplay-mode .mobile-control-deck {
        grid-area: deck;
        position: relative;
        inset: auto;
        z-index: 27;
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        align-items: stretch;
        gap: 0.35rem;
        min-height: 70px;
        height: auto;
        border: 1px solid rgba(245, 197, 66, 0.16);
        border-radius: 14px;
        padding: 0.4rem;
        background:
            linear-gradient(180deg, rgba(23, 24, 39, 0.92), rgba(8, 9, 20, 0.92));
        box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.36);
        backdrop-filter: blur(14px);
    }

    .mobile-control,
    .mobile-action-button,
    body.gameplay-mode .mobile-control,
    body.gameplay-mode .mobile-action-button {
        min-width: 0;
        min-height: 52px;
        width: 100%;
        border-radius: 10px;
        padding: 0 0.25rem;
        font-size: 0.66rem;
        line-height: 1;
        box-shadow: none;
        display: grid;
        place-items: center;
        touch-action: manipulation;
    }

    .mobile-control span,
    .mobile-action-button span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-action-button,
    body.gameplay-mode .mobile-action-button {
        justify-self: center;
        align-self: center;
        width: min(60px, 100%);
        min-height: 60px;
        aspect-ratio: 1;
        border-radius: 50%;
        margin: -0.08rem 0 0;
        font-size: 0.7rem;
    }

    #mobile-audio-settings-toggle {
        min-width: 0;
        padding: 0 0.25rem;
    }

    .mobile-count {
        top: -6px;
        right: -4px;
        min-width: 19px;
        min-height: 19px;
        font-size: 0.62rem;
    }

    .mobile-sheet {
        max-height: min(76vh, 76dvh, 680px);
        border-radius: 16px 16px 0 0;
        padding: 0.75rem 0.8rem calc(0.85rem + env(safe-area-inset-bottom));
    }

    .mobile-sheet-content {
        padding-top: 0.65rem;
    }

    .mobile-chat-stream,
    .mobile-log-stream {
        max-height: calc(76dvh - 126px);
    }

    .target-dialog,
    .audio-settings-card {
        width: 100vw;
        max-height: min(84vh, 84dvh, 760px);
        border-radius: 16px 16px 0 0;
    }

    @media (max-width: 420px) {
        .mobile-game-hud {
            gap: 0.3rem;
            padding-left: 0.42rem;
            padding-right: 0.42rem;
        }

        .mobile-chip-label {
            display: none;
        }

        .mobile-chip {
            padding: 0 0.48rem;
            font-size: 0.68rem;
        }

        .mobile-player-chip {
            min-width: 46px;
        }

        .gameplay-toggle {
            min-width: 44px;
        }

        #mobile-phase-title {
            font-size: 0.94rem;
        }

        .mobile-control,
        .mobile-action-button {
            font-size: 0.61rem;
        }
    }

    @media (orientation: landscape) {
        .game-shell,
        body.gameplay-mode .game-shell {
            grid-template-columns: minmax(0, 1fr) clamp(144px, 21vw, 208px);
            grid-template-rows: auto minmax(0, 1fr);
            grid-template-areas:
                "hud hud"
                "stage deck";
            gap: 0.4rem;
            padding:
                max(0.35rem, env(safe-area-inset-top))
                max(0.4rem, env(safe-area-inset-right))
                max(0.35rem, env(safe-area-inset-bottom))
                max(0.4rem, env(safe-area-inset-left));
        }

        .mobile-game-hud,
        body.gameplay-mode .mobile-game-hud {
            min-height: 42px;
            padding: 0.3rem 0.48rem;
        }

        #mobile-day-label {
            font-size: 0.62rem;
        }

        #mobile-phase-title {
            font-size: 0.98rem;
        }

        .mobile-chip,
        .mobile-timer {
            min-height: 32px;
            font-size: 0.68rem;
        }

        .mobile-timer {
            min-width: 48px;
        }

        .village-scene,
        body.gameplay-mode .village-scene {
            border-radius: 12px;
        }

        .scene-moon,
        body.gameplay-mode .scene-moon {
            top: 18px;
            width: clamp(66px, 14vw, 112px);
        }

        .scene-player,
        body.gameplay-mode .scene-player {
            width: clamp(40px, 8.2vw, 72px);
        }

        .scene-player-name,
        body.gameplay-mode .scene-player-name {
            max-width: 66px;
            font-size: 0.5rem;
        }

        .announcement,
        body.gameplay-mode .announcement {
            bottom: 0.5rem;
            max-height: 56px;
            padding: 0.5rem 0.6rem;
            font-size: 0.74rem;
        }

        .mobile-control-deck,
        body.gameplay-mode .mobile-control-deck {
            height: 100%;
            min-height: 0;
            grid-template-columns: 1fr;
            grid-template-rows: repeat(6, minmax(0, 1fr));
            gap: 0.32rem;
            padding: 0.35rem;
        }

        .mobile-control,
        .mobile-action-button,
        body.gameplay-mode .mobile-control,
        body.gameplay-mode .mobile-action-button {
            min-height: 0;
            height: 100%;
            width: 100%;
            aspect-ratio: auto;
            border-radius: 10px;
            margin: 0;
            font-size: 0.66rem;
        }

        .mobile-action-button,
        body.gameplay-mode .mobile-action-button {
            border-radius: 12px;
        }

        .mobile-host-actions,
        body.gameplay-mode .mobile-host-actions {
            left: max(0.7rem, env(safe-area-inset-left));
            right: calc(clamp(144px, 21vw, 208px) + 0.85rem);
            bottom: max(0.65rem, env(safe-area-inset-bottom));
            max-width: none;
            transform: none;
        }

        .mobile-sheet {
            top: max(0.4rem, env(safe-area-inset-top));
            right: max(0.4rem, env(safe-area-inset-right));
            bottom: max(0.4rem, env(safe-area-inset-bottom));
            left: auto;
            width: min(390px, 46vw);
            max-height: none;
            border: 1px solid rgba(245, 197, 66, 0.22);
            border-radius: 14px;
            padding: 0.72rem;
        }

        .mobile-chat-stream,
        .mobile-log-stream {
            max-height: none;
        }

        .target-modal,
        .audio-settings-panel {
            place-items: stretch end;
            padding: max(0.4rem, env(safe-area-inset-top)) max(0.4rem, env(safe-area-inset-right)) max(0.4rem, env(safe-area-inset-bottom)) 0;
        }

        .target-dialog,
        .audio-settings-card {
            width: min(430px, 48vw);
            max-height: none;
            height: 100%;
            border: 1px solid rgba(245, 197, 66, 0.28);
            border-radius: 14px 0 0 14px;
            padding: 0.78rem;
        }

        .target-grid {
            grid-template-columns: 1fr;
        }
    }
}

@media (max-width: 760px), (max-height: 520px) and (max-width: 940px) {
    body.game-body .game-shell,
    body.game-body.gameplay-mode .game-shell {
        align-items: stretch;
        justify-items: stretch;
    }

    body.game-body .mobile-game-hud,
    body.game-body.gameplay-mode .mobile-game-hud,
    body.game-body .mobile-control-deck,
    body.game-body.gameplay-mode .mobile-control-deck {
        position: relative;
        inset: auto;
    }

    body.game-body .game-stage,
    body.game-body.gameplay-mode .game-stage,
    body.game-body .village-scene,
    body.game-body.gameplay-mode .village-scene {
        height: 100%;
    }

    @media (orientation: landscape) {
        body.game-body .game-stage,
        body.game-body.gameplay-mode .game-stage,
        body.game-body .mobile-control-deck,
        body.game-body.gameplay-mode .mobile-control-deck {
            align-self: stretch;
            min-height: calc(100vh - 60px - 1rem);
            min-height: calc(100dvh - 60px - 1rem);
        }

        body.game-body .mobile-control-deck,
        body.game-body.gameplay-mode .mobile-control-deck {
            gap: 0.22rem;
            padding: 0.28rem;
            grid-template-rows: repeat(6, minmax(0, 1fr));
        }

        body.game-body .mobile-control,
        body.game-body .mobile-action-button,
        body.game-body.gameplay-mode .mobile-control,
        body.game-body.gameplay-mode .mobile-action-button {
            min-height: 0;
            height: auto;
            width: 100%;
            aspect-ratio: auto;
            margin: 0;
            padding: 0.08rem 0.2rem;
            border-radius: 10px;
            font-size: 0.62rem;
        }

        body.game-body .scene-character-lineup {
            left: -18%;
            bottom: -52px;
            width: 98%;
            opacity: 0.16;
        }

        body.game-body .scene-player,
        body.game-body.gameplay-mode .scene-player {
            width: clamp(30px, 6.4vw, 50px);
        }
    }
}

html.gameplay-root,
html.gameplay-root body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: #050610;
}

@media (max-width: 760px), (max-height: 520px) and (max-width: 940px) {
    body.game-body,
    body.game-body.gameplay-mode {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: var(--app-height, 100dvh);
        min-height: var(--app-height, 100dvh);
        overflow: hidden;
        background:
            radial-gradient(circle at 78% 14%, rgba(192, 57, 43, 0.36), transparent 14rem),
            radial-gradient(circle at 18% 92%, rgba(245, 197, 66, 0.1), transparent 16rem),
            linear-gradient(180deg, #050610 0%, #101322 64%, #050610 100%);
    }

    body.game-body main,
    body.game-body.gameplay-mode main {
        width: 100vw;
        height: var(--app-height, 100dvh);
        min-height: var(--app-height, 100dvh);
        overflow: hidden;
    }

    body.game-body .game-shell,
    body.game-body.gameplay-mode .game-shell {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: var(--app-height, 100dvh);
        min-height: var(--app-height, 100dvh);
        max-width: none;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "hud"
            "stage"
            "deck";
        gap: 0.5rem;
        margin: 0;
        padding:
            max(0.55rem, env(safe-area-inset-top))
            max(0.55rem, env(safe-area-inset-right))
            max(0.55rem, env(safe-area-inset-bottom))
            max(0.55rem, env(safe-area-inset-left));
        overflow: hidden;
        background:
            linear-gradient(180deg, rgba(5, 6, 16, 0.88), rgba(5, 6, 16, 0.2) 44%, rgba(5, 6, 16, 0.9)),
            transparent;
    }

    body.game-body .mobile-game-hud,
    body.game-body.gameplay-mode .mobile-game-hud {
        grid-area: hud;
        position: relative;
        inset: auto;
        z-index: 28;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto auto auto;
        align-items: center;
        gap: 0.42rem;
        min-height: 54px;
        border: 1px solid rgba(245, 197, 66, 0.18);
        border-radius: 16px;
        padding: 0.42rem 0.5rem;
        background:
            linear-gradient(180deg, rgba(23, 24, 39, 0.94), rgba(8, 9, 20, 0.84));
        box-shadow: 0 16px 34px rgba(0, 0, 0, 0.36);
        backdrop-filter: blur(14px);
    }

    body.game-body .mobile-game-hud > div,
    body.game-body.gameplay-mode .mobile-game-hud > div {
        min-width: 0;
        gap: 0.04rem;
    }

    body.game-body #mobile-day-label {
        font-size: 0.64rem;
        letter-spacing: 0;
    }

    body.game-body #mobile-phase-title {
        max-width: none;
        font-size: clamp(0.98rem, 4.2vw, 1.18rem);
        line-height: 1.05;
    }

    body.game-body .mobile-chip,
    body.game-body .mobile-timer,
    body.game-body .mobile-exit-button,
    body.game-body.gameplay-mode .mobile-chip,
    body.game-body.gameplay-mode .mobile-timer,
    body.game-body.gameplay-mode .mobile-exit-button {
        min-height: 36px;
        height: 36px;
        border-radius: 999px;
        box-shadow: none;
    }

    body.game-body .mobile-chip,
    body.game-body.gameplay-mode .mobile-chip {
        padding: 0 0.58rem;
        font-size: 0.72rem;
    }

    body.game-body .mobile-timer,
    body.game-body.gameplay-mode .mobile-timer {
        min-width: 54px;
        font-size: 0.82rem;
    }

    body.game-body .mobile-exit-button,
    body.game-body.gameplay-mode .mobile-exit-button {
        width: 36px;
    }

    body.game-body .game-stage,
    body.game-body.gameplay-mode .game-stage {
        grid-area: stage;
        width: 100%;
        height: 100%;
        min-height: 0;
        display: grid;
        grid-template-rows: minmax(0, 1fr);
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: hidden;
    }

    body.game-body .village-scene,
    body.game-body.gameplay-mode .village-scene {
        height: 100%;
        min-height: 0;
        border: 1px solid rgba(245, 197, 66, 0.22);
        border-radius: 18px;
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.04),
            0 18px 40px rgba(0, 0, 0, 0.42);
        background:
            linear-gradient(to top, rgba(8, 9, 20, 0.98) 0 20%, transparent 54%),
            radial-gradient(circle at 72% 18%, rgba(192, 57, 43, 0.58), transparent 12rem),
            linear-gradient(180deg, #080914, #15172a 58%, #11101a);
    }

    body.game-body .scene-bg-art,
    body.game-body.gameplay-mode .scene-bg-art {
        opacity: 0.9;
        transform: scale(1.04);
        object-position: center;
    }

    body.game-body .scene-moon,
    body.game-body.gameplay-mode .scene-moon {
        top: clamp(18px, 7vh, 54px);
        right: clamp(16px, 6vw, 42px);
        width: clamp(82px, 28vw, 136px);
    }

    body.game-body .scene-character-lineup,
    body.game-body.gameplay-mode .scene-character-lineup {
        left: -24%;
        bottom: -44px;
        width: 112%;
        opacity: 0.24;
        filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.42)) saturate(0.82) brightness(0.78);
    }

    body.game-body .scene-player,
    body.game-body.gameplay-mode .scene-player {
        width: clamp(46px, 16vw, 78px);
    }

    body.game-body .scene-player-name,
    body.game-body.gameplay-mode .scene-player-name {
        max-width: 76px;
        padding: 0.12rem 0.34rem;
        font-size: 0.54rem;
    }

    body.game-body .scene-player:nth-child(n + 10) .scene-player-name {
        display: none;
    }

    body.game-body .announcement,
    body.game-body.gameplay-mode .announcement {
        left: 0.7rem;
        right: 0.7rem;
        bottom: 0.72rem;
        width: auto;
        max-height: 80px;
        overflow-y: auto;
        border: 1px solid rgba(245, 197, 66, 0.28);
        border-radius: 12px;
        padding: 0.58rem 0.68rem;
        background: rgba(8, 9, 20, 0.78);
        box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
        font-size: 0.82rem;
        line-height: 1.28;
    }

    body.game-body .mobile-control-deck,
    body.game-body.gameplay-mode .mobile-control-deck {
        grid-area: deck;
        position: relative;
        inset: auto;
        z-index: 28;
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        align-items: stretch;
        gap: 0.34rem;
        min-height: 70px;
        border: 1px solid rgba(245, 197, 66, 0.16);
        border-radius: 18px;
        padding: 0.42rem;
        background:
            linear-gradient(180deg, rgba(23, 24, 39, 0.94), rgba(8, 9, 20, 0.92));
        box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.34);
        backdrop-filter: blur(14px);
    }

    body.game-body .mobile-control,
    body.game-body .mobile-action-button,
    body.game-body.gameplay-mode .mobile-control,
    body.game-body.gameplay-mode .mobile-action-button {
        min-width: 0;
        min-height: 52px;
        width: 100%;
        display: grid;
        place-items: center;
        border-radius: 12px;
        padding: 0 0.25rem;
        font-size: 0.64rem;
        line-height: 1;
        box-shadow: none;
    }

    body.game-body .mobile-action-button,
    body.game-body.gameplay-mode .mobile-action-button {
        min-height: 58px;
        aspect-ratio: auto;
        margin: 0;
        border-radius: 14px;
    }

    body.game-body .mobile-host-actions,
    body.game-body.gameplay-mode .mobile-host-actions {
        left: max(0.75rem, env(safe-area-inset-left));
        right: max(0.75rem, env(safe-area-inset-right));
        bottom: calc(78px + env(safe-area-inset-bottom));
    }

    body.game-body .target-dialog,
    body.game-body .audio-settings-card {
        border-radius: 18px 18px 0 0;
        background:
            linear-gradient(180deg, rgba(23, 24, 39, 0.98), rgba(8, 9, 20, 0.98));
    }

    @media (max-width: 420px) {
        body.game-body .mobile-game-hud,
        body.game-body.gameplay-mode .mobile-game-hud {
            gap: 0.3rem;
            min-height: 50px;
            padding: 0.38rem 0.42rem;
        }

        body.game-body .mobile-player-chip .mobile-chip-label {
            display: none;
        }

        body.game-body .mobile-chip,
        body.game-body.gameplay-mode .mobile-chip {
            padding: 0 0.48rem;
            font-size: 0.66rem;
        }

        body.game-body .mobile-timer,
        body.game-body.gameplay-mode .mobile-timer {
            min-width: 50px;
            font-size: 0.78rem;
        }

        body.game-body #mobile-phase-title {
            font-size: 0.94rem;
        }

        body.game-body .mobile-control,
        body.game-body .mobile-action-button,
        body.game-body.gameplay-mode .mobile-control,
        body.game-body.gameplay-mode .mobile-action-button {
            font-size: 0.58rem;
        }
    }

    @media (orientation: landscape) {
        body.game-body .game-shell,
        body.game-body.gameplay-mode .game-shell {
            grid-template-columns: minmax(0, 1fr) clamp(132px, 20vw, 190px);
            grid-template-rows: auto minmax(0, 1fr);
            grid-template-areas:
                "hud hud"
                "stage deck";
            gap: 0.48rem;
            padding:
                max(0.42rem, env(safe-area-inset-top))
                max(0.48rem, env(safe-area-inset-right))
                max(0.42rem, env(safe-area-inset-bottom))
                max(0.48rem, env(safe-area-inset-left));
        }

        body.game-body .mobile-game-hud,
        body.game-body.gameplay-mode .mobile-game-hud {
            min-height: 44px;
            border-radius: 14px;
            padding: 0.32rem 0.48rem;
        }

        body.game-body #mobile-day-label {
            font-size: 0.6rem;
        }

        body.game-body #mobile-phase-title {
            font-size: 0.98rem;
        }

        body.game-body .mobile-chip,
        body.game-body .mobile-timer,
        body.game-body .mobile-exit-button,
        body.game-body.gameplay-mode .mobile-chip,
        body.game-body.gameplay-mode .mobile-timer,
        body.game-body.gameplay-mode .mobile-exit-button {
            min-height: 32px;
            height: 32px;
        }

        body.game-body .mobile-control-deck,
        body.game-body.gameplay-mode .mobile-control-deck {
            height: 100%;
            min-height: 0;
            grid-template-columns: 1fr;
            grid-template-rows: repeat(6, minmax(0, 1fr));
            gap: 0.28rem;
            border-radius: 16px;
            padding: 0.34rem;
        }

        body.game-body .mobile-control,
        body.game-body .mobile-action-button,
        body.game-body.gameplay-mode .mobile-control,
        body.game-body.gameplay-mode .mobile-action-button {
            min-height: 0;
            height: 100%;
            border-radius: 10px;
            font-size: 0.62rem;
        }

        body.game-body .village-scene,
        body.game-body.gameplay-mode .village-scene {
            border-radius: 16px;
        }

        body.game-body .scene-moon,
        body.game-body.gameplay-mode .scene-moon {
            top: 18px;
            width: clamp(66px, 13vw, 112px);
        }

        body.game-body .scene-character-lineup,
        body.game-body.gameplay-mode .scene-character-lineup {
            left: -12%;
            bottom: -58px;
            width: 98%;
            opacity: 0.15;
        }

        body.game-body .scene-player,
        body.game-body.gameplay-mode .scene-player {
            width: clamp(32px, 6.6vw, 56px);
        }

        body.game-body .scene-player-name,
        body.game-body.gameplay-mode .scene-player-name {
            max-width: 62px;
            font-size: 0.5rem;
        }

        body.game-body .announcement,
        body.game-body.gameplay-mode .announcement {
            bottom: 0.55rem;
            max-height: 56px;
            padding: 0.48rem 0.6rem;
            font-size: 0.74rem;
        }

        body.game-body .mobile-host-actions,
        body.game-body.gameplay-mode .mobile-host-actions {
            right: calc(clamp(132px, 20vw, 190px) + 0.95rem);
            bottom: max(0.66rem, env(safe-area-inset-bottom));
        }

        body.game-body .mobile-sheet {
            top: max(0.44rem, env(safe-area-inset-top));
            right: max(0.44rem, env(safe-area-inset-right));
            bottom: max(0.44rem, env(safe-area-inset-bottom));
            left: auto;
            width: min(390px, 46vw);
            max-height: none;
            border: 1px solid rgba(245, 197, 66, 0.24);
            border-radius: 16px;
            padding: 0.78rem;
        }
    }
}

@media (max-width: 760px), (max-height: 520px) and (max-width: 940px) {
    body.game-body button,
    body.game-body a,
    body.game-body .mobile-control,
    body.game-body .mobile-action-button,
    body.game-body .mobile-host-btn,
    body.game-body .target-player-card,
    body.game-body .target-submit {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        user-select: none;
    }

    body.game-body.gameplay-mode {
        touch-action: manipulation;
    }

    body.game-body .mobile-control-deck,
    body.game-body.gameplay-mode .mobile-control-deck,
    body.game-body .mobile-control,
    body.game-body .mobile-action-button,
    body.game-body.gameplay-mode .mobile-control,
    body.game-body.gameplay-mode .mobile-action-button {
        pointer-events: auto;
    }

    body.game-body .mobile-control,
    body.game-body .mobile-action-button,
    body.game-body .mobile-host-btn,
    body.game-body .mobile-chip,
    body.game-body .game-exit-button,
    body.game-body .target-player-card,
    body.game-body .target-submit,
    body.game-body .sheet-close {
        cursor: pointer;
        -webkit-touch-callout: none;
    }

    body.game-body .mobile-stage-log.has-entries,
    body.game-body.gameplay-mode .mobile-stage-log.has-entries {
        position: absolute;
        top: 0.65rem;
        left: 0.65rem;
        right: 0.65rem;
        z-index: 10;
        display: grid;
        gap: 0.42rem;
        max-height: min(38%, 190px);
        overflow-y: auto;
        border: 1px solid rgba(245, 197, 66, 0.22);
        border-radius: 12px;
        padding: 0.55rem;
        color: var(--text);
        background:
            linear-gradient(180deg, rgba(23, 24, 39, 0.84), rgba(8, 9, 20, 0.82));
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
        backdrop-filter: blur(12px);
        pointer-events: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.game-body .mobile-stage-log-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.5rem;
        align-items: center;
    }

    body.game-body .mobile-stage-log-head strong {
        overflow: hidden;
        color: var(--gold);
        font-size: 0.72rem;
        text-overflow: ellipsis;
        text-transform: uppercase;
        white-space: nowrap;
    }

    body.game-body .mobile-stage-log-open {
        min-height: 28px;
        border: 1px solid rgba(245, 197, 66, 0.24);
        border-radius: 999px;
        padding: 0 0.52rem;
        color: var(--gold);
        background: rgba(8, 9, 20, 0.72);
        font-size: 0.66rem;
        font-weight: 900;
    }

    body.game-body .mobile-stage-votes,
    body.game-body .mobile-stage-log-list {
        display: grid;
        gap: 0.32rem;
        min-width: 0;
    }

    body.game-body .mobile-stage-log-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        min-width: 0;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 8px;
        padding: 0.42rem 0.48rem;
        background: rgba(8, 9, 20, 0.5);
        color: var(--text);
        font-size: 0.72rem;
        line-height: 1.28;
    }

    body.game-body .mobile-stage-log-row.vote-row {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        gap: 0.32rem;
    }

    body.game-body .mobile-stage-log-row span,
    body.game-body .mobile-stage-log-row strong {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.game-body .mobile-stage-log-row b {
        color: var(--gold);
    }

    @media (orientation: landscape) {
        body.game-body .mobile-stage-log.has-entries,
        body.game-body.gameplay-mode .mobile-stage-log.has-entries {
            width: min(380px, 44vw);
            right: auto;
            max-height: min(48%, 220px);
            padding: 0.48rem;
        }

        body.game-body .mobile-stage-log-row {
            font-size: 0.68rem;
            padding: 0.34rem 0.42rem;
        }
    }
}

html.dashboard-fullscreen-root,
html.dashboard-fullscreen-root body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: #050610;
}

@media (max-width: 760px), (max-height: 520px) and (max-width: 940px), (pointer: coarse) and (max-width: 1180px) {
    .dashboard-landscape-btn {
        display: inline-flex;
    }
}

@media (max-width: 760px), (max-height: 520px) and (max-width: 940px) {
    body.dashboard-body {
        background:
            radial-gradient(circle at 78% 12%, rgba(192, 57, 43, 0.38), transparent 15rem),
            radial-gradient(circle at 16% 88%, rgba(245, 197, 66, 0.1), transparent 16rem),
            linear-gradient(180deg, #050610 0%, #101322 64%, #050610 100%);
    }

    body.dashboard-body main {
        min-height: var(--app-height, 100dvh);
    }

    .player-dashboard-shell {
        position: relative;
        width: min(100vw - 1rem, 980px);
        min-height: var(--app-height, 100dvh);
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
        padding: calc(0.75rem + env(safe-area-inset-top)) 0 calc(0.75rem + env(safe-area-inset-bottom));
        overflow: hidden;
    }

    .player-dashboard-shell::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -2;
        background:
            linear-gradient(90deg, rgba(5, 6, 16, 0.98), rgba(5, 6, 16, 0.5) 48%, rgba(5, 6, 16, 0.92)),
            url("/static/images/generated/moonfall-village-stage.png") center / cover;
        opacity: 0.5;
        filter: saturate(0.9) brightness(0.78);
    }

    .player-dashboard-hero,
    body.dashboard-body .landing-panel {
        border: 1px solid rgba(245, 197, 66, 0.18);
        border-radius: 18px;
        padding: 0.9rem;
        background:
            linear-gradient(180deg, rgba(23, 24, 39, 0.92), rgba(8, 9, 20, 0.88));
        box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
        backdrop-filter: blur(14px);
    }

    body.dashboard-body .landing-title {
        font-size: clamp(2.35rem, 11vw, 4.8rem);
    }

    body.dashboard-body .landing-subtitle {
        margin-bottom: 0.55rem;
        font-size: clamp(1rem, 4vw, 1.5rem);
    }

    body.dashboard-body .landing-text {
        display: none;
    }

    body.dashboard-body .account-strip {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.45rem;
        margin-top: 0.75rem;
        border-radius: 12px;
        padding: 0.55rem 0.6rem;
        font-size: 0.75rem;
    }

    body.dashboard-body .account-strip span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.dashboard-body .account-strip span:nth-of-type(n + 2) {
        display: none;
    }

    body.dashboard-body .account-strip .btn {
        min-height: 32px;
        padding: 0.38rem 0.55rem;
        font-size: 0.7rem;
    }

    body.dashboard-body .dashboard-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
        margin-top: 0.65rem;
    }

    body.dashboard-body .dashboard-stats article {
        border-radius: 12px;
        padding: 0.55rem 0.52rem;
    }

    body.dashboard-body .dashboard-stats span,
    body.dashboard-body .dashboard-stats em {
        font-size: 0.58rem;
    }

    body.dashboard-body .dashboard-stats strong {
        font-size: 1.18rem;
    }

    body.dashboard-body .landing-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        margin-top: 0.8rem;
    }

    body.dashboard-body .landing-actions .btn,
    body.dashboard-body .landing-actions .inline-form,
    body.dashboard-body .landing-actions .inline-form .btn {
        width: 100%;
        min-width: 0;
    }

    body.dashboard-body .landing-actions .btn {
        min-height: 42px;
        border-radius: 12px;
        padding: 0.52rem 0.55rem;
        font-size: 0.76rem;
        font-weight: 900;
    }

    body.dashboard-body .landing-panel {
        max-height: none;
        overflow: hidden;
    }

    body.dashboard-body .landing-panel h2 {
        font-size: 1.25rem;
    }

    body.dashboard-body .stacked-form {
        gap: 0.62rem;
    }

    body.dashboard-body .stacked-form label {
        gap: 0.28rem;
        font-size: 0.76rem;
    }

    body.dashboard-body input,
    body.dashboard-body select {
        min-height: 36px;
        border-radius: 9px;
        padding: 0.52rem 0.58rem;
        font-size: 0.82rem;
    }

    body.dashboard-body .setting-grid,
    body.dashboard-body .timer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }

    body.dashboard-body .check-row {
        min-height: 36px;
        border-radius: 9px;
        padding: 0.45rem 0.5rem;
    }

    body.dashboard-body .field-note {
        font-size: 0.7rem;
    }

    body.dashboard-body .landing-panel .btn.wide {
        min-height: 42px;
        border-radius: 11px;
    }

    @media (orientation: portrait) {
        body.dashboard-body .player-dashboard-shell {
            align-content: start;
            overflow-y: auto;
        }
    }

    @media (orientation: landscape) {
        body.dashboard-body,
        body.dashboard-body.dashboard-fullscreen-mode {
            position: fixed;
            inset: 0;
            width: 100vw;
            height: var(--app-height, 100dvh);
            overflow: hidden;
            overscroll-behavior: none;
        }

        body.dashboard-body main {
            width: 100vw;
            height: var(--app-height, 100dvh);
            min-height: var(--app-height, 100dvh);
            overflow: hidden;
        }

        body.dashboard-body .player-dashboard-shell {
            position: fixed;
            inset: 0;
            width: 100vw;
            max-width: none;
            height: var(--app-height, 100dvh);
            min-height: 0;
            display: grid;
            grid-template-columns: minmax(0, 0.88fr) minmax(300px, 0.72fr);
            grid-template-rows: minmax(0, 1fr);
            align-items: stretch;
            gap: 0.55rem;
            margin: 0;
            padding:
                max(0.45rem, env(safe-area-inset-top))
                max(0.5rem, env(safe-area-inset-right))
                max(0.45rem, env(safe-area-inset-bottom))
                max(0.5rem, env(safe-area-inset-left));
            overflow: hidden;
        }

        body.dashboard-body .player-dashboard-hero,
        body.dashboard-body .landing-panel {
            min-height: 0;
            height: 100%;
            border-radius: 16px;
            padding: 0.72rem;
            overflow: hidden;
        }

        body.dashboard-body .player-dashboard-hero {
            display: grid;
            grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
            align-content: start;
        }

        body.dashboard-body .landing-title {
            font-size: clamp(2rem, 6.4vw, 4.2rem);
        }

        body.dashboard-body .landing-subtitle {
            font-size: clamp(0.95rem, 2.4vw, 1.35rem);
        }

        body.dashboard-body .account-strip {
            margin-top: 0.5rem;
        }

        body.dashboard-body .dashboard-stats {
            margin-top: 0.55rem;
        }

        body.dashboard-body .landing-actions {
            align-self: end;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            align-content: end;
            margin-top: 0.6rem;
        }

        body.dashboard-body .landing-actions .btn {
            min-height: 38px;
            font-size: 0.68rem;
        }

        body.dashboard-body .landing-panel.active {
            display: grid;
            grid-template-rows: auto minmax(0, 1fr);
            gap: 0.65rem;
        }

        body.dashboard-body .landing-panel form {
            min-height: 0;
            overflow-y: auto;
            padding-right: 0.18rem;
        }

        body.dashboard-body .landing-panel h2 {
            font-size: 1.12rem;
        }

        body.dashboard-body .stacked-form {
            gap: 0.5rem;
        }

        body.dashboard-body .setting-grid,
        body.dashboard-body .timer-grid {
            grid-template-columns: 1fr 1fr;
        }

        body.dashboard-body .check-row {
            font-size: 0.68rem;
        }
    }
}
