:root {
    --sb-header-height: 62px;
    --sb-ink: #fff8dd;
    --sb-muted: #b9c8b8;
    --sb-dark: #10251b;
    --sb-green: #1d4d35;
    --sb-green-light: #387352;
    --sb-yellow: #f2d15f;
    --sb-red: #ba3e37;
    --sb-card-width: clamp(50px, calc((100dvh - 270px) * .13), 90px);
    --sb-card-height-factor: 1.538;
}

body[data-skipbo-room] {
    --game-ui-accent: var(--sb-yellow);
    --game-ui-panel: #123563f2;
    --game-ui-primary-background: var(--sb-yellow);
    --game-ui-primary-color: #172033;
}

@property --sb-light-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow: hidden;
    background: radial-gradient(ellipse 90% 80% at 0% 0%, #585dee30, transparent 72%), radial-gradient(ellipse 90% 80% at 100% 0%, #fa262030, transparent 72%), radial-gradient(ellipse 90% 80% at 0% 100%, #fbd70d2b, transparent 72%), radial-gradient(ellipse 90% 80% at 100% 100%, #02b8492b, transparent 72%), #050505;
    color: var(--sb-ink);
    font-family: Arial, Helvetica, sans-serif;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: default;
}

.sb-header {
    position: relative;
    z-index: 100;
    min-height: calc(var(--sb-header-height) + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 16px 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border-bottom: 1px solid #ffffff1c;
    background: #050505e8;
    backdrop-filter: blur(10px);
}

.sb-back,
.sb-brand {
    color: var(--sb-ink);
    text-decoration: none;
}

.sb-back {
    width: max-content;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: .8rem;
}

.sb-back svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.sb-brand {
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-brand img {
    display: block;
    width: auto;
    height: 48px;
    object-fit: contain;
}

.sb-info {
    width: 29px;
    height: 29px;
    padding: 0;
    justify-self: end;
    border: 1px solid #c5d9c8;
    border-radius: 50%;
    background: transparent;
    color: var(--sb-ink);
    font-family: Georgia, serif;
    font-size: 1rem;
}

#skipbo-app {
    height: calc(100vh - var(--sb-header-height) - env(safe-area-inset-top, 0px));
    height: calc(100dvh - var(--sb-header-height) - env(safe-area-inset-top, 0px));
    overflow: auto;
}

.sb-panel {
    width: min(440px, calc(100% - 28px));
    margin: clamp(28px, 8vh, 80px) auto 24px;
    padding: clamp(20px, 5vw, 32px);
    border: 1px solid #ffffff21;
    border-radius: 22px;
    background: linear-gradient(145deg, #1b1b1beb, #050505f2);
    text-align: center;
    box-shadow: 0 24px 60px #07130d99;
}

.sb-placeholder-logo {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.sb-placeholder-logo img {
    width: min(220px, 72%);
    max-height: 225px;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px #000a);
}

.sb-placeholder-logo strong {
    margin-left: -8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--sb-red);
    color: #fff7d4;
    font-family: Georgia, serif;
    font-size: clamp(1.8rem, 8vw, 2.75rem);
    line-height: 1;
    letter-spacing: -.07em;
    transform: rotate(2deg);
    box-shadow: 0 8px 20px #0006;
}

.sb-panel h1 {
    margin: 8px 0;
    font-size: clamp(1.45rem, 6vw, 2rem);
}

.sb-panel p {
    color: var(--sb-muted);
}

.sb-form,
.sb-form label {
    display: grid;
    gap: 8px;
}

.sb-form {
    margin-top: 22px;
    text-align: left;
}

.sb-form label {
    color: var(--sb-muted);
    font-size: .8rem;
}

.sb-form input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #7fa18a;
    border-radius: 10px;
    outline: none;
    background: #f7f0d9;
    color: #17251b;
    font-size: 1rem;
}

.sb-form input:focus {
    border-color: var(--sb-yellow);
    box-shadow: 0 0 0 3px #f2d15f33;
}

.sb-primary,
.sb-secondary,
.sb-link-button,
.sb-result-card button {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 10px;
}

.sb-primary {
    border: 1px solid #f9e89a;
    background: var(--sb-yellow);
    color: #24331f;
    font-weight: 800;
}

.sb-primary:disabled {
    opacity: .42;
}

.sb-secondary {
    width: 100%;
    margin-top: 10px;
    border: 1px solid #75967f;
    background: #234c36;
    color: var(--sb-ink);
}

.sb-secondary[data-share-link],
.sb-secondary[data-share-player-url] { width: auto; max-width: 100%; }

.sb-link-button {
    border: 0;
    background: transparent;
    color: var(--sb-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sb-player-list {
    margin: 18px 0;
    padding: 0;
    display: grid;
    gap: 7px;
    list-style: none;
}

.sb-player-list li {
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    border-radius: 9px;
    background: #ffffff0b;
}

.sb-player-list small {
    color: var(--sb-yellow);
}

.sb-recent {
    width: min(560px, calc(100% - 28px));
    margin: 0 auto 40px;
}

.sb-recent h2 {
    margin: 0 0 10px;
    font-size: .86rem;
    font-weight: 500;
    color: var(--sb-muted);
}

.sb-recent-session {
    margin-bottom: 8px;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    border: 1px solid #ffffff18;
    border-radius: 12px;
    background: #10271ddd;
}

.sb-recent-session > div {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.sb-recent-session strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-recent-session small {
    color: var(--sb-muted);
}

.sb-recent-players {
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sb-recent-players button {
    padding: 5px 9px;
    border: 1px solid #769781;
    border-radius: 7px;
    background: #244b37;
    color: var(--sb-ink);
    font-size: .75rem;
}

.sb-delete-session {
    width: 34px;
    height: 34px;
    padding: 7px;
    border: 0;
    background: transparent;
    color: #d9b0a8;
}

.sb-delete-session svg,
.sb-fullscreen svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.sb-board {
    height: 100%;
    min-height: calc(var(--sb-card-width) * var(--sb-card-height-factor) * 5 + 96px);
    padding: 10px max(10px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
    display: grid;
    grid-template-rows: calc(var(--sb-card-width) * var(--sb-card-height-factor) * 2 + 34px) minmax(calc(var(--sb-card-width) * var(--sb-card-height-factor)), 1fr) calc(var(--sb-card-width) * var(--sb-card-height-factor) * 2 + 42px);
    gap: 5px;
    position: relative;
    isolation: isolate;
}

.sb-board::before {
    content: '';
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    opacity: 1;
    transition: opacity .24s ease;
}

.sb-board::after {
    content: '';
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 44% 27% at 50% 50%, rgb(161 190 255 / 11%) 0%, rgb(68 103 203 / 5%) 46%, transparent 76%);
    box-shadow: inset 0 0 86px rgb(0 0 0 / 18%);
}

.sb-board > * {
    position: relative;
    z-index: 1;
}

.sb-board.sb-light-to-bottom::before {
    animation: sb-light-rotate-to-bottom 2s cubic-bezier(.35, .75, .25, 1) both;
}

.sb-board.sb-light-to-top::before {
    animation: sb-light-rotate-to-top 2s cubic-bezier(.35, .75, .25, 1) both;
}

@keyframes sb-light-rotate-to-bottom {
    from {
        --sb-light-angle: 180deg;
    }
    to {
        --sb-light-angle: 0deg;
    }
}

@keyframes sb-light-rotate-to-top {
    from {
        --sb-light-angle: 0deg;
    }
    to {
        --sb-light-angle: 180deg;
    }
}

.sb-board.busy button {
    pointer-events: none;
}

.sb-opponents {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(6px, 2vw, 18px);
}

.sb-opponent-slot,
.sb-own-slot {
    position: relative;
    min-width: 0;
    text-align: center;
}

.sb-own-slot {
    align-self: end;
}

.sb-own-area {
    position: relative;
    min-width: 0;
    min-height: calc(var(--sb-card-width) * var(--sb-card-height-factor) * 2 + 42px);
    display: flex;
    align-items: flex-end;
    align-self: end;
}

.sb-own-area .sb-own-slot {
    width: 100%;
}

.sb-opponent {
    position: relative;
    isolation: isolate;
    min-width: 0;
    min-height: calc(var(--sb-card-width) * var(--sb-card-height-factor) * 2 + 34px);
    padding: 5px 8px 7px;
    text-align: center;
}

.sb-skip-card {
    position: absolute;
    z-index: 20;
    top: 50%;
    left: 50%;
    width: var(--sb-card-width);
    border-radius: 8.4%;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-4deg);
    box-shadow: 0 8px 22px #0009;
    animation: sb-skip-card-in .24s ease-out both;
}

.sb-skip-card.own {
    top: 0;
    animation: none;
    transform: translate(-50%, -35%) rotate(-4deg);
}

@keyframes sb-skip-card-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.7) rotate(8deg); }
    to { opacity: 1; transform: translate(-50%, -50%) rotate(-4deg); }
}

.sb-opponent header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
}

.sb-opponent header span {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .8rem;
    font-weight: 700;
}

.sb-opponent header small {
    color: var(--sb-muted);
    font-size: .62rem;
}

.sb-player-hand {
    height: 55px;
    margin-top: 3px;
    display: flex;
    justify-content: center;
}

.sb-opponent .sb-player-hand {
    position: relative;
    z-index: 1;
    margin-top: 6px;
}

.sb-player-hand img {
    width: 38px;
    height: 55px;
    margin-left: -25px;
    border-radius: 8.4%;
}

.sb-player-hand img:first-child {
    margin-left: 0;
}

.sb-opponents.two-player .sb-player-hand {
    height: calc(var(--sb-card-width) * var(--sb-card-height-factor) + 4px);
}

.sb-opponents.two-player .sb-player-hand img {
    width: var(--sb-card-width);
    height: auto;
    margin-left: clamp(-52px, -5vw, -27px);
    border-radius: 8.4%;
}

.sb-opponents.two-player .sb-player-hand img:first-child {
    margin-left: 0;
}

.sb-center {
    align-self: stretch;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 7px;
}

.sb-turn,
.sb-move {
    min-height: 18px;
    margin: 0;
    text-align: center;
}

.sb-turn {
    color: var(--sb-yellow);
    font-weight: 800;
}

.sb-move {
    max-width: min(520px, 90vw);
    color: var(--sb-muted);
    font-size: .72rem;
}

.sb-piles {
    display: flex;
    align-items: center;
    gap: clamp(22px, 8vw, 56px);
}

.sb-pile {
    position: relative;
    width: var(--sb-card-width);
    min-height: calc(var(--sb-card-width) * var(--sb-card-height-factor) + 9px);
    padding: 0;
    border: 0;
    background: transparent;
}

.sb-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 223 / 343;
    display: block;
    border-radius: 8.4%;
    object-fit: cover;
}

.sb-physical-stack {
    position: relative;
    display: block;
    width: calc(var(--sb-card-width) + var(--stack-offset));
    height: calc(var(--sb-card-width) * var(--sb-card-height-factor) + var(--stack-offset));
    isolation: isolate;
}

.sb-pile .sb-stack-card {
    position: absolute;
    top: var(--card-offset);
    left: var(--card-offset);
    width: var(--sb-card-width);
    height: auto;
    aspect-ratio: 223 / 343;
    display: block;
    border: 0;
    border-radius: 8.4%;
    object-fit: cover;
    pointer-events: none;
}

.sb-empty-card {
    width: 100%;
    aspect-ratio: 223 / 343;
    display: grid;
    place-items: center;
    border: 1px solid #ffffff26;
    border-radius: 8.4%;
    background: transparent;
}

.sb-required-suit {
    position: absolute;
    right: -14px;
    bottom: -10px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 2px solid #fff7de;
    border-radius: 50%;
    background: #fff7de;
    color: #1a211c;
    font-size: 1.35rem;
    box-shadow: 0 4px 12px #0007;
    transition: opacity .16s ease, transform .16s ease;
}

.sb-board.conceal-required-suit .sb-required-suit {
    opacity: 0;
    transform: scale(.7);
}

.sb-required-suit.hearts,
.sb-required-suit.diamonds {
    color: #c63232;
}

.sb-keep {
    margin-top: 8px;
    padding: 7px 11px;
    border: 1px solid #a7c6ad;
    border-radius: 8px;
    background: #173a29;
    color: var(--sb-ink);
    font-size: .76rem;
}

.sb-own {
    position: relative;
    min-width: 0;
    padding: 7px 8px 0;
    align-self: end;
}

.sb-own.active {
    overflow: visible;
}

.sb-player-announcement {
    position: absolute;
    z-index: 30;
    display: block;
    width: fit-content;
    margin: 0;
    padding: 8px 14px;
    border: 2px solid #ffe27a;
    border-radius: 999px;
    background: #351f18f2;
    color: #ffe27a;
    font-family: Georgia, serif;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: .02em;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 5px 18px #0009, 0 0 0 3px #ffe27a2b;
    transform: translateX(-50%);
    animation: sb-call-confirmation .2s ease-out both;
}

.sb-opponent-slot .sb-player-announcement {
    top: calc(100% + 5px);
    left: 50%;
}

.sb-own-slot .sb-player-announcement {
    bottom: calc(100% + 5px);
    left: 50%;
}

.sb-own-header {
    position: relative;
    padding: 0 4px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    color: var(--sb-muted);
    font-size: .72rem;
}

.sb-own-header small {
    margin-left: auto;
    text-align: right;
    font-size: .84rem;
}

.sb-own-meta {
    margin-left: 2px;
    color: var(--sb-muted);
    font-size: .84rem;
    text-align: right;
}

.sb-hand-sorts {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

.sb-hand-sorts button {
    height: 24px;
    padding: 0 4px;
    border: 1px solid rgb(255 255 255 / 30%);
    border-radius: 5px;
    background: rgb(0 0 0 / 24%);
    color: var(--sb-ink);
    font-size: .69rem;
    font-weight: 800;
    line-height: 1;
}

.sb-hand-sorts button:last-child {
    display: grid;
    grid-template-columns: repeat(4, 7px);
    place-content: center;
    gap: 2px;
}

.sb-hand-sorts i {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 1px;
}

.sb-hand-sorts i:nth-child(1) {
    background: #f9d60e;
}

.sb-hand-sorts i:nth-child(2) {
    background: #03b94b;
}

.sb-hand-sorts i:nth-child(3) {
    background: #f92721;
}

.sb-hand-sorts i:nth-child(4) {
    background: #585eed;
}

.sb-own-name-wrap {
    position: relative;
}

.sb-player-name {
    max-width: 180px;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    color: var(--sb-ink);
    font-size: .9rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-opponent-name::before,
.sb-player-name::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin: 0 .42em .08em 0;
    border-top: .34em solid transparent;
    border-bottom: .34em solid transparent;
    border-left: .52em solid transparent;
}

.sb-opponent.sb-active-player .sb-opponent-name::before,
.sb-own-header.active .sb-player-name::before {
    border-left-color: #37c965;
}

.sb-call-buttons {
    position: absolute;
    z-index: 12;
    top: -6px;
    right: 7px;
    display: flex;
    gap: 5px;
    transform: translateY(-100%);
}

.sb-call-buttons button {
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #fff5c5;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
}

.sb-call-buttons button.rejected {
    border-color: #ef6257;
    color: #ef6257;
}

.sb-call-confirmation {
    align-self: center;
    padding: 4px 7px;
    color: #fff4b0;
    font-family: Georgia, serif;
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
    animation: sb-call-confirmation .2s ease-out both;
}

.sb-player-hand {
    height: auto;
    min-height: calc(var(--sb-card-width) * var(--sb-card-height-factor) + 12px);
    padding: 8px 8px 5px;
    display: flex;
    align-items: flex-end;
    justify-content: safe center;
    overflow: visible;
    scrollbar-width: none;
    background: transparent;
    box-shadow: none;
}

.sb-player-hand::-webkit-scrollbar {
    display: none;
}

.sb-card {
    position: relative;
    z-index: var(--card-order);
    width: var(--sb-card-width);
    min-width: var(--sb-card-width);
    padding: 0;
    border: 0;
    background: transparent;
    transition: transform .16s ease;
}

.sb-own-card {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.sb-own-card img {
    -webkit-user-drag: none;
    user-drag: none;
}

.sb-own-card.dragging {
    opacity: .38;
    cursor: grabbing;
    transform: translateY(-16px) scale(.96);
}

.sb-card + .sb-card {
    margin-left: var(--sb-hand-card-gap, clamp(-52px, -5vw, -27px));
}

.sb-card:not(:disabled):hover,
.sb-card:not(:disabled):focus-visible {
    outline: none;
    transform: translateY(-8px);
}

.sb-card.rejected {
    animation: sb-card-rejected .52s ease-in-out;
    transform-origin: 50% 85%;
}

.sb-announcement {
    position: fixed;
    z-index: 900;
    top: 45%;
    left: 50%;
    padding: 13px 22px;
    border: 2px solid #fff2af;
    border-radius: 14px;
    background: var(--sb-red);
    color: #fff;
    font-family: Georgia, serif;
    font-size: clamp(2rem, 10vw, 4rem);
    font-weight: 900;
    letter-spacing: -.06em;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-3deg);
    box-shadow: 0 18px 50px #0009;
    animation: sb-pop .3s ease-out both;
}

.sb-flying-card {
    position: fixed;
    z-index: 850;
    border-radius: 8px;
    pointer-events: none;
    transform-origin: top left;
    transition: transform .9s cubic-bezier(.2, .8, .2, 1), opacity .08s ease .9s;
    perspective: 900px;
    will-change: transform, opacity;
}

.sb-flying-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.sb-flying-card-front {
    transform: rotateY(180deg);
}

.sb-flying-card.flip .sb-flying-card-back {
    animation: sb-card-back-flip .52s ease-in-out calc(var(--sb-fly-delay, 0ms) + .2s) forwards;
}

.sb-flying-card.flip .sb-flying-card-front {
    animation: sb-card-front-flip .52s ease-in-out calc(var(--sb-fly-delay, 0ms) + .2s) forwards;
}

.sb-card-arrival-hidden {
    visibility: hidden !important;
}

.sb-overlay,
.sb-result-overlay,
.sb-rules-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 18px;
    display: grid;
    place-items: center;
    background: #07130dba;
    backdrop-filter: blur(5px);
}

.sb-dialog,
.sb-result-card,
.sb-rules-card {
    width: min(420px, 100%);
    padding: 24px;
    border: 1px solid #ffffff28;
    border-radius: 18px;
    background: #11291f;
    text-align: center;
    box-shadow: 0 24px 70px #000a;
}

.sb-suit-overlay {
    align-items: end;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--sb-card-width) * var(--sb-card-height-factor) + 76px);
    background: transparent;
    backdrop-filter: none;
}

.sb-result-overlay {
    inset: calc(var(--sb-header-height) + env(safe-area-inset-top, 0px) + 10px) 12px auto;
    padding: 0;
    display: flex;
    justify-content: center;
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
}

.sb-result-overlay .sb-result-card {
    width: min(340px, 100%);
    padding: 12px 16px;
    pointer-events: auto;
    background: #11291ff2;
    box-shadow: 0 10px 28px #0009;
}

.sb-result-overlay .sb-result-symbol {
    font-size: 1.6rem;
}

.sb-result-overlay .sb-result-card h2 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.sb-suit-overlay .sb-dialog {
    width: min(360px, 100%);
    padding: 14px 16px 10px;
    background: #11291ff2;
}

.sb-suit-overlay .sb-dialog h2 {
    margin-bottom: 10px;
}

.sb-suit-overlay .sb-suit-options button {
    height: 52px;
    aspect-ratio: auto;
}

.sb-dialog h2,
.sb-result-card h2,
.sb-rules-card h2 {
    margin: 0 0 18px;
}

.sb-suit-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
}

.sb-suit-options button {
    aspect-ratio: 1;
    border: 1px solid #d9dacd;
    border-radius: 12px;
    background: #f8f1d9;
    color: #161b17;
    font-size: 2.2rem;
}

.sb-suit-options .hearts,
.sb-suit-options .diamonds {
    color: #c63232;
}

.sb-result-symbol {
    color: var(--sb-red);
    font-size: 3rem;
}

.sb-result-card button {
    border: 0;
}

.sb-result-card button:disabled {
    background: #244536;
    color: var(--sb-muted);
}

.sb-rules-overlay {
    z-index: 2000;
    overflow-y: auto;
}

.sb-rules-card {
    position: relative;
    max-height: min(720px, calc(100dvh - 36px));
    overflow-y: auto;
    text-align: left;
}

.sb-rules-card h2 {
    color: var(--sb-yellow);
    font-family: Georgia, serif;
    font-size: 2rem;
}

.sb-rules-card h3 {
    margin: 20px 0 5px;
    font-size: .95rem;
}

.sb-rules-card p,
.sb-rules-card li {
    color: #d2ded2;
    font-size: .86rem;
    line-height: 1.5;
}

.sb-rules-card ul {
    padding-left: 20px;
}

.sb-rules-card a {
    color: var(--sb-yellow);
    font-size: .78rem;
}

.sb-rules-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--sb-ink);
    font-size: 1.7rem;
}

.sb-reaction-bubble {
    position: absolute;
    z-index: 80;
    top: calc(100% + 6px);
    left: 50%;
    min-width: 38px;
    max-width: min(280px, calc(100vw - 30px));
    padding: 7px 10px;
    border: 0;
    border-radius: 14px;
    background: #fff;
    color: #213227;
    font-size: 1.3rem;
    line-height: 1;
    box-shadow: 0 5px 18px #0007;
    transform: translateX(-50%);
}

.sb-reaction-bubble.own {
    top: auto;
    bottom: calc(100% + 7px);
    left: 0;
    transform: none;
}

.sb-reaction-bubble.message {
    width: max-content;
    overflow-wrap: anywhere;
    font-size: .82rem;
    line-height: 1.25;
    text-align: left;
}

.sb-reaction-picker,
.sb-reaction-composer {
    position: fixed;
    z-index: 1500;
    left: 50%;
    bottom: max(84px, calc(env(safe-area-inset-bottom, 0px) + 66px));
    transform: translateX(-50%);
    border: 1px solid #ffffff38;
    border-radius: 13px;
    background: #10271ff5;
    box-shadow: 0 8px 28px #0009;
}

.sb-reaction-picker {
    padding: 7px;
    display: flex;
    gap: 5px;
}

.sb-reaction-picker > div {
    display: grid;
    grid-template-columns: repeat(7, 34px);
    gap: 3px;
}

.sb-reaction-picker button {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 1.12rem;
}

.sb-reaction-picker button:hover,
.sb-reaction-picker button:focus-visible {
    background: #ffffff20;
}

.sb-reaction-composer {
    width: min(360px, calc(100vw - 24px));
    padding: 7px;
    display: flex;
    gap: 6px;
}

.sb-reaction-composer input {
    min-width: 0;
    padding: 9px 10px;
    flex: 1;
    border: 0;
    border-radius: 8px;
    background: #fff9e5;
    color: #18271d;
}

.sb-reaction-composer button {
    padding: 8px 11px;
    border: 0;
    border-radius: 8px;
    background: var(--sb-red);
    color: #fff;
    font-weight: 700;
}

#phase-10-status {
    position: fixed;
    z-index: 3000;
    right: 14px;
    bottom: 14px;
    max-width: min(360px, calc(100vw - 28px));
    padding: 10px 13px;
    border: 1px solid #f4d868;
    border-radius: 10px;
    background: #10251bf2;
    color: #ffe885;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity .18s ease, transform .18s ease;
}

#phase-10-status.visible {
    opacity: 1;
    transform: none;
}

.sb-fullscreen {
    position: fixed;
    z-index: 120;
    right: max(3px, env(safe-area-inset-right, 0px));
    bottom: max(3px, env(safe-area-inset-bottom, 0px));
    width: 38px;
    height: 38px;
    padding: 8px;
    border: 0;
    background: #10251b99;
    color: var(--sb-muted);
}

.sb-fullscreen.active {
    color: var(--sb-yellow);
}

@keyframes sb-pop {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(-8deg) scale(.5);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(-3deg) scale(1);
    }
}

@keyframes sb-card-back-flip {
    to {
        transform: rotateY(-180deg);
    }
}

@keyframes sb-card-front-flip {
    to {
        transform: rotateY(0);
    }
}

@keyframes sb-card-rejected {
    0%, 100% {
        transform: rotate(0);
    }
    18% {
        transform: rotate(-5deg);
    }
    36% {
        transform: rotate(5deg);
    }
    54% {
        transform: rotate(-4deg);
    }
    72% {
        transform: rotate(4deg);
    }
    88% {
        transform: rotate(-2deg);
    }
}

@keyframes sb-call-confirmation {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px) scale(.9);
    }
    to {
        opacity: 1;
        transform: translateX(-50%);
    }
}

@media (max-width: 620px) {
    :root {
        --sb-card-width: clamp(66px, 20vw, 82px);
    }

    .sb-header {
        padding-inline: 10px;
    }

    .sb-back span {
        display: none;
    }

    .sb-board {
        grid-template-rows: minmax(79px, auto) minmax(155px, 1fr) minmax(132px, auto);
        padding-inline: 5px;
    }

    .sb-opponents {
        gap: 1px;
    }

    .sb-opponent {
        padding-inline: 3px;
    }

    .sb-opponent header span {
        max-width: 72px;
        font-size: .68rem;
    }

    .sb-player-hand img {
        width: 31px;
        height: 44px;
        margin-left: -23px;
    }

    .sb-piles {
        gap: 30px;
    }

    .sb-call-buttons button {
        min-height: 31px;
        padding: 5px 8px;
        font-size: .66rem;
    }

    .sb-card + .sb-card {
        margin-left: var(--sb-hand-card-gap, -36px);
    }

    .sb-opponents.two-player .sb-player-hand img {
        margin-left: -36px;
    }

    .sb-reaction-picker {
        gap: 3px;
    }

    .sb-reaction-picker > div {
        grid-template-columns: repeat(7, 30px);
    }

    .sb-reaction-picker button {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
}

@media (orientation: landscape) and (max-height: 620px) {
    :root {
        --sb-header-height: 50px;
        --sb-card-width: clamp(58px, 11vh, 74px);
    }

    .sb-board {
        grid-template-rows: minmax(66px, auto) minmax(108px, 1fr) 100px;
        gap: 1px;
        padding-top: 3px;
    }

    .sb-opponent {
        padding-block: 2px;
    }

    .sb-player-hand {
        height: 38px;
    }

    .sb-player-hand img {
        width: 28px;
        height: 40px;
        margin-left: -21px;
    }

    .sb-center {
        grid-template-columns: auto auto auto;
        grid-template-rows: auto auto;
        column-gap: 14px;
    }

    .sb-turn {
        grid-column: 1 / -1;
    }

    .sb-piles {
        grid-column: 2;
        grid-row: 2;
    }

    .sb-keep {
        grid-column: 3;
        grid-row: 2;
    }

    .sb-move {
        grid-column: 1;
        grid-row: 2;
        max-width: 160px;
    }

    .sb-own {
        padding-top: 3px;
    }

    .sb-player-hand {
        min-height: calc(var(--sb-card-width) * var(--sb-card-height-factor) + 3px);
        padding-top: 2px;
    }

    .sb-card + .sb-card {
        margin-left: var(--sb-hand-card-gap, -31px);
    }

    .sb-opponents.two-player .sb-player-hand img {
        margin-left: -31px;
    }

    .sb-call-buttons {
        transform: none;
    }

    .sb-suit-overlay {
        align-items: start;
        padding-top: calc(var(--sb-header-height) + env(safe-area-inset-top, 0px) + 7px);
        padding-bottom: 0;
    }

    .sb-suit-overlay .sb-dialog {
        width: min(330px, 62vw);
    }

    .sb-suit-overlay .sb-suit-options button {
        height: 40px;
        font-size: 1.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Phase 10 additions */
.sb-board {
    grid-template-rows: minmax(92px, auto) minmax(210px, 1fr) auto;
}

.sb-center {
    grid-template-rows: auto;
    align-content: center;
    overflow: visible;
    padding-top: 0;
}

.sb-center .sb-piles {
    grid-row: 1;
}

.sb-laid-phases {
    display: grid;
    gap: 8px;
    width: min(100%, 760px);
    margin: 10px auto 0;
}

.sb-laid-phases section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sb-laid-phases section > strong {
    width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-laid-phases section > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sb-laid-group {
    padding: 5px 8px;
    border: 1px solid rgb(255 255 255 / 22%);
    border-radius: 10px;
    background: rgb(0 0 0 / 22%);
    color: var(--sb-ink);
}

.sb-laid-group small {
    display: block;
    margin-bottom: 4px;
}

.sb-laid-cards {
    display: inline-flex;
    align-items: flex-end;
    padding: 1px 0;
}

.sb-laid-group img {
    width: 35px;
    margin-left: -15px;
    border-radius: 8.4%;
    vertical-align: bottom;
    box-shadow: 0 1px 3px #0008;
}

.sb-laid-group img:first-child {
    margin-left: 0;
}

.sb-no-phases {
    margin: 8px 0;
    color: var(--sb-muted);
    font-size: .82rem;
}

.sb-phase-builder {
    position: relative;
    margin: 0 0 3px;
    padding: 8px;
    border: 1px solid rgb(255 255 255 / 16%);
    border-radius: 12px;
    background: rgb(0 0 0 / 18%);
    opacity: 0.7;
}

.sb-phase-builder > div {
    display: flex;
    justify-content: center;
    gap: 7px;
}

.sb-group-choice {
    display: grid;
    width: calc(var(--sb-card-width) * (.5 + var(--sb-group-card-count) * .5));
    height: calc(var(--sb-card-width) * var(--sb-card-height-factor));
    justify-items: center;
    gap: 3px;
    min-width: 0;
}

.sb-group-slot {
    display: grid;
    gap: 2px;
    padding: 6px 9px;
    border: 1px dashed rgb(255 255 255 / 35%);
    border-radius: 8px;
    background: rgb(255 255 255 / 7%);
    color: var(--sb-ink);
    width: 100%;
    height: 100%;
    min-width: 0;
    align-items: center;
}

.sb-phase-actions {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.sb-phase-actions button {
    position: absolute;
    pointer-events: auto;
    width: 25px;
    height: 25px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 38%);
    border-radius: 50%;
    background: #111d19e8;
    color: var(--sb-ink);
    font-size: 1.1rem;
    line-height: 1;
}

.sb-phase-actions button[data-clear-groups] {
    bottom: -5px;
    left: -5px;
    font-size: 1.2rem;
}

.sb-phase-actions button[data-lay-phase] {
    top: -5px;
    right: -5px;
}

.sb-group-slot small {
    color: var(--sb-muted);
}

.sb-group-choice.has-cards {
    height: auto;
}

.sb-phase-builder .sb-group-choice.has-cards {
    width: max-content;
}

.sb-group-choice.has-cards .sb-group-slot {
    height: auto;
    width: max-content;
    padding: 0;
    border: 0;
    background: transparent;
}

.sb-group-cards {
    display: flex;
    align-items: flex-start;
    height: calc(var(--sb-card-width) * var(--sb-card-height-factor));
    padding-top: 1px;
    transform: translateY(-12px);
    margin-bottom: -12px;
    min-width: 0;
}

.sb-group-cards img {
    width: var(--sb-card-width);
    margin-left: 0;
    border-radius: 8.4%;
    box-shadow: 0 1px 3px #0008;
}

.sb-phase-card {
    display: block;
    touch-action: none;
    user-select: none;
}

.sb-phase-card + .sb-phase-card {
    margin-left: clamp(-52px, -5vw, -27px);
}

.sb-phase-card.dragging {
    opacity: .4;
}

.sb-phase-card.selected {
    z-index: 3;
    border-radius: 8.4%;
    transform: translateY(-15px);
}

.sb-group-choice.has-cards .sb-group-cards {
    transform: none;
    margin-bottom: 0;
}

.sb-own-phase {
    position: absolute;
    z-index: 4;
    bottom: calc(100% + 6px);
    left: 50%;
    width: max-content;
    max-width: min(100vw - 12px, 760px);
    transform: translateX(-50%);
}

.sb-player-phase {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
}

.sb-player-phase-group {
    display: flex;
    align-items: flex-end;
}

.sb-player-phase-card {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    line-height: 0;
    vertical-align: bottom;
}

.sb-player-phase-card > span {
    display: flex;
    align-items: flex-end;
}

.sb-player-phase-group img {
    width: var(--sb-card-width);
    border-radius: 8.4%;
    box-shadow: 0 1px 3px #0008;
}

.sb-player-phase-card + .sb-player-phase-card,
.sb-player-phase-card img + img {
    margin-left: clamp(-52px, -5vw, -27px);
}

.sb-opponent-phase {
    margin-top: 6px;
}

.sb-clear-groups {
    display: block;
    width: auto;
    margin: 1px auto 5px;
    padding: 4px 9px;
}

.sb-lay-controls {
    position: absolute;
    z-index: 5;
    bottom: calc(100% + var(--sb-card-width) * var(--sb-card-height-factor) + 14px);
    left: 50%;
    transform: translate(-50%, -100%);
}

.sb-lay-controls .sb-primary {
    width: auto;
    padding: 7px 12px;
    white-space: nowrap;
}

.sb-action-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 7px;
}

.sb-action-bar .sb-primary, .sb-action-bar .sb-secondary {
    width: auto;
    padding: 8px 12px;
}

.sb-action-bar small {
    color: var(--sb-muted);
}

.sb-card {
    position: relative;
}

.sb-card.selected {
    transform: translateY(-15px);
    border-radius: 5px;
}

.sb-card.group-1 {
    box-shadow: 0 0 0 4px #f2d15f;
}

.sb-card.group-2 {
    box-shadow: 0 0 0 4px #56a8ef;
}

.sb-skip-mark {
    color: var(--sb-yellow);
    font-size: .72rem;
}

.sb-score-table p {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin: 5px 0;
}

.sb-score-table span {
    color: var(--sb-muted);
}

.sb-result-card > .sb-primary[href] {
    display: inline-block;
    margin-top: 10px;
    text-decoration: none;
}

@media (max-width: 699px) {
    .sb-board {
        grid-template-rows: auto minmax(185px, 1fr) auto;
    }

    .sb-laid-phases section {
        align-items: flex-start;
    }

    .sb-laid-phases section > strong {
        width: 66px;
        font-size: .72rem;
    }

    .sb-laid-group img {
        width: 29px;
    }

    .sb-group-slot {
        padding: 4px 6px;
        font-size: .67rem;
    }
}

/* Skip-Bo additions to the copied Phase-10 table geometry. */
body,
.sb-board {
    background: #151836;
}

.sb-board {
    min-height: calc(var(--sb-card-width) * var(--sb-card-height-factor) * 5 + 142px);
    grid-template-rows: calc(var(--sb-card-width) * var(--sb-card-height-factor) * 2 + 64px) minmax(calc(var(--sb-card-width) * var(--sb-card-height-factor)), 1fr) calc(var(--sb-card-width) * var(--sb-card-height-factor) * 2 + 74px);
}

.sb-board::before {
    display: block;
    opacity: 1;
}

.sb-board.sb-active-top::before {
    --sb-light-angle: 180deg;
    background: linear-gradient(var(--sb-light-angle), rgb(0 102 255 / 31%) 0%, rgb(255 255 255 / 6%) 30%, transparent 58%);
}

.sb-board.sb-active-bottom::before {
    --sb-light-angle: 0deg;
    background: linear-gradient(var(--sb-light-angle), rgb(0 102 255 / 31%) 0%, rgb(255 255 255 / 6%) 30%, transparent 58%);
}

.sb-opponent-phase,
.sb-own-phase {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(14px, 4vw, 48px);
}

.sb-opponent-phase {
    margin-top: 6px;
}

.sb-own-phase {
    width: max-content;
    max-width: min(100vw - 12px, 760px);
}

.sb-stock {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 0 0 auto;
}

.sb-opponent .sb-stock-count {
    order: 0;
    margin: 0 4px 0 0;
}

.sb-stock-count {
    min-height: 1em;
    color: var(--sb-muted);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1;
    margin-right: 4px;
}

.sb-stock-stack,
.sb-deck-stack,
.sb-completed-stack {
    position: relative;
    flex: 0 0 auto;
    width: calc(var(--sb-card-width) + 18px);
    height: calc(var(--sb-card-width) * var(--sb-card-height-factor) + 18px);
}

.sb-stock-stack > img,
.sb-stock-top,
.sb-deck-stack img,
.sb-completed-stack img {
    position: absolute;
    display: block;
    width: var(--sb-card-width);
    height: calc(var(--sb-card-width) * var(--sb-card-height-factor));
    border-radius: 8.4%;
    object-fit: cover;
}

.sb-stock-stack > img,
.sb-stock-top {
    top: min(var(--stock-offset), 9px);
    left: min(var(--stock-offset), 9px);
}

.sb-deck-stack img {
    top: var(--deck-offset);
    left: var(--deck-offset);
}

.sb-completed-stack img {
    top: var(--completed-offset);
    left: var(--completed-offset);
}

.sb-stock-top .sb-card {
    width: 100%;
    height: 100%;
}

.sb-discards {
    display: flex;
    flex-flow: row nowrap;
    gap: 7px;
    overflow: visible;
}

.sb-discard {
    display: grid;
    width: var(--sb-card-width);
    flex: 0 0 var(--sb-card-width);
    justify-items: center;
}

.sb-discard .sb-card,
.sb-discard .sb-empty-card {
    width: var(--sb-card-width);
}

.sb-center .sb-piles {
    display: flex;
    align-items: center;
    gap: clamp(18px, 5vw, 54px);
}

.sb-building-piles {
    display: flex;
    gap: clamp(7px, 2vw, 18px);
}

.sb-building {
    width: var(--sb-card-width);
    min-height: calc(var(--sb-card-width) * var(--sb-card-height-factor));
    padding: 0;
    border: 0;
    background: transparent;
}

.sb-building-card {
    pointer-events: none;
}

.sb-card,
.sb-card:not(:disabled):hover,
.sb-card.selected {
    border: 0;
    box-shadow: none;
}

.sb-own.sb-opposing-player {
    background: transparent;
    box-shadow: none;
}


@media (max-width: 700px) {
    :root {
        --sb-card-width: clamp(50px, calc((100dvh - 220px) * .13), 72px);
    }

    .sb-board {
        min-height: calc(var(--sb-card-width) * var(--sb-card-height-factor) * 5 + 94px);
        grid-template-rows: calc(var(--sb-card-width) * var(--sb-card-height-factor) * 2 + 38px) minmax(calc(var(--sb-card-width) * var(--sb-card-height-factor)), 1fr) calc(var(--sb-card-width) * var(--sb-card-height-factor) * 2 + 48px);
    }

    .sb-opponent-phase,
    .sb-own-phase {
        gap: 7px;
    }

    .sb-center .sb-piles {
        gap: 9px;
    }

    .sb-building-piles {
        gap: 4px;
    }
}

@media (max-height: 899px) {
    .sb-header {
        min-height: 0;
        height: 0;
        padding: 0;
        border: 0;
        background: transparent;
        backdrop-filter: none;
    }

    .sb-header .sb-back,
    .sb-header .sb-brand {
        display: none;
    }

    .sb-header .sb-info {
        position: absolute;
        z-index: 200;
        top: max(8px, env(safe-area-inset-top, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
    }

    #skipbo-app {
        height: 100vh;
        height: 100dvh;
    }
}

/* Fünf feste Kartenebenen: gegnerische Hand/Phase, Stapel, eigene Phase/Hand. */
.sb-board {
    grid-template-rows: calc(var(--sb-card-width) * var(--sb-card-height-factor) * 2 + 34px) minmax(calc(var(--sb-card-width) * var(--sb-card-height-factor)), 1fr) calc(var(--sb-card-width) * var(--sb-card-height-factor) * 2 + 42px);
}

/* Nur Reihen, die den sichtbaren Bereich überschreiten, werden enger gelegt. */
.sb-player-hand.sb-fit-compact .sb-card + .sb-card,
.sb-player-hand.sb-fit-compact img + img,
.sb-fit-compact .sb-player-phase-card + .sb-player-phase-card,
.sb-fit-compact .sb-player-phase-card img + img,
.sb-fit-compact .sb-group-cards img + img {
    margin-left: clamp(-67px, -7vw, -39px);
}

.sb-group-cards.sb-fit-compact .sb-phase-card + .sb-phase-card,
.sb-fit-compact .sb-group-cards .sb-phase-card + .sb-phase-card {
    margin-left: clamp(-67px, -7vw, -39px);
}

.sb-player-hand.sb-fit-tight .sb-card + .sb-card,
.sb-player-hand.sb-fit-tight img + img,
.sb-fit-tight .sb-player-phase-card + .sb-player-phase-card,
.sb-fit-tight .sb-player-phase-card img + img,
.sb-fit-tight .sb-group-cards img + img {
    margin-left: clamp(-78px, -9vw, -48px);
}

.sb-group-cards.sb-fit-tight .sb-phase-card + .sb-phase-card,
.sb-fit-tight .sb-group-cards .sb-phase-card + .sb-phase-card {
    margin-left: clamp(-78px, -9vw, -48px);
}

.sb-player-phase.sb-fit-compact {
    gap: 3px;
}

.sb-player-phase.sb-fit-tight {
    gap: 0;
}

/* Die Zwei-Spieler-Ansicht nutzt größere verdeckte Karten und braucht daher
   eine ebenso spezifische Überschreibung für die dynamische Verdichtung. */
.sb-opponents.two-player .sb-player-hand.sb-fit-compact img + img {
    margin-left: clamp(-67px, -7vw, -39px);
}

.sb-opponents.two-player .sb-player-hand.sb-fit-tight img + img {
    margin-left: clamp(-78px, -9vw, -48px);
}

.sb-sound, .sb-fullscreen, .sb-reaction-toggle {
    position: fixed;
    z-index: 190;
    bottom: max(3px, env(safe-area-inset-bottom, 0px));
    width: 38px;
    height: 38px;
    padding: 9px;
    border: 0;
    color: var(--sb-muted);
    background: transparent;
}

.sb-reaction-toggle svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.sb-fullscreen {
    right: max(3px, env(safe-area-inset-right, 0px));
}

.sb-sound {
    right: max(44px, calc(env(safe-area-inset-right, 0px) + 44px));
}

.sb-reaction-toggle {
    right: max(85px, calc(env(safe-area-inset-right, 0px) + 85px));
    font-size: 1rem;
}

.sb-sound.active, .sb-fullscreen.active, .sb-reaction-toggle.active {
    color: var(--sb-yellow);
}

.sb-reaction-panel {
    position: fixed;
    z-index: 201;
    right: max(85px, calc(env(safe-area-inset-right, 0px) + 85px));
    bottom: max(46px, calc(env(safe-area-inset-bottom, 0px) + 46px));
    display: flex;
    width: min(390px, calc(100vw - 20px));
    flex-direction: column;
    gap: 9px;
    padding: 10px;
    border: 1px solid #ffffff35;
    border-radius: 12px;
    background: #10271ff5;
    box-shadow: 0 10px 30px #0008;
}

.sb-reaction-panel header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sb-reaction-panel header button {
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1.2rem;
}

.sb-chat-history {
    display: flex;
    min-height: 72px;
    max-height: min(34dvh, 240px);
    flex-direction: column;
    gap: 7px;
    overflow-y: auto;
}

.sb-chat-message {
    align-self: flex-start;
    max-width: 82%;
    padding: 5px 8px;
    border-radius: 11px 11px 11px 3px;
    color: #122219;
    background: #eef5ea;
    overflow-wrap: anywhere;
}

.sb-chat-message.yours {
    align-self: flex-end;
    border-radius: 11px 11px 3px 11px;
    background: var(--sb-yellow);
}

.sb-chat-message small {
    display: block;
    opacity: .7;
    font-size: .66rem;
    font-weight: 700;
}

.sb-chat-message p, .sb-chat-empty {
    margin: 0;
    white-space: pre-wrap;
}

.sb-chat-empty {
    margin: auto;
    color: var(--sb-muted);
}

.sb-reaction-emojis {
    display: grid;
    grid-template-columns:repeat(7, 1fr);
    gap: 5px;
}

.sb-reaction-panel form {
    display: flex;
    gap: 6px;
}

.sb-reaction-panel input {
    min-width: 0;
    flex: 1;
    padding: 8px;
    border: 1px solid #ffffff45;
    border-radius: 7px;
}

.sb-reaction-panel form button, .sb-reaction-emojis button {
    min-height: 35px;
    border: 0;
    border-radius: 7px;
    background: #ffffff18;
    color: #fff;
}

.sb-reaction-panel form button {
    padding: 0 10px;
    background: var(--sb-green-light);
}

@media (max-width: 699px) {
    .sb-reaction-panel {
        right: 0;
        bottom: max(42px, calc(env(safe-area-inset-bottom, 0px) + 42px));
        left: 0;
        width: 100%;
        max-width: none;
        padding: 11px max(10px, env(safe-area-inset-right, 0px)) 11px max(10px, env(safe-area-inset-left, 0px));
        border-right: 0;
        border-left: 0;
        border-radius: 12px 12px 0 0;
    }
}

/* Final override: the Skip-Bo supply rows need more space than Phase 10 phases. */
.sb-board {
    min-height: calc(var(--sb-card-width) * var(--sb-card-height-factor) * 5 + 142px);
    grid-template-rows: calc(var(--sb-card-width) * var(--sb-card-height-factor) * 2 + 64px) minmax(calc(var(--sb-card-width) * var(--sb-card-height-factor)), 1fr) calc(var(--sb-card-width) * var(--sb-card-height-factor) * 2 + 74px);
}

@media (max-width: 700px) {
    .sb-board {
        min-height: calc(var(--sb-card-width) * var(--sb-card-height-factor) * 5 + 94px);
        grid-template-rows: calc(var(--sb-card-width) * var(--sb-card-height-factor) * 2 + 38px) minmax(calc(var(--sb-card-width) * var(--sb-card-height-factor)), 1fr) calc(var(--sb-card-width) * var(--sb-card-height-factor) * 2 + 48px);
    }
}
