:root {
    color-scheme: light;
    --ink: #17212b;
    --ink-2: #2d3742;
    --muted: #687684;
    --paper: #f4ead8;
    --felt: #0f6b55;
    --felt-dark: #0b4639;
    --panel: #fffaf0;
    --white: #ffffff;
    --line: #d7c29e;
    --gold: #c89a38;
    --red: #bf2f3f;
    --blue: #255f99;
    --green: #15845f;
    --violet: #70519c;
    --shadow: 0 24px 70px rgba(34, 26, 15, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 12% 10%, rgba(200, 154, 56, 0.2), transparent 28%),
        radial-gradient(circle at 88% 18%, rgba(37, 95, 153, 0.16), transparent 30%),
        linear-gradient(135deg, #f8f0df 0%, #ead7b6 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.2;
    background-image:
        linear-gradient(30deg, rgba(23, 33, 43, 0.08) 12%, transparent 12.5%, transparent 87%, rgba(23, 33, 43, 0.08) 87.5%, rgba(23, 33, 43, 0.08)),
        linear-gradient(150deg, rgba(23, 33, 43, 0.08) 12%, transparent 12.5%, transparent 87%, rgba(23, 33, 43, 0.08) 87.5%, rgba(23, 33, 43, 0.08));
    background-size: 54px 94px;
}

button,
input,
select,
a {
    font: inherit;
}

button,
.nav-link,
.top-actions a {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 0 18px;
    background: var(--red);
    color: white;
    cursor: pointer;
    font-weight: 900;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(191, 47, 63, 0.22);
}

button:hover,
.nav-link:hover,
.top-actions a:hover {
    transform: translateY(-1px);
}

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

input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 13px;
    background: var(--white);
    color: var(--ink);
    outline: none;
}

select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 13px;
    background: var(--white);
    color: var(--ink);
}

input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(200, 154, 56, 0.22);
}

textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 13px;
    background: var(--white);
    color: var(--ink);
    outline: none;
    resize: vertical;
    font: 800 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.secondary {
    background: var(--blue);
    box-shadow: 0 10px 24px rgba(37, 95, 153, 0.2);
}

.ghost {
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
}

.danger {
    color: var(--red);
}

.full {
    width: 100%;
}

.page {
    width: min(1540px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.page:has(.game-layout) {
    width: 100%;
    max-width: none;
    padding: 22px 16px;
}

.messages {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 20;
    width: min(460px, calc(100vw - 36px));
    display: grid;
    gap: 10px;
}

.message {
    border: 1px solid var(--line);
    border-left: 5px solid var(--blue);
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
    font-weight: 800;
}

.message-success {
    border-left-color: var(--green);
}

.message-error {
    border-left-color: var(--red);
}

.board-viewport > .messages {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 80;
    width: min(430px, calc(100% - 36px));
    pointer-events: none;
}

.board-viewport > .messages .message {
    background: rgba(255, 250, 240, 0.94);
    backdrop-filter: blur(4px);
}

.eyebrow {
    margin: 0;
    color: var(--gold);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 0;
    text-transform: uppercase;
}

.login-shell {
    min-height: calc(100vh - 48px);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 460px);
    align-items: center;
    gap: 40px;
}

.brand-panel h1,
.lobby-hero h1 {
    max-width: 100%;
    margin: 16px 0 12px;
    font-size: clamp(48px, 8vw, 112px);
    line-height: 0.88;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.brand-panel p,
.lobby-hero p {
    max-width: 680px;
    color: var(--ink-2);
    font-size: 20px;
    line-height: 1.5;
}

.brand-mark {
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    border: 8px solid var(--red);
    border-radius: 8px;
    background: var(--panel);
    color: var(--felt);
    font-size: 60px;
    font-weight: 950;
    box-shadow: var(--shadow);
}

.login-form,
.create-room,
.search-form,
.room-card,
.side-panel section,
.topbar {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 250, 240, 0.94);
    box-shadow: var(--shadow);
}

.login-form,
.create-room,
.profile-form,
.search-form {
    display: grid;
    gap: 13px;
    padding: 24px;
}

.login-form button,
.create-room button,
.profile-form button {
    width: 100%;
}

.form-link {
    color: var(--blue);
    font-weight: 900;
    text-align: center;
    text-decoration: none;
}

.lobby {
    display: grid;
    gap: 22px;
}

.lobby-hero {
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 34px;
    border-radius: 8px;
    color: var(--white);
    background:
        linear-gradient(90deg, rgba(7, 42, 35, 0.94), rgba(15, 107, 85, 0.86)),
        repeating-linear-gradient(90deg, transparent 0 36px, rgba(255, 255, 255, 0.08) 36px 38px);
    box-shadow: var(--shadow);
}

.lobby-hero > * {
    min-width: 0;
}

.lobby-hero p,
.lobby-hero .eyebrow {
    color: rgba(255, 255, 255, 0.86);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.compact-hero {
    min-height: 190px;
}

.lobby-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.room-search-row {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.create-room-open-button {
    background: var(--green);
    box-shadow: 0 10px 24px rgba(21, 132, 95, 0.2);
}

.create-room h2,
.room-card h2,
.side-panel h2 {
    margin: 0;
}

.create-room-modal {
    width: min(430px, calc(100vw - 28px));
    max-height: min(860px, calc(100vh - 28px));
    border: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
}

.create-room-modal::backdrop {
    background: rgba(23, 33, 43, 0.48);
    backdrop-filter: blur(3px);
}

.create-room-modal .create-room {
    max-height: min(860px, calc(100vh - 28px));
    overflow: auto;
}

.create-room .modal-head {
    margin: 0;
}

.create-room .modal-head .icon-close {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
}

.switch-line {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    cursor: pointer;
}

.switch-line input {
    width: 20px;
    min-height: 20px;
    accent-color: var(--red);
}

.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.room-card {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.room-card-head,
.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.badge {
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(21, 132, 95, 0.12);
    color: var(--green);
    font-size: 12px;
    font-weight: 950;
}

.badge.locked {
    background: rgba(191, 47, 63, 0.11);
    color: var(--red);
}

.room-meter {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #eadbc0;
}

.room-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--green), var(--gold));
}

.room-stats,
.last-turn {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.room-stats div,
.last-turn div {
    min-height: 58px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: var(--white);
}

.room-stats dt,
.last-turn dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.room-stats dd,
.last-turn dd {
    margin: 4px 0 0;
    font-size: 18px;
    font-weight: 950;
}

.join-form {
    display: grid;
    gap: 10px;
}

.empty-state {
    grid-column: 1 / -1;
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 30px;
    background: rgba(255, 250, 240, 0.72);
}

.admin-shell {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.admin-hero h1 {
    font-size: clamp(42px, 6vw, 80px);
    overflow-wrap: anywhere;
}

.admin-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 14px;
    min-width: 0;
}

.metric-card,
.admin-form,
.proxy-list,
.proxy-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 250, 240, 0.94);
    box-shadow: var(--shadow);
}

.metric-card {
    min-height: 112px;
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 18px;
}

.metric-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 950;
}

.metric-card strong {
    color: var(--ink);
    font-size: 42px;
    line-height: 0.95;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    min-width: 0;
}

.admin-form,
.proxy-list,
.proxy-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    min-width: 0;
}

.admin-grid > *,
.admin-form > *,
.proxy-list > *,
.proxy-card > * {
    min-width: 0;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field-grid label {
    display: grid;
    gap: 7px;
}

.proxy-list {
    box-shadow: none;
}

.proxy-card {
    background: var(--white);
    box-shadow: none;
}

.proxy-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.proxy-head > div {
    min-width: 0;
}

.proxy-head h3 {
    margin: 0 0 4px;
    font-size: 24px;
}

.proxy-head a {
    color: var(--blue);
    font-weight: 900;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.status-pill {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 950;
    white-space: nowrap;
}

.status-stopped {
    background: rgba(104, 118, 132, 0.12);
    color: var(--muted);
}

.status-running {
    background: rgba(21, 132, 95, 0.12);
    color: var(--green);
}

.status-error {
    background: rgba(191, 47, 63, 0.12);
    color: var(--red);
}

.proxy-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.proxy-facts div {
    min-height: 60px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: rgba(244, 234, 216, 0.35);
}

.proxy-facts dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
}

.proxy-facts dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    font-size: 14px;
    font-weight: 950;
}

.proxy-config {
    min-height: 250px;
    background: #17212b;
    color: #f8f0df;
}

.proxy-error {
    margin: 0;
    border-left: 4px solid var(--red);
    border-radius: 0 6px 6px 0;
    padding: 10px 12px;
    background: rgba(191, 47, 63, 0.1);
    color: var(--red);
    font-weight: 900;
    overflow-wrap: anywhere;
}

.job-state {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: 0 8px 8px 0;
    padding: 10px 12px;
    background: rgba(37, 95, 153, 0.08);
}

.job-state strong,
.job-state span,
.job-state p {
    overflow-wrap: anywhere;
}

.job-state strong {
    display: block;
    font-size: 14px;
}

.job-state span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.job-state p {
    margin: 0;
    font-weight: 850;
}

.job-success {
    border-left-color: var(--green);
    background: rgba(21, 132, 95, 0.1);
}

.job-error {
    border-left-color: var(--red);
    background: rgba(191, 47, 63, 0.1);
}

.job-queued {
    border-left-color: var(--gold);
    background: rgba(200, 154, 56, 0.12);
}

.proxy-auth-form {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.proxy-auth-form label {
    display: grid;
    gap: 7px;
}

.proxy-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: start;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.game-layout.is-updating {
    filter: saturate(1.02);
}

.game-layout.is-updating button {
    pointer-events: none;
}

.game-layout.live-error {
    animation: live-error-pulse 0.75s ease both;
}

.topbar {
    grid-column: 1 / -1;
    min-height: 78px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 14px 18px;
}

.topbar h1 {
    margin: 2px 0 0;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1;
}

.wallet {
    min-width: 140px;
    min-height: 58px;
    display: grid;
    place-items: center;
    border: 2px solid var(--gold);
    border-radius: 8px;
    background: var(--white);
}

.wallet span {
    font-size: 24px;
    font-weight: 950;
}

.wallet small {
    color: var(--muted);
    font-weight: 900;
}

.top-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mobile-game-rail,
.mobile-drawer-backdrop {
    display: none;
}

.mobile-rail-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mobile-rail-button {
    min-height: 42px;
    border: 1px solid rgba(215, 194, 158, 0.86);
    padding: 0 13px;
    background: rgba(255, 250, 240, 0.96);
    color: var(--ink);
    box-shadow: 0 12px 28px rgba(23, 33, 43, 0.16);
}

.mobile-rail-button.is-active {
    background: var(--felt-dark);
    color: var(--white);
}

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

.board-shell {
    position: relative;
    grid-column: 1;
    grid-row: 2;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(11, 70, 57, 0.24);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 107, 85, 0.08), rgba(200, 154, 56, 0.08)),
        rgba(255, 250, 240, 0.62);
    box-shadow: var(--shadow);
}

.call-panel {
    position: absolute;
    inset: 0;
    z-index: 9;
    pointer-events: none;
}

.field-comms-dock {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
    width: 100%;
    pointer-events: auto;
}

.field-comms-dock.is-stacked {
    grid-template-columns: minmax(0, 1fr);
}

.field-chat-panel,
.business-news-panel {
    min-width: 0;
    min-height: 500px;
    max-height: 720px;
    display: grid;
    grid-template-rows: auto auto minmax(120px, 1fr) auto;
    gap: 10px;
    border: 1px solid rgba(215, 194, 158, 0.86);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 250, 240, 0.95);
    box-shadow: 0 14px 34px rgba(23, 33, 43, 0.18);
    backdrop-filter: blur(10px);
}

.business-news-panel {
    grid-template-rows: auto minmax(170px, 1fr);
}

.chat-call-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 8px;
}

.chat-call-controls .call-status {
    grid-column: 1 / -1;
    max-width: none;
}

.call-status {
    max-width: 140px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.call-button {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 6px;
    box-shadow: none;
    font-size: 12px;
}

.chat-call-controls .call-button {
    min-width: 0;
    width: 100%;
    height: 38px;
    padding: 0 9px;
    line-height: 1.1;
    white-space: normal;
}

.call-button[hidden] {
    display: none;
}

.call-button.active {
    background: var(--felt-dark);
    color: var(--white);
}

.call-button.danger {
    background: var(--red);
}

.call-dock {
    position: absolute;
    top: 72px;
    display: grid;
    gap: 10px;
    width: 168px;
    pointer-events: auto;
}

.call-dock-left {
    left: 12px;
}

.call-dock-right {
    right: 12px;
}

.call-tile {
    position: relative;
    min-height: 92px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    border: 1px solid rgba(255, 250, 240, 0.42);
    border-radius: 8px;
    padding: 8px;
    background: rgba(22, 34, 34, 0.82);
    color: var(--white);
    box-shadow: 0 12px 28px rgba(13, 29, 23, 0.26);
    backdrop-filter: blur(10px);
    transition: min-height 0.18s ease, grid-template-columns 0.18s ease, opacity 0.18s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.call-tile.self {
    border-color: rgba(200, 154, 56, 0.78);
}

.call-tile[data-speaking="1"] {
    border-color: rgba(45, 211, 111, 0.95);
    box-shadow:
        0 0 0 2px rgba(45, 211, 111, 0.48),
        0 12px 28px rgba(13, 29, 23, 0.26);
}

.call-tile video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.2s ease;
}

.call-tile[data-video-active="1"] video {
    opacity: 1;
}

.call-tile[data-video-active="1"] .call-avatar {
    opacity: 0;
}

.call-avatar {
    position: relative;
    z-index: 1;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255, 250, 240, 0.84);
    border-radius: 999px;
    font-size: 24px;
    font-weight: 950;
    box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.16);
    transition: opacity 0.18s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.call-tile[data-speaking="1"] .call-avatar {
    border-color: rgba(45, 211, 111, 0.98);
    box-shadow:
        0 0 0 3px rgba(45, 211, 111, 0.42),
        inset 0 -10px 18px rgba(0, 0, 0, 0.16);
}

.call-meta {
    position: relative;
    z-index: 1;
    min-width: 0;
    display: grid;
    gap: 3px;
}

.call-meta strong,
.call-meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.call-meta strong {
    font-size: 13px;
    line-height: 1.1;
}

.call-meta small {
    color: rgba(255, 250, 240, 0.72);
    font-size: 11px;
    font-weight: 900;
}

.call-tile-actions {
    position: absolute;
    z-index: 2;
    right: 6px;
    bottom: 6px;
    display: flex;
    gap: 4px;
}

.call-tile-actions button {
    width: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    border: 1px solid rgba(255, 250, 240, 0.5);
    border-radius: 999px;
    background: rgba(255, 250, 240, 0.9);
    color: var(--ink);
    box-shadow: none;
    font-size: 11px;
    line-height: 1;
}

.call-tile[data-muted="1"] [data-call-mute] {
    background: var(--red);
    color: var(--white);
}

.call-tile[data-collapsed="1"] {
    min-height: 54px;
    grid-template-columns: 38px minmax(0, 1fr);
}

.call-tile[data-collapsed="1"] video,
.call-tile[data-collapsed="1"] .call-tile-actions [data-call-mute],
.call-tile[data-collapsed="1"] .call-meta small {
    display: none;
}

.call-tile[data-collapsed="1"] .call-avatar {
    width: 38px;
    height: 38px;
    font-size: 18px;
}

[data-modal-layer] {
    display: contents;
}

.map-controls {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(215, 194, 158, 0.86);
    border-radius: 8px;
    padding: 8px;
    background: rgba(255, 250, 240, 0.94);
    box-shadow: 0 12px 28px rgba(23, 33, 43, 0.16);
}

.map-control {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    box-shadow: none;
    font-size: 21px;
    line-height: 1;
}

.map-reset {
    color: var(--felt-dark);
    font-size: 18px;
}

.map-scale {
    width: 142px;
    min-height: 38px;
    padding: 0;
    accent-color: var(--blue);
}

.map-scale-readout {
    min-width: 44px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
    text-align: right;
}

.board-viewport {
    position: relative;
    min-height: calc(100vh - 134px);
    overflow: hidden;
    cursor: grab;
    touch-action: none;
}

.board-viewport.is-dragging {
    cursor: grabbing;
}

.board-pan {
    position: absolute;
    top: 72px;
    left: 0;
    width: max-content;
    transform-origin: 0 0;
    will-change: transform;
    transition: transform 0.12s ease;
}

.board-viewport.is-dragging .board-pan {
    transition: none;
}

.board {
    width: max-content;
    min-width: max-content;
    --cell-size: 190px;
    --board-cols: 11;
    --board-rows: 11;
    display: grid;
    grid-template-columns: repeat(var(--board-cols), var(--cell-size));
    grid-template-rows: repeat(var(--board-rows), var(--cell-size));
    gap: 6px;
    border: 12px solid var(--felt-dark);
    border-radius: 8px;
    padding: 10px;
    background: var(--felt-dark);
    box-shadow: 0 20px 54px rgba(13, 29, 23, 0.28);
}

.board[data-board-animating="1"] .cell,
.board[data-board-animating="1"] .center-panel {
    will-change: transform;
}

.board [data-board-moving="1"] {
    pointer-events: none;
}

.cell,
.center-panel {
    min-width: 0;
    min-height: 0;
}

.cell {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-rows: 16px auto auto 1fr auto auto;
    gap: 6px;
    padding: 10px;
    border: 1px solid #b79762;
    border-radius: 6px;
    background: #24170e;
    color: var(--white);
    isolation: isolate;
}

.cell-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    border-radius: 0;
    filter: saturate(1.08) contrast(1.05);
}

.cell::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    height: 8px;
    background: var(--green);
}

.cell::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(10, 11, 12, 0.28), rgba(10, 11, 12, 0.76)),
        radial-gradient(circle at 50% 25%, rgba(255, 250, 240, 0.22), transparent 52%);
}

.cell > :not(.cell-art) {
    position: relative;
    z-index: 3;
}

.cell.current {
    outline: 4px solid var(--gold);
    z-index: 2;
}

.cell.auctioned {
    box-shadow:
        inset 0 0 0 3px rgba(205, 37, 56, 0.95),
        0 12px 24px rgba(119, 6, 25, 0.42);
}

.cell.property-clickable {
    cursor: pointer;
}

.cell.property-clickable:hover {
    outline: 3px solid rgba(200, 154, 56, 0.84);
    z-index: 2;
}

.cell.mortgaged {
    filter: saturate(0.78);
}

.type-chance::before {
    background: var(--violet);
}

.type-tax::before,
.type-go_to_jail::before {
    background: var(--red);
}

.type-railroad::before {
    background: var(--blue);
}

.type-utility::before {
    background: var(--gold);
}

.type-factory::before {
    background: var(--green);
}

.group-brown::before {
    background: #7b4a28;
}

.group-light_blue::before {
    background: #79c7e3;
}

.group-pink::before {
    background: #c6559b;
}

.group-orange::before {
    background: #ef8d32;
}

.group-red::before {
    background: #c73d3d;
}

.group-yellow::before {
    background: #f0c84b;
}

.group-green::before {
    background: #168a5a;
}

.group-dark_blue::before {
    background: #264e9f;
}

.type-start::before,
.type-parking::before,
.type-jail::before {
    background: var(--ink);
}

.cell-number {
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 950;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}

.cell h2 {
    margin: 0;
    max-width: 100%;
    font-size: var(--cell-title-size, 16px);
    line-height: 1.08;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.72);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell p {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
    line-height: 1.2;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.66);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.buildings {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 20px;
    align-items: center;
    justify-content: flex-start;
}

.house-chip {
    width: 17px;
    height: 14px;
    position: relative;
    display: inline-block;
    border: 2px solid rgba(255, 255, 255, 0.84);
    border-top: 0;
    border-radius: 2px 2px 4px 4px;
    background: #15845f;
    box-shadow: 0 2px 5px rgba(23, 33, 43, 0.3);
}

.house-chip::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -8px;
    width: 13px;
    height: 13px;
    border-left: 2px solid rgba(255, 255, 255, 0.84);
    border-top: 2px solid rgba(255, 255, 255, 0.84);
    border-radius: 2px 0 0;
    background: #1ca06f;
    transform: translateX(-50%) rotate(45deg);
}

.house-chip::after {
    content: "";
    position: absolute;
    left: 6px;
    bottom: 0;
    width: 4px;
    height: 7px;
    border-radius: 2px 2px 0 0;
    background: rgba(9, 69, 48, 0.82);
}

.hotel-chip,
.mortgage-chip {
    border-radius: 4px;
    padding: 2px 5px;
    color: white;
    font-size: 8px;
    font-weight: 950;
    line-height: 1;
}

.hotel-chip {
    width: 30px;
    height: 18px;
    position: relative;
    display: inline-block;
    border: 2px solid rgba(255, 255, 255, 0.84);
    border-top: 0;
    border-radius: 2px 2px 4px 4px;
    background: var(--red);
    color: transparent;
    box-shadow: 0 2px 5px rgba(23, 33, 43, 0.3);
}

.hotel-chip::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -10px;
    width: 22px;
    height: 22px;
    border-left: 2px solid rgba(255, 255, 255, 0.84);
    border-top: 2px solid rgba(255, 255, 255, 0.84);
    border-radius: 2px 0 0;
    background: #d94b57;
    transform: translateX(-50%) rotate(45deg);
}

.hotel-chip::after {
    content: "";
    position: absolute;
    inset: 5px 6px auto;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
}

.mortgage-chip {
    background: var(--ink);
}

.auction-chip {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    background: #cd2538;
    box-shadow: 0 6px 14px rgba(119, 6, 25, 0.34);
}

.auction-chip::before,
.auction-chip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    display: block;
    border-radius: 999px;
    background: #fff7ec;
    transform-origin: center;
}

.auction-chip::before {
    width: 14px;
    height: 5px;
    transform: translate(-64%, -72%) rotate(-35deg);
}

.auction-chip::after {
    width: 5px;
    height: 14px;
    transform: translate(-3%, -16%) rotate(-35deg);
}

.auction-chip-small {
    width: 20px;
    height: 20px;
}

.auction-chip-small::before {
    width: 12px;
    height: 4px;
}

.auction-chip-small::after {
    width: 4px;
    height: 12px;
}

.cell-sale-form {
    position: relative;
    z-index: 4;
}

.cell-sale-form button,
.cell-sale-state {
    width: 100%;
    min-height: 30px;
    border: 1px solid rgba(255, 250, 240, 0.68);
    border-radius: 4px;
    padding: 2px 5px;
    background: rgba(255, 250, 240, 0.9);
    color: var(--felt-dark);
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
    box-shadow: none;
}

.cell-sale-state {
    display: grid;
    place-items: center;
    background: rgba(200, 154, 56, 0.92);
}

.owner {
    width: fit-content;
    max-width: 100%;
    min-height: 0;
    overflow: hidden;
    justify-self: start;
    align-self: start;
    height: fit-content;
    display: inline-flex;
    align-items: center;
    border-radius: 5px;
    padding: 3px 7px;
    background: rgba(255, 250, 240, 0.88);
    color: var(--felt-dark);
    font-size: 12px;
    font-weight: 950;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.tokens span,
.token-flight-clone {
    width: 24px;
    height: 24px;
    position: relative;
    display: grid;
    place-items: center;
    border: 2px solid var(--white);
    border-radius: 42% 42% 46% 46%;
    background: var(--red);
    color: var(--white);
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow:
        inset 0 6px 8px rgba(255, 255, 255, 0.24),
        inset 0 -8px 12px rgba(0, 0, 0, 0.28),
        0 7px 10px rgba(0, 0, 0, 0.34);
    transform: perspective(70px) rotateX(14deg);
}

.style-neon {
    box-shadow: 0 0 0 2px #7dd3fc, 0 0 16px rgba(20, 184, 166, 0.85);
}

.style-royal {
    border-color: #f8e08e !important;
    box-shadow: 0 0 0 2px #9f6b1e, 0 7px 16px rgba(159, 107, 30, 0.32);
}

.move-hop {
    animation: token-hop 0.82s cubic-bezier(0.2, 0.78, 0.24, 1.1) both;
}

.move-slide {
    animation: token-slide 0.8s ease both;
}

.move-glow {
    animation: token-glow 1s ease both;
}

.tokens .bot-token {
    background: var(--blue);
}

.token-flight-clone {
    position: fixed !important;
    z-index: 10000;
    pointer-events: none;
    margin: 0;
    transform-origin: center;
    will-change: transform, filter;
    animation: none !important;
    transition: none !important;
}

.token-flight-target-hidden {
    opacity: 0;
    animation: none !important;
    transition: none !important;
}

.mini-token,
.figure-token {
    position: relative;
    display: inline-grid;
    place-items: center;
    border-radius: 42% 42% 46% 46%;
    color: var(--white);
    font-weight: 950;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow:
        inset 0 8px 10px rgba(255, 255, 255, 0.24),
        inset 0 -10px 14px rgba(0, 0, 0, 0.3),
        0 8px 14px rgba(23, 33, 43, 0.28);
    transform: perspective(90px) rotateX(13deg);
}

.mini-token {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    margin-right: 8px;
    font-size: 11px;
}

.figure-jedi {
    border-color: #b8fff0 !important;
    box-shadow:
        inset 0 7px 9px rgba(255, 255, 255, 0.28),
        inset 0 -9px 14px rgba(0, 56, 45, 0.42),
        0 0 0 1px rgba(142, 231, 213, 0.42),
        0 9px 16px rgba(20, 93, 73, 0.36);
}

.figure-elephant {
    border-radius: 48% 48% 42% 42%;
    border-color: #d5dee8 !important;
}

.figure-elephant::after {
    content: "";
    position: absolute;
    right: 12%;
    bottom: 18%;
    width: 20%;
    height: 34%;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    transform: rotate(-18deg);
}

.figure-soldier {
    border-radius: 32% 32% 48% 48%;
    border-color: #d9f8b6 !important;
}

.figure-soldier::before {
    content: "";
    position: absolute;
    inset: 8% 24% auto;
    height: 18%;
    border-radius: 999px;
    background: rgba(20, 33, 18, 0.44);
}

.figure-peter {
    border-color: #d9e8ff !important;
    box-shadow:
        inset 0 8px 10px rgba(255, 255, 255, 0.28),
        inset 0 -10px 15px rgba(3, 23, 59, 0.38),
        0 8px 16px rgba(31, 79, 143, 0.34);
}

.figure-tuxedo {
    border-color: #f6f0e4 !important;
}

.figure-tuxedo::before {
    content: "";
    position: absolute;
    inset: 18% 32% 18% 32%;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    background: rgba(255, 255, 255, 0.9);
}

.figure-artist {
    border-color: #ffe0ec !important;
}

.figure-artist::after {
    content: "";
    position: absolute;
    right: 10%;
    top: 14%;
    width: 12%;
    height: 68%;
    border-radius: 999px;
    background: #f2d08b;
    transform: rotate(35deg);
}

.center-panel {
    grid-row: 2 / 11;
    grid-column: 2 / 11;
    position: relative;
    overflow: hidden;
    display: grid;
    padding: 24px;
    border: 14px solid #5b321b;
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.11), transparent 19%, rgba(0, 0, 0, 0.2) 100%),
        repeating-linear-gradient(94deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 18px),
        linear-gradient(135deg, #734324, #4b2816);
    box-shadow:
        0 22px 44px rgba(35, 20, 9, 0.2),
        inset 0 0 0 2px rgba(255, 250, 240, 0.18),
        inset 0 0 0 8px rgba(37, 19, 9, 0.28),
        inset 0 0 30px rgba(23, 33, 43, 0.4);
}

.center-panel::before,
.center-panel::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.center-panel::before {
    inset: 11px;
    border: 1px solid rgba(248, 224, 142, 0.28);
    border-radius: 6px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 250, 240, 0.12),
        inset 0 0 28px rgba(0, 0, 0, 0.32);
}

.center-panel::after {
    width: 42%;
    height: 120%;
    left: -18%;
    top: -10%;
    background: linear-gradient(90deg, transparent, rgba(255, 250, 240, 0.08), transparent);
    transform: rotate(16deg);
}

.center-panel > * {
    position: relative;
    z-index: 1;
}

.turn-card {
    position: relative;
    overflow: hidden;
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 32px;
    border: 1px solid rgba(248, 224, 142, 0.32);
    border-radius: 8px;
    background:
        radial-gradient(ellipse at 50% 20%, rgba(255, 250, 240, 0.22), transparent 36%),
        radial-gradient(ellipse at 50% 78%, rgba(8, 35, 28, 0.5), transparent 62%),
        linear-gradient(145deg, rgba(9, 72, 52, 0.98), rgba(13, 93, 66, 0.94) 48%, rgba(5, 43, 34, 0.98)),
        #0b4f39;
    color: var(--white);
    box-shadow:
        inset 0 0 0 8px rgba(10, 45, 35, 0.72),
        inset 0 0 0 11px rgba(248, 224, 142, 0.08),
        inset 0 0 90px rgba(0, 0, 0, 0.28),
        0 18px 36px rgba(23, 33, 43, 0.2);
}

.turn-card::before {
    content: "";
    position: absolute;
    inset: 18px 18px 126px;
    border: 1px solid rgba(248, 224, 142, 0.32);
    border-radius: 6px;
    pointer-events: none;
}

.turn-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 9px),
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.035) 0 1px, transparent 1px 11px);
    mix-blend-mode: soft-light;
    pointer-events: none;
}

.turn-card > * {
    position: relative;
    z-index: 1;
}

.turn-card h2 {
    margin: 0;
    max-width: 100%;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1;
    color: var(--white);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow-wrap: anywhere;
}

.turn-card p {
    margin: 0;
    color: rgba(255, 250, 240, 0.9);
    font-weight: 750;
}

.turn-card .muted {
    color: rgba(255, 250, 240, 0.66);
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.turn-card .last-turn div {
    border-color: rgba(248, 224, 142, 0.28);
    background:
        linear-gradient(180deg, rgba(255, 250, 240, 0.16), rgba(255, 250, 240, 0.08)),
        rgba(8, 45, 35, 0.48);
    box-shadow:
        inset 0 1px 0 rgba(255, 250, 240, 0.18),
        0 8px 20px rgba(0, 0, 0, 0.12);
}

.turn-card .last-turn dt {
    color: rgba(255, 250, 240, 0.72);
}

.turn-card .last-turn dd {
    color: var(--white);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

.turn-card .field-chat-panel,
.turn-card .business-news-panel {
    border-color: rgba(248, 224, 142, 0.28);
    background:
        linear-gradient(180deg, rgba(255, 250, 240, 0.16), rgba(255, 250, 240, 0.08)),
        rgba(8, 45, 35, 0.48);
    box-shadow:
        inset 0 1px 0 rgba(255, 250, 240, 0.18),
        0 8px 20px rgba(0, 0, 0, 0.12);
}

.turn-card .field-comms-dock h2 {
    margin: 0;
    color: var(--white);
    font-size: 16px;
    line-height: 1.1;
    text-shadow: none;
}

.turn-card .field-comms-dock .section-head span,
.turn-card .field-comms-dock .call-status,
.turn-card .field-comms-dock .muted,
.turn-card .field-comms-dock small {
    color: rgba(255, 250, 240, 0.72);
}

.turn-card .field-comms-dock .chat-message-meta,
.turn-card .field-comms-dock .chat-message-meta small,
.turn-card .field-comms-dock .business-news-item time {
    color: rgba(255, 250, 240, 0.68);
}

.turn-card .field-comms-dock .chat-message-meta strong {
    color: var(--white);
}

.turn-card .field-comms-dock .encrypted-error {
    color: rgba(255, 250, 240, 0.82);
}

.turn-card .field-comms-dock textarea,
.turn-card .field-comms-dock .chat-file-button {
    border-color: rgba(248, 224, 142, 0.24);
    background: rgba(255, 250, 240, 0.92);
}

.turn-card .business-news-item,
.turn-card .chat-message {
    border-color: rgba(248, 224, 142, 0.2);
    background: rgba(5, 36, 28, 0.46);
}

.turn-card .business-news-item p,
.turn-card .chat-message p {
    color: rgba(255, 250, 240, 0.9);
}

.game-over-banner {
    display: grid;
    gap: 8px;
    border: 3px solid var(--gold);
    border-radius: 8px;
    padding: 18px;
    background: linear-gradient(135deg, rgba(191, 47, 63, 0.12), rgba(200, 154, 56, 0.18)), var(--white);
    text-align: center;
}

.game-over-banner strong {
    color: var(--red);
    font-size: clamp(34px, 5vw, 64px);
    font-weight: 950;
    line-height: 0.95;
}

.game-over-banner span {
    color: var(--ink);
    font-size: 20px;
    font-weight: 950;
}

.dice-board {
    min-height: 132px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 34px;
    border: 1px solid rgba(248, 224, 142, 0.42);
    border-radius: 8px;
    padding: 24px 26px 28px;
    background:
        radial-gradient(ellipse at 50% 42%, rgba(255, 250, 240, 0.2), transparent 42%),
        radial-gradient(ellipse at 50% 80%, rgba(0, 0, 0, 0.3), transparent 58%),
        linear-gradient(180deg, rgba(4, 38, 29, 0.24), rgba(0, 0, 0, 0.32));
    color: var(--white);
    perspective: 860px;
    box-shadow:
        inset 0 0 0 5px rgba(4, 34, 27, 0.38),
        inset 0 0 30px rgba(0, 0, 0, 0.28),
        0 13px 30px rgba(0, 0, 0, 0.14);
}

.dice-board::before,
.dice-board::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.dice-board::before {
    inset: 14px 18px;
    border: 1px dashed rgba(248, 224, 142, 0.18);
    border-radius: 8px;
}

.dice-board::after {
    width: 220px;
    height: 44px;
    left: 50%;
    bottom: 13px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.24);
    filter: blur(14px);
    transform: translateX(-50%);
}

.dice-physics-canvas {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.dice-board.has-dice-physics {
    transform: none !important;
}

.dice-board.has-dice-physics .die {
    opacity: 0;
    visibility: hidden;
}

.dice-form {
    margin: 0;
}

button.dice-board {
    width: 100%;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

button.dice-board:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(23, 33, 43, 0.14);
}

button.dice-board:not(:disabled):active {
    transform: translateY(1px) scale(0.99);
}

button.dice-board:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    transform: none;
}

.die-face {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.die {
    --die-size: 68px;
    --die-half: calc(var(--die-size) / 2);
    --die-final-transform: rotateX(-16deg) rotateY(22deg);
    width: var(--die-size);
    height: var(--die-size);
    position: relative;
    z-index: 1;
    display: block;
    transform-style: preserve-3d;
    filter: drop-shadow(0 20px 15px rgba(0, 0, 0, 0.34));
}

.die::after {
    content: "";
    position: absolute;
    left: 5px;
    right: 5px;
    bottom: -24px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.28);
    filter: blur(8px);
    transform: rotateX(72deg);
}

.die-1 { --die-final-transform: rotateX(-16deg) rotateY(22deg); }
.die-2 { --die-final-transform: rotateX(-14deg) rotateY(-70deg); }
.die-3 { --die-final-transform: rotateX(-72deg) rotateY(18deg); }
.die-4 { --die-final-transform: rotateX(72deg) rotateY(18deg); }
.die-5 { --die-final-transform: rotateX(-14deg) rotateY(112deg); }
.die-6 { --die-final-transform: rotateX(-16deg) rotateY(202deg); }

.die-cube {
    position: absolute;
    inset: 0;
    display: block;
    transform: var(--die-final-transform);
    transform-style: preserve-3d;
    transition: transform 0.28s cubic-bezier(0.18, 0.8, 0.26, 1);
}

.die-side {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(52, 43, 31, 0.74);
    border-radius: 12px;
    background:
        radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.96), transparent 23%),
        radial-gradient(circle at 74% 82%, rgba(116, 84, 50, 0.18), transparent 34%),
        linear-gradient(145deg, #fffaf0 0%, #f4ead8 54%, #ded0b9 100%);
    box-shadow:
        inset 5px 6px 11px rgba(255, 255, 255, 0.88),
        inset -9px -11px 15px rgba(66, 46, 27, 0.22),
        0 0 0 1px rgba(255, 250, 240, 0.28);
    backface-visibility: hidden;
}

.die-side-1 { transform: translateZ(var(--die-half)); }
.die-side-2 { transform: rotateY(90deg) translateZ(var(--die-half)); }
.die-side-3 { transform: rotateX(90deg) translateZ(var(--die-half)); }
.die-side-4 { transform: rotateX(-90deg) translateZ(var(--die-half)); }
.die-side-5 { transform: rotateY(-90deg) translateZ(var(--die-half)); }
.die-side-6 { transform: rotateY(180deg) translateZ(var(--die-half)); }

.pip {
    width: 9px;
    height: 9px;
    position: absolute;
    display: none;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.28), transparent 32%),
        #1f2933;
    box-shadow:
        inset 1px 1px 2px rgba(255, 255, 255, 0.22),
        inset -2px -2px 3px rgba(0, 0, 0, 0.38);
}

.pip-1 { top: 14px; left: 14px; }
.pip-2 { top: 14px; left: 50%; transform: translateX(-50%); }
.pip-3 { top: 14px; right: 14px; }
.pip-4 { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.pip-5 { bottom: 14px; left: 14px; }
.pip-6 { bottom: 14px; left: 50%; transform: translateX(-50%); }
.pip-7 { right: 14px; bottom: 14px; }

.die-side-1 .pip-4,
.die-side-2 .pip-1,
.die-side-2 .pip-7,
.die-side-3 .pip-1,
.die-side-3 .pip-4,
.die-side-3 .pip-7,
.die-side-4 .pip-1,
.die-side-4 .pip-3,
.die-side-4 .pip-5,
.die-side-4 .pip-7,
.die-side-5 .pip-1,
.die-side-5 .pip-3,
.die-side-5 .pip-4,
.die-side-5 .pip-5,
.die-side-5 .pip-7,
.die-side-6 .pip-1,
.die-side-6 .pip-2,
.die-side-6 .pip-3,
.die-side-6 .pip-5,
.die-side-6 .pip-6,
.die-side-6 .pip-7 {
    display: block;
}

.side-panel {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    gap: 12px;
    justify-self: end;
    width: min(330px, 100%);
    min-width: 0;
    max-height: calc(100vh - 140px);
    overflow: auto;
    position: sticky;
    top: 12px;
}

.side-panel section {
    padding: 12px;
    width: 100%;
    min-width: 0;
}

.side-panel * {
    min-width: 0;
}

.side-panel button {
    white-space: normal;
}

.section-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.score-list,
.property-list,
.bot-toggle,
.money-form,
.deal-list,
.trade-list,
.auction-list {
    display: grid;
    gap: 8px;
}

.loadout-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

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

.profile-page {
    display: grid;
    gap: 22px;
}

.profile-grid,
.shop-grid {
    display: grid;
    grid-template-columns: minmax(320px, 520px) minmax(280px, 1fr);
    gap: 18px;
    align-items: start;
}

.profile-form,
.profile-card,
.shop-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 250, 240, 0.94);
    box-shadow: var(--shadow);
}

.profile-form {
    display: grid;
    gap: 13px;
    padding: 24px;
}

.profile-form h2,
.profile-card h2 {
    max-width: 100%;
    margin: 0;
    overflow-wrap: anywhere;
}

.profile-card {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 28px;
    text-align: center;
}

.profile-card p {
    max-width: 100%;
    margin: 0;
    color: var(--muted);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.profile-logo {
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    border: 5px solid var(--white);
    border-radius: 50%;
    color: var(--white);
    font-size: 38px;
    font-weight: 950;
    text-transform: uppercase;
    box-shadow: var(--shadow);
}

.profile-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.profile-stats div {
    min-height: 78px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--white);
}

.profile-stats dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.profile-stats dd {
    margin: 5px 0 0;
    font-size: 28px;
    font-weight: 950;
}

.shop-panel {
    display: grid;
    gap: 14px;
    padding: 20px;
}

.shop-panel h2 {
    margin: 0;
}

.figure-list {
    display: grid;
    gap: 8px;
}

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

.figure-list form {
    margin: 0;
}

.figure-option {
    width: 100%;
    min-height: 58px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--white);
    color: var(--ink);
    box-shadow: none;
    text-align: left;
}

.figure-option.selected {
    border-color: var(--gold);
    box-shadow: inset 4px 0 0 var(--gold);
}

.figure-option span:nth-child(2) {
    min-width: 0;
    overflow: hidden;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.figure-option small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.figure-token {
    width: 38px;
    height: 38px;
    font-size: 15px;
}

.dice-readout {
    display: inline-block;
}

.dice-shake {
    animation: dice-shake 0.7s ease both;
}

.dice-board.dice-shake .die-cube {
    animation: dice-board-throw 0.92s cubic-bezier(0.16, 0.88, 0.26, 1.18) both;
}

.dice-board.dice-shake .die:last-child .die-cube {
    animation-name: dice-board-throw-alt;
    animation-delay: 0.06s;
}

.dice-board.has-dice-physics.dice-shake,
.dice-board.has-dice-physics.dice-spin,
.dice-board.has-dice-physics.dice-spark,
.dice-board.has-dice-physics.dice-shake .die-cube,
.dice-board.has-dice-physics.dice-spin .die-cube,
.dice-board.has-dice-physics.dice-spark .die-cube {
    animation: none;
}

.dice-spin {
    animation: dice-spin 0.75s ease both;
}

.dice-spark {
    animation: dice-spark 1s ease both;
}

@keyframes token-hop {
    0% { transform: perspective(90px) rotateX(13deg) translateY(0) scale(1); }
    38% { transform: perspective(90px) rotateX(22deg) translateY(-14px) scale(1.08); }
    68% { transform: perspective(90px) rotateX(8deg) translateY(2px) scale(0.98); }
    100% { transform: perspective(90px) rotateX(13deg) translateY(0) scale(1); }
}

@keyframes token-slide {
    0% { transform: translateX(-10px); opacity: 0.5; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes token-glow {
    0% { filter: brightness(1); box-shadow: 0 0 0 rgba(112, 81, 156, 0); }
    50% { filter: brightness(1.25); box-shadow: 0 0 20px rgba(112, 81, 156, 0.75); }
    100% { filter: brightness(1); }
}

@keyframes dice-shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    20% { transform: translateX(-3px) rotate(-6deg); }
    40% { transform: translateX(3px) rotate(6deg); }
    60% { transform: translateX(-2px) rotate(-4deg); }
    80% { transform: translateX(2px) rotate(4deg); }
}

@keyframes dice-board-throw {
    0% {
        opacity: 0;
        transform: translate3d(-110px, -74px, 90px) rotateX(12deg) rotateY(-48deg) rotateZ(-25deg) scale(0.62);
    }
    58% {
        opacity: 1;
        transform: translate3d(10px, 8px, 18px) rotateX(430deg) rotateY(310deg) rotateZ(28deg) scale(1.08);
    }
    78% {
        transform: translate3d(-4px, -3px, 6px) rotateX(512deg) rotateY(384deg) rotateZ(-8deg) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: var(--die-final-transform);
    }
}

@keyframes dice-board-throw-alt {
    0% {
        opacity: 0;
        transform: translate3d(112px, -82px, 90px) rotateX(-18deg) rotateY(56deg) rotateZ(25deg) scale(0.62);
    }
    58% {
        opacity: 1;
        transform: translate3d(-12px, 9px, 18px) rotateX(-390deg) rotateY(340deg) rotateZ(-30deg) scale(1.08);
    }
    78% {
        transform: translate3d(5px, -2px, 6px) rotateX(-486deg) rotateY(414deg) rotateZ(10deg) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: var(--die-final-transform);
    }
}

@keyframes dice-spin {
    from { transform: rotate(0) scale(0.96); }
    to { transform: rotate(360deg) scale(1); }
}

@keyframes dice-spark {
    0% { transform: scale(0.92); text-shadow: none; }
    45% { transform: scale(1.08); text-shadow: 0 0 18px rgba(200, 154, 56, 0.9); }
    100% { transform: scale(1); text-shadow: none; }
}

@keyframes live-error-pulse {
    0%, 100% { filter: none; }
    45% { filter: drop-shadow(0 0 14px rgba(191, 47, 63, 0.42)); }
}

.score-row,
.property-row,
.deal-row,
.trade-row,
.auction-row {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--white);
}

.property-card {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: var(--white);
}

.property-card-collapsible {
    overflow: hidden;
}

.property-summary {
    min-height: 42px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    cursor: pointer;
    list-style: none;
}

.property-summary::-webkit-details-marker {
    display: none;
}

.property-summary > span:first-child {
    min-width: 0;
    overflow: hidden;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.property-summary strong {
    font-size: 13px;
    font-weight: 950;
    white-space: nowrap;
}

.property-card-body {
    display: grid;
    grid-template-rows: 0fr;
    gap: 0;
    opacity: 0;
    transform: translateY(-4px);
    transition: grid-template-rows 0.24s ease, opacity 0.2s ease, transform 0.2s ease, gap 0.2s ease;
}

.property-card-body > * {
    overflow: hidden;
}

.property-card-collapsible[open] .property-card-body {
    grid-template-rows: 1fr;
    gap: 8px;
    opacity: 1;
    transform: translateY(0);
}

.property-card .property-row {
    min-height: 0;
    border: 0;
    padding: 0;
}

.property-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.property-meta span {
    border-radius: 4px;
    padding: 3px 6px;
    background: rgba(15, 107, 85, 0.1);
    color: var(--ink-2);
    font-size: 11px;
    font-weight: 900;
}

.property-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.property-actions form,
.auction-bid {
    display: grid;
    gap: 5px;
}

.property-actions button,
.auction-row button {
    width: 100%;
    min-height: 36px;
    padding: 0 8px;
    font-size: 12px;
}

.property-actions input,
.auction-bid input {
    min-height: 36px;
    padding: 0 8px;
}

.trade-row,
.auction-row {
    align-items: stretch;
}

.trade-row > div,
.auction-row > div {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.trade-row.waiting {
    background: rgba(255, 250, 240, 0.72);
}

.trade-price-form,
.trade-answer-form {
    min-width: 128px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
}

.trade-price-form input {
    grid-column: 1 / -1;
    min-height: 34px;
    padding: 0 8px;
}

.trade-price-form button,
.trade-answer-form button {
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
}

.quick-trade-form {
    margin: 8px 0 0;
}

.property-modal,
.trade-offers-modal,
.chat-image-modal {
    width: min(720px, calc(100vw - 28px));
    max-height: min(760px, calc(100vh - 28px));
    border: 0;
    border-radius: 8px;
    padding: 0;
    background: transparent;
    color: var(--ink);
}

.trade-offers-modal {
    width: min(980px, calc(100vw - 28px));
}

.property-modal::backdrop,
.trade-offers-modal::backdrop,
.chat-image-modal::backdrop {
    background: rgba(18, 24, 22, 0.58);
    backdrop-filter: blur(4px);
}

.chat-image-modal {
    width: min(1180px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
}

.chat-image-modal-panel {
    position: relative;
    display: grid;
    place-items: center;
    min-height: min(720px, calc(100vh - 44px));
    border-radius: 8px;
    padding: 12px;
    background: rgba(18, 24, 22, 0.94);
    box-shadow: var(--shadow);
}

.chat-image-modal-panel .icon-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.chat-image-modal-panel img {
    display: block;
    width: auto;
    max-width: calc(100vw - 64px);
    height: auto;
    max-height: calc(100vh - 64px);
    border-radius: 6px;
    object-fit: contain;
}

.modal-panel {
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(245, 233, 211, 0.98)),
        var(--paper);
    box-shadow: var(--shadow);
}

.modal-panel.wide {
    gap: 16px;
}

.modal-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
}

.modal-head h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1.05;
}

.icon-close {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    padding: 0;
    font-size: 22px;
    line-height: 1;
}

.modal-city-state,
.modal-economy,
.rent-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 8px;
}

.modal-city-state div,
.modal-economy div,
.rent-table div {
    min-height: 58px;
    display: grid;
    align-content: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: var(--white);
}

.modal-city-state.mortgaged div {
    background: rgba(23, 33, 43, 0.08);
}

.modal-city-state span,
.modal-economy span,
.rent-table span,
.trade-offer-card span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.modal-city-state strong,
.modal-economy strong,
.rent-table strong {
    font-size: 16px;
    font-weight: 950;
}

.modal-buildings {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.62);
}

.modal-buildings .house-chip {
    width: 18px;
    height: 14px;
}

.modal-buildings .hotel-chip,
.modal-buildings .mortgage-chip {
    min-height: 18px;
    display: inline-grid;
    place-items: center;
    font-size: 10px;
}

.modal-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}

.modal-actions form {
    display: grid;
    gap: 6px;
}

.modal-actions button,
.modal-actions input {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
}

.trade-offer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.trade-offer-card {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--white);
}

.trade-offer-card h3 {
    margin: 0;
    font-size: 17px;
}

.trade-offer-card > strong {
    font-size: 24px;
}

.trade-offer-card.muted-card {
    background: rgba(255, 255, 255, 0.64);
}

.trade-row span,
.auction-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.score-row.self {
    border-color: var(--green);
}

.score-row.active {
    box-shadow: inset 4px 0 0 var(--gold);
}

.score-row span,
.deal-row span,
.trade-row span,
.property-row span,
.property-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score-name {
    display: inline-flex;
    align-items: center;
}

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

.chat-panel {
    gap: 10px;
}

.field-chat-panel .chat-thread {
    min-height: 240px;
    max-height: none;
}

.chat-thread {
    max-height: 280px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    display: grid;
    gap: 8px;
    padding-right: 2px;
}

.chat-message {
    display: grid;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px;
    background: rgba(255, 250, 240, 0.78);
}

.chat-message p {
    margin: 0;
    overflow-wrap: anywhere;
}

.chat-image-preview {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 180px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.66);
    cursor: zoom-in;
    object-fit: contain;
}

.chat-message small {
    color: var(--muted);
    font-weight: 800;
}

.chat-message-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.chat-message-meta strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.encrypted-error {
    color: var(--muted);
    font-size: 12px;
}

.chat-compose {
    display: grid;
    gap: 8px;
}

.chat-compose textarea {
    min-height: 64px;
    resize: vertical;
}

.chat-compose-actions {
    display: grid;
    grid-template-columns: 40px 92px 1fr;
    gap: 8px;
    align-items: center;
}

.chat-emoji-shell {
    position: relative;
    min-width: 0;
}

.chat-emoji-toggle {
    width: 40px;
    min-height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 250, 240, 0.78);
    color: var(--ink);
    box-shadow: none;
    font-size: 20px;
    line-height: 1;
}

.chat-emoji-picker {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 95;
    width: min(340px, calc(100vw - 42px));
    max-height: 330px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    border: 1px solid rgba(215, 194, 158, 0.86);
    border-radius: 8px;
    padding: 8px;
    background: rgba(255, 250, 240, 0.98);
    box-shadow: 0 18px 42px rgba(23, 33, 43, 0.24);
}

.chat-emoji-picker[hidden] {
    display: none;
}

.chat-emoji-tabs {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 4px;
}

.chat-emoji-tab,
.chat-emoji-option {
    min-height: 32px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    font-size: 20px;
    line-height: 1;
}

.chat-emoji-tab.active,
.chat-emoji-tab:hover,
.chat-emoji-option:hover {
    border-color: rgba(47, 104, 166, 0.18);
    background: rgba(47, 104, 166, 0.1);
}

.chat-emoji-grid {
    max-height: 260px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
    padding-right: 2px;
}

.chat-file-button {
    min-height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 250, 240, 0.78);
    color: var(--ink);
    font-size: 12px;
    font-weight: 950;
    cursor: pointer;
}

.chat-file-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.chat-file-download {
    width: fit-content;
    max-width: 100%;
    border: 1px solid rgba(47, 104, 166, 0.24);
    border-radius: 6px;
    padding: 7px 10px;
    background: rgba(47, 104, 166, 0.12);
    color: var(--blue);
    font-size: 12px;
    font-weight: 950;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.business-news-list {
    min-height: 340px;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    display: grid;
    gap: 8px;
    padding-right: 2px;
}

.business-news-item {
    display: grid;
    gap: 5px;
    border: 1px solid rgba(215, 194, 158, 0.72);
    border-left: 3px solid var(--gold);
    border-radius: 6px;
    padding: 8px;
    background: rgba(255, 250, 240, 0.78);
}

.business-news-item p {
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.business-news-item time {
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
}

@media (max-width: 1160px) {
    .lobby-tools {
        grid-template-columns: 1fr;
    }

    .admin-metrics {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

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

    .call-dock {
        width: 142px;
    }

    .call-tile {
        min-height: 76px;
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .call-avatar {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }
}

@media (max-width: 900px) {
    .game-layout {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
    }

    .board-viewport {
        min-height: 72vh;
    }

    .field-comms-dock {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .call-dock {
        top: 72px;
        width: 128px;
    }

    .side-panel {
        width: min(300px, 100%);
    }
}

@media (max-width: 760px) {
    html,
    body {
        min-height: 100%;
        overflow-x: hidden;
    }

    body.has-mobile-drawer {
        overflow: hidden;
    }

    .page {
        padding: 14px;
    }

    .page:has(.game-layout) {
        width: 100%;
        min-height: 100dvh;
        padding: 0;
    }

    .login-shell {
        min-height: calc(100vh - 28px);
        grid-template-columns: 1fr;
        align-content: center;
    }

    .brand-panel h1,
    .lobby-hero h1 {
        font-size: 48px;
    }

    .profile-page .compact-hero h1 {
        font-size: 40px;
        line-height: 1.05;
    }

    .lobby-hero,
    .topbar {
        display: grid;
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .hero-actions {
        justify-content: flex-start;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .top-actions {
        flex-wrap: wrap;
    }

    .game-layout {
        position: relative;
        min-height: 100dvh;
        display: block;
        overflow: hidden;
    }

    .game-layout .topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 58;
        min-height: 66px;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        border-radius: 0;
        padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
        background: rgba(255, 250, 240, 0.96);
        backdrop-filter: blur(12px);
        box-shadow: 0 10px 28px rgba(23, 33, 43, 0.14);
    }

    .game-layout .topbar h1 {
        margin: 0;
        font-size: 18px;
        line-height: 1.06;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .game-layout .topbar .eyebrow,
    .game-layout .top-actions {
        display: none;
    }

    .game-layout .wallet {
        min-width: 92px;
        min-height: 44px;
        padding: 5px 8px;
        border-width: 1px;
    }

    .game-layout .wallet span {
        font-size: 18px;
        line-height: 1;
    }

    .game-layout .wallet small {
        max-width: 76px;
        overflow: hidden;
        font-size: 10px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-game-rail {
        position: fixed;
        top: calc(76px + env(safe-area-inset-top, 0px));
        left: 8px;
        right: 8px;
        z-index: 57;
        display: flex;
        justify-content: space-between;
        gap: 8px;
        pointer-events: none;
    }

    .mobile-game-rail > * {
        pointer-events: auto;
    }

    .mobile-rail-button {
        min-height: 40px;
        padding: 0 11px;
        font-size: 13px;
        box-shadow: 0 10px 24px rgba(23, 33, 43, 0.18);
    }

    .mobile-drawer-backdrop {
        position: fixed;
        inset: 0;
        z-index: 70;
        display: block;
        width: auto;
        min-height: 0;
        border-radius: 0;
        padding: 0;
        background: rgba(14, 24, 21, 0.42);
        box-shadow: none;
        backdrop-filter: blur(2px);
    }

    .mobile-drawer-backdrop[hidden] {
        display: none;
    }

    .board-shell {
        width: 100%;
        height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .board-viewport {
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
    }

    .map-controls {
        right: 8px;
        left: auto;
        top: calc(126px + env(safe-area-inset-top, 0px));
        z-index: 56;
        gap: 5px;
        max-width: calc(100vw - 16px);
        padding: 6px;
    }

    .map-scale {
        width: min(96px, 26vw);
    }

    .map-control {
        width: 34px;
        min-width: 34px;
        min-height: 34px;
    }

    .board-pan {
        top: calc(176px + env(safe-area-inset-top, 0px));
    }

    .board {
        --cell-size: 148px;
        gap: 5px;
        border-width: 8px;
        padding: 7px;
    }

    .cell {
        padding: 9px;
    }

    .cell h2 {
        font-size: var(--cell-title-size, 15px);
    }

    .cell p,
    .owner,
    .cell-number {
        font-size: 12px;
    }

    .tokens span {
        width: 18px;
        height: 18px;
        font-size: 8px;
    }

    .turn-card {
        padding: 14px;
        gap: 10px;
    }

    .turn-card h2 {
        font-size: 30px;
    }

    .action-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .action-row form,
    .action-row button {
        width: 100%;
    }

    .dice-board {
        min-height: 118px;
    }

    .call-panel {
        display: none;
    }

    .field-comms-dock,
    .side-panel {
        position: fixed;
        top: 0;
        bottom: 0;
        z-index: 80;
        width: min(88vw, 380px);
        max-height: none;
        overflow: auto;
        overscroll-behavior: contain;
        display: grid;
        gap: 10px;
        padding: calc(16px + env(safe-area-inset-top, 0px)) 12px calc(18px + env(safe-area-inset-bottom, 0px));
        background: rgba(244, 234, 216, 0.98);
        box-shadow: 0 0 36px rgba(23, 33, 43, 0.28);
        transition: transform 0.24s ease;
    }

    .field-comms-dock {
        left: 0;
        grid-template-columns: minmax(0, 1fr);
        transform: translateX(-104%);
    }

    .side-panel {
        right: 0;
        justify-self: auto;
        width: min(90vw, 400px);
        transform: translateX(104%);
    }

    .field-comms-dock.is-open,
    .side-panel.is-open {
        transform: translateX(0);
    }

    .field-chat-panel,
    .business-news-panel,
    .side-panel section {
        min-height: auto;
        max-height: none;
        border-radius: 8px;
        background: rgba(255, 250, 240, 0.96);
        box-shadow: none;
        backdrop-filter: none;
    }

    .field-chat-panel {
        grid-template-rows: auto auto minmax(260px, 1fr) auto;
    }

    .field-chat-panel .chat-thread,
    .business-news-list {
        min-height: 260px;
        max-height: 44vh;
    }

    .last-turn {
        grid-template-columns: 1fr;
    }

    .profile-grid,
    .shop-grid {
        grid-template-columns: 1fr;
    }

    .admin-metrics,
    .field-grid,
    .proxy-facts,
    .proxy-auth-form {
        grid-template-columns: 1fr;
    }

    .admin-hero h1 {
        font-size: 38px;
    }

    .metric-card strong {
        font-size: 34px;
    }

    .cell-art {
        height: 100%;
    }
}
