:root {
    --paper: #fffaf0;
    --paper-deep: #f4ead8;
    --wall: #e8d5b9;
    --wall-line: #d8c2a1;
    --ink: #26312e;
    --ink-soft: #52605b;
    --coral: #d85b47;
    --coral-dark: #a93f31;
    --coral-pale: #f2c0b1;
    --skin: #e7ad7f;
    --skin-shadow: #cb8762;
    --rice: #fffdf5;
    --belt: #3b4945;
    --belt-dark: #26332f;
    --metal: #9aa6a0;
    --line: 2px solid var(--ink);
    --belt-speed: 8s;
    --shadow: 0 16px 0 rgba(38, 49, 46, .08);
    --rounded-font: "Arial Rounded MT Bold", "Trebuchet MS", "Avenir Next Rounded", system-ui, sans-serif;
    --body-font: "Trebuchet MS", "Avenir Next", system-ui, sans-serif;
    --number-font: "Courier New", ui-monospace, monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--paper-deep);
}

body {
    min-width: 320px;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 250, 240, .92) 0 13rem, transparent 13.1rem),
        var(--paper-deep);
    font-family: var(--body-font);
    -webkit-font-smoothing: antialiased;
}

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

button {
    color: inherit;
    font: inherit;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 4px;
}

.paper-grain {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    opacity: .18;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(38, 49, 46, .2) 0 .6px, transparent .75px),
        radial-gradient(circle at 70% 60%, rgba(38, 49, 46, .14) 0 .55px, transparent .7px);
    background-size: 11px 13px, 17px 19px;
}

.game-shell {
    width: min(100%, 1280px);
    min-height: 100dvh;
    margin-inline: auto;
    padding: 18px 28px 26px;
}

.topbar {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    color: var(--coral);
    flex: 0 0 auto;
}

.brand span {
    display: grid;
    line-height: 1;
}

.brand strong {
    font-family: var(--rounded-font);
    font-size: 1.08rem;
    letter-spacing: -.035em;
}

.brand small {
    margin-top: 5px;
    color: var(--ink-soft);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.key-guide {
    color: var(--ink-soft);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

kbd {
    min-width: 21px;
    height: 21px;
    display: inline-grid;
    place-items: center;
    padding: 0 4px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid rgba(38, 49, 46, .32);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-family: var(--number-font);
    font-size: .68rem;
}

.icon-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    color: var(--ink);
    background: transparent;
    border: 1px solid rgba(38, 49, 46, .32);
    border-radius: 50%;
    transition: transform .25s cubic-bezier(.16, 1, .3, 1), background-color .25s ease;
}

.icon-button:hover {
    background: rgba(255, 250, 240, .75);
    transform: rotate(-5deg);
}

.icon-button:active {
    transform: scale(.94);
}

.icon-button svg {
    width: 21px;
    height: 21px;
}

.sound-off,
.icon-button[aria-pressed="false"] .sound-on {
    display: none;
}

.icon-button[aria-pressed="false"] .sound-off {
    display: block;
}

.scoreboard {
    min-height: 82px;
    display: grid;
    grid-template-columns: 1fr 2.1fr 1fr 1fr;
    align-items: stretch;
    margin: 2px 0 14px;
    border-top: 1px solid rgba(38, 49, 46, .22);
    border-bottom: 1px solid rgba(38, 49, 46, .22);
}

.score-stat,
.round-status {
    min-width: 0;
    padding: 13px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.score-stat + .round-status,
.round-status + .score-stat,
.score-stat + .score-stat {
    border-left: 1px solid rgba(38, 49, 46, .18);
}

.stat-label,
.round-copy span {
    color: var(--ink-soft);
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.score-stat strong {
    margin-top: 2px;
    font-family: var(--number-font);
    font-size: 1.48rem;
    line-height: 1;
    letter-spacing: -.06em;
}

.score-stat--primary strong {
    color: var(--coral-dark);
}

.stat-unit {
    margin-left: 2px;
    font-family: var(--rounded-font);
    font-size: .82rem;
}

.round-status {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.round-copy {
    display: grid;
    gap: 2px;
}

.round-copy strong {
    overflow: hidden;
    font-family: var(--rounded-font);
    font-size: 1.18rem;
    letter-spacing: -.03em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.round-pips {
    display: flex;
    gap: 7px;
}

.round-pips span {
    width: 28px;
    height: 6px;
    background: rgba(38, 49, 46, .15);
    border-radius: 20px;
    transition: background-color .25s ease, transform .25s cubic-bezier(.16, 1, .3, 1);
}

.round-pips span.is-active {
    background: var(--coral);
    transform: scaleY(1.25);
}

.game-scene {
    --scene-edge: 3px;
    position: relative;
    min-height: 650px;
    isolation: isolate;
    overflow: hidden;
    background: var(--wall);
    border: var(--scene-edge) solid var(--ink);
    border-radius: 30px;
    box-shadow: var(--shadow);
}

.timer-track {
    position: absolute;
    inset: 0 0 auto;
    z-index: 11;
    height: 8px;
    overflow: hidden;
    background: rgba(38, 49, 46, .14);
}

.timer-fill {
    width: 100%;
    height: 100%;
    display: block;
    background: var(--coral);
    transform: scaleX(1);
    transform-origin: left center;
    will-change: transform;
}

.game-scene.is-urgent .timer-fill {
    animation: timer-pulse .55s ease-in-out infinite alternate;
}

@keyframes timer-pulse {
    to { opacity: .45; }
}

.restaurant-wall {
    position: absolute;
    inset: 0 0 165px;
    z-index: -1;
    overflow: hidden;
    background:
        linear-gradient(rgba(255, 250, 240, .15), rgba(255, 250, 240, 0) 42%),
        repeating-linear-gradient(90deg, transparent 0 128px, rgba(38, 49, 46, .055) 128px 130px);
}

.restaurant-wall::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 96px;
    background: #cfb996;
    border-top: 2px solid rgba(38, 49, 46, .42);
}

.wall-line {
    position: absolute;
    height: 1px;
    background: var(--wall-line);
    transform: rotate(-7deg);
    transform-origin: left center;
}

.wall-line--one {
    width: 210px;
    top: 110px;
    left: -30px;
}

.wall-line--two {
    width: 170px;
    right: 20px;
    bottom: 84px;
    transform: rotate(10deg);
}

.menu-board {
    position: absolute;
    left: 42px;
    top: 48px;
    width: 92px;
    height: 128px;
    padding: 20px 10px;
    display: grid;
    place-items: center;
    color: var(--paper);
    background: var(--ink);
    border: 6px solid #af805f;
    box-shadow: 8px 8px 0 rgba(38, 49, 46, .09);
    font-family: var(--number-font);
    font-size: .72rem;
    letter-spacing: .12em;
}

.menu-board i {
    width: 34px;
    height: 2px;
    background: var(--coral-pale);
}

.norens {
    position: absolute;
    top: 0;
    left: 50%;
    width: 315px;
    height: 92px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    transform: translateX(-50%);
}

.norens::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--coral-dark);
    border-radius: 0 0 7px 7px;
}

.norens span {
    position: relative;
    border-right: 2px solid rgba(255, 250, 240, .38);
}

.norens span:last-child {
    border-right: 0;
}

.norens span::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 22px;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 250, 240, .78);
    border-radius: 50%;
    transform: translateX(-50%);
}

.hanging-lamp {
    position: absolute;
    top: 0;
    width: 3px;
    height: 78px;
    background: var(--ink-soft);
}

.hanging-lamp--left { left: 22%; }
.hanging-lamp--right { right: 16%; }

.hanging-lamp::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -19px;
    width: 64px;
    height: 29px;
    background: var(--ink);
    border-radius: 36px 36px 7px 7px;
    transform: translateX(-50%);
}

.hanging-lamp span {
    position: absolute;
    left: 50%;
    bottom: -33px;
    width: 15px;
    height: 15px;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 50%;
    transform: translateX(-50%);
}

.timer-readout {
    position: absolute;
    top: 31px;
    right: 28px;
    z-index: 3;
    min-width: 112px;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 6px;
    padding: 9px 13px;
    color: var(--ink);
    background: rgba(255, 250, 240, .78);
    border: 1px solid rgba(38, 49, 46, .28);
    border-radius: 100px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}

.timer-readout svg {
    width: 20px;
    height: 20px;
    align-self: center;
}

.timer-readout span {
    font-family: var(--number-font);
    font-size: 1.05rem;
    letter-spacing: -.07em;
}

.timer-readout small {
    color: var(--ink-soft);
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
}

.game-scene.is-urgent .timer-readout {
    color: var(--paper);
    background: var(--coral-dark);
    border-color: var(--coral-dark);
    animation: urgent-bump .65s cubic-bezier(.16, 1, .3, 1) infinite alternate;
}

.game-scene.is-urgent .timer-readout small {
    color: var(--paper);
}

@keyframes urgent-bump {
    to { transform: scale(1.05) rotate(1deg); }
}

.thought-bubble {
    position: absolute;
    left: clamp(145px, 15%, 210px);
    top: 77px;
    z-index: 3;
    width: 190px;
    min-height: 173px;
    padding: 22px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    background: var(--paper);
    border: var(--line);
    border-radius: 49% 51% 46% 54% / 54% 42% 58% 46%;
    box-shadow: 8px 9px 0 rgba(38, 49, 46, .11), inset 0 2px 0 rgba(255, 255, 255, .8);
    transform: rotate(-3deg);
    animation: thought-float 4s ease-in-out infinite;
}

@keyframes thought-float {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-7px) rotate(-1.5deg); }
}

.bubble-kicker,
.bubble-caption {
    font-weight: 800;
    letter-spacing: .1em;
    text-align: center;
    text-transform: uppercase;
}

.bubble-kicker {
    color: var(--coral-dark);
    font-size: .68rem;
}

.thought-bubble strong {
    margin: 2px 0 -1px;
    font-family: var(--number-font);
    font-size: 4.65rem;
    line-height: 1;
    letter-spacing: -.12em;
}

.bubble-caption {
    color: var(--ink-soft);
    font-size: .62rem;
}

.thought-dot {
    position: absolute;
    display: block;
    background: var(--paper);
    border: var(--line);
    border-radius: 50%;
}

.thought-dot--large {
    right: -25px;
    bottom: -19px;
    width: 31px;
    height: 31px;
}

.thought-dot--small {
    right: -42px;
    bottom: -42px;
    width: 17px;
    height: 17px;
}

.chef {
    position: absolute;
    left: 54%;
    bottom: 116px;
    z-index: 2;
    width: 340px;
    transform: translateX(-50%);
    pointer-events: none;
}

.chef-art {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
    animation: chef-breathe 3.6s ease-in-out infinite;
    transform-origin: center bottom;
}

@keyframes chef-breathe {
    0%, 100% { transform: translateY(0) scaleY(1); }
    50% { transform: translateY(-3px) scaleY(1.012); }
}

.chef-shadow { fill: rgba(38, 49, 46, .18); }
.body-shirt { fill: var(--paper); stroke: var(--ink); stroke-width: 5; }
.apron { fill: #d8dfda; stroke: var(--ink); stroke-width: 4; }
.apron-line { fill: none; stroke: rgba(38, 49, 46, .32); stroke-width: 3; }
.arm { fill: none; stroke: var(--skin); stroke-width: 42; stroke-linecap: round; }
.arm--left, .arm--right { filter: none; }
.hand { fill: var(--skin); stroke: var(--ink); stroke-width: 4; }
.neck { fill: var(--skin-shadow); stroke: var(--ink); stroke-width: 4; }
.face, .ear { fill: var(--skin); stroke: var(--ink); stroke-width: 5; }
.ear-line, .nose { fill: none; stroke: var(--skin-shadow); stroke-width: 4; stroke-linecap: round; }
.hair { fill: var(--ink); stroke: var(--ink); stroke-width: 4; }
.headband { fill: var(--coral); stroke: var(--ink); stroke-width: 4; }
.headband-mark { fill: none; stroke: var(--paper); stroke-width: 3; stroke-linecap: round; opacity: .9; }
.brow { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; }
.eye { fill: var(--ink); transform-box: fill-box; transform-origin: center; animation: blink 4.8s ease-in-out infinite; }
.eye--right { animation-delay: .03s; }

@keyframes blink {
    0%, 43%, 47%, 100% { transform: scaleY(1); }
    45% { transform: scaleY(.08); }
}

.cheek { fill: var(--coral); opacity: .25; }
.mouth { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.mouth--happy, .mouth--worried { display: none; }
.mouth--happy path:first-child { fill: var(--ink); }
.mouth--happy .tongue { stroke: var(--coral-pale); stroke-width: 5; }

.game-scene[data-mood="happy"] .mouth--idle,
.game-scene[data-mood="worried"] .mouth--idle {
    display: none;
}

.game-scene[data-mood="happy"] .mouth--happy,
.game-scene[data-mood="worried"] .mouth--worried {
    display: block;
}

.game-scene[data-mood="happy"] .arm--right {
    animation: arm-wave .25s ease-in-out 4 alternate;
    transform-box: fill-box;
    transform-origin: left bottom;
}

@keyframes arm-wave {
    to { transform: rotate(-8deg) translateY(-4px); }
}

.chef.is-worried .chef-art {
    animation: chef-wobble .44s ease-in-out;
}

@keyframes chef-wobble {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px) rotate(-1deg); }
    75% { transform: translateX(8px) rotate(1deg); }
}

.reaction-bubble {
    position: absolute;
    top: 83px;
    right: -72px;
    z-index: 4;
    max-width: 145px;
    padding: 11px 15px;
    opacity: 0;
    color: var(--paper);
    background: var(--ink);
    border: 2px solid var(--paper);
    border-radius: 16px 16px 16px 4px;
    box-shadow: 4px 5px 0 rgba(38, 49, 46, .16);
    font-family: var(--rounded-font);
    font-size: .82rem;
    font-weight: 800;
    text-align: center;
    transform: translateY(8px) scale(.86) rotate(3deg);
    transition: opacity .2s ease, transform .35s cubic-bezier(.2, 1.4, .4, 1);
}

.reaction-bubble.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(3deg);
}

.reaction-bubble::after {
    content: "";
    position: absolute;
    left: -8px;
    bottom: 4px;
    width: 14px;
    height: 14px;
    background: var(--ink);
    border-left: 2px solid var(--paper);
    border-bottom: 2px solid var(--paper);
    transform: rotate(20deg) skew(-15deg);
}

.equation-panel {
    position: absolute;
    left: 50%;
    bottom: 203px;
    z-index: 4;
    min-width: 260px;
    max-width: calc(100% - 40px);
    padding: 8px 18px 10px;
    color: var(--paper);
    background: var(--ink);
    border: 2px solid var(--paper);
    border-radius: 14px;
    box-shadow: 5px 6px 0 rgba(38, 49, 46, .16);
    text-align: center;
    transform: translateX(-50%) rotate(-1deg);
}

.equation-label {
    display: block;
    margin-bottom: 1px;
    color: var(--coral-pale);
    font-size: .59rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.equation {
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--number-font);
    font-size: 1.08rem;
    font-weight: 700;
}

.equation-empty {
    color: rgba(255, 250, 240, .74);
    font-family: var(--body-font);
    font-size: .82rem;
    font-weight: 700;
}

.equation .operator {
    color: var(--coral-pale);
}

.equation .answer {
    color: var(--paper);
    border-bottom: 2px solid var(--coral);
}

.equation-panel.is-wrong {
    animation: equation-shake .36s ease-in-out;
    background: var(--coral-dark);
}

@keyframes equation-shake {
    0%, 100% { transform: translateX(-50%) rotate(-1deg); }
    25% { transform: translateX(calc(-50% - 8px)) rotate(-2deg); }
    75% { transform: translateX(calc(-50% + 8px)) rotate(1deg); }
}

.conveyor {
    position: absolute;
    inset: auto 0 0;
    z-index: 5;
    height: 187px;
}

.belt-rail {
    position: absolute;
    inset: 36px 0 auto;
    height: 111px;
    overflow: hidden;
    background: var(--belt);
    border-top: 4px solid var(--ink);
    border-bottom: 4px solid var(--ink);
}

.belt-slats {
    position: absolute;
    inset: 0 auto 0 -20%;
    width: 140%;
    opacity: .62;
    background: repeating-linear-gradient(90deg, transparent 0 68px, rgba(255, 250, 240, .15) 68px 71px);
    animation: belt-move var(--belt-speed) linear infinite;
    will-change: transform;
}

@keyframes belt-move {
    to { transform: translateX(-20%); }
}

.belt-glint {
    position: absolute;
    inset: 7px 0 auto;
    height: 2px;
    background: rgba(255, 255, 255, .16);
}

.belt-base {
    position: absolute;
    inset: 144px 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    background: var(--belt-dark);
    border-top: 3px solid var(--ink);
}

.belt-base span {
    width: 13px;
    height: 28px;
    display: block;
    margin-top: 5px;
    background: var(--metal);
    border: 2px solid var(--ink);
    border-radius: 2px 2px 8px 8px;
}

.sushi-row {
    --item-count: 6;
    position: absolute;
    inset: 0 16px auto;
    z-index: 2;
    height: 148px;
    display: grid;
    grid-template-columns: repeat(var(--item-count), minmax(82px, 1fr));
    align-items: start;
    gap: 3px;
}

.sushi-button {
    position: relative;
    min-width: 0;
    height: 142px;
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: 0;
    animation: plate-arrive .48s both cubic-bezier(.2, 1.4, .4, 1);
    animation-delay: calc(var(--index) * 55ms);
}

@keyframes plate-arrive {
    from { opacity: 0; transform: translateX(32px) scale(.85); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.plate-stack {
    position: absolute;
    left: 50%;
    top: 18px;
    width: 104px;
    height: 94px;
    transform: translateX(-50%);
    transform-origin: center bottom;
    transition: transform .3s cubic-bezier(.16, 1, .3, 1), filter .2s ease;
}

.plate-rim {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 99px;
    height: 33px;
    background: #c8d1cc;
    border: 3px solid var(--ink);
    border-radius: 50%;
    box-shadow: inset 0 -8px 0 #98a7a0, 0 5px 0 rgba(38, 49, 46, .2);
    transform: translateX(-50%);
}

.plate-rim::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 5px;
    width: 68px;
    height: 15px;
    background: var(--paper);
    border: 2px solid var(--ink-soft);
    border-radius: 50%;
    transform: translateX(-50%);
}

.sushi-piece {
    position: absolute;
    left: 50%;
    top: 0;
    z-index: 2;
    width: 76px;
    height: 68px;
    transform: translateX(-50%);
}

.sushi-rice,
.sushi-topping,
.sushi-number {
    position: absolute;
    display: block;
}

.sushi-piece--nigiri .sushi-rice {
    left: 8px;
    right: 8px;
    bottom: 5px;
    height: 38px;
    background: var(--rice);
    border: 3px solid var(--ink);
    border-radius: 13px 13px 17px 17px;
    box-shadow: inset 0 -6px 0 #e4ded1;
}

.sushi-piece--nigiri .sushi-topping {
    inset: 0 1px auto;
    height: 33px;
    background: var(--coral);
    border: 3px solid var(--ink);
    border-radius: 52% 48% 40% 42%;
    box-shadow: inset 0 -7px 0 rgba(169, 63, 49, .25);
    transform: rotate(-3deg);
}

.sushi-piece--nigiri .sushi-topping::before,
.sushi-piece--nigiri .sushi-topping::after {
    content: "";
    position: absolute;
    top: 4px;
    width: 2px;
    height: 21px;
    background: rgba(255, 250, 240, .34);
    border-radius: 2px;
    transform: rotate(28deg);
}

.sushi-piece--nigiri .sushi-topping::before { left: 19px; }
.sushi-piece--nigiri .sushi-topping::after { right: 19px; }

.sushi-piece--maki {
    top: -2px;
    width: 68px;
    height: 68px;
    background: var(--ink);
    border: 3px solid #18211f;
    border-radius: 50%;
    box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .18);
}

.sushi-piece--maki .sushi-rice {
    inset: 7px;
    background: var(--rice);
    border: 2px solid #bfc4bb;
    border-radius: 50%;
}

.sushi-piece--maki .sushi-topping {
    inset: 20px;
    background: var(--coral);
    border: 2px solid var(--ink);
    border-radius: 38% 62% 56% 44%;
    transform: rotate(18deg);
}

.sushi-piece--gunkan {
    top: 0;
    width: 65px;
    height: 64px;
    background: var(--ink);
    border: 3px solid #18211f;
    border-radius: 12px 12px 18px 18px;
    box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .2);
}

.sushi-piece--gunkan .sushi-rice {
    inset: 6px 6px auto;
    height: 25px;
    background: var(--rice);
    border-radius: 50%;
}

.sushi-piece--gunkan .sushi-topping {
    inset: 3px 8px auto;
    height: 23px;
    background:
        radial-gradient(circle at 20% 40%, var(--coral) 0 4px, transparent 4.5px),
        radial-gradient(circle at 50% 25%, var(--coral) 0 4px, transparent 4.5px),
        radial-gradient(circle at 80% 45%, var(--coral) 0 4px, transparent 4.5px),
        radial-gradient(circle at 40% 72%, var(--coral) 0 4px, transparent 4.5px),
        radial-gradient(circle at 70% 78%, var(--coral) 0 4px, transparent 4.5px);
}

.sushi-number {
    left: 50%;
    top: 18px;
    z-index: 4;
    min-width: 35px;
    height: 31px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    color: var(--ink);
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 9px;
    box-shadow: 0 3px 0 rgba(38, 49, 46, .15);
    font-family: var(--number-font);
    font-size: 1rem;
    line-height: 1;
    letter-spacing: -.08em;
    transform: translateX(-50%) rotate(2deg);
}

.sushi-piece--maki .sushi-number { top: 18px; }
.sushi-piece--gunkan .sushi-number { top: 20px; }

.key-hint {
    position: absolute;
    left: 50%;
    bottom: 1px;
    min-width: 24px;
    height: 23px;
    display: grid;
    place-items: center;
    color: rgba(255, 250, 240, .76);
    background: rgba(38, 49, 46, .54);
    border: 1px solid rgba(255, 250, 240, .38);
    border-radius: 6px;
    font-family: var(--number-font);
    font-size: .68rem;
    transform: translateX(-50%);
}

.sushi-button:hover .plate-stack {
    transform: translateX(-50%) translateY(-8px) rotate(-2deg);
}

.sushi-button:active .plate-stack {
    transform: translateX(-50%) translateY(-3px) scale(.96);
}

.sushi-button.is-selected .plate-stack {
    filter: drop-shadow(0 7px 0 rgba(38, 49, 46, .14));
    transform: translateX(-50%) translateY(-19px) rotate(-3deg) scale(1.04);
}

.sushi-button.is-selected .plate-rim {
    background: var(--coral-pale);
    box-shadow: inset 0 -8px 0 var(--coral), 0 5px 0 rgba(38, 49, 46, .2);
}

.sushi-button.is-selected .key-hint {
    color: var(--paper);
    background: var(--coral-dark);
}

.sushi-button.is-wrong .plate-stack {
    animation: plate-wrong .34s ease-in-out;
}

@keyframes plate-wrong {
    0%, 100% { transform: translateX(-50%) translateY(-19px); }
    33% { transform: translateX(calc(-50% - 7px)) translateY(-19px) rotate(-4deg); }
    66% { transform: translateX(calc(-50% + 7px)) translateY(-19px) rotate(4deg); }
}

.sushi-button.is-fed {
    pointer-events: none;
    z-index: 6;
}

.sushi-button.is-fed .plate-stack {
    animation: feed-nori .72s cubic-bezier(.3, .8, .35, 1) forwards;
}

@keyframes feed-nori {
    0% { opacity: 1; transform: translateX(-50%) translateY(-19px) scale(1); }
    55% { opacity: 1; transform: translateX(-50%) translateY(-145px) scale(.72) rotate(8deg); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-190px) scale(.35) rotate(14deg); }
}

.game-overlay {
    position: absolute;
    inset: 8px 0 0;
    z-index: 9;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 34px clamp(28px, 6vw, 82px) 184px;
    background: linear-gradient(90deg, rgba(232, 213, 185, .1), rgba(232, 213, 185, .48) 47%, rgba(232, 213, 185, .95) 72%);
    transition: opacity .35s ease, visibility .35s ease;
}

.game-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-panel {
    width: min(100%, 400px);
    padding: 10px 0;
    animation: panel-enter .6s cubic-bezier(.2, 1.2, .4, 1) both;
}

@keyframes panel-enter {
    from { opacity: 0; transform: translateX(24px) scale(.96); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.intro-eyebrow {
    display: inline-block;
    margin-bottom: 11px;
    color: var(--coral-dark);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.intro-panel h1 {
    max-width: 11ch;
    margin: 0;
    font-family: var(--rounded-font);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: .98;
    letter-spacing: -.065em;
}

.intro-panel p {
    margin: 16px 0 18px;
    color: var(--ink-soft);
    font-size: .93rem;
    font-weight: 600;
    line-height: 1.48;
}

.example-sum {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 21px;
    font-family: var(--number-font);
}

.example-sum span,
.example-sum strong {
    min-width: 43px;
    height: 39px;
    display: grid;
    place-items: center;
    border-bottom: 3px solid rgba(38, 49, 46, .35);
}

.example-sum strong {
    color: var(--coral-dark);
    border-color: var(--coral-dark);
}

.example-sum i {
    color: var(--ink-soft);
    font-style: normal;
}

.result-summary {
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    margin: 4px 0 22px;
    overflow: hidden;
    background: rgba(38, 49, 46, .22);
    border: 1px solid rgba(38, 49, 46, .22);
    border-radius: 10px;
}

.result-summary:not([hidden]) {
    display: grid;
}

.result-summary div {
    padding: 12px;
    display: grid;
    gap: 3px;
    background: var(--paper-deep);
}

.result-summary span {
    color: var(--ink-soft);
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.result-summary strong {
    font-family: var(--number-font);
    font-size: 1.25rem;
}

.start-button {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 17px 0 20px;
    cursor: pointer;
    color: var(--paper);
    background: var(--coral-dark);
    border: 2px solid var(--ink);
    border-radius: 12px;
    box-shadow: 0 5px 0 var(--ink);
    font-family: var(--rounded-font);
    font-size: .9rem;
    font-weight: 800;
    transition: transform .22s cubic-bezier(.16, 1, .3, 1), box-shadow .22s ease;
}

.start-button svg {
    width: 21px;
    height: 21px;
    transition: transform .22s cubic-bezier(.16, 1, .3, 1);
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 var(--ink);
}

.start-button:hover svg {
    transform: translateX(3px);
}

.start-button:active {
    transform: translateY(4px) scale(.99);
    box-shadow: 0 1px 0 var(--ink);
}

.intro-note {
    display: block;
    margin-top: 13px;
    color: var(--ink-soft);
    font-size: .68rem;
    font-weight: 700;
    text-align: center;
}

.countdown {
    position: absolute;
    inset: 8px 0 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding-bottom: 150px;
    background: rgba(232, 213, 185, .45);
    backdrop-filter: blur(2px);
}

.countdown[hidden] {
    display: none;
}

.countdown span {
    width: 130px;
    height: 130px;
    display: grid;
    place-items: center;
    color: var(--paper);
    background: var(--coral-dark);
    border: 4px solid var(--ink);
    border-radius: 48% 52% 45% 55%;
    box-shadow: 10px 11px 0 rgba(38, 49, 46, .16);
    font-family: var(--number-font);
    font-size: 4.5rem;
    line-height: 1;
    animation: countdown-pop .74s cubic-bezier(.2, 1.4, .4, 1) both;
}

@keyframes countdown-pop {
    0% { opacity: 0; transform: scale(.4) rotate(-9deg); }
    40% { opacity: 1; transform: scale(1.08) rotate(3deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

.game-footer {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 4px 0;
    color: var(--ink-soft);
    font-size: .72rem;
    font-weight: 600;
}

.game-footer p {
    margin: 0;
}

.game-footer p:last-child {
    text-align: right;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 960px) {
    .game-shell {
        padding-inline: 18px;
    }

    .game-scene {
        min-height: 640px;
    }

    .thought-bubble {
        left: 70px;
        top: 68px;
    }

    .chef {
        left: 53%;
        width: 315px;
    }

    .hanging-lamp--left { left: 25%; }
    .menu-board { left: 22px; transform: scale(.84); transform-origin: top left; }

    .sushi-row {
        inset-inline: 8px;
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(102px, 1fr);
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
    }

    .sushi-row::-webkit-scrollbar { display: none; }

    .game-overlay {
        padding-right: 38px;
    }
}

@media (max-width: 720px) {
    .game-shell {
        padding: 10px 10px 18px;
    }

    .topbar {
        min-height: 55px;
    }

    .brand-mark {
        width: 36px;
        height: 36px;
    }

    .key-guide { display: none; }

    .scoreboard {
        min-height: 70px;
        grid-template-columns: .8fr 1.4fr .8fr;
        margin-bottom: 9px;
    }

    .score-stat,
    .round-status {
        padding: 9px 10px;
    }

    .score-stat--best { display: none; }

    .round-status {
        gap: 7px;
        justify-content: center;
        text-align: center;
    }

    .round-pips { display: none; }

    .round-copy strong { font-size: .95rem; }
    .score-stat strong { font-size: 1.15rem; }
    .score-stat:last-child { text-align: right; }

    .game-scene {
        min-height: 650px;
        border-radius: 22px;
    }

    .restaurant-wall {
        inset-bottom: 167px;
    }

    .restaurant-wall::after { height: 75px; }
    .menu-board, .hanging-lamp--right { display: none; }
    .hanging-lamp--left { left: 86%; transform: scale(.72); transform-origin: top; }

    .norens {
        width: 228px;
        height: 69px;
    }

    .thought-bubble {
        left: 17px;
        top: 40px;
        width: 148px;
        min-height: 139px;
        padding: 17px 13px;
    }

    .thought-bubble strong { font-size: 3.65rem; }
    .bubble-kicker { font-size: .59rem; }
    .bubble-caption { font-size: .52rem; }

    .thought-dot--large {
        right: -18px;
        bottom: -15px;
        width: 24px;
        height: 24px;
    }

    .thought-dot--small {
        right: -30px;
        bottom: -31px;
        width: 13px;
        height: 13px;
    }

    .timer-readout {
        top: 20px;
        right: 13px;
        min-width: 98px;
        padding: 7px 10px;
    }

    .timer-readout svg { width: 17px; height: 17px; }

    .chef {
        left: 56%;
        bottom: 128px;
        width: 275px;
    }

    .reaction-bubble {
        top: 83px;
        right: -28px;
        max-width: 112px;
        padding: 8px 10px;
        font-size: .69rem;
    }

    .equation-panel {
        bottom: 202px;
        min-width: 225px;
        padding: 7px 13px 8px;
    }

    .conveyor { height: 185px; }

    .game-overlay {
        justify-content: center;
        padding: 76px 16px 177px;
        background: rgba(232, 213, 185, .88);
    }

    .intro-panel {
        width: min(100%, 370px);
        padding: 18px;
    }

    .intro-panel h1 {
        max-width: 12ch;
        font-size: 2.25rem;
    }

    .intro-panel p {
        margin-block: 13px 15px;
        font-size: .84rem;
    }

    .example-sum { margin-bottom: 17px; }

    .game-footer {
        justify-content: center;
        text-align: center;
    }

    .game-footer p:last-child { display: none; }
}

@media (max-width: 430px) {
    .brand small { display: none; }
    .icon-button { width: 38px; height: 38px; }

    .game-scene { min-height: 625px; }
    .thought-bubble { top: 35px; width: 139px; min-height: 130px; }
    .thought-bubble strong { font-size: 3.3rem; }
    .timer-readout { top: 18px; }

    .chef {
        left: 58%;
        bottom: 128px;
        width: 245px;
    }

    .equation-panel {
        bottom: 199px;
        min-width: 205px;
    }

    .equation { font-size: .92rem; }
    .plate-stack { transform: translateX(-50%) scale(.93); }
    .sushi-button:hover .plate-stack { transform: translateX(-50%) translateY(-6px) scale(.93); }
    .sushi-button.is-selected .plate-stack { transform: translateX(-50%) translateY(-17px) rotate(-3deg) scale(.97); }

    .intro-panel { padding: 15px; }
    .intro-panel h1 { font-size: 2rem; }
    .intro-note { display: none; }

    .countdown { padding-bottom: 135px; }
    .countdown span { width: 104px; height: 104px; font-size: 3.55rem; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }

    .chef-art,
    .thought-bubble,
    .eye,
    .belt-slats,
    .game-scene.is-urgent .timer-fill,
    .game-scene.is-urgent .timer-readout {
        animation: none;
    }

    .sushi-button,
    .intro-panel {
        animation-duration: .01ms;
    }
}

/* Full-screen belt game */
html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.game-shell {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    max-width: none;
    margin: 0;
    padding: 0;
}

.game-scene {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.timer-track {
    z-index: 12;
    height: clamp(7px, 1.1vh, 12px);
    background: rgba(38, 49, 46, .18);
}

.timer-track::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(248, 242, 228, .82);
    pointer-events: none;
}

.scene-sound {
    position: absolute;
    top: clamp(20px, 3vw, 38px);
    left: clamp(20px, 3vw, 38px);
    z-index: 8;
    color: var(--ink);
    background: rgba(255, 250, 240, .72);
    border-color: rgba(38, 49, 46, .3);
}

.restaurant-wall {
    inset: 0 0 clamp(175px, 23vh, 245px);
}

.norens {
    width: clamp(230px, 27vw, 390px);
    height: clamp(64px, 10vh, 102px);
}

.chef {
    --nori-scale: 1;
    left: 50%;
    bottom: clamp(115px, 15vh, 158px);
    width: clamp(300px, 32vw, 440px);
    transform: translateX(-50%) scale(var(--nori-scale));
    transform-origin: center bottom;
    transition: transform .72s cubic-bezier(.16, 1, .3, 1);
}

.chef.is-growing .chef-art {
    animation: nori-grow-pop .7s cubic-bezier(.16, 1, .3, 1);
}

@keyframes nori-grow-pop {
    0% { transform: scale(1); }
    42% { transform: scale(1.08, .94); }
    72% { transform: scale(.98, 1.04); }
    100% { transform: scale(1); }
}

.cap-target {
    position: absolute;
    left: 50%;
    top: -52px;
    z-index: 5;
    width: clamp(90px, 8.4vw, 118px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: var(--paper);
    border: 4px solid var(--ink);
    border-radius: 50%;
    box-shadow: 7px 8px 0 rgba(38, 49, 46, .14), inset 0 2px 0 #fff;
    font-family: var(--number-font);
    transform: translateX(-50%) rotate(-2deg);
    animation: target-hover 2.8s ease-in-out infinite;
}

.cap-target::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -13px;
    width: 19px;
    height: 19px;
    background: var(--paper);
    border-right: 4px solid var(--ink);
    border-bottom: 4px solid var(--ink);
    transform: translateX(-50%) rotate(45deg);
}

.cap-target strong {
    position: relative;
    z-index: 1;
    font-size: clamp(2.35rem, 4.1vw, 3.8rem);
    line-height: 1;
    letter-spacing: -.13em;
}

@keyframes target-hover {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(-2deg); }
    50% { transform: translateX(-50%) translateY(-5px) rotate(1deg); }
}

.held-sushi {
    position: absolute;
    left: 12%;
    bottom: 8%;
    z-index: 4;
    width: 61px;
    height: 54px;
    display: grid;
    place-items: center;
    opacity: 0;
    color: var(--ink);
    background: var(--coral);
    border: 3px solid var(--ink);
    border-radius: 50% 50% 42% 45%;
    box-shadow: inset 0 -10px 0 rgba(169, 63, 49, .25), 4px 5px 0 rgba(38, 49, 46, .14);
    transform: translateY(18px) scale(.65) rotate(-12deg);
    transition: opacity .2s ease, transform .45s cubic-bezier(.2, 1.4, .4, 1);
}

.held-sushi::after {
    content: "";
    position: absolute;
    inset: 12px 8px;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 8px;
}

.held-sushi strong {
    position: relative;
    z-index: 1;
    font-family: var(--number-font);
    font-size: 1rem;
}

.chef.has-held .held-sushi {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(-5deg);
}

.anger-marks {
    display: none;
    fill: none;
    stroke: var(--coral-dark);
    stroke-width: 6;
    stroke-linecap: round;
}

.game-scene[data-mood="angry"] .mouth--idle,
.game-scene[data-mood="angry"] .mouth--happy {
    display: none;
}

.game-scene[data-mood="angry"] .mouth--worried,
.game-scene[data-mood="angry"] .anger-marks {
    display: block;
}

.game-scene[data-mood="angry"] .brow--left {
    transform: rotate(18deg) translate(3px, -2px);
    transform-origin: center;
}

.game-scene[data-mood="angry"] .brow--right {
    transform: rotate(-18deg) translate(-3px, -2px);
    transform-origin: center;
}

.game-scene[data-mood="angry"] .face {
    fill: #df8e70;
}

.chef.is-angry .chef-art {
    animation: angry-rattle .18s ease-in-out infinite alternate;
}

@keyframes angry-rattle {
    from { transform: translateX(-4px) rotate(-.6deg); }
    to { transform: translateX(4px) rotate(.6deg); }
}

.conveyor {
    height: clamp(175px, 23vh, 245px);
}

.belt-rail {
    inset: clamp(34px, 4.8vh, 52px) 0 auto;
    height: clamp(105px, 14vh, 146px);
}

.belt-slats {
    animation-duration: var(--slat-speed, 5s);
}

@keyframes belt-move {
    from { transform: translateX(-20%); }
    to { transform: translateX(0); }
}

.belt-base {
    inset: auto 0 0;
    height: clamp(39px, 5.5vh, 58px);
}

.sushi-row {
    position: absolute;
    inset: 0;
    height: clamp(150px, 19vh, 190px);
    display: block;
    overflow: visible;
    pointer-events: none;
}

.sushi-button {
    position: absolute;
    left: 0;
    top: 0;
    width: 116px;
    min-width: 116px;
    height: clamp(145px, 18vh, 180px);
    pointer-events: auto;
    animation-name: sushi-stream;
    animation-duration: var(--belt-speed);
    animation-delay: var(--travel-delay, 0s);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
    will-change: transform;
}

@keyframes sushi-stream {
    from { transform: translate3d(-9rem, 0, 0); }
    to { transform: translate3d(calc(100vw + 9rem), 0, 0); }
}

.sushi-button.is-captured .plate-stack {
    opacity: 0;
}

.game-scene.is-game-over .sushi-button,
.game-scene.is-game-over .belt-slats {
    animation-play-state: paused;
}

.key-hint {
    display: none;
}

.game-overlay {
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 13vw 15vh 0;
    background: transparent;
    backdrop-filter: none;
}

.game-overlay.is-game-over {
    justify-content: flex-end;
    padding: 0 13vw 15vh 0;
    background: rgba(169, 63, 49, .09);
}

.start-button {
    width: clamp(82px, 8vw, 112px);
    min-height: 0;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--paper);
    background: var(--coral-dark);
    border: 4px solid var(--ink);
    border-radius: 50%;
    box-shadow: 0 8px 0 var(--ink);
}

.start-button svg {
    grid-area: 1 / 1;
    width: 62%;
    height: 62%;
}

.start-button .replay-icon,
.game-overlay.is-game-over .start-button .play-icon {
    display: none;
}

.game-overlay.is-game-over .start-button .replay-icon {
    display: block;
}

.start-button:hover {
    transform: translateY(-3px) rotate(-3deg);
    box-shadow: 0 11px 0 var(--ink);
}

.start-button:active {
    transform: translateY(6px) scale(.96);
    box-shadow: 0 2px 0 var(--ink);
}

.result-number {
    display: none;
}

.result-number strong {
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -.12em;
}

.countdown {
    inset: 0;
    padding-bottom: 14vh;
    background: rgba(232, 213, 185, .28);
    backdrop-filter: none;
}

@media (max-width: 720px) {
    .game-shell,
    .game-scene {
        min-height: 100dvh;
        height: 100dvh;
    }

    .scene-sound {
        top: 18px;
        left: 16px;
    }

    .hanging-lamp--left,
    .hanging-lamp--right {
        display: none;
    }

    .chef {
        left: 50%;
        bottom: 119px;
        width: clamp(245px, 72vw, 310px);
    }

    .cap-target {
        top: -38px;
        width: 88px;
    }

    .cap-target strong {
        font-size: 2.45rem;
    }

    .held-sushi {
        width: 50px;
        height: 45px;
    }

    .conveyor {
        height: 178px;
    }

    .restaurant-wall {
        inset-bottom: 178px;
    }

    .belt-rail {
        top: 36px;
        height: 108px;
    }

    .sushi-button {
        width: 104px;
        min-width: 104px;
        height: 148px;
    }

    .plate-stack {
        transform: translateX(-50%) scale(.92);
    }

    .sushi-button:hover .plate-stack {
        transform: translateX(-50%) translateY(-6px) scale(.92);
    }

    .game-overlay {
        align-items: flex-start;
        justify-content: flex-end;
        padding: 22vh 9vw 0 0;
        background: transparent;
    }

    .game-overlay.is-game-over {
        justify-content: flex-end;
        padding: 22vh 9vw 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sushi-button {
        animation-duration: var(--belt-speed) !important;
    }

    .cap-target,
    .chef-art {
        animation: none;
    }
}
