@font-face {
    font-family: "RubikLocal";
    src: url("../fonts/Rubik-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}

:root {
    --bg-overlay: rgba(14, 28, 18, 0.72);
    --panel: rgba(88, 45, 15, 0.88);
    --panel-border: rgba(255, 235, 200, 0.18);
    --panel-light: rgba(120, 62, 18, 0.92);
    --text: #fff8ea;
    --muted: #f0d9b5;
    --accent: #f3b230;
    --accent-strong: #f59f00;
    --success: #43d97d;
    --danger: #ff7a84;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "RubikLocal", sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(7, 22, 11, 0.68), rgba(7, 22, 11, 0.78)),
        url("../img/garden-bg.jpg");
    background-size: 680px auto;
    background-repeat: repeat;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.app-body {
    min-height: 100vh;
}

.home-shell,
.join-shell,
.status-shell,
.room-shell {
    width: min(100%, 1200px);
    margin: 0 auto;
    padding: 24px 20px 34px;
}

.home-shell,
.join-shell,
.status-shell {
    display: grid;
    justify-items: center;
}

.home-hero,
.join-title {
    text-align: center;
}

.home-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.home-brand__icon {
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
}

.home-brand h1,
.join-title h1,
.status-card h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 400;
}

.home-hero p,
.join-title p,
.home-footnote,
.join-footnote,
.status-card p {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: clamp(0.95rem, 1.5vw, 1.08rem);
}

.card {
    width: 100%;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(4px);
}

.home-card {
    max-width: 620px;
    margin-top: 26px;
    padding: 24px;
}

.home-card h2,
.join-card h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 400;
}

.home-form,
.join-form-block {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.home-form label,
.join-form-block label,
.room-label {
    font-size: 0.95rem;
    color: #ffe8c2;
    letter-spacing: 0.05em;
}

.home-form input,
.home-form select,
.join-form-block input {
    width: 100%;
    min-height: 54px;
    border-radius: 14px;
    border: 1px solid rgba(255, 230, 176, 0.28);
    background: rgba(68, 36, 12, 0.95);
    color: var(--text);
    padding: 0 14px;
}

.home-form input::placeholder,
.join-form-block input::placeholder {
    color: rgba(255, 234, 197, 0.58);
}

.home-form select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #ffd790 50%),
        linear-gradient(135deg, #ffd790 50%, transparent 50%);
    background-position:
        calc(100% - 20px) 24px,
        calc(100% - 14px) 24px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.home-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin: 24px 0 14px;
}

.home-divider span {
    height: 1px;
    background: rgba(255, 226, 171, 0.28);
}

.home-divider p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.btn {
    border: 0;
    border-radius: 14px;
    min-height: 54px;
    color: #fff;
    cursor: pointer;
    transition: transform 140ms ease, opacity 140ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn--create {
    margin-top: 6px;
    background: linear-gradient(120deg, #2fbf7e, #149056);
}

.btn--join {
    margin-top: 8px;
    background: linear-gradient(120deg, #f6af2f, #e07c08);
}

.color-slider {
    margin-top: 6px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 12px;
}

.color-slider__arrow {
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 220, 160, 0.2);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.color-slider__card {
    position: relative;
    min-height: 94px;
    border-radius: 14px;
    border: 1px solid rgba(255, 220, 160, 0.28);
    background: rgba(69, 35, 11, 0.82);
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 10px;
    padding: 12px;
}

.color-slider__swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.16) inset;
}

.color-slider__card strong {
    font-size: 1.05rem;
    font-weight: 400;
}

.color-slider__taken {
    position: absolute;
    top: 8px;
    right: 8px;
    min-height: 24px;
    padding: 2px 8px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    background: rgba(197, 56, 67, 0.95);
    color: #fff;
    font-size: 0.78rem;
}

.color-slider__taken.is-hidden {
    display: none;
}

.join-shell {
    padding-top: 60px;
}

.join-card {
    max-width: 620px;
    margin-top: 24px;
    padding: 28px;
}

.join-card__note {
    margin: 16px 0 0;
    text-align: center;
    color: #ffdfaf;
}

.room-shell {
    width: min(100%, 1460px);
}

.room-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.room-topbar__back {
    color: #ffe2b0;
}

.room-topbar__right {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.room-connection {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffe8c8;
}

.room-connection__dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #42d47b;
    box-shadow: 0 0 12px rgba(66, 212, 123, 0.7);
}

.room-viewers {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(104, 52, 17, 0.85);
    border: 1px solid rgba(255, 220, 160, 0.28);
    color: #ffeccd;
}

.room-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 20px;
}

.room-panel {
    padding: 22px;
}

.room-section + .room-section {
    margin-top: 20px;
}

.room-code-box {
    margin-top: 10px;
    min-height: 58px;
    border-radius: 12px;
    background: rgba(69, 35, 11, 0.9);
    border: 1px solid rgba(255, 220, 160, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
}

.room-code-box strong {
    font-size: 1.08rem;
    letter-spacing: 0.16em;
    font-weight: 400;
}

.room-copy {
    border: 0;
    min-width: 100px;
    min-height: 40px;
    border-radius: 10px;
    background: rgba(255, 191, 64, 0.95);
    color: #4a2308;
    cursor: pointer;
}

.room-section h2 {
    margin: 8px 0 0;
    font-size: 1.08rem;
    font-weight: 400;
}

.room-hint {
    margin: 8px 0 0;
    color: #ffd9ab;
    font-size: 0.92rem;
}

.room-players {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.room-player-row {
    min-height: 58px;
    border-radius: 12px;
    border: 1px solid rgba(255, 220, 160, 0.2);
    background: rgba(70, 35, 12, 0.87);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.room-player-row.is-turn {
    border-color: rgba(110, 239, 162, 0.8);
    box-shadow: inset 0 0 0 1px rgba(110, 239, 162, 0.35);
}

.room-player-row.is-winner {
    border-color: rgba(255, 216, 88, 0.88);
    box-shadow: inset 0 0 0 1px rgba(255, 216, 88, 0.35);
}

.room-player-row__left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.room-player-row__dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    flex: 0 0 auto;
}

.room-player-row__identity {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.room-player-row__identity strong,
.room-player-row__identity span,
.room-player-row__right span,
.room-player-row__right small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-player-row__identity strong {
    font-weight: 400;
}

.room-player-row__identity span,
.room-player-row__right span {
    color: #ffd9ab;
    font-size: 0.88rem;
}

.room-player-row__right {
    display: grid;
    justify-items: end;
    gap: 2px;
    min-width: 84px;
}

.room-player-row__right small {
    color: #70ebb1;
    font-size: 0.79rem;
}

.room-player-waiting {
    margin: 4px 2px 0;
    color: #ffd9ab;
    font-size: 0.9rem;
}

.room-section--rules ul {
    margin: 12px 0 0;
    padding-left: 20px;
    color: #ffe3be;
    display: grid;
    gap: 8px;
}

.room-panel--board {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    justify-items: stretch;
    align-content: start;
}

.room-banner {
    width: min(100%, 560px);
    justify-self: center;
    min-height: 48px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: rgba(57, 116, 56, 0.88);
    border: 1px solid rgba(136, 245, 174, 0.35);
    color: #e8ffe3;
    font-size: clamp(1rem, 1.5vw, 1.16rem);
    text-align: center;
    padding: 8px 14px;
}

.room-banner.is-finished {
    background: rgba(160, 89, 12, 0.88);
    border-color: rgba(255, 209, 106, 0.44);
    color: #fff0c8;
}

.room-feedback {
    min-height: 38px;
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid transparent;
}

.room-feedback.is-hidden {
    display: none;
}

.room-feedback--info {
    background: rgba(63, 91, 145, 0.65);
    border-color: rgba(126, 167, 255, 0.45);
}

.room-feedback--ladder {
    background: rgba(48, 126, 75, 0.78);
    border-color: rgba(113, 238, 159, 0.5);
}

.room-feedback--snake {
    background: rgba(154, 62, 62, 0.78);
    border-color: rgba(255, 138, 138, 0.5);
}

.room-board-stage {
    width: min(100%, 780px, calc(100vh - 340px));
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    justify-items: stretch;
    justify-content: stretch;
    justify-self: center;
    gap: 12px;
}

.room-board-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    aspect-ratio: 1 / 1;
    border-radius: 22px;
    overflow: hidden;
    border: 12px solid #995214;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
    justify-self: stretch;
}

.snake-board {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #efcb86;
}

.snake-board__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
}

.snake-board__cells {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    z-index: 2;
    pointer-events: none;
}

.snake-board__cells--ghost .snake-cell {
    position: relative;
    background: transparent;
    border: 0;
    padding: 0;
}

.snake-board__cells--ghost .snake-cell__number {
    display: none;
}

.room-token-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}

.room-board-reaction {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 7;
}

.room-board-dock-row {
    width: fit-content;
    max-width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 6px;
    justify-self: center;
}

.room-token-dock {
    width: fit-content;
    min-width: 96px;
    max-width: min(100%, 172px);
    min-height: 58px;
    border-radius: 16px;
    border: 1px solid rgba(255, 220, 160, 0.28);
    background: rgba(100, 48, 14, 0.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 8px;
    flex-wrap: wrap;
    flex: 0 1 auto;
}

.room-token-dock.is-hidden {
    display: none;
}

.room-reaction-dock {
    width: 52px;
    min-height: 58px;
    border-radius: 16px;
    border: 1px solid rgba(255, 220, 160, 0.28);
    background: rgba(100, 48, 14, 0.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 3px;
    flex: 0 0 auto;
}

.room-token {
    --token-color: #ffffff;
    --token-size: 24px;
    position: absolute;
    width: var(--token-size);
    height: var(--token-size);
    border-radius: 50%;
    background: radial-gradient(circle at 28% 28%, #ffffff, var(--token-color) 65%);
    border: 2px solid rgba(255, 255, 255, 0.86);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    transition-property: left, top, transform, box-shadow;
    transition-timing-function: linear;
    z-index: 5;
}

.room-token__label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    line-height: 1;
    color: #121212;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.room-token--you {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.88), 0 0 20px rgba(255, 255, 255, 0.45);
}

.room-token--docked {
    position: static;
    transform: scale(0.76);
    transition-property: transform, box-shadow;
}

.room-token.is-climbing {
    animation: climbPulse 0.9s ease-in-out;
}

.room-token.is-sliding {
    animation: slidePulse 0.9s ease-in-out;
}

@keyframes climbPulse {
    0% {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    }
    40% {
        box-shadow: 0 0 18px rgba(122, 255, 164, 0.85);
    }
    100% {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    }
}

@keyframes slidePulse {
    0% {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    }
    40% {
        box-shadow: 0 0 18px rgba(255, 114, 114, 0.85);
    }
    100% {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    }
}

.room-board-footer {
    width: min(100%, 780px, calc(100vh - 340px));
    min-height: 84px;
    border-radius: 16px;
    border: 1px solid rgba(255, 220, 160, 0.28);
    background: rgba(100, 48, 14, 0.92);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    justify-self: center;
}

.dice-button {
    width: 86px;
    height: 86px;
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 140ms ease, opacity 140ms ease;
}

.dice-button:hover {
    transform: translateY(-1px);
}

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

.dice-button.is-rolling {
    transform: translateZ(0);
}

.dice-scene {
    --dice-size: 62px;
    width: 78px;
    height: 78px;
    display: block;
    position: relative;
    perspective: 700px;
    contain: layout;
}

.dice-scene::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -10px;
    width: 66px;
    height: 14px;
    border-radius: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(31, 20, 10, 0.54) 0%, rgba(31, 20, 10, 0) 75%);
    filter: blur(1px);
    pointer-events: none;
}

.dice-cube {
    width: var(--dice-size);
    height: var(--dice-size);
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: calc(var(--dice-size) / -2);
    margin-top: calc(var(--dice-size) / -2);
    transform-style: preserve-3d;
    transform: rotateX(-18deg) rotateY(28deg);
    will-change: transform;
    backface-visibility: hidden;
}

.dice-face {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    border: 2px solid #d7d7d7;
    background: linear-gradient(145deg, #ffffff 0%, #f7f2e6 65%, #e6d9bf 100%);
    box-shadow:
        inset 0 0 10px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.24);
    backface-visibility: hidden;
}

.dice-face--1 {
    transform: translateZ(calc(var(--dice-size) / 2));
}

.dice-face--2 {
    transform: rotateX(-90deg) translateZ(calc(var(--dice-size) / 2));
}

.dice-face--3 {
    transform: rotateY(90deg) translateZ(calc(var(--dice-size) / 2));
}

.dice-face--4 {
    transform: rotateY(-90deg) translateZ(calc(var(--dice-size) / 2));
}

.dice-face--5 {
    transform: rotateX(90deg) translateZ(calc(var(--dice-size) / 2));
}

.dice-face--6 {
    transform: rotateY(180deg) translateZ(calc(var(--dice-size) / 2));
}

.pip {
    position: absolute;
    width: calc(var(--dice-size) * 0.15);
    height: calc(var(--dice-size) * 0.15);
    border-radius: 50%;
    background: #1f1f1f;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.24);
}

.pip--tl {
    top: calc(var(--dice-size) * 0.2);
    left: calc(var(--dice-size) * 0.2);
}

.pip--tr {
    top: calc(var(--dice-size) * 0.2);
    right: calc(var(--dice-size) * 0.2);
}

.pip--ml {
    top: calc(50% - (var(--dice-size) * 0.075));
    left: calc(var(--dice-size) * 0.2);
}

.pip--mr {
    top: calc(50% - (var(--dice-size) * 0.075));
    right: calc(var(--dice-size) * 0.2);
}

.pip--bl {
    top: calc(var(--dice-size) * 0.65);
    left: calc(var(--dice-size) * 0.2);
}

.pip--br {
    top: calc(var(--dice-size) * 0.65);
    right: calc(var(--dice-size) * 0.2);
}

.pip--center {
    top: 50%;
    left: 50%;
    margin-left: calc(var(--dice-size) * -0.075);
    margin-top: calc(var(--dice-size) * -0.075);
}

.dice-button.is-rolling .dice-scene::after {
    animation: diceShadowBounce 920ms cubic-bezier(0.14, 0.9, 0.24, 1);
}

@keyframes diceShadowBounce {
    0% {
        transform: translateX(-50%) scale(0.8);
        opacity: 0.34;
    }
    22% {
        transform: translateX(-50%) scale(1.18);
        opacity: 0.56;
    }
    72% {
        transform: translateX(-50%) scale(1.04);
        opacity: 0.44;
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.42;
    }
}

.dice-value {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(70, 34, 12, 0.86);
    color: #fff8e6;
    font-size: 0.9rem;
    line-height: 1;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 230, 180, 0.35);
}

.dice-button.is-rolling .dice-value {
    animation: diceValueSpin 140ms linear infinite;
}

@keyframes diceValueSpin {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 0.88;
    }
    50% {
        transform: scale(1.08) rotate(9deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.88;
    }
}

.room-dice-meta {
    min-width: 0;
    display: grid;
    gap: 4px;
    text-align: left;
}

.room-dice-meta strong {
    font-weight: 400;
}

.room-dice-meta p {
    margin: 0;
    color: #ffe0b5;
    font-size: 0.92rem;
}

.room-reaction-btn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: rgba(73, 33, 8, 0.86);
    box-shadow: inset 0 0 0 1px rgba(255, 220, 160, 0.24);
    color: #fff;
    cursor: pointer;
    font-size: 1.14rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 120ms ease, opacity 120ms ease;
}

.room-reaction-btn:hover {
    transform: translateY(-1px);
}

.room-reaction-btn:disabled {
    opacity: 0.54;
    cursor: not-allowed;
    transform: none;
}

.room-emoji-mobile__trigger {
    display: inline-flex;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(73, 33, 8, 0.94);
    box-shadow: inset 0 0 0 1px rgba(255, 220, 160, 0.24);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    align-items: center;
    justify-content: center;
}

.room-emoji-mobile__trigger:disabled {
    opacity: 0.54;
    cursor: not-allowed;
}

.room-emoji-mobile__picker {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    width: 170px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(72, 33, 10, 0.98);
    border: 1px solid rgba(255, 220, 160, 0.24);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    z-index: 12;
}

.room-emoji-mobile__picker.is-hidden {
    display: none;
}

.reaction-float {
    position: absolute;
    left: 50%;
    bottom: 8%;
    transform: translateX(-50%);
    min-width: 122px;
    max-width: 240px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(68, 32, 10, 0.95);
    border: 1px solid rgba(255, 220, 160, 0.24);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
    text-align: center;
    animation: reactionFloatUp 2400ms ease-out forwards;
}

.reaction-float__emoji {
    display: block;
    font-size: 2rem;
    line-height: 1;
}

.reaction-float__name {
    display: block;
    margin-top: 8px;
    color: #ffe5bf;
    font-size: 0.86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes reactionFloatUp {
    0% {
        transform: translateX(-50%) translateY(22px) scale(0.9);
        opacity: 0;
    }
    16% {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 1;
    }
    74% {
        transform: translateX(-50%) translateY(-52px) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(-106px) scale(0.95);
        opacity: 0;
    }
}

.status-shell {
    padding-top: 90px;
}

.status-card {
    max-width: 540px;
    text-align: center;
    padding: 30px;
}

.status-card__button {
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
}

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

    .room-panel--info {
        order: 2;
    }

    .room-panel--board {
        order: 1;
    }

    .room-board-stage {
        width: min(100%, 720px, calc(100vh - 300px));
    }

    .room-board-footer {
        width: min(100%, 720px, calc(100vh - 300px));
    }
}

@media (max-width: 760px) {
    .home-shell,
    .join-shell,
    .status-shell,
    .room-shell {
        padding-left: 14px;
        padding-right: 14px;
    }

    .home-card,
    .join-card,
    .room-panel,
    .status-card {
        padding: 18px;
    }

    .color-slider {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        gap: 8px;
    }

    .color-slider__arrow {
        width: 42px;
        height: 42px;
    }

    .room-topbar {
        flex-wrap: wrap;
    }

    .room-topbar__right {
        margin-left: auto;
    }

    .room-board-stage {
        width: min(100%, 560px);
    }

    .room-board-wrap {
        border-width: 10px;
        border-radius: 18px;
    }

    .room-token-dock,
    .room-reaction-dock,
    .room-board-footer {
        border-radius: 12px;
    }

    .room-board-footer {
        min-height: 74px;
        padding: 8px 10px;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 10px;
    }

    .dice-button {
        width: 74px;
        height: 74px;
    }

    .dice-scene {
        --dice-size: 54px;
        width: 66px;
        height: 66px;
    }

}

@media (max-width: 680px) {
    .room-board-stage {
        width: 100%;
    }

    .room-board-dock-row {
        gap: 8px;
    }

    .room-token-dock {
        width: min(72vw, 240px);
        min-height: 60px;
        padding: 8px 9px;
        gap: 8px;
    }

    .room-reaction-dock {
        width: 58px;
        min-height: 60px;
    }

    .room-emoji-mobile__trigger {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .room-board-footer {
        width: min(100%, 560px);
        min-height: 74px;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .room-emoji-mobile__picker {
        right: 0;
        bottom: calc(100% + 8px);
    }
}

@media (max-width: 520px) {
    .home-brand h1,
    .join-title h1 {
        font-size: 1.86rem;
    }

    .home-form input,
    .home-form select,
    .join-form-block input,
    .btn {
        min-height: 50px;
    }

    .room-code-box {
        flex-wrap: wrap;
    }

    .room-copy {
        width: 100%;
    }

    .room-player-row {
        padding: 8px;
    }

    .room-player-row__identity strong {
        font-size: 0.94rem;
    }

    .room-player-row__identity span,
    .room-player-row__right span {
        font-size: 0.82rem;
    }

    .room-board-stage {
        width: 100%;
    }

    .room-token-dock {
        width: min(68vw, 220px);
        min-height: 52px;
        padding: 6px 8px;
        gap: 6px;
    }

    .room-token--docked {
        transform: scale(0.66);
    }

    .room-reaction-dock {
        width: 52px;
        min-height: 52px;
        padding: 4px;
    }

    .room-board-footer {
        width: 100%;
        align-items: center;
        gap: 8px;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .room-dice-meta {
        text-align: left;
    }

    .room-dice-meta p {
        font-size: 0.84rem;
    }

    .dice-button {
        width: 68px;
        height: 68px;
    }

    .dice-scene {
        --dice-size: 50px;
        width: 62px;
        height: 62px;
    }

    .room-emoji-mobile__trigger {
        width: 36px;
        height: 36px;
        font-size: 0.96rem;
    }

    .room-emoji-mobile__picker {
        width: 160px;
        right: 0;
    }
}
