@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;
    --white-checker: #fffaf0;
    --black-checker: #26313d;
    --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;
}

.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: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 30px;
    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, 4.4rem);
    max-width: 16ch;
}

.hero-copy {
    color: var(--muted);
    max-width: 64ch;
    line-height: 1.65;
    margin: 16px 0 0;
}

.hero-side {
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 250px;
}

.hero-chip,
.code-badge,
.die,
.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-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;
}

.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);
}

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 {
    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);
}

.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(0, 1.85fr) minmax(320px, 0.75fr);
}

.room-screen.room-grid {
    align-items: start;
}

.board-panel {
    display: grid;
    gap: 22px;
}

.board-panel-immersive {
    min-height: calc(100vh - 36px);
    align-content: start;
    padding: 14px;
    gap: 14px;
}

.board-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.board-status {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.board-hud-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.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);
}

.turn-banner.is-your-turn {
    background: linear-gradient(135deg, rgba(45, 106, 97, 0.18), rgba(255, 255, 255, 0.92));
    border-color: rgba(45, 106, 97, 0.26);
}

.turn-banner.is-opponent-turn {
    background: linear-gradient(135deg, rgba(31, 36, 48, 0.08), rgba(255, 255, 255, 0.88));
}

.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-copy {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.room-message-compact {
    max-width: 34ch;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.code-badge-compact {
    min-height: 42px;
    padding: 0 14px;
    font-size: 0.92rem;
    letter-spacing: 0.14em;
}

.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;
}

.dice-strip-floating {
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
}

.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;
    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), 0 6px 16px rgba(31, 36, 48, 0.1);
    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: center;
    justify-content: center;
    flex: 1 1 auto;
}

.board-frame {
    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;
}

.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 0 0 6px rgba(245, 233, 208, 0.56), 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 0 0 6px rgba(38, 49, 61, 0.28), 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 0 0 6px rgba(217, 109, 63, 0.26), 0 18px 36px rgba(185, 82, 39, 0.16);
}

.lane {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr) 84px;
    gap: 12px;
}

.lane + .lane {
    margin-top: 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;
}

.point::before {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    height: calc(100% - 46px);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.point.top-point::before {
    top: 8px;
    background: linear-gradient(180deg, #f7dca8, rgba(255, 255, 255, 0.45));
}

.point.bottom-point::before {
    bottom: 8px;
    transform: rotate(180deg);
    background: linear-gradient(180deg, #203340, rgba(255, 255, 255, 0.14));
}

.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 1px 2px rgba(255, 255, 255, 0.32), 0 8px 14px rgba(15, 20, 28, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.28);
    position: relative;
}

.checker.white {
    background: radial-gradient(circle at top left, white, #f5e9d0 68%);
}

.checker.black {
    background: radial-gradient(circle at top left, #516276, var(--black-checker) 68%);
}

.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;
}

.selectable-origin {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.38), 0 0 0 5px rgba(255, 240, 201, 0.2);
}

.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(217, 109, 63, 0.72), 0 0 0 7px rgba(217, 109, 63, 0.2);
}

.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: 18px;
    align-content: start;
}

.room-sidebar {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    overflow: hidden;
}

.status-card {
    display: grid;
    gap: 14px;
    padding: 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.scoreboard-head,
.chat-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.scoreboard-list {
    display: grid;
    gap: 12px;
}

.score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 22px;
    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: 52px;
    min-height: 52px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(217, 109, 63, 0.16), rgba(255, 255, 255, 0.92));
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.8rem;
}

.chat-card {
    grid-template-rows: auto minmax(220px, 1fr) auto;
    min-height: 430px;
}

.chat-list {
    overflow-y: auto;
    display: grid;
    gap: 10px;
    padding-right: 6px;
}

.chat-empty {
    margin: 0;
    color: var(--muted);
}

.chat-message {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 18px;
    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, 250, 240, 0.96), rgba(255, 255, 255, 0.9));
}

.chat-message.chat-black {
    background: linear-gradient(135deg, rgba(38, 49, 61, 0.94), rgba(70, 82, 97, 0.92));
    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 {
    display: none;
}

.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) {
    .lobby-grid,
    .room-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        flex-direction: column;
    }

    .room-sidebar {
        position: static;
        max-height: none;
    }
}

@media (max-width: 780px) {
    .app-shell {
        padding: 18px;
    }

    .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);
    }
}