:root {
    color-scheme: light;
    --paper: #fffef8;
    --cream: #f3f5e8;
    --cream-deep: #dde3c5;
    --ink: #34391f;
    --muted: #74775c;
    --tomato: #727533;
    --tomato-dark: #4a4e20;
    --basil: #727533;
    --basil-dark: #4a4e20;
    --mustard: #f0b94b;
    --peach: #b7c787;
    --board: #e1e8cc;
    --tile: #fffef9;
    --tile-border: #ccd5ad;
    --shadow: 0 16px 42px rgba(75, 79, 32, 0.14);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #e6e8d7;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 50% -10%, rgba(251, 253, 239, 0.98), transparent 42%),
        #e6e8d7;
    color: var(--ink);
    overscroll-behavior: none;
}

body.intro-active {
    overflow: hidden;
}

.opening-intro {
    position: fixed;
    z-index: 1000;
    inset: 0;
    overflow: hidden;
    background:
        linear-gradient(rgba(184, 199, 112, 0.026) 1px, transparent 1px),
        linear-gradient(90deg, rgba(184, 199, 112, 0.026) 1px, transparent 1px),
        radial-gradient(ellipse 62% 90% at 10% 48%, rgba(114, 117, 51, 0.34), transparent 72%),
        linear-gradient(112deg, #1b2412 0%, #17200f 38%, #111b10 68%, #0b1510 100%);
    background-size: 32px 32px, 32px 32px, auto, auto;
    color: #f7f8ec;
    isolation: isolate;
    touch-action: manipulation;
}

.opening-intro::before,
.opening-intro::after {
    position: absolute;
    content: "";
    border-radius: 50%;
    pointer-events: none;
}

.opening-intro::before {
    top: -18vmax;
    left: -24vmax;
    width: 62vmax;
    height: 62vmax;
    border: 1px solid rgba(184, 199, 112, 0.1);
    box-shadow: 0 0 0 7vmax rgba(114, 117, 51, 0.04), 0 0 0 14vmax rgba(214, 162, 74, 0.025);
}

.opening-intro::after {
    right: -18vmax;
    bottom: -22vmax;
    width: 58vmax;
    height: 58vmax;
    background: rgba(214, 162, 74, 0.055);
}

.opening-intro.is-leaving {
    pointer-events: none;
    animation: opening-leave 520ms cubic-bezier(.55, .06, .68, .19) both;
}

.opening-intro[hidden] {
    display: none;
}

.skip-opening {
    position: absolute;
    z-index: 20;
    top: max(16px, env(safe-area-inset-top));
    right: 17px;
    padding: 7px 12px;
    border: 1px solid rgba(214, 162, 74, 0.2);
    border-radius: 999px;
    background: rgba(23, 32, 15, 0.54);
    color: #e7d49a;
    font-size: 11px;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.opening-scene {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    width: min(100%, 520px);
    margin: 0 auto;
    padding: max(68px, env(safe-area-inset-top)) 24px max(66px, env(safe-area-inset-bottom));
    opacity: 0;
    visibility: hidden;
    transform: scale(1.045);
    transition: opacity 520ms ease, transform 700ms cubic-bezier(.2, .8, .2, 1), visibility 520ms;
}

.opening-scene.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.opening-studio-logo-shell {
    position: relative;
    display: grid;
    place-items: center;
    width: 118px;
    height: 118px;
    margin-bottom: 9px;
    animation: opening-brand-float 2.8s ease-in-out infinite;
}

.opening-studio-logo-shell::before {
    position: absolute;
    inset: 23px;
    content: "";
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(114, 117, 51, 0.62), rgba(214, 162, 74, 0.42));
    filter: blur(22px);
}

.opening-studio-logo-shell img {
    position: relative;
    width: 112px;
    height: 112px;
    object-fit: contain;
    filter: drop-shadow(0 15px 24px rgba(5, 10, 4, 0.42));
}

.opening-studio-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 7px;
    color: #b8c770;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.25em;
}

.opening-studio-kicker span {
    width: 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #727533);
}

.opening-studio-kicker span:last-child {
    background: linear-gradient(90deg, #d6a24a, transparent);
}

.opening-scene-one h1 {
    margin: 0;
    font-family: Georgia, "STSong", serif;
    color: #f7f8ec;
    font-size: clamp(23px, 6.8vw, 34px);
    line-height: 1.48;
    text-align: center;
    text-wrap: balance;
    animation: opening-copy-in 780ms 180ms cubic-bezier(.2, .82, .2, 1) both;
}

.opening-scene-one h1 strong {
    display: block;
    margin-top: 4px;
    background: linear-gradient(90deg, #aebc63 0%, #d6a24a 52%, #f0cb78 100%);
    background-clip: text;
    color: transparent;
    font-size: 0.78em;
    font-weight: 800;
    line-height: 1.48;
    -webkit-background-clip: text;
}

.opening-studio-loader {
    position: relative;
    width: 116px;
    height: 3px;
    margin-top: 25px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(184, 199, 112, 0.14);
}

.opening-studio-loader i {
    position: absolute;
    inset: 0;
    width: 48%;
    border-radius: inherit;
    background: linear-gradient(90deg, #727533, #d6a24a, #f0cb78);
    animation: opening-studio-loading 1.25s ease-in-out infinite;
}

.opening-tap-hint {
    position: absolute;
    right: 0;
    bottom: max(32px, calc(env(safe-area-inset-bottom) + 18px));
    left: 0;
    margin: 0;
    color: rgba(232, 235, 211, 0.62);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-align: center;
    animation: opening-hint 1.5s ease-in-out infinite;
}

.opening-scene-two {
    align-content: stretch;
    background:
        radial-gradient(circle at 52% 35%, rgba(239, 242, 213, 0.96), transparent 40%),
        linear-gradient(155deg, #f9faef 0%, #dce4bd 54%, #aab66d 100%);
    color: #34391f;
    box-shadow: 0 0 70px rgba(6, 12, 5, 0.34);
}

.opening-scene-two .opening-tap-hint {
    color: rgba(52, 57, 31, 0.62);
}

.wife-photo-card {
    position: absolute;
    z-index: 4;
    top: max(76px, calc(env(safe-area-inset-top) + 58px));
    right: 7%;
    width: min(58vw, 286px);
    padding: 8px 8px 24px;
    border-radius: 6px;
    background: #fffdf4;
    box-shadow: 0 18px 45px rgba(61, 51, 25, 0.3);
    opacity: 0;
    transform: translate(28px, -12px) rotate(4deg) scale(0.88);
}

.opening-scene-two.active .wife-photo-card {
    animation: opening-photo-in 700ms 100ms cubic-bezier(.16, .88, .26, 1.14) forwards;
}

.wife-photo-card img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center top;
    border-radius: 3px;
}

.wife-photo-card span {
    position: absolute;
    right: 0;
    bottom: 7px;
    left: 0;
    color: #727533;
    font-family: Georgia, serif;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-align: center;
}

.opening-dog {
    position: absolute;
    z-index: 6;
    bottom: 1.5%;
    left: -8%;
    width: min(65vw, 325px);
    max-height: 69%;
    object-fit: contain;
    opacity: 0;
    filter: drop-shadow(0 15px 17px rgba(66, 51, 25, 0.25));
    transform: translate(-30px, 35px) rotate(-3deg);
}

.opening-scene-two.active .opening-dog {
    animation: opening-dog-in 760ms 390ms cubic-bezier(.18, .86, .24, 1.12) forwards,
        opening-dog-bob 1.8s 1.15s ease-in-out infinite;
}

.dog-speech {
    position: absolute;
    z-index: 8;
    right: 6%;
    bottom: 15%;
    width: min(61%, 292px);
    padding: 13px 15px;
    border: 2px solid rgba(114, 117, 51, 0.22);
    border-radius: 18px 18px 5px 18px;
    background: rgba(255, 254, 248, 0.95);
    box-shadow: 0 10px 28px rgba(64, 51, 27, 0.2);
    font-family: Georgia, "STSong", serif;
    font-size: clamp(14px, 4.2vw, 19px);
    font-weight: 800;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(16px) scale(0.9);
}

.dog-speech::after {
    position: absolute;
    right: 20px;
    bottom: -10px;
    width: 17px;
    height: 17px;
    content: "";
    background: #fffef8;
    border-right: 2px solid rgba(114, 117, 51, 0.22);
    border-bottom: 2px solid rgba(114, 117, 51, 0.22);
    transform: rotate(45deg);
}

.opening-scene-two.active .dog-speech {
    animation: opening-speech-in 520ms 920ms cubic-bezier(.16, .88, .26, 1.14) forwards;
}

.opening-progress {
    position: absolute;
    z-index: 20;
    bottom: max(15px, env(safe-area-inset-bottom));
    left: 50%;
    display: flex;
    gap: 6px;
    transform: translateX(-50%);
}

.opening-progress i {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(74, 78, 32, 0.28);
    transition: width 300ms ease, background 300ms ease;
}

.opening-progress i.active {
    width: 22px;
    background: #727533;
}

@keyframes opening-copy-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes opening-brand-float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-7px) rotate(2deg); }
}

@keyframes opening-studio-loading {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(245%); }
}

@keyframes opening-hint {
    0%, 100% { opacity: 0.45; transform: translateY(0); }
    50% { opacity: 0.9; transform: translateY(-3px); }
}

@keyframes opening-photo-in {
    to { opacity: 1; transform: translate(0, 0) rotate(2deg) scale(1); }
}

@keyframes opening-dog-in {
    to { opacity: 1; transform: translate(0, 0) rotate(0); }
}

@keyframes opening-dog-bob {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-7px) rotate(1deg); }
}

@keyframes opening-speech-in {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes opening-leave {
    to { opacity: 0; transform: scale(1.055); filter: blur(5px); }
}

button {
    color: inherit;
    font: inherit;
}

button:focus-visible {
    outline: 3px solid rgba(114, 117, 51, 0.38);
    outline-offset: 2px;
}

.app-shell {
    width: min(100%, 460px);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding:
        max(10px, env(safe-area-inset-top))
        12px
        max(122px, calc(110px + env(safe-area-inset-bottom)));
    background:
        linear-gradient(rgba(255, 254, 248, 0.97), rgba(243, 245, 232, 0.98)),
        repeating-linear-gradient(0deg, transparent 0 23px, rgba(82, 87, 35, 0.025) 24px);
    box-shadow: 0 0 60px rgba(65, 69, 28, 0.16);
}

.topbar {
    position: sticky;
    z-index: 80;
    top: 0;
    display: grid;
    grid-template-columns: 48px 1fr 44px;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 5px 8px 9px;
    border-bottom: 1px solid rgba(114, 117, 51, 0.1);
    border-radius: 0 0 16px 16px;
    background: rgba(255, 254, 248, 0.94);
    box-shadow: 0 7px 18px rgba(75, 79, 32, 0.07);
    backdrop-filter: blur(12px);
}

.level-badge {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 2px solid var(--basil);
    border-radius: 50%;
    background: var(--paper);
    box-shadow: inset 0 0 0 3px rgba(114, 117, 51, 0.13);
    line-height: 1;
}

.level-badge strong {
    font-family: Georgia, serif;
    font-size: 21px;
    color: var(--basil-dark);
}

.level-caption {
    margin-bottom: -4px;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.brand-lockup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.brand-lockup h1,
.brand-lockup p {
    margin: 0;
}

.brand-lockup h1 {
    font-family: "Noto Serif SC", "Songti SC", Georgia, serif;
    font-size: 19px;
    line-height: 1;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.brand-lockup p {
    margin-top: 2px;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--tomato);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 46% 54%;
    background: var(--tomato);
    color: white;
    font-family: Georgia, serif;
    font-size: 21px;
    font-style: italic;
    font-weight: 700;
    transform: rotate(-5deg);
    box-shadow: 0 4px 0 var(--tomato-dark);
}

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

.dialog-game-name {
    position: sticky;
    z-index: 30;
    top: 0;
    width: fit-content;
    margin: -4px auto 8px;
    padding: 5px 14px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    background: rgba(82, 87, 35, 0.94);
    box-shadow: 0 5px 16px rgba(47, 50, 23, 0.18);
    color: #fffef8;
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.icon-button,
.small-button {
    border: 1px solid rgba(88, 65, 47, 0.14);
    background: rgba(255, 253, 247, 0.88);
    box-shadow: 0 5px 14px rgba(70, 45, 29, 0.08);
    cursor: pointer;
}

.icon-button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 20px;
    font-weight: 800;
}

.system-ribbon {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    margin: -2px 0 9px;
}

.system-chip {
    position: relative;
    display: grid;
    grid-template-columns: 18px 1fr;
    grid-template-rows: auto auto;
    column-gap: 3px;
    align-items: center;
    min-width: 0;
    padding: 6px 5px;
    border: 1px solid rgba(93, 99, 42, 0.14);
    border-radius: 13px;
    background: rgba(255, 254, 248, 0.94);
    box-shadow: 0 5px 13px rgba(71, 75, 30, 0.07);
    cursor: pointer;
    text-align: left;
}

.system-chip > span {
    grid-row: 1 / 3;
    font-size: 16px;
    text-align: center;
}

.system-chip small {
    overflow: hidden;
    color: var(--muted);
    font-size: 7px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.system-chip strong {
    color: var(--basil-dark);
    font-family: Georgia, serif;
    font-size: 12px;
    line-height: 1;
}

.star-chip > span { color: #d99b23; }
.diamond-chip > span { color: #4a9a8e; }

.notice-badge {
    position: absolute;
    top: -5px;
    right: -3px;
    display: grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid var(--paper);
    border-radius: 999px;
    background: #db684f;
    color: white;
    font-size: 8px;
    font-style: normal;
    font-weight: 900;
}

.restaurant-card {
    position: relative;
    height: 132px;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    box-shadow: var(--shadow);
    isolation: isolate;
}

.restaurant-card img,
.restaurant-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.restaurant-card img {
    z-index: -2;
    object-fit: cover;
    object-position: center 58%;
}

.restaurant-shade {
    z-index: -1;
    background: linear-gradient(90deg, rgba(62, 67, 25, 0.86), rgba(62, 67, 25, 0.4) 72%, rgba(62, 67, 25, 0.14));
}

.restaurant-copy {
    height: 100%;
    padding: 14px 15px 11px;
    color: white;
}

.restaurant-kicker,
.eyebrow {
    margin: 0;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.18em;
}

.restaurant-kicker {
    color: #e8edc9;
}

.restaurant-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
}

.restaurant-heading h2,
.restaurant-heading p {
    margin: 0;
}

.restaurant-heading h2 {
    font-family: Georgia, "STSong", serif;
    font-size: 22px;
    line-height: 1.2;
}

.restaurant-heading p {
    max-width: 270px;
    margin-top: 3px;
    overflow: hidden;
    font-size: 10px;
    opacity: 0.82;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.star-counter {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 62px;
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(34, 26, 19, 0.38);
    backdrop-filter: blur(8px);
}

.star-counter span {
    color: #ffd26c;
}

.restaurant-actions {
    display: grid;
    justify-items: end;
    gap: 5px;
}

.restaurant-entry {
    padding: 4px 9px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 999px;
    background: rgba(114, 117, 51, 0.95);
    color: white;
    cursor: pointer;
    font-size: 9px;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(28, 20, 14, 0.2);
}

.progress-track {
    height: 8px;
    margin-top: 11px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    background: rgba(25, 20, 13, 0.45);
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #a4b560, #727533);
    box-shadow: 0 0 10px rgba(164, 181, 96, 0.5);
    transition: width 420ms cubic-bezier(.2, .8, .2, 1);
}

.progress-label {
    margin: 4px 0 0;
    text-align: right;
    font-size: 9px;
    opacity: 0.86;
}

.orders-panel,
.board-panel {
    margin-top: 10px;
    border: 1px solid rgba(89, 94, 40, 0.13);
    background: rgba(255, 254, 248, 0.92);
    box-shadow: 0 10px 24px rgba(71, 75, 30, 0.08);
}

.orders-panel {
    padding: 11px 11px 10px;
    border-radius: 20px;
}

.section-heading,
.board-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.section-heading h2,
.board-toolbar h2 {
    margin: 2px 0 0;
    font-family: Georgia, "STSong", serif;
    font-size: 17px;
}

.eyebrow {
    color: var(--tomato);
}

.order-hint {
    padding: 4px 8px;
    border-radius: 999px;
    background: #edf1dc;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
}

.order-tools {
    display: grid;
    justify-items: end;
    gap: 4px;
}

.refresh-orders {
    padding: 4px 8px;
    border: 1px solid rgba(74, 154, 142, 0.2);
    border-radius: 999px;
    background: #edf5ea;
    color: #426e66;
    cursor: pointer;
    font-size: 8px;
    font-weight: 900;
}

.refresh-orders b { color: #398a7e; }
.refresh-orders.not-affordable { opacity: 0.62; }

.order-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 8px;
}

.npc-guide {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: end;
    gap: 6px;
    min-height: 92px;
    margin-top: 9px;
}

.npc-portrait {
    position: relative;
    align-self: stretch;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 18px 18px 8px 18px;
    background: linear-gradient(145deg, #f0f3df, #d6dfb9);
    box-shadow: 0 8px 18px rgba(75, 79, 32, 0.13);
    cursor: pointer;
}

.npc-portrait img {
    position: absolute;
    top: 3px;
    left: 50%;
    width: 84px;
    max-width: none;
    transform: translateX(-50%);
    filter: drop-shadow(0 5px 5px rgba(61, 42, 28, 0.18));
}

.npc-speech {
    position: relative;
    min-height: 82px;
    padding: 10px 11px;
    border: 1px solid rgba(63, 114, 80, 0.19);
    border-radius: 9px 18px 18px 18px;
    background: rgba(255, 253, 247, 0.94);
    box-shadow: 0 8px 18px rgba(73, 48, 30, 0.09);
}

.npc-speech::before {
    position: absolute;
    top: 13px;
    left: -7px;
    width: 12px;
    height: 12px;
    border-bottom: 1px solid rgba(63, 114, 80, 0.19);
    border-left: 1px solid rgba(63, 114, 80, 0.19);
    background: #fffdf7;
    content: "";
    transform: rotate(45deg);
}

.npc-heading {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.npc-heading strong {
    color: var(--basil-dark);
    font-family: Georgia, "STSong", serif;
    font-size: 15px;
}

.npc-heading span {
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
}

.npc-speech p {
    margin: 3px 0 7px;
    overflow: hidden;
    color: var(--ink);
    font-size: 10px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.npc-action {
    padding: 5px 9px;
    border: 0;
    border-radius: 999px;
    background: var(--basil);
    color: white;
    cursor: pointer;
    font-size: 9px;
    font-weight: 900;
}

.order-guide {
    margin: 7px 2px 0;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.4;
}

.order-card {
    position: relative;
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    min-width: 0;
    min-height: 57px;
    padding: 7px;
    border: 1px solid #d8ddbf;
    border-radius: 14px;
    background: #fffef8;
    box-shadow: inset 0 -2px 0 rgba(106, 74, 42, 0.05);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.order-card.ready {
    border-color: #9aa75a;
    background: #f2f5e3;
    box-shadow: 0 0 0 2px rgba(114, 117, 51, 0.14);
    animation: order-ready 1.7s ease-in-out infinite;
}

.order-card:disabled {
    cursor: default;
}

.order-emoji {
    font-size: 26px;
    filter: drop-shadow(0 2px 1px rgba(70, 40, 20, 0.14));
}

.order-copy {
    min-width: 0;
    text-align: left;
}

.order-copy strong,
.order-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-copy .order-action {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #eee4d3;
    color: var(--muted);
    font-size: 8px;
    font-style: normal;
    font-weight: 900;
}

.order-card.ready .order-action {
    background: var(--basil);
    color: white;
}

.order-copy strong {
    font-size: 10px;
}

.order-copy span {
    margin-top: 3px;
    color: #a66a2c;
    font-size: 9px;
    font-weight: 800;
}

.ready-mark {
    position: absolute;
    top: -5px;
    right: -4px;
    display: none;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-radius: 50%;
    background: var(--basil);
    color: white;
    font-size: 11px;
    font-weight: 900;
}

.order-card.ready .ready-mark {
    display: grid;
}

.board-panel {
    padding: 11px;
    border-radius: 22px;
}

.small-button {
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--basil-dark);
    font-size: 11px;
    font-weight: 800;
}

.board-toolbar-actions {
    display: flex;
    gap: 4px;
}

.board-toolbar-actions .small-button {
    padding: 6px 8px;
    font-size: 9px;
}

.board-toolbar-actions b {
    color: #ae7720;
}

.board-tip {
    margin: 3px 0 8px;
    color: var(--muted);
    font-size: 9px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 7px;
    border: 2px solid #a2ad68;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 40%),
        var(--board);
    box-shadow: inset 0 5px 12px rgba(78, 83, 33, 0.13);
    touch-action: none;
}

.board-cell {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    min-width: 0;
    padding: 0;
    border: 1px solid var(--tile-border);
    border-radius: 11px;
    background: var(--tile);
    box-shadow: inset 0 -3px 0 rgba(110, 80, 52, 0.07);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 130ms ease, border-color 130ms ease, background 130ms ease;
}

.board-cell.empty {
    background: rgba(255, 253, 247, 0.42);
    border-color: rgba(104, 124, 94, 0.18);
    box-shadow: none;
}

.board-cell.selected {
    z-index: 1;
    border-color: var(--tomato);
    background: #eff3d9;
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 12px rgba(88, 94, 37, 0.18);
}

.board-cell.drop-target {
    border-color: var(--basil);
    background: #ebf0d4;
    transform: scale(1.04);
}

.food-emoji {
    font-size: clamp(23px, 7vw, 32px);
    line-height: 1;
    pointer-events: none;
    filter: drop-shadow(0 3px 1px rgba(82, 49, 25, 0.16));
}

.food-level {
    position: absolute;
    right: 3px;
    bottom: 2px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 999px;
    background: rgba(63, 48, 39, 0.78);
    color: white;
    font-size: 8px;
    font-weight: 900;
    line-height: 14px;
    pointer-events: none;
}

.board-cell.merge-pop {
    animation: merge-pop 420ms cubic-bezier(.17, .89, .32, 1.45);
}

.bubble-reward {
    display: grid;
    grid-template-columns: 38px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(74, 154, 142, 0.28);
    border-radius: 16px;
    background: linear-gradient(120deg, rgba(223, 247, 238, 0.96), rgba(249, 235, 188, 0.94));
    color: #426e66;
    box-shadow: 0 7px 17px rgba(65, 123, 112, 0.12);
    cursor: pointer;
    text-align: left;
    animation: bubble-float 1.8s ease-in-out infinite;
}

.bubble-reward[hidden] { display: none; }
.bubble-reward > span { grid-row: 1 / 3; font-size: 28px; }
.bubble-reward strong { font-size: 11px; }
.bubble-reward small { font-size: 9px; }

@keyframes bubble-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.stations {
    position: fixed;
    z-index: 10;
    right: 0;
    bottom: 0;
    left: 0;
    width: min(100%, 460px);
    margin: 0 auto;
    padding: 7px 0 max(9px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(82, 87, 35, 0.16);
    background: rgba(248, 249, 239, 0.94);
    box-shadow: 0 -10px 30px rgba(64, 68, 27, 0.12);
    backdrop-filter: blur(14px);
}

.stations-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px 6px;
    color: var(--muted);
    font-size: 8px;
}

.stations-heading strong {
    color: var(--ink);
    font-size: 10px;
    letter-spacing: 0.04em;
}

.station-scroll {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 0 12px 2px;
    scroll-padding: 12px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    touch-action: pan-x;
}

.station-scroll::-webkit-scrollbar {
    display: none;
}

.station {
    position: relative;
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    flex: 0 0 124px;
    min-width: 124px;
    min-height: 58px;
    padding: 7px 9px;
    border: 0;
    border-radius: 16px;
    color: white;
    box-shadow: inset 0 -3px 0 rgba(36, 31, 22, 0.16), 0 6px 14px rgba(65, 43, 28, 0.12);
    cursor: pointer;
    text-align: left;
    transition: transform 120ms ease;
    scroll-snap-align: start;
}

.station:active {
    transform: translateY(2px) scale(0.98);
}

.station-pastry { background: linear-gradient(145deg, #d4775d, #b9473e); }
.station-burger { background: linear-gradient(145deg, #648d5c, #356848); }
.station-pizza { background: linear-gradient(145deg, #e3a341, #ce7136); }
.station-parfait { background: linear-gradient(145deg, #dc82a5, #ad557d); }
.station-cake { background: linear-gradient(145deg, #b97eaa, #875786); }
.station-pasta { background: linear-gradient(145deg, #d3a548, #a8752e); }
.station-steak { background: linear-gradient(145deg, #9d6657, #70443b); }
.station-coffee { background: linear-gradient(145deg, #8c6850, #5e4435); }
.station-hotdog { background: linear-gradient(145deg, #df7552, #ad4938); }

.station-icon {
    font-size: 27px;
    filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.18));
}

.station span:nth-child(2) {
    min-width: 0;
}

.station strong,
.station small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.station strong {
    font-size: 11px;
}

.station small {
    margin-top: 2px;
    font-size: 8px;
    opacity: 0.82;
}

.station b {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 10px;
    opacity: 0.75;
}

.toast {
    position: fixed;
    z-index: 40;
    top: max(72px, calc(env(safe-area-inset-top) + 58px));
    left: 50%;
    max-width: calc(100vw - 48px);
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(48, 39, 30, 0.9);
    color: white;
    font-size: 11px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -12px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.ready-order-shortcut {
    position: fixed;
    z-index: 30;
    bottom: max(108px, calc(96px + env(safe-area-inset-bottom)));
    left: 50%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border: 2px solid white;
    border-radius: 999px;
    background: var(--basil);
    color: white;
    box-shadow: 0 8px 24px rgba(74, 78, 32, 0.3);
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    transform: translateX(-50%);
    animation: order-ready 1.7s ease-in-out infinite;
}

.ready-order-shortcut[hidden] {
    display: none;
}

.drag-ghost {
    position: fixed;
    z-index: 50;
    display: none;
    place-items: center;
    width: 56px;
    height: 56px;
    border: 2px solid white;
    border-radius: 16px;
    background: #fff8e9;
    box-shadow: 0 12px 24px rgba(71, 44, 25, 0.24);
    font-size: 34px;
    pointer-events: none;
    transform: translate(-50%, -60%) rotate(-3deg);
}

.drag-ghost.visible {
    display: grid;
}

.help-dialog {
    width: min(calc(100% - 32px), 390px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 22px;
    border: 0;
    border-radius: 26px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 30px 80px rgba(43, 28, 18, 0.28);
}

.progress-dialog,
.warehouse-dialog {
    width: min(calc(100% - 20px), 480px);
    max-height: calc(100dvh - 20px);
    padding: 18px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 0;
    border-radius: 26px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 30px 80px rgba(43, 28, 18, 0.32);
}

.progress-dialog::backdrop,
.warehouse-dialog::backdrop {
    background: rgba(38, 44, 22, 0.62);
    backdrop-filter: blur(5px);
}

.progress-dialog[open],
.warehouse-dialog[open] {
    animation: renovation-dialog-in 300ms cubic-bezier(.18, .86, .28, 1) both;
}

.progress-dialog h2,
.warehouse-dialog h2 {
    margin: 3px 0 0;
    font-family: Georgia, "STSong", serif;
    font-size: 24px;
}

.progress-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin: 15px 0 12px;
    padding: 4px;
    border-radius: 15px;
    background: #edf0df;
}

.progress-tabs button {
    padding: 9px 6px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 900;
}

.progress-tabs button.active {
    background: var(--paper);
    color: var(--basil-dark);
    box-shadow: 0 4px 11px rgba(71, 75, 30, 0.1);
}

.progress-panel[hidden] { display: none; }

.journal-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.journal-summary strong { font-size: 12px; }
.journal-summary span { color: var(--muted); font-size: 8px; text-align: right; }

.goal-list {
    display: grid;
    gap: 7px;
}

.goal-card {
    display: grid;
    grid-template-columns: 39px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 9px;
    border: 1px solid rgba(93, 99, 42, 0.13);
    border-radius: 15px;
    background: #fbfbf3;
}

.goal-card.ready {
    border-color: rgba(114, 117, 51, 0.42);
    background: #f3f6e7;
}

.goal-card.claimed { opacity: 0.68; }

.goal-icon {
    display: grid;
    place-items: center;
    width: 37px;
    height: 37px;
    border-radius: 12px;
    background: #e7ecd2;
    font-size: 20px;
}

.badge-icon { border-radius: 50%; background: linear-gradient(145deg, #f6e9b8, #dce7b8); }

.goal-copy { min-width: 0; }
.goal-copy strong,
.goal-copy small { display: block; }
.goal-copy strong { font-size: 11px; }
.goal-copy small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.goal-copy em { display: block; margin-top: 2px; color: var(--muted); font-size: 7px; font-style: normal; text-align: right; }

.goal-progress {
    height: 4px;
    margin-top: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe4cc;
}

.goal-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #9cad55, #727533);
}

.goal-card > button {
    min-width: 64px;
    padding: 7px 8px;
    border: 0;
    border-radius: 10px;
    background: var(--basil);
    color: white;
    cursor: pointer;
    font-size: 8px;
    font-weight: 900;
}

.goal-card > button:disabled {
    background: #e3e5d8;
    color: #8b8e78;
    cursor: default;
}

.collection-list { display: grid; gap: 9px; }

.collection-chain {
    padding: 9px;
    border: 1px solid rgba(93, 99, 42, 0.12);
    border-radius: 15px;
    background: #fbfbf3;
}

.collection-chain header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 7px;
    font-size: 9px;
}

.collection-chain header span { color: var(--muted); }

.collection-chain > div {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.collection-item {
    display: grid;
    place-items: center;
    min-width: 0;
    aspect-ratio: 0.9;
    border: 1px dashed #cbd0ba;
    border-radius: 10px;
    background: #eeefe8;
    color: #a9ac9c;
}

.collection-item.unlocked {
    border-style: solid;
    border-color: #ccd6aa;
    background: #fffef8;
    color: var(--ink);
}

.collection-item span { font-size: 22px; }
.collection-item small { font-size: 7px; font-weight: 900; }

.warehouse-guide {
    margin: 14px 0 11px;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.55;
}

.warehouse-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    margin-bottom: 13px;
    padding: 9px;
    border: 2px solid #a2ad68;
    border-radius: 18px;
    background: var(--board);
}

.warehouse-slot {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 0.9;
    min-width: 0;
    padding: 5px;
    border: 1px solid var(--tile-border);
    border-radius: 12px;
    background: var(--tile);
    cursor: pointer;
}

.warehouse-slot.empty { border-style: dashed; background: rgba(255,255,255,.38); color: #9da381; }
.warehouse-slot > span { font-size: 27px; }
.warehouse-slot > strong { position: absolute; top: 3px; right: 4px; font-size: 7px; }
.warehouse-slot > small { overflow: hidden; width: 100%; font-size: 7px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }

.restaurant-dialog {
    width: min(calc(100% - 24px), 520px);
    max-height: min(920px, calc(100dvh - 20px));
    padding: 18px;
    border: 0;
    border-radius: 26px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 30px 80px rgba(43, 28, 18, 0.32);
    overflow-x: hidden;
    overflow-y: auto;
}

.restaurant-dialog[open] {
    animation: renovation-dialog-in 360ms cubic-bezier(.18, .86, .28, 1) both;
}

.restaurant-dialog::backdrop {
    background: rgba(43, 33, 25, 0.58);
    backdrop-filter: blur(5px);
}

.restaurant-dialog h2,
.restaurant-dialog h3,
.restaurant-dialog p {
    margin: 0;
}

.restaurant-dialog h2 {
    margin-top: 3px;
    font-family: Georgia, "STSong", serif;
    font-size: 24px;
}

.room-preview {
    position: relative;
    height: clamp(260px, 43dvh, 360px);
    margin-top: 14px;
    overflow: hidden;
    border: 3px solid white;
    border-radius: 20px;
    background: #dfe4cc;
    box-shadow: 0 12px 28px rgba(76, 80, 34, 0.2);
    isolation: isolate;
}

.room-camera {
    position: absolute;
    inset: 0;
    transform: scale(1.04);
    transform-origin: var(--focus-x, 50%) var(--focus-y, 50%);
    transition: transform 520ms cubic-bezier(.2, .8, .2, 1);
}

.restaurant-dialog[open] .room-camera {
    animation: room-camera-enter 700ms cubic-bezier(.2, .78, .22, 1) both;
}

.room-preview.is-choosing .room-camera {
    animation: none;
    transform: scale(1.18);
}

.room-camera > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 58%;
}

.room-preview::after {
    position: absolute;
    inset: 0;
    content: "";
    z-index: 1;
    background: linear-gradient(180deg, transparent 58%, rgba(48, 52, 24, 0.36));
    pointer-events: none;
}

.room-stage-badge {
    position: absolute;
    z-index: 6;
    top: 10px;
    left: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(46, 35, 27, 0.72);
    color: white;
    font-size: 9px;
    font-weight: 900;
    backdrop-filter: blur(6px);
}

.room-zoom-hint {
    position: absolute;
    z-index: 6;
    right: 10px;
    bottom: 9px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(58, 62, 28, 0.72);
    color: white;
    font-size: 8px;
    font-weight: 800;
    backdrop-filter: blur(6px);
}

.room-decor-layer {
    position: absolute;
    z-index: 3;
    inset: 0;
}

.room-decor-layer span {
    position: absolute;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 2px solid white;
    border-color: color-mix(in srgb, var(--choice-color, var(--basil)) 62%, white);
    border-radius: 50%;
    background: rgba(255, 248, 228, 0.92);
    background: color-mix(in srgb, var(--choice-color, var(--basil)) 24%, rgba(255, 248, 228, 0.94));
    box-shadow: 0 6px 15px rgba(61, 40, 26, 0.2), 0 0 0 3px color-mix(in srgb, var(--choice-color, var(--basil)) 15%, transparent);
    font-size: 21px;
    color: var(--choice-color, var(--basil));
    transform: translate(-50%, -50%);
    animation: decor-settle 520ms cubic-bezier(.2, .9, .2, 1.18) both;
}

.room-decor-layer span.preview {
    border-color: #fff5b7;
    background: rgba(255, 254, 232, 0.95);
    box-shadow: 0 0 0 4px rgba(114, 117, 51, 0.22), 0 8px 22px rgba(54, 57, 24, 0.28);
    animation: decor-preview 1.25s ease-in-out infinite;
}

.renovation-hotspot {
    position: absolute;
    z-index: 5;
    display: grid;
    place-items: center;
    min-width: 58px;
    padding: 7px 9px;
    border: 2px solid white;
    border-radius: 16px;
    background: rgba(114, 117, 51, 0.94);
    color: white;
    box-shadow: 0 0 0 0 rgba(239, 231, 132, 0.52), 0 8px 22px rgba(46, 49, 20, 0.32);
    cursor: pointer;
    transform: translate(-50%, -50%);
    animation: renovation-hotspot-pulse 1.65s ease-out infinite;
}

.renovation-hotspot span {
    font-size: 20px;
    line-height: 1;
}

.renovation-hotspot strong,
.renovation-hotspot small {
    display: block;
    line-height: 1.2;
}

.renovation-hotspot strong {
    margin-top: 3px;
    font-size: 10px;
}

.renovation-hotspot small {
    font-size: 7px;
    opacity: 0.84;
}

.room-preview.is-choosing .renovation-hotspot,
.room-preview.is-placing .renovation-hotspot {
    opacity: 0;
    pointer-events: none;
}

.placement-effects {
    position: absolute;
    z-index: 7;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.placement-effects span {
    position: absolute;
    left: var(--effect-x, 50%);
    top: var(--effect-y, 50%);
    color: #fff2a2;
    font-size: var(--effect-size, 16px);
    opacity: 0;
    animation: renovation-spark 720ms ease-out var(--effect-delay, 0ms) both;
}

.room-copy {
    margin-top: 14px;
}

.room-copy h3 {
    font-family: Georgia, "STSong", serif;
    font-size: 20px;
}

.room-copy p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
}

.renovation-task-card {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(114, 117, 51, 0.24);
    border-radius: 17px;
    background: linear-gradient(145deg, #eef2dd, #fffef5);
}

.renovation-task-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.renovation-task-heading h4 {
    margin: 3px 0 0;
    font-family: Georgia, "STSong", serif;
    font-size: 17px;
}

.room-star-balance {
    flex: none;
    padding: 5px 8px;
    border-radius: 999px;
    background: #f6d782;
    color: #79531b;
    font-size: 11px;
    font-weight: 900;
}

.renovation-task-card > p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.choice-guide {
    margin-top: 10px !important;
    color: var(--basil-dark) !important;
    font-weight: 800;
}

.decor-choice-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 8px;
}

.decor-choice {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 76px;
    padding: 8px 5px;
    border: 2px solid transparent;
    border-radius: 14px;
    background: rgba(255, 254, 248, 0.86);
    box-shadow: inset 0 -2px 0 rgba(79, 83, 35, 0.08);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.decor-choice:hover,
.decor-choice:focus-visible {
    transform: translateY(-2px);
}

.decor-choice.selected {
    border-color: var(--choice-color);
    background: #f5f7e8;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--choice-color) 20%, transparent);
    transform: translateY(-3px);
}

.decor-choice span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--choice-color) 20%, white);
    font-size: 20px;
}

.decor-choice strong {
    width: 100%;
    margin-top: 5px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.renovation-action {
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 13px;
    background: var(--basil);
    color: white;
    box-shadow: inset 0 -3px 0 var(--basil-dark);
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
}

.renovation-action:disabled {
    background: #b8afa0;
    box-shadow: inset 0 -3px 0 #958b7d;
    cursor: default;
}

.restaurant-dialog.task-complete .renovation-task-card {
    animation: task-card-celebrate 620ms cubic-bezier(.2, .85, .25, 1.2);
}

.decor-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 12px;
}

.decor-item {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid #e7d7bd;
    border-radius: 13px;
    background: #fffaf0;
    font-size: 10px;
    font-weight: 800;
}

.decor-item.locked {
    filter: grayscale(1);
    opacity: 0.48;
}

.decor-item.current {
    border-color: #d9aa4e;
    background: #fff4cf;
    box-shadow: 0 0 0 2px rgba(217, 170, 78, 0.13);
}

.decor-item span {
    font-size: 18px;
}

.decor-item small {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 600;
}

.room-progress-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    margin-top: 13px;
}

.room-progress-row .progress-track {
    margin-top: 0;
    background: #e9dcc7;
}

.room-progress-row strong {
    color: var(--basil-dark);
    font-size: 9px;
}

.restaurant-dialog .primary-button {
    margin-top: 15px;
}

@media (max-height: 760px) {
    .restaurant-dialog {
        max-height: calc(100dvh - 20px);
        overflow-y: auto;
    }

    .room-preview {
        height: 240px;
    }
}

@media (max-width: 520px) {
    .restaurant-dialog {
        width: 100%;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        padding: max(14px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
        border-radius: 0;
    }

    .room-preview {
        height: clamp(260px, 42dvh, 350px);
    }
}

@keyframes renovation-dialog-in {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes room-camera-enter {
    0% { filter: saturate(0.72) brightness(0.84); transform: scale(1.28); }
    100% { filter: saturate(1) brightness(1); transform: scale(1.04); }
}

@keyframes renovation-hotspot-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 231, 132, 0.5), 0 8px 22px rgba(46, 49, 20, 0.32); }
    65% { box-shadow: 0 0 0 13px rgba(239, 231, 132, 0), 0 8px 22px rgba(46, 49, 20, 0.32); }
    100% { box-shadow: 0 0 0 0 rgba(239, 231, 132, 0), 0 8px 22px rgba(46, 49, 20, 0.32); }
}

@keyframes decor-settle {
    0% { opacity: 0; transform: translate(-50%, -90%) scale(0.45) rotate(-9deg); }
    70% { opacity: 1; transform: translate(-50%, -48%) scale(1.14) rotate(3deg); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
}

@keyframes decor-preview {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -56%) scale(1.08); }
}

@keyframes renovation-spark {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(0); }
    28% { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scale(1.25) rotate(120deg); }
}

@keyframes task-card-celebrate {
    0%, 100% { transform: scale(1); }
    45% { transform: scale(1.025); box-shadow: 0 0 0 5px rgba(164, 181, 96, 0.18); }
}

.help-dialog::backdrop {
    background: rgba(43, 33, 25, 0.5);
    backdrop-filter: blur(4px);
}

.dialog-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.help-dialog h2 {
    margin: 6px 0 18px;
    font-family: Georgia, "STSong", serif;
    font-size: 25px;
}

.help-dialog ol {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.help-dialog li {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 11px;
    align-items: start;
}

.help-dialog li > span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f2dec0;
    color: var(--tomato-dark);
    font-family: Georgia, serif;
    font-weight: 800;
}

.help-dialog li strong {
    font-size: 13px;
}

.help-dialog li p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

.primary-button {
    width: 100%;
    padding: 13px 18px;
    border: 0;
    border-radius: 16px;
    background: var(--tomato);
    color: white;
    box-shadow: inset 0 -3px 0 var(--tomato-dark), 0 8px 18px rgba(161, 57, 46, 0.22);
    cursor: pointer;
    font-weight: 900;
}

.dialog-actions {
    display: grid;
    gap: 9px;
    margin-top: 20px;
}

.secondary-button {
    width: 100%;
    padding: 11px 18px;
    border: 1px solid rgba(168, 55, 47, 0.2);
    border-radius: 15px;
    background: transparent;
    color: var(--tomato-dark);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

@keyframes merge-pop {
    0% { transform: scale(0.7) rotate(-7deg); }
    55% { transform: scale(1.18) rotate(3deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes order-ready {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

@media (min-width: 700px) {
    body {
        padding: 22px 0;
    }

    .app-shell {
        min-height: calc(100vh - 44px);
        border: 1px solid rgba(87, 61, 41, 0.12);
        border-radius: 34px;
        overflow: hidden;
    }

    .stations {
        bottom: 22px;
        border: 1px solid rgba(94, 66, 43, 0.16);
        border-radius: 0 0 34px 34px;
    }
}

@media (max-height: 760px) {
    .restaurant-card {
        height: 112px;
    }

    .restaurant-heading p,
    .progress-label {
        display: none;
    }

    .progress-track {
        margin-top: 7px;
    }

    .orders-panel,
    .board-panel {
        margin-top: 7px;
    }

    .board-cell {
        border-radius: 9px;
    }
}

/* Mobile game board: every primary interaction stays in one viewport. */
@media (max-width: 699px) {
    html,
    body {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .app-shell {
        --single-board-size: min(calc(100vw - 30px), calc(100dvh - 390px), 416px);
        display: grid;
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
        grid-template-rows: 46px 36px 76px 82px calc(var(--single-board-size) + 38px) 65px;
        gap: 5px;
        align-content: center;
        width: min(100%, 460px);
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        padding: max(5px, env(safe-area-inset-top)) 8px max(5px, env(safe-area-inset-bottom));
        overflow: hidden;
    }

    .topbar,
    .system-ribbon,
    .orders-panel,
    .board-panel,
    .stations {
        grid-column: 1 / -1;
        min-width: 0;
        margin: 0;
    }

    .topbar {
        position: relative;
        top: auto;
        grid-template-columns: 36px minmax(0, 1fr) 34px;
        gap: 5px;
        min-height: 0;
        padding: 2px 4px;
        border-radius: 12px;
    }

    .level-badge {
        width: 34px;
        height: 34px;
        border-width: 1px;
    }

    .level-caption {
        font-size: 5px;
    }

    .level-badge strong {
        font-size: 15px;
    }

    .brand-lockup {
        gap: 6px;
    }

    .brand-mark {
        width: 26px;
        height: 26px;
        font-size: 16px;
        box-shadow: 0 3px 0 var(--tomato-dark);
    }

    .brand-lockup h1 {
        font-size: clamp(13px, 3.8vw, 17px);
    }

    .brand-lockup p {
        font-size: 5px;
    }

    .icon-button {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .system-ribbon {
        gap: 3px;
    }

    .system-chip {
        grid-template-columns: 14px 1fr;
        column-gap: 2px;
        height: 36px;
        padding: 3px;
        border-radius: 9px;
    }

    .system-chip > span {
        font-size: 12px;
    }

    .system-chip small {
        font-size: 5px;
    }

    .system-chip strong {
        font-size: 9px;
    }

    .restaurant-card {
        grid-column: 1;
        grid-row: 3;
        height: 76px;
        border-width: 2px;
        border-radius: 14px;
    }

    .restaurant-copy {
        padding: 8px 9px 6px;
    }

    .restaurant-kicker,
    .progress-label,
    .restaurant-actions .star-counter {
        display: none;
    }

    .restaurant-heading {
        align-items: center;
        gap: 4px;
        margin-top: 0;
    }

    .restaurant-heading h2 {
        font-size: 14px;
    }

    .restaurant-heading p {
        max-width: 135px;
        margin-top: 1px;
        font-size: 7px;
    }

    .restaurant-actions {
        gap: 0;
    }

    .restaurant-entry {
        padding: 4px 6px;
        font-size: 7px;
    }

    .restaurant-card .progress-track {
        height: 5px;
        margin-top: 7px;
    }

    .npc-guide {
        grid-column: 2;
        grid-row: 3;
        grid-template-columns: 42px minmax(0, 1fr);
        align-items: stretch;
        gap: 3px;
        height: 76px;
        min-height: 0;
        margin: 0;
    }

    .npc-portrait {
        border-radius: 12px 8px 8px 12px;
    }

    .npc-portrait img {
        top: 2px;
        width: 55px;
    }

    .npc-speech {
        min-height: 0;
        padding: 6px;
        border-radius: 7px 12px 12px 7px;
    }

    .npc-speech::before,
    .npc-heading span {
        display: none;
    }

    .npc-heading strong {
        font-size: 11px;
    }

    .npc-speech p {
        display: -webkit-box;
        margin: 2px 0 4px;
        overflow: hidden;
        font-size: 7px;
        line-height: 1.25;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .npc-action {
        padding: 3px 5px;
        font-size: 7px;
    }

    .orders-panel {
        grid-row: 4;
        height: 82px;
        padding: 5px 6px;
        border-radius: 13px;
    }

    .orders-panel .eyebrow,
    .order-hint,
    .order-guide {
        display: none;
    }

    .section-heading h2 {
        margin: 0;
        font-size: 13px;
    }

    .order-tools {
        display: block;
    }

    .refresh-orders {
        padding: 3px 6px;
        font-size: 7px;
    }

    .order-list {
        gap: 3px;
        margin-top: 4px;
    }

    .order-card {
        grid-template-columns: 24px minmax(0, 1fr);
        min-height: 48px;
        padding: 4px;
        border-radius: 9px;
    }

    .order-emoji {
        font-size: 19px;
    }

    .order-copy strong {
        font-size: 7px;
    }

    .order-copy span {
        margin-top: 2px;
        font-size: 7px;
    }

    .order-copy .order-action {
        display: none;
    }

    .board-panel {
        grid-row: 5;
        display: flex;
        flex-direction: column;
        align-items: center;
        height: calc(var(--single-board-size) + 38px);
        padding: 5px;
        border-radius: 15px;
        overflow: hidden;
    }

    .board-toolbar {
        width: 100%;
        min-height: 27px;
        gap: 3px;
    }

    .board-toolbar .eyebrow,
    .board-tip {
        display: none;
    }

    .board-toolbar h2 {
        margin: 0;
        font-size: 13px;
    }

    .board-toolbar-actions {
        gap: 2px;
    }

    .board-toolbar-actions .small-button {
        padding: 4px 5px;
        font-size: 7px;
    }

    .game-board {
        flex: 0 0 var(--single-board-size);
        width: var(--single-board-size);
        height: var(--single-board-size);
        gap: 3px;
        padding: 5px;
        border-radius: 13px;
    }

    .board-cell {
        border-radius: 7px;
    }

    .food-emoji {
        font-size: clamp(14px, calc(var(--single-board-size) / 13), 28px);
    }

    .food-level {
        right: 1px;
        bottom: 1px;
        min-width: 11px;
        height: 11px;
        padding: 0 2px;
        font-size: 6px;
        line-height: 11px;
    }

    .stations {
        position: relative;
        right: auto;
        bottom: auto;
        left: auto;
        grid-row: 6;
        width: 100%;
        height: 65px;
        padding: 3px 2px;
        border: 1px solid rgba(82, 87, 35, 0.12);
        border-radius: 13px;
        box-shadow: 0 5px 16px rgba(64, 68, 27, 0.08);
        backdrop-filter: none;
    }

    .stations-heading {
        height: 14px;
        padding: 0 4px 2px;
        font-size: 6px;
    }

    .stations-heading strong {
        font-size: 7px;
    }

    .station-scroll {
        display: grid;
        grid-template-columns: repeat(9, minmax(0, 1fr));
        gap: 3px;
        overflow: visible;
        padding: 0 2px;
        scroll-snap-type: none;
        touch-action: manipulation;
    }

    .station {
        display: flex;
        flex: none;
        flex-direction: column;
        justify-content: center;
        gap: 1px;
        width: auto;
        min-width: 0;
        min-height: 43px;
        padding: 3px 1px;
        border-radius: 9px;
        text-align: center;
    }

    .station-icon {
        font-size: 18px;
        line-height: 18px;
    }

    .station span:nth-child(2) {
        width: 100%;
    }

    .station strong {
        display: -webkit-box;
        height: 14px;
        overflow: hidden;
        font-size: 6px;
        line-height: 7px;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .station small,
    .station b {
        display: none;
    }

    .ready-order-shortcut {
        bottom: max(72px, calc(66px + env(safe-area-inset-bottom)));
    }
}

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