@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Manrope:wght@400;600;700;800&display=swap');

:root {
    --bg: #f4ecdf;
    --panel: rgba(255, 249, 239, 0.78);
    --panel-strong: rgba(255, 251, 244, 0.94);
    --ink: #1f2430;
    --muted: #6d6f7b;
    --wood-dark: #8a4c2f;
    --wood-mid: #b36a3c;
    --wood-light: #d9a56c;
    --felt: #2d6a61;
    --felt-soft: #a9d1c2;
    --line: rgba(31, 36, 48, 0.12);
    --accent: #d96d3f;
    --accent-strong: #bb4b22;
    --shadow: 0 22px 48px rgba(80, 54, 35, 0.14);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background:
        radial-gradient(circle at top left, rgba(217, 109, 63, 0.22), transparent 28%),
        radial-gradient(circle at bottom right, rgba(45, 106, 97, 0.18), transparent 26%),
        linear-gradient(135deg, #efe3cf 0%, #f8f0e2 48%, #ead8c2 100%);
    color: var(--ink);
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    position: relative;
    transition: background 220ms ease;
}

body.player-turn-active.player-turn-white {
    background:
        radial-gradient(circle at top left, rgba(247, 201, 72, 0.34), transparent 26%),
        radial-gradient(circle at bottom right, rgba(255, 247, 184, 0.28), transparent 24%),
        linear-gradient(135deg, #f7edd0 0%, #fff8dc 50%, #ecd58f 100%);
}

body.player-turn-active.player-turn-black {
    background:
        radial-gradient(circle at top left, rgba(201, 52, 47, 0.3), transparent 26%),
        radial-gradient(circle at bottom right, rgba(255, 122, 104, 0.22), transparent 24%),
        linear-gradient(135deg, #f2d7cd 0%, #fff1eb 46%, #e3a18f 100%);
}

.page-glow {
    position: fixed;
    inset: auto;
    width: 32rem;
    height: 32rem;
    border-radius: 999px;
    filter: blur(80px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.page-glow-left {
    background: rgba(217, 109, 63, 0.3);
    top: -12rem;
    left: -8rem;
}

.page-glow-right {
    background: rgba(45, 106, 97, 0.28);
    right: -10rem;
    bottom: -12rem;
}

.app-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px;
    position: relative;
    z-index: 1;
}

.room-mode .hero {
    display: none;
}

.invite-mode .hero {
    display: none;
}

.room-mode .app-shell {
    max-width: none;
    padding: 18px;
}

.invite-mode .app-shell {
    max-width: 760px;
    padding: 24px 18px;
}

.room-mode .main-grid {
    gap: 0;
}

.invite-mode .main-grid {
    gap: 0;
}

.panel {
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    align-items: center;
    gap: 28px;
    padding: 34px;
    margin-bottom: 24px;
    overflow: hidden;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    inset: auto -40px -80px auto;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(45, 106, 97, 0.18), transparent 70%);
}

.eyebrow,
.kicker,
.status-label,
.dice-label {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--accent-strong);
    margin: 0 0 8px;
}

.hero h1,
.card h2,
.room-topbar h2,
.status-card h2 {
    font-family: 'Fraunces', Georgia, serif;
    line-height: 1.02;
    margin: 0;
}

.hero h1 {
    font-size: clamp(2.3rem, 4vw, 4rem);
    max-width: 13ch;
}

.hero-copy {
    color: var(--muted);
    max-width: 38ch;
    line-height: 1.65;
    margin: 16px 0 0;
}

.hero-entry-stack,
.hero-copy-block {
    position: relative;
    z-index: 1;
}

.hero-entry-stack {
    display: grid;
    gap: 18px;
    align-content: start;
}

.hero-entry-card {
    width: 100%;
    background: linear-gradient(180deg, rgba(255, 251, 244, 0.96), rgba(255, 247, 236, 0.92));
    border: 1px solid rgba(31, 36, 48, 0.08);
    box-shadow: 0 16px 34px rgba(80, 54, 35, 0.12);
}

.hero-note {
    max-width: 42ch;
    margin: 12px 0 0;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.55;
}

.hero-create-card {
    width: 100%;
    background: var(--panel-strong);
    border: 1px solid rgba(31, 36, 48, 0.1);
    box-shadow: 0 18px 38px rgba(80, 54, 35, 0.15);
}

.hero-side {
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 250px;
}

.hero-chip,
.code-badge,
.seat-pill,
.status-block,
.ghost-button,
.point-label,
.move-button {
    border-radius: 999px;
}

.hero-chip {
    background: var(--panel-strong);
    border: 1px solid rgba(31, 36, 48, 0.08);
    padding: 12px 16px;
    font-weight: 700;
}

.main-grid,
.lobby-grid,
.room-grid {
    display: grid;
    gap: 24px;
}

.lobby-screen {
    display: block;
}

.entry-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.entry-mode-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 999px;
    border: 1px solid rgba(31, 36, 48, 0.1);
    background: rgba(255, 255, 255, 0.76);
    font-weight: 800;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.entry-mode-option:hover {
    transform: translateY(-1px);
}

.entry-mode-option input {
    width: auto;
    margin: 0;
    accent-color: var(--felt);
}

.entry-mode-option:has(input:checked) {
    background: rgba(45, 106, 97, 0.12);
    border-color: rgba(45, 106, 97, 0.34);
}

.lobby-join-card {
    width: 100%;
    background: linear-gradient(180deg, rgba(255, 251, 244, 0.96), rgba(255, 247, 236, 0.92));
    border: 1px solid rgba(31, 36, 48, 0.08);
    box-shadow: 0 16px 34px rgba(80, 54, 35, 0.12);
}

.lobby-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.invite-screen {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 80px);
}

.invite-card {
    width: min(100%, 520px);
    padding: 28px;
}

.invite-copy {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.7;
}

.invite-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.form-feedback {
    margin: 2px 0 0;
    font-size: 0.92rem;
    line-height: 1.5;
}

.form-feedback.is-error {
    color: #b43d2a;
}

.form-feedback.is-info {
    color: var(--felt);
}

.card,
.info-card,
.board-panel,
.side-panel,
.room-topbar {
    padding: 24px;
}

.card-heading {
    margin-bottom: 20px;
}

.stack-form {
    display: grid;
    gap: 14px;
}

body.chat-disabled .chat-card {
    display: none !important;
}

.stack-form label,
.status-block {
    display: grid;
    gap: 8px;
}

input {
    width: 100%;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(31, 36, 48, 0.12);
    border-radius: 16px;
    padding: 14px 16px;
    font: inherit;
    color: var(--ink);
}

#join-room-code {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 800;
    text-align: center;
}

.featured-name-input {
    background: #fffdf8;
    border: 2px solid rgba(217, 109, 63, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 26px rgba(80, 54, 35, 0.08);
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    font-weight: 800;
    padding: 18px;
}

input:focus,
button:focus-visible {
    outline: 3px solid rgba(45, 106, 97, 0.24);
    outline-offset: 2px;
}

button {
    border: 0;
    font: inherit;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

button:hover {
    transform: translateY(-1px);
}

.primary-button,
.secondary-button,
.ghost-button,
.block-button,
.move-button {
    border-radius: 999px;
    padding: 14px 18px;
    font-weight: 800;
}

.primary-button {
    color: white;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 14px 28px rgba(185, 82, 39, 0.26);
}

.play-button {
    min-height: 66px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.44);
    box-shadow: 0 20px 38px rgba(185, 82, 39, 0.34);
    font-size: 1.12rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

#entry-submit-button {
    width: 100%;
    min-height: 66px;
    border: 1px solid rgba(255, 255, 255, 0.44);
    box-shadow: 0 20px 38px rgba(80, 54, 35, 0.22);
    font-size: 1.12rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

#entry-submit-button.primary-button,
#entry-submit-button.secondary-button {
    color: white;
}

.secondary-button {
    color: white;
    background: linear-gradient(135deg, var(--felt), #234d46);
    box-shadow: 0 14px 28px rgba(35, 77, 70, 0.22);
}

.ghost-button {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(31, 36, 48, 0.08);
    padding-inline: 16px;
}

.flow-list {
    margin: 0;
    padding-left: 18px;
    line-height: 1.8;
    color: var(--muted);
}

.room-topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
}

.room-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.room-grid {
    grid-template-columns: minmax(286px, 340px) minmax(720px, 1fr);
}

.room-screen.room-grid {
    align-items: start;
}

.room-sidebar {
    order: -1;
}

.board-panel {
    display: grid;
    gap: 22px;
}

.board-panel-immersive {
    min-height: calc(100vh - 36px);
    align-content: start;
    padding: 14px;
    gap: 0;
}

.board-mobile-hud,
.board-menu-button,
.room-sidebar-mobile-head,
.room-sidebar-backdrop {
    display: none;
}

.board-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.board-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.board-status-meta {
    display: grid;
    justify-items: end;
    gap: 4px;
}

.win-loss-summary {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--muted);
    white-space: nowrap;
}

.board-hud-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.turn-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 22px;
    border: 1px solid rgba(31, 36, 48, 0.08);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.game-summary-card .turn-banner {
    padding: 12px 14px;
    border-radius: 16px;
}

.turn-banner.is-your-turn {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 36%),
        linear-gradient(140deg, rgba(255, 213, 146, 0.98), rgba(246, 157, 77, 0.96) 42%, rgba(219, 95, 54, 0.94));
    border-color: rgba(182, 81, 35, 0.54);
    box-shadow: inset 0 1px 0 rgba(255, 247, 236, 0.8), 0 16px 34px rgba(190, 91, 36, 0.24);
}

.turn-banner.is-opponent-turn {
    background: linear-gradient(135deg, rgba(246, 247, 249, 0.78), rgba(219, 224, 231, 0.94));
    border-color: rgba(108, 118, 131, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 22px rgba(31, 36, 48, 0.06);
}

.turn-banner.is-finished {
    background: linear-gradient(135deg, rgba(217, 109, 63, 0.16), rgba(255, 255, 255, 0.92));
    border-color: rgba(217, 109, 63, 0.28);
}

.turn-indicator {
    display: block;
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.5rem, 2vw, 2rem);
    line-height: 1;
}

.turn-indicator.with-player-stone,
.board-mobile-turn-indicator.with-player-stone {
    display: inline-flex;
    align-items: center;
    gap: 0.42em;
}

.board-mobile-turn .board-mobile-turn-indicator.with-player-stone {
    display: flex;
    width: 100%;
    justify-content: flex-end;
}

.turn-indicator.with-player-stone::before,
.board-mobile-turn-indicator.with-player-stone::before {
    content: '';
    flex: none;
    width: 0.78em;
    height: 0.78em;
    border-radius: 999px;
    border: 1px solid rgba(31, 36, 48, 0.2);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.32), 0 3px 8px rgba(15, 20, 28, 0.16);
    background-image:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 58%),
        radial-gradient(circle at 54% 78%, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0) 66%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 42%, rgba(0, 0, 0, 0.12));
    background-color: var(--turn-indicator-stone, rgba(31, 36, 48, 0.18));
}

.turn-indicator.with-player-stone.player-white,
.board-mobile-turn-indicator.with-player-stone.player-white {
    --turn-indicator-stone: var(--white-checker);
}

.turn-indicator.with-player-stone.player-black,
.board-mobile-turn-indicator.with-player-stone.player-black {
    --turn-indicator-stone: var(--black-checker);
}

.game-summary-card .turn-indicator {
    font-size: 1.22rem;
}

.turn-indicator-copy {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.turn-banner.is-your-turn .turn-indicator,
.turn-banner.is-your-turn .turn-indicator-copy {
    color: #4f2711;
}

.turn-banner.is-opponent-turn .turn-indicator {
    color: rgba(31, 36, 48, 0.78);
}

.turn-banner.is-opponent-turn .turn-indicator-copy {
    color: rgba(74, 83, 95, 0.82);
}

.game-summary-card .turn-indicator-copy {
    margin-top: 5px;
    font-size: 0.82rem;
    line-height: 1.35;
}

.room-message-compact {
    max-width: none;
    font-size: 0.88rem;
    line-height: 1.4;
}

.code-badge-compact {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.86rem;
    letter-spacing: 0.14em;
}

.room-code-title {
    cursor: pointer;
    font-weight: 900;
}

.room-code-title:hover {
    background: rgba(255, 255, 255, 0.96);
}

.viewer-badge {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(31, 36, 48, 0.08);
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--muted);
    white-space: nowrap;
}

.hud-button {
    padding: 10px 14px;
    font-size: 0.84rem;
    box-shadow: none;
}

.stacked-button {
    display: inline-grid;
    justify-items: center;
    gap: 2px;
    min-height: 44px;
    line-height: 1.05;
}

.stacked-button small {
    display: block;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    opacity: 0.72;
    text-transform: uppercase;
}

.dice-strip-floating {
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
}

.game-summary-card .dice-strip {
    grid-column: 1 / -1;
}

.dice-strip-floating .dice-launcher {
    justify-content: space-between;
    width: 100%;
}

.dice-strip-floating .die {
    width: 42px;
    height: 42px;
    padding: 6px;
    font-size: 0.94rem;
}

.dice-strip-floating .pip,
.dice-strip-floating .die-placeholder {
    width: 7px;
    height: 7px;
}

.dice-strip-floating .die-placeholder {
    width: 18px;
    height: 18px;
}

.board-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.seat-pill {
    background: rgba(255, 255, 255, 0.78);
    padding: 14px 18px;
    border: 1px solid rgba(31, 36, 48, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    min-height: 56px;
}

.seat-pill.active-seat {
    border-color: rgba(45, 106, 97, 0.32);
    box-shadow: inset 0 0 0 1px rgba(45, 106, 97, 0.18), 0 0 0 6px rgba(45, 106, 97, 0.08);
}

.seat-pill.you-seat {
    background: linear-gradient(135deg, rgba(255, 250, 240, 0.95), rgba(255, 255, 255, 0.72));
}

.dice-panel {
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 24px;
    padding: 14px 18px;
    text-align: center;
}

.dice-strip,
.move-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dice-launcher,
.dice-pair {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dice-launcher {
    padding: 8px 10px 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(31, 36, 48, 0.1);
    box-shadow: 0 12px 24px rgba(31, 36, 48, 0.08);
}

.dice-launcher:hover {
    background: rgba(255, 255, 255, 0.94);
}

.dice-launcher:disabled {
    cursor: progress;
    transform: none;
}

.dice-launcher.is-rolling {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(241, 234, 217, 0.92));
}

.dice-launcher-label {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-strong);
    padding-inline: 6px 2px;
}

.dice-pair-muted {
    opacity: 0.48;
}

.die {
    width: 50px;
    height: 50px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 7px;
    border-radius: 18%;
    background: linear-gradient(180deg, #fffef9, #eee2c7);
    border: 1px solid rgba(31, 36, 48, 0.14);    
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.96),
        inset 0 -2px 0 rgba(125, 96, 52, 0.08),
        1px 2px 0 rgba(31, 36, 48, 0.1),
        3px 6px 10px rgba(31, 36, 48, 0.14);
    font-weight: 800;
    font-size: 1.08rem;
}

.die-value {
    background: linear-gradient(180deg, #fffef9, #f2e7cf);
}

.die-empty {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(241, 234, 217, 0.52));
    border-style: dashed;
}

.dice-launcher.is-rolling .die {
    animation: die-shake 520ms linear infinite;
}

.dice-launcher.is-rolling .die:nth-child(2n) {
    animation-direction: reverse;
    animation-duration: 460ms;
}

.pip,
.die-placeholder {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    align-self: center;
    justify-self: center;
}

.pip {
    background: #202a35;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.die-placeholder {
    width: 22px;
    height: 22px;
    border: 2px dashed rgba(31, 36, 48, 0.2);
    background: transparent;
    grid-column: 2;
    grid-row: 2;
}

.pip-1 {
    grid-column: 1;
    grid-row: 1;
}

.pip-3 {
    grid-column: 3;
    grid-row: 1;
}

.pip-4 {
    grid-column: 1;
    grid-row: 2;
}

.pip-5 {
    grid-column: 2;
    grid-row: 2;
}

.pip-6 {
    grid-column: 3;
    grid-row: 2;
}

.pip-7 {
    grid-column: 1;
    grid-row: 3;
}

.pip-9 {
    grid-column: 3;
    grid-row: 3;
}

.board-scroll {
    overflow-x: auto;
    padding-bottom: 8px;
}

.board-panel-immersive .board-scroll {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex: 1 1 auto;
}

.board-fit-stage {
    width: max-content;
    margin-inline: auto;
    position: relative;
}

.board-fit-stage.is-fitted {
    --board-scale: 1;
    overflow: hidden;
}

.board-fit-stage.is-fitted .board-frame {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    transform: scale(var(--board-scale));
}

.board-frame {
    display: grid;
    gap: 12px;
    min-width: 980px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 12%),
        linear-gradient(135deg, var(--wood-light), var(--wood-mid) 45%, var(--wood-dark));
    border-radius: 26px;
    padding: 18px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), inset 0 20px 28px rgba(255, 255, 255, 0.08);
    transition: box-shadow 180ms ease, transform 180ms ease;
    position: relative;
}

.board-frame::after {
    content: '';
    position: absolute;
    inset: -6px;
    border: 6px solid transparent;
    border-radius: 32px;
    opacity: 0;
    pointer-events: none;
    transition: border-color 180ms ease, opacity 180ms ease;
}

.board-frame.turn-white {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), inset 0 20px 28px rgba(255, 255, 255, 0.08), 0 18px 36px rgba(31, 36, 48, 0.16);
}

.board-frame.turn-black {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), inset 0 20px 28px rgba(255, 255, 255, 0.08), 0 18px 36px rgba(31, 36, 48, 0.18);
}

.board-frame.game-finished {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), inset 0 20px 28px rgba(255, 255, 255, 0.08), 0 18px 36px rgba(185, 82, 39, 0.16);
}

.board-frame.turn-white::after {
    border-color: var(--white-checker);
    opacity: 0.46;
}

.board-frame.turn-black::after {
    border-color: var(--black-checker);
    opacity: 0.32;
}

.board-frame.game-finished::after {
    border-color: rgba(217, 109, 63, 0.26);
    opacity: 1;
}

.lane {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr) 84px;
    gap: 12px;
}

.point-group {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.slot-button,
.point {
    position: relative;
    background: rgba(26, 31, 39, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    overflow: hidden;
}

.slot-button {
    border-radius: 20px;
}

.bar-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 246px;
    background: linear-gradient(180deg, rgba(31, 36, 48, 0.14), rgba(255, 255, 255, 0.06));
}

.off-slot {
    min-height: 246px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(31, 36, 48, 0.14));
}

.point {
    border-radius: 18px;
    min-height: 246px;
    padding: 8px 8px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bottom-point {
    flex-direction: column-reverse;
    padding: 12px 8px 8px;
}

.point::before {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    height: calc(100% - 16px);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.point.top-point::before {
    top: 8px;
    clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
}

.point.bottom-point::before {
    bottom: 8px;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.point-group .point.top-point:nth-child(odd)::before {
    background: linear-gradient(180deg, var(--board-point-light-base), var(--board-point-light));
}

.point-group .point.bottom-point:nth-child(odd)::before {
    background: linear-gradient(180deg, var(--board-point-light), var(--board-point-light-base));
}

.point-group .point.top-point:nth-child(even)::before {
    background: linear-gradient(180deg, var(--board-point-dark-base), var(--board-point-dark));
}

.point-group .point.bottom-point:nth-child(even)::before {
    background: linear-gradient(180deg, var(--board-point-dark), var(--board-point-dark-base));
}

.point-label {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.78);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    margin-inline: auto;
}

.checker-stack {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 6px;
    min-height: 170px;
}

.top-point .checker-stack,
.slot-top .checker-stack {
    flex-direction: column;
    justify-content: flex-start;
}

.bottom-point .checker-stack,
.slot-bottom .checker-stack {
    flex-direction: column-reverse;
    justify-content: flex-start;
}

.checker {
    width: 100%;
    aspect-ratio: 1;
    max-width: 50px;
    border-radius: 999px;
    margin-inline: auto;
    box-shadow:
        inset 0 2px 3px var(--checker-surface-shine),
        inset 0 -6px 10px var(--checker-inner-shadow),
        0 10px 16px var(--checker-drop-shadow);
    border: 2px solid var(--checker-border-color);
    position: relative;
}

.checker.white,
.player-color-swatch.white {
    --checker-base-color: var(--white-checker);
}

.checker.black,
.player-color-swatch.black {
    --checker-base-color: var(--black-checker);
}

.checker.white,
.checker.black,
.player-color-swatch.white,
.player-color-swatch.black {
    background-color: var(--checker-base-color);
    background-image:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, var(--checker-gloss-opacity)), rgba(255, 255, 255, 0) var(--checker-gloss-fade)),
        radial-gradient(circle at 54% 78%, rgba(0, 0, 0, var(--checker-shadow-opacity)), rgba(0, 0, 0, 0) var(--checker-shadow-fade)),
        radial-gradient(circle at top left, rgba(255, 255, 255, var(--checker-highlight-opacity)), rgba(255, 255, 255, 0) var(--checker-highlight-fade)),
        linear-gradient(145deg, rgba(255, 255, 255, var(--checker-top-wash-opacity)), rgba(255, 255, 255, 0) 42%, rgba(0, 0, 0, var(--checker-bottom-wash-opacity)));
}

.opponent-flying-checker {
    position: fixed;
    z-index: 80;
    display: block;
    pointer-events: none;
    margin: 0;
    opacity: 0.95;
    will-change: transform, opacity;
    filter: drop-shadow(0 18px 18px rgba(15, 20, 28, 0.28));
}

.point.you-piece-home::after,
.slot-button.you-piece-home::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 16px;
    border: 2px solid transparent;
    pointer-events: none;
    z-index: 1;
}

.slot-button.you-piece-home::after {
    border-radius: 18px;
}

.point.you-piece-white::after,
.slot-button.you-piece-white::after {
    border-color: var(--white-checker);
    opacity: 0.38;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.point.you-piece-black::after,
.slot-button.you-piece-black::after {
    border-color: var(--black-checker);
    opacity: 0.34;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.checker.more::after {
    content: attr(data-count);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--ink);
}

.checker.black.more::after {
    color: white;
}

body.room-mode.viewing-as-white .point.opponent-piece-black:hover,
body.room-mode.viewing-as-white .slot-button.opponent-piece-black:hover,
body.room-mode.viewing-as-black .point.opponent-piece-white:hover,
body.room-mode.viewing-as-black .slot-button.opponent-piece-white:hover {
    cursor: not-allowed;
}

body.room-mode .point.destination-highlight:hover,
body.room-mode .slot-button.destination-highlight:hover {
    cursor: pointer;
}

body.room-mode.viewing-as-white .point.opponent-piece-black.destination-highlight:hover,
body.room-mode.viewing-as-white .slot-button.opponent-piece-black.destination-highlight:hover,
body.room-mode.viewing-as-black .point.opponent-piece-white.destination-highlight:hover,
body.room-mode.viewing-as-black .slot-button.opponent-piece-white.destination-highlight:hover {
    cursor: pointer !important;
}

.selectable-origin {
    box-shadow: inset 0 0 0 3px rgba(52, 143, 111, 0.9), 0 0 0 7px rgba(75, 168, 131, 0.26);
}

.point.you-piece-home:not(.selectable-origin):not(.selected-origin):not(.destination-highlight)::after,
.slot-button.you-piece-home:not(.selectable-origin):not(.selected-origin):not(.destination-highlight)::after {
    border-color: rgba(190, 78, 62, 0.9);
    opacity: 0.9;
    box-shadow: inset 0 0 0 1px rgba(255, 236, 232, 0.24);
}

.selected-origin {
    box-shadow: inset 0 0 0 3px rgba(45, 106, 97, 0.72), 0 0 0 7px rgba(45, 106, 97, 0.18);
}

.destination-highlight {
    box-shadow: inset 0 0 0 3px rgba(255, 217, 74, 0.94), 0 0 0 8px rgba(255, 219, 96, 0.45);
}

.point.opponent-move-from,
.slot-button.opponent-move-from {
    animation: opponent-move-origin 1360ms ease-out;
}

.point.opponent-move-to,
.slot-button.opponent-move-to {
    animation: opponent-move-target 1440ms cubic-bezier(0.22, 1, 0.36, 1);
}

.point.opponent-move-to .checker-stack,
.slot-button.opponent-move-to .checker-stack {
    animation: opponent-checker-pop 840ms ease-out;
}

.dice-pair.opponent-roll-visible .die {
    animation: opponent-dice-reveal 1800ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dice-pair.opponent-roll-visible .die:nth-child(2) {
    animation-delay: 160ms;
}

@keyframes opponent-move-origin {
    0% {
        box-shadow: inset 0 0 0 3px rgba(255, 147, 128, 0.86), 0 0 0 10px rgba(226, 106, 81, 0.34);
    }

    100% {
        box-shadow: none;
    }
}

@keyframes opponent-move-target {
    0% {
        box-shadow: inset 0 0 0 3px rgba(82, 183, 146, 0.9), 0 0 0 12px rgba(82, 183, 146, 0.34);
    }

    100% {
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    }
}

@keyframes opponent-checker-pop {
    0% {
        transform: translateY(-8px) scale(0.96);
        opacity: 0.65;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes opponent-dice-reveal {
    0% {
        transform: translateY(-8px) rotate(-7deg) scale(0.9);
        box-shadow: 0 0 0 0 rgba(255, 219, 96, 0.0), 0 10px 16px rgba(15, 20, 28, 0.16);
    }

    45% {
        transform: translateY(0) rotate(3deg) scale(1.08);
        box-shadow: 0 0 0 8px rgba(255, 219, 96, 0.28), 0 14px 20px rgba(15, 20, 28, 0.20);
    }

    100% {
        transform: translateY(0) rotate(0) scale(1);
        box-shadow: 0 10px 16px rgba(15, 20, 28, 0.16);
    }
}

@media (prefers-reduced-motion: reduce) {
    .point.opponent-move-from,
    .slot-button.opponent-move-from,
    .point.opponent-move-to,
    .slot-button.opponent-move-to,
    .point.opponent-move-to .checker-stack,
    .slot-button.opponent-move-to .checker-stack,
    .dice-pair.opponent-roll-visible .die {
        animation: none;
    }
}

.slot-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    justify-items: center;
    align-items: stretch;
    gap: 12px;
    padding: 12px 8px;
    height: 100%;
}

.slot-meta {
    display: grid;
    justify-items: center;
    gap: 2px;
}

.slot-label {
    font-size: 0.72rem;
    line-height: 1.1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.slot-color {
    font-size: 0.62rem;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.72);
}

.slot-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.72rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.94);
}

.off-slot .slot-label {
    color: rgba(31, 36, 48, 0.76);
}

.off-slot .slot-color {
    color: rgba(31, 36, 48, 0.62);
}

.off-slot .slot-count {
    background: rgba(31, 36, 48, 0.08);
    color: rgba(31, 36, 48, 0.84);
}

.slot-stack {
    width: 100%;
    align-self: stretch;
}

.slot-stack .checker {
    max-width: 40px;
}

.selection-panel,
.side-panel {
    display: grid;
    gap: 12px;
    align-content: start;
}

.room-sidebar {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
}

.status-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(31, 36, 48, 0.08);
    min-height: 0;
}

.game-summary-card {
    gap: 8px;
}

.player-identity-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.player-identity-card.is-your-turn {
    border-color: rgba(45, 106, 97, 0.34);
    box-shadow: 0 0 0 4px rgba(45, 106, 97, 0.1);
}

.player-color-swatch {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: rgba(31, 36, 48, 0.14);
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3), 0 8px 14px rgba(15, 20, 28, 0.12);
}

.player-identity-copy {
    min-width: 0;
}

.player-identity-copy strong,
.player-identity-copy small {
    display: block;
}

.player-identity-copy strong {
    font-size: 1rem;
    line-height: 1.2;
}

.player-identity-copy small {
    margin-top: 4px;
    color: var(--muted);
    font-weight: 800;
    line-height: 1.35;
}

.scoreboard-head,
.chat-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.scoreboard-list {
    display: grid;
    gap: 8px;
}

.score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.score-row.is-active {
    border-color: rgba(45, 106, 97, 0.22);
    box-shadow: 0 0 0 4px rgba(45, 106, 97, 0.08);
}

.score-row.is-winner {
    border-color: rgba(217, 109, 63, 0.26);
    box-shadow: 0 0 0 4px rgba(217, 109, 63, 0.08);
}

.score-row-copy {
    display: grid;
    gap: 4px;
}

.score-row-color,
.score-row-meta,
.chat-status,
.chat-message-head span {
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.score-row-copy strong {
    font-size: 1rem;
}

.score-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(217, 109, 63, 0.16), rgba(255, 255, 255, 0.92));
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.45rem;
}

.chat-card {
    display: none !important;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
}

.chat-list {
    overflow-y: auto;
    display: grid;
    gap: 10px;
    padding-right: 6px;
    min-height: 0;
}

.chat-empty {
    margin: 0;
    color: var(--muted);
}

.chat-message {
    display: grid;
    gap: 4px;
    padding: 8px 9px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.chat-message.chat-white {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.88)),
        linear-gradient(135deg, var(--white-checker), var(--white-checker));
}

.chat-message.chat-black {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.26)),
        linear-gradient(135deg, var(--black-checker), var(--black-checker));
    color: white;
}

.chat-message.chat-black .chat-message-head span,
.chat-message.chat-black .chat-message-head strong {
    color: rgba(255, 255, 255, 0.92);
}

.chat-message.is-own {
    border-color: rgba(45, 106, 97, 0.22);
}

.chat-message.is-system {
    background: rgba(45, 106, 97, 0.12);
    border-style: dashed;
}

.chat-message-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chat-message-head strong {
    font-size: 0.92rem;
}

.chat-message p {
    margin: 0;
    line-height: 1.55;
}

.chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.chat-form input {
    min-width: 0;
}

.move-dock {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(31, 36, 48, 0.08);
    border-radius: 18px;
}

.selection-summary,
.room-message,
.rules-note p,
.link-field {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.move-button {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(31, 36, 48, 0.08);
    padding: 10px 14px;
    font-size: 0.86rem;
}

.move-button:hover {
    background: white;
}

.code-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0 20px;
    background: var(--panel-strong);
    border: 1px solid rgba(31, 36, 48, 0.08);
    letter-spacing: 0.18em;
    font-size: 1.2rem;
}

.block-button {
    width: 100%;
}

.block-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

[hidden],
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(20px);
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(31, 36, 48, 0.92);
    color: white;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@keyframes die-shake {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-1px) rotate(-7deg);
    }

    50% {
        transform: translateY(1px) rotate(8deg);
    }

    75% {
        transform: translateY(-1px) rotate(-5deg);
    }

    100% {
        transform: translateY(0) rotate(0deg);
    }
}

@media (max-width: 1180px) {

    body.room-sidebar-open {
        overflow: hidden;
    }

    body.room-mode .app-shell {
        padding: 0;
    }

    .lobby-grid,
    .room-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    body.room-mode .board-panel {
        background: transparent;
        border: 0;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    body.room-mode .board-panel-immersive {
        min-height: 100dvh;
        padding: 0;
        align-content: center;
    }

    body.room-mode .board-panel-immersive .board-scroll {
        min-height: 100dvh;
        padding: 0;
        align-items: center;
    }

    .board-mobile-hud {
        display: grid;
        grid-template-columns: 112px max-content minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        padding: 6px 8px;
        height: min(10dvh, 72px);
        max-height: min(10dvh, 72px);
        border-radius: 20px;
        background: linear-gradient(180deg, rgba(255, 248, 238, 0.94), rgba(255, 252, 246, 0.9));
        border: 1px solid rgba(255, 255, 255, 0.34);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 16px 32px rgba(80, 54, 35, 0.14);
    }

    .board-mobile-room-trigger {
        display: grid;
        align-content: center;
        justify-items: start;
        gap: 3px;
        width: 100%;
        height: 100%;
        min-height: 0;
        min-width: 0;
        padding: 0 12px;
        border-radius: 16px;
        border: 1px solid rgba(31, 36, 48, 0.08);
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 10px 22px rgba(31, 36, 48, 0.08);
        text-align: left;
    }

    .board-mobile-room-code {
        display: block;
        width: auto;
        min-width: 0;
        font-size: 0.92rem;
        letter-spacing: 0.12em;
        line-height: 1;
        white-space: nowrap;
    }

    .board-mobile-room-menu-label {
        display: block;
        font-size: 0.62rem;
        font-weight: 900;
        letter-spacing: 0.18em;
        line-height: 1;
        color: rgba(74, 83, 95, 0.78);
    }

    .board-mobile-turn {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        min-width: 0;
        height: 100%;
        min-height: 0;
        padding: 0 10px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(31, 36, 48, 0.08);
        box-shadow: 0 12px 24px rgba(31, 36, 48, 0.08);
        text-align: right;
    }

    .board-mobile-turn.is-your-turn {
        background:
            radial-gradient(circle at top left, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 38%),
            linear-gradient(140deg, rgba(255, 212, 146, 0.98), rgba(244, 154, 75, 0.96) 46%, rgba(219, 95, 54, 0.94));
        border-color: rgba(182, 81, 35, 0.42);
        box-shadow: inset 0 1px 0 rgba(255, 247, 236, 0.76), 0 10px 22px rgba(190, 91, 36, 0.2);
    }

    .board-mobile-turn.is-opponent-turn {
        background: linear-gradient(135deg, rgba(246, 247, 249, 0.76), rgba(219, 224, 231, 0.92));
        border-color: rgba(108, 118, 131, 0.18);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68), 0 10px 18px rgba(31, 36, 48, 0.06);
    }

    .board-mobile-turn-indicator {
        flex: 1 1 auto;
        min-width: 0;
        font-family: 'Fraunces', Georgia, serif;
        font-size: 0.98rem;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: right;
    }

    .board-mobile-turn-copy {
        display: none;
    }

    .board-mobile-turn.is-your-turn .board-mobile-turn-indicator,
    .board-mobile-turn.is-your-turn .board-mobile-turn-copy {
        color: #4f2711;
    }

    .board-mobile-turn.is-opponent-turn .board-mobile-turn-indicator {
        color: rgba(31, 36, 48, 0.76);
    }

    .board-mobile-turn.is-opponent-turn .board-mobile-turn-copy {
        color: rgba(74, 83, 95, 0.8);
    }

    .board-mobile-dice {
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 6px;
        min-height: 0;
        height: 100%;
        width: fit-content;
        max-width: 100%;
        min-width: 0;
        padding: 0 10px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.86);
        border: 1px solid rgba(31, 36, 48, 0.08);
        box-shadow: 0 10px 22px rgba(31, 36, 48, 0.08);
    }

    .board-mobile-dice .dice-launcher,
    .board-mobile-dice .dice-pair {
        flex-wrap: nowrap;
        gap: 4px;
        justify-content: flex-start;
        width: auto;
        max-width: none;
    }

    .board-mobile-dice .die {
        width: 34px;
        height: 34px;
        padding: 5px;
    }

    .board-mobile-dice.has-double-dice .dice-launcher,
    .board-mobile-dice.has-double-dice .dice-pair {
        gap: 3px;
    }

    .board-mobile-dice.has-double-dice .die {
        width: 28px;
        height: 28px;
        padding: 4px;
    }

    .board-mobile-dice.has-double-dice .pip,
    .board-mobile-dice.has-double-dice .die-placeholder {
        width: 5px;
        height: 5px;
    }

    .board-mobile-dice.has-double-dice .die-placeholder {
        width: 12px;
        height: 12px;
    }

    .board-mobile-dice .pip,
    .board-mobile-dice .die-placeholder {
        width: 6px;
        height: 6px;
    }

    .board-mobile-dice .die-placeholder {
        width: 14px;
        height: 14px;
    }

    .board-mobile-dice .dice-launcher-label {
        display: none;
    }

    .board-mobile-dice .selection-summary {
        font-size: 0.72rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .room-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 60;
        background: rgba(18, 23, 31, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    .room-sidebar {
        order: 0;
        display: block;
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 70;
        max-height: min(78vh, 720px);
        overflow: auto;
        margin: 0;
        transform: translateY(calc(100% + 18px));
        opacity: 0;
        pointer-events: none;
        transition: transform 180ms ease, opacity 180ms ease;
        box-shadow: 0 24px 52px rgba(18, 23, 31, 0.28);
    }

    .room-sidebar-mobile-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        margin-bottom: 14px;
    }

    .room-sidebar-close-button {
        min-width: 96px;
    }

    body.room-sidebar-open .room-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.room-sidebar-open .room-sidebar {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .room-sidebar {
        display: block;
    }

    .room-sidebar .status-card + .status-card {
        margin-top: 10px;
    }
}

@media (max-width: 780px) {
    body.room-sidebar-open {
        overflow: hidden;
    }

    .board-hud,
    .board-status,
    .board-hud-actions {
        display: grid;
        justify-content: stretch;
        width: 100%;
    }

    .invite-card {
        padding: 22px;
    }

    .turn-banner,
    .scoreboard-head,
    .chat-head,
    .score-row,
    .chat-message-head,
    .chat-form {
        grid-template-columns: 1fr;
    }

    .turn-banner,
    .scoreboard-head,
    .chat-head,
    .score-row,
    .chat-message-head {
        display: grid;
    }

    .chat-form button {
        width: 100%;
    }

    .room-message-compact {
        max-width: none;
        white-space: normal;
    }

    .hero h1 {
        font-size: clamp(2rem, 10vw, 3.2rem);
    }

    body.room-mode .app-shell {
        padding: 0;
    }

    body.room-mode .board-panel-immersive {
        min-height: 100dvh;
        padding: 0;
    }

    .board-mobile-hud {
        gap: 6px;
        padding: 4px 6px;
        height: min(10dvh, 56px);
        max-height: min(10dvh, 56px);
        border-radius: 16px;
        grid-template-columns: 92px max-content minmax(0, 1fr);
    }

    .board-mobile-room-trigger {
        gap: 2px;
        padding: 0 8px;
        border-radius: 12px;
    }

    .board-mobile-room-code {
        font-size: 0.74rem;
        letter-spacing: 0.12em;
    }

    .board-mobile-room-menu-label {
        font-size: 0.52rem;
        letter-spacing: 0.14em;
    }

    .board-mobile-turn {
        gap: 4px;
        padding: 0 8px;
        border-radius: 12px;
    }

    .board-mobile-turn-indicator {
        font-size: 0.76rem;
    }

    .board-mobile-dice {
        gap: 4px;
        padding: 0 6px;
        border-radius: 12px;
    }

    .board-mobile-dice .dice-launcher,
    .board-mobile-dice .dice-pair {
        gap: 3px;
        width: auto;
    }

    .board-mobile-dice .die {
        width: 24px;
        height: 24px;
        padding: 4px;
    }

    .board-mobile-dice .pip,
    .board-mobile-dice .die-placeholder {
        width: 4px;
        height: 4px;
    }

    .board-mobile-dice .die-placeholder {
        width: 10px;
        height: 10px;
    }

    .board-mobile-dice.has-double-dice .die {
        width: 19px;
        height: 19px;
        padding: 3px;
    }

    .board-mobile-dice.has-double-dice .pip,
    .board-mobile-dice.has-double-dice .die-placeholder {
        width: 3px;
        height: 3px;
    }

    .board-mobile-dice.has-double-dice .die-placeholder {
        width: 8px;
        height: 8px;
    }

    .room-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 60;
        background: rgba(18, 23, 31, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    .room-sidebar {
        order: 0;
        display: block;
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 70;
        max-height: min(78vh, 720px);
        overflow: auto;
        margin: 0;
        transform: translateY(calc(100% + 18px));
        opacity: 0;
        pointer-events: none;
        transition: transform 180ms ease, opacity 180ms ease;
        box-shadow: 0 24px 52px rgba(18, 23, 31, 0.28);
    }

    .room-sidebar-mobile-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        margin-bottom: 14px;
    }

    .room-sidebar-close-button {
        min-width: 96px;
    }

    body.room-sidebar-open .room-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.room-sidebar-open .room-sidebar {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .room-sidebar {
        display: block;
    }

    .room-sidebar .status-card + .status-card {
        margin-top: 10px;
    }
}
