.room-reference {
    --reference-gutter: 12px;
}

.room-reference .game-room-brand, .room-reference .game-room-header-star { visibility: hidden; }
.room-reference .room-training-notice {
    margin: 0 0 5px;
    padding: 4px 8px;
    border-color: #fff4;
    background: #111827bb;
    font-size: 10px;
}

/* Keep the board above the controls and put the balance beside the stake. */
.room-reference-instant #gameRoomContent:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

body:not(.browser-player) .room-reference-instant .room-wallet {
    order: 2;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    min-height: 32px;
    margin: 0;
    padding: 4px 0;
    gap: 5px 12px;
    border: 0;
    background: transparent;
    box-shadow: none;
    text-shadow: 0 1px 2px #160d13, 0 0 3px #160d13;
}

body:not(.browser-player) .room-reference-instant .room-wallet > div:first-child {
    flex: 0 1 auto;
    width: auto;
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.room-reference-instant .room-wallet::before, .room-reference-instant .room-wallet::after { content: none; }
.room-reference-instant .room-wallet-label,
.room-reference-instant .room-wallet .room-stake-label {
    margin: 0;
    color: #ffbf43;
    font-size: clamp(10px, 2.7vw, 15px);
    font-weight: 900;
    text-transform: uppercase;
}

body:not(.browser-player) .room-reference-instant .room-wallet strong,
.room-reference-instant .room-wallet #roomStake {
    margin: 0;
    color: #fff;
    font: 900 clamp(12px, 3.4vw, 18px)/1.25 Arial, sans-serif;
}

.room-reference-instant .room-wallet #roomStake {
    width: 4.2em;
    min-height: 28px;
    padding: 1px 3px;
    appearance: textfield;
    background: #11112160;
    box-shadow: none;
    border-color: #fff4;
}

.room-reference-instant #roomStake::-webkit-inner-spin-button { appearance: none; }
.room-reference-instant .room-wallet-actions:has(button:not([hidden])) { width: 100%; justify-content: center; }
.room-reference-instant .room-wallet-actions:not(:has(button:not([hidden]))) { display: none; }

body:not(.browser-player) .room-reference-instant .room-round-status {
    height: auto;
    min-height: 0;
    flex-basis: auto;
    margin: 0 calc(-1 * var(--reference-gutter));
}

body:not(.browser-player) .room-reference-instant .room-round-status :is(#roomGameMessage, #roomResult) {
    height: clamp(31px, 5.9svh, 48px);
    margin: 0;
    display: grid;
    place-items: center;
    padding: 3px 7px;
    background: #0b10236c;
    border: 0;
    color: #fff;
    opacity: 1;
    font: 900 clamp(14px, 4.8vw, 24px)/1.06 Arial, sans-serif;
    text-shadow: 0 2px 2px #0007;
}

body:not(.browser-player) .room-reference-instant .room-round-status #roomResult:empty { display: none; }

body:not(.browser-player) .room-reference-instant .room-bet-controls {
    order: 1;
    grid-template-columns: repeat(2, minmax(36px, 46px)) minmax(58px, 116px) repeat(2, minmax(36px, 46px));
    justify-content: center;
    gap: clamp(4px, 2.4vw, 15px);
    margin: 0;
    padding: 5px 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.room-reference-instant #roomSound { grid-column: 1; grid-row: 1; }
.room-reference-instant #roomStakeMinus { grid-column: 2; grid-row: 1; }
.room-reference-instant #roomPlay { grid-column: 3; grid-row: 1; }
.room-reference-instant #roomStakePlus { grid-column: 4; grid-row: 1; }
.room-reference-instant #roomRulesOpen { grid-column: 5; grid-row: 1; }

.room-reference-instant .room-bet-controls .room-round-button,
.room-reference-instant .room-bet-controls .room-spin-button {
    background: #0c1016d9;
    color: #fff;
    border-color: transparent;
    box-shadow: none;
}

.room-reference-instant .room-round-button svg { width: 56%; height: 56%; }
.room-reference-instant .room-round-button[aria-pressed="true"] { color: #ffdb73; }
.room-reference-instant .room-bet-controls .room-spin-button { max-width: 116px; border: 2px solid #fff; }
.room-reference-instant .room-spin-button::before { content: none; }
.room-reference-instant .room-spin-button svg { filter: none; }

.room-olympus.room-reference {
    background: #5a356f url("../../images/olympus-reference-v2.30d15f859fcc.webp") center top / 100% 100% no-repeat;
}

.room-olympus .room-short-stage .room-olympus-arena { justify-content: flex-start; gap: 0; }
.room-olympus .room-short-stage .room-olympus-arena h1 {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .23em;
    width: 68%;
    min-height: clamp(46px, 10svh, 88px);
    margin: 0 auto 0 0;
    padding: 0;
    color: #ffdf66;
    font: 900 clamp(16px, 5.1vw, 35px)/.9 Georgia, serif;
    text-shadow: 0 2px #ab6116, 0 4px 3px #2a102b, 0 0 5px #2a102b;
}
.room-olympus .room-short-stage .room-olympus-arena h1 span { margin: 0; color: #ffdf66; font-size: .55em; letter-spacing: .1em; }
.room-olympus .room-short-stage .room-olympus-grid {
    margin-inline: auto;
    border: 5px ridge #f7c94c;
    padding: 3px;
    background: repeating-linear-gradient(90deg, #361637 0 16.66%, #422043 16.66% 33.33%);
}
.room-olympus .room-olympus-grid .room-symbol-art {
    background-image: url("../../images/symbols/olympus-reference-v2.e1dac299ce71.webp");
}

.room-sweet.room-reference {
    background: #0f0963 url("../../images/sweet/reference-v2.d36bca454ab9.webp") center top / 100% 100% no-repeat;
}
.room-sweet .room-short-stage .sweet-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .22em;
    height: clamp(45px, 9svh, 76px);
    margin: 0;
    padding: 0;
    font-size: clamp(26px, 8.5vw, 42px);
}
.room-sweet .room-short-stage .sweet-title :is(span, h1) {
    font: 1000 1em/1 'Trebuchet MS', Arial, sans-serif;
    letter-spacing: -.075em;
    text-shadow: 0 2px #f98615, 0 4px #a41355, 0 0 5px #6f063b;
    paint-order: stroke fill;
    -webkit-text-stroke: .12em #fff4f6;
    color: #ffce33;
    margin: 0;
}
.room-sweet .room-short-stage .sweet-title span { color: #63edf7; text-shadow: 0 2px #1598bd, 0 4px #631958; }
.room-sweet .sweet-title p { display: none; }
.room-sweet .room-short-stage .sweet-frame {
    width: 100%;
    margin: 0 auto;
    padding: 4px;
    border: 2px solid #fff4e8;
    border-radius: 14px;
    background: repeating-linear-gradient(125deg, #fff9f7 0 7px, #f4abac 7px 12px);
    box-shadow: 0 3px 0 #a55398, 0 6px 18px #23125b6b;
}
.room-sweet .sweet-frame::before, .room-sweet .sweet-frame::after { content: none; }
.room-sweet .sweet-grid {
    border: 0;
    border-radius: 9px;
    background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 6 - 1px), #fff3 calc(100% / 6 - 1px) calc(100% / 6)), linear-gradient(#533be4, #a86aeb);
}
.room-sweet .sweet-grid .sweet-art {
    background-image: url("../../images/sweet/symbols-reference-v2.a7c6f5749c8f.webp");
}
.room-sweet .sweet-cascade-bar { margin: 5px 0 0; min-height: 22px; padding: 3px 8px; background: #20144fba; }

.room-reference :is(.sweet-frame, .room-olympus-arena) > .feature-meter {
    position: relative;
    z-index: 4;
    right: auto;
    left: auto;
    width: 100%;
    min-height: 24px;
    margin: 0;
    background: #22142af2;
}
.room-sweet .sweet-frame > .feature-meter { position: absolute; top: calc(100% + 4px); }
.room-olympus .room-olympus-arena > .feature-meter { order: 3; top: 0; max-width: 100%; }
.room-reference .feature-meter:not(:has(button:not([hidden]))) {
    clip-path: inset(50%);
    pointer-events: none;
}
.room-olympus .feature-meter { flex-shrink: 0; }
.room-olympus .room-short-stage .room-olympus-grid { max-width: calc((100cqh - 108px) * 1.17); }
.room-olympus .room-olympus-arena { position: relative; display: flex; flex-direction: column; }

.room-dog.room-reference {
    background:
        linear-gradient(#269de8 0 15%, transparent 23%),
        #388c57 url("../../images/dog/reference-v2.6bef6979d7bb.webp") center bottom / 100% 265% no-repeat;
}
.room-dog .room-short-stage .slot-arena {
    --dog-board-width: 100%;
    --dog-round-height: 50px;
    display: flex;
    flex-direction: column;
    width: var(--dog-board-width);
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}
.dog-board {
    position: relative;
    flex: none;
    width: 100%;
    aspect-ratio: 1024 / 997;
    background: url("../../images/dog/reference-v2.6bef6979d7bb.webp") top center / 100% auto no-repeat;
}
.room-dog .room-short-stage .slot-hero {
    position: absolute;
    inset: 35% 0 auto;
    display: grid;
    place-items: center;
    height: 15%;
    padding: 0;
    background: none;
}
.room-dog .slot-hero::after, .room-dog .slot-hero::before { content: none; }
.room-dog .room-short-stage .slot-hero h1 {
    width: 44%;
    margin: 0;
    padding: .16em .4em;
    border: 2px solid #a75a3d;
    border-radius: 32% 24% 29% 25%;
    background: linear-gradient(#f0ae88, #bf6c56);
    color: #ffe270;
    font: 1000 clamp(14px, 5vw, 30px)/.9 'Trebuchet MS', Arial, sans-serif;
    text-align: center;
    text-shadow: 0 2px #973b2e, 0 3px 2px #642713;
    transform: rotate(-4deg);
}
.room-dog .slot-hero h1 span { display: block; color: #fff5df; font-size: .84em; }
.room-dog .room-short-stage .slot-frame {
    position: absolute;
    inset: 54.3% 8.1% 2.9% 8.1%;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}
.room-dog .slot-frame::before, .room-dog .slot-frame::after { content: none; }
.room-dog .room-short-stage .slot-grid {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    padding: 0;
    background: none;
}
.room-dog .slot-cell:not(.is-win, .is-sticky, .is-scatter) { background: none; }
.room-dog .slot-art { background-image: url("../../images/dog/symbols-reference-v2.225ea8536ba1.webp"); }
.dog-round {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-content: center;
    align-items: center;
    column-gap: 8px;
    flex: 0 0 var(--dog-round-height);
    padding: 3px 8px;
    color: #fff0d6;
    background: linear-gradient(110deg, #351e17f5, #231811f5);
    border: 1px solid #e1ab6470;
    border-radius: 0 0 9px 9px;
}
.room-dog .dog-round :is(.slot-meter, .slot-total) {
    grid-column: 1;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0 6px;
    min-height: 0;
    height: auto;
    padding: 0;
    border: 0;
    background: none;
    font-size: 10px;
}
.dog-round .slot-meter { color: #fff0d6; }
.dog-round .slot-meter > strong,
.dog-round .slot-total > span { font-size: 10px; }
.dog-round #slotWin { font-size: 13px; line-height: 1.2; }
.dog-round > button {
    grid-area: 1 / 2 / 3 / 3;
    max-width: 126px;
    min-height: 44px;
    padding: 3px 8px;
    border: 1px solid #e1ab64a0;
    border-radius: 7px;
    background: #553622;
    color: #fff0d6;
    font: 700 10px/1.15 Arial, sans-serif;
    cursor: pointer;
}
.room-dog .dog-board .slot-popup {
    top: auto;
    bottom: 4%;
    padding: 9px 10px;
}
.room-dog .dog-board .slot-barrels > i { min-height: 21px; }
.room-dog .room-round-status #roomGameMessage:empty { background: none; }
.room-dog .room-round-status:has(#roomResult:not(:empty)) :is(#roomGameMessage, #roomResult) {
    clip-path: inset(50%);
}
.room-sound-credit { font-size: 12px; color: #e7d3b9; }
.room-sound-credit a { color: #ffd89a; }

.room-plinko.room-reference { background: radial-gradient(ellipse at 52% 55%, #086b9e, #033364 52%, #051a42 88%); }
.room-plinko .room-short-stage .room-plinko-arena { --plinko-width: min(100%, 470px); }
.room-plinko .room-short-stage .room-plinko-arena h1 {
    height: auto;
    margin: 0 auto 4px;
    font-size: clamp(27px, 7.5vw, 41px);
}
.room-plinko .room-short-stage .room-plinko-history { top: 42px; width: 18%; height: 39%; }
.room-plinko .room-short-stage .room-plinko-arena #plinkoCanvas {
    width: var(--plinko-width);
    height: auto;
    margin-inline: auto;
    aspect-ratio: 1;
}
.room-plinko .room-short-stage .room-plinko-arena .room-plinko-multipliers {
    width: calc(var(--plinko-width) * var(--plinko-bins, 11) / (var(--plinko-bins, 11) + 1));
}
.room-plinko .room-plinko-multipliers[data-reference] span { font-size: clamp(7px, 2.7cqw, 12px); }
.room-plinko .plinko-options summary { background: #021026de; }
.room-plinko .plinko-options[open] { max-width: 100%; }

.room-chicken.room-reference {
    background: #343536;
    --reference-gutter: 0px;
}
.room-chicken .chicken-actor { --chicken-size: min(calc(var(--lane) * .68), 125px, 34cqh); top: 49%; }
.room-chicken .chicken-sprite,
.room-chicken :is(.chicken-car, .chicken-collision-car, .chicken-stopped-car):not(.is-blue)::before {
    background-image: url("../../images/chicken/sprites-reference-v2.120523a4f157.webp");
}
.room-chicken .chicken-actor > .chicken-sprite {
    background: url("../../images/chicken/hen-reference-v2.548abd862918.webp") center / 118% auto no-repeat;
    animation: chicken-breathe-v1 2.6s ease-in-out infinite;
}
.room-chicken .chicken-actor:is(.is-hopping, .is-landing, .is-lost, .is-crowned) > .chicken-sprite {
    background: url("../../images/chicken/hen-reference-v2.548abd862918.webp") center / 118% auto no-repeat;
    animation: none;
}
.room-chicken .chicken-arena { border: 0; border-radius: 0; }
.room-chicken .chicken-viewport { border-radius: 0; border: 0; container-type: size; }
.room-chicken .chicken-lane:not(.is-passed) > strong { top: 57%; }
.chicken-hud-title {
    grid-area: 1 / 1;
    align-self: center;
    margin: 0;
    color: #fff;
    font: 1000 clamp(15px, 4.9vw, 27px)/1 Arial, sans-serif;
    letter-spacing: -.045em;
}
.chicken-hud-title .chicken-edition { font-size: 1.42em; font-style: italic; }
.chicken-hud-tools { grid-area: 1 / 3; display: flex; gap: 5px; }
.chicken-hud-tools button {
    display: grid;
    place-items: center;
    width: clamp(33px, 10vw, 43px);
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    background: #535355;
    color: #fff;
    font-size: 22px;
}
.chicken-hud-tools button[aria-pressed="true"] { color: #ffda62; }
.chicken-hud-tools svg { width: 21px; height: 21px; }
body:not(.browser-player) .room-chicken #gameRoomContent:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: 5px;
}
.room-chicken #gameRoomContent > :not(.chicken-hud-title, .chicken-hud-tools) { grid-column: 1/-1; }
[data-room-mode="demo"] body:not(.browser-player) .room-chicken #gameRoomContent > .room-wallet {
    grid-area: 1 / 2;
    min-height: 42px;
    margin: 0;
    padding: 4px 9px;
    border: 0;
    background: #535355;
    box-shadow: none;
}
[data-room-mode="demo"] .room-chicken .room-wallet :is(.room-wallet-actions, .room-wallet-label) { display: none; }
[data-room-mode="demo"] .room-chicken .room-wallet::before, [data-room-mode="demo"] .room-chicken .room-wallet::after { content: none; }
body:not(.browser-player) .room-chicken .room-wallet strong { font-size: clamp(14px, 4.5vw, 22px); }
.room-chicken .room-decision-controls .room-start { color: #fff; background: #6cbe61; box-shadow: 0 3px 0 #407c38; }
.room-chicken .room-decision-controls .room-stake-row { padding: 3px 5px; background: #515153; border-radius: 10px; }
.room-chicken .room-decision-controls .room-stake-row button,
.room-chicken .chicken-stake-presets button,
.room-chicken #chickenMode { background: #575758; }
.room-chicken .room-decision-controls #roomStake { background: transparent; border: 0; box-shadow: none; }
.room-chicken .room-decision-controls .room-stake-row { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.room-chicken .room-stake-row label { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.room-chicken .room-decision-controls .room-stake-row #roomStake { width: 100%; }
.room-chicken.room-reference.has-active-round #chickenMode { display: block; }

@media (min-width: 601px) {
    .room-reference-instant .room-short-stage > section { max-width: 500px; margin-inline: auto; }
    .room-reference-instant .room-round-status { margin-inline: 0; }
}

@media (max-height: 700px) {
    .room-chicken #gameRoomContent { grid-template-rows: auto minmax(0, 1fr) repeat(3, auto); }
    .room-chicken .room-currencies:not([hidden]) ~ .room-short-stage { grid-row: 4; }
    .room-chicken #gameRoomContent:has(.room-currencies:not([hidden])) { grid-template-rows: repeat(3, auto) minmax(0, 1fr); }
    body:not(.browser-player) .room-reference-instant .room-bet-controls {
        grid-template-columns: 44px 44px 62px 44px 44px;
        padding: 2px 0;
    }
    .room-olympus .room-short-stage .room-olympus-grid { width: min(100cqw, max(138px, calc((100cqh - 62px) * 1.17))); }
    .room-sweet .room-short-stage .sweet-frame { width: min(100cqw, max(138px, calc((100cqh - 75px) * 1.17))); }
    .room-dog .room-short-stage .slot-arena {
        --dog-board-width: min(100cqw, max(160px, calc((100cqh - var(--dog-round-height)) * 1.027)));
        flex: none;
    }
    .room-plinko .room-short-stage .room-plinko-arena { --plinko-width: min(100cqw, max(145px, calc(100cqh - 60px))); }
    .room-plinko .room-short-stage .room-plinko-history { top: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    .room-chicken .chicken-actor > .chicken-sprite { animation: none; }
}
