/* Forkville — a warm, rounded look: terracotta, cream, olive and berry. System rounded fonts only. */
/* Stack Sans Notch is the signature of Saverio Morelli: only .credit-name uses it, never the game */
@font-face {
    font-family: 'Stack Sans Notch';
    src: url('fonts/stack-sans-notch.ttf') format('truetype');
    font-weight: 200 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #FFF6E9;
    --surface: #FFFFFF;
    --surface-2: #FBEBD5;
    --ink: #3B2418;
    --text: #3B2418;
    --muted: #8A6E5C;
    --line: #EAD5BA;
    --primary: #D9653B;
    --primary-dark: #B84F2A;
    --olive: #7A8B3A;
    --berry: #B43E5C;
    --gold: #E2B23A;
    --wrong: #C0392B;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(59, 36, 24, .16);
    --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-tap-highlight-color: transparent;
}

body {
    overscroll-behavior: none;
}

a {
    color: var(--primary-dark);
}

button {
    font: inherit;
    color: inherit;
}

input, select {
    font: inherit;
    color: var(--text);
}

/* ---------------------------------------------------------------- buttons and fields */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 2px solid var(--ink);
    background: var(--surface);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    color: var(--ink);
    box-shadow: 0 3px 0 var(--ink);
    transition: transform .08s, box-shadow .08s;
    white-space: nowrap;
}

.btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--ink);
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: #FFF6E9;
}

.btn-danger {
    background: #FBE3E0;
    color: var(--wrong);
    border-color: var(--wrong);
    box-shadow: 0 3px 0 var(--wrong);
}

.btn-ghost {
    border-color: transparent;
    box-shadow: none;
    background: transparent;
}

.btn-small {
    min-height: 34px;
    padding: 0 12px;
    font-size: 14px;
    box-shadow: 0 2px 0 var(--ink);
}

.btn-wide {
    width: 100%;
}

.btn .ic svg, .icon-btn .ic svg {
    width: 18px;
    height: 18px;
}

.icon-btn {
    border: 0;
    background: var(--surface-2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
}

.field input, .field select, .search input {
    height: 46px;
    padding: 0 14px;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    width: 100%;
}

.field input:focus, .search input:focus {
    outline: none;
    border-color: var(--primary);
}

.field small {
    font-weight: 400;
    color: var(--muted);
}

.field.inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.field.inline select {
    width: auto;
    flex: 1;
}

.check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 14px;
}

.check input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.form-error, .err {
    color: var(--wrong);
    min-height: 1em;
    margin: 0;
    font-size: 14px;
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.row.wrap {
    flex-wrap: wrap;
}

.row input {
    flex: 1;
    min-width: 0;
}

.muted {
    color: var(--muted);
}

.note {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
}

.note.bad {
    color: var(--wrong);
}

/* ---------------------------------------------------------------- splash and accounts */

.splash {
    min-height: 100dvh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    color: var(--muted);
}

.logo-big svg {
    width: 92px;
    height: 92px;
    filter: drop-shadow(0 6px 0 rgba(59, 36, 24, .2));
}

.splash .logo-big {
    animation: bob 1.4s ease-in-out infinite;
}

@keyframes bob {
    50% {
        transform: translateY(-8px) rotate(-4deg);
    }
}

.auth {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 32px 16px 24px;
    background: radial-gradient(circle at 20% 0%, #FFE2C2 0, transparent 50%), radial-gradient(circle at 100% 30%, #F4D9C9 0, transparent 40%), var(--bg);
}

.auth-hero {
    text-align: center;
}

.auth-hero h1 {
    font-size: 44px;
    margin: 10px 0 4px;
    letter-spacing: -.02em;
}

.tagline {
    margin: 0;
    color: var(--muted);
    max-width: 340px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 2px solid var(--ink);
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 6px 0 var(--ink);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-card.verify {
    text-align: center;
    align-items: center;
}

.auth-card.verify h1 {
    margin: 0;
}

.mail-art svg {
    width: 120px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.google-slot {
    display: flex;
    justify-content: center;
    min-height: 0;
}

.google-slot:empty {
    display: none;
}

.or {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
}

.or::before, .or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.tabs {
    display: flex;
    gap: 6px;
    background: var(--surface-2);
    padding: 4px;
    border-radius: 999px;
}

.tabs.scroll {
    overflow-x: auto;
    scrollbar-width: none;
}

.tab {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 9px 12px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.tab.on {
    background: var(--surface);
    box-shadow: 0 2px 0 var(--line);
    color: var(--primary-dark);
}

.lang-switch {
    display: inline-flex;
    gap: 4px;
}

.lang-switch button {
    border: 2px solid var(--line);
    background: var(--surface);
    border-radius: 999px;
    padding: 4px 12px;
    font-weight: 700;
    cursor: pointer;
}

.lang-switch button.on {
    border-color: var(--ink);
}

/* ---------------------------------------------------------------- credit (signature font only here) */

.credit-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

.credit {
    color: var(--muted);
    text-decoration: none;
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
}

.credit-name {
    font-family: 'Stack Sans Notch', system-ui, sans-serif;
    font-size: 1.08rem;
    color: var(--text);
    letter-spacing: .01em;
    transition: color .15s;
}

.credit:hover .credit-name, .credit:focus-visible .credit-name {
    color: var(--primary);
}

.credit-ai {
    font-size: 12px;
    color: var(--muted);
    opacity: .8;
}

/* ---------------------------------------------------------------- game */

.game {
    position: fixed;
    inset: 0;
    overflow: hidden;
    touch-action: none;
}

#world {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

#hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#hud > * {
    pointer-events: auto;
}

.topbar {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    pointer-events: none;
}

.topbar > * {
    pointer-events: auto;
}

.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255, 246, 233, .94);
    border: 2px solid var(--ink);
    border-radius: 18px;
    padding: 6px 12px 6px 6px;
    box-shadow: 0 3px 0 var(--ink);
    min-width: 0;
}

.logo-small svg {
    width: 38px;
    height: 38px;
    display: block;
}

.rname {
    font-weight: 800;
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rsub {
    font-size: 13px;
    color: var(--muted);
}

.xp {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.xpbar {
    width: 80px;
    height: 8px;
    border-radius: 9px;
    background: var(--surface-2);
    overflow: hidden;
    border: 1px solid var(--line);
}

.xpbar i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--olive), #A4B85A);
}

.pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 40px;
    padding: 0 12px;
    background: rgba(255, 246, 233, .94);
    border: 2px solid var(--ink);
    border-radius: 999px;
    box-shadow: 0 3px 0 var(--ink);
    font-weight: 800;
}

.iconpill {
    cursor: pointer;
    width: 40px;
    padding: 0;
    justify-content: center;
    position: relative;
}

.iconpill .ic svg {
    width: 20px;
    height: 20px;
}

.badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--berry);
    color: #fff;
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    font-size: 12px;
    display: grid;
    place-items: center;
    padding: 0 5px;
}

.coin-amount {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 800;
}

.coin {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #FFE58A, var(--gold) 60%, #B98A1E);
    border: 1.5px solid #8C6612;
    display: inline-block;
    flex: none;
}

.stars .st {
    color: var(--gold);
    letter-spacing: -1px;
    text-shadow: 0 1px 0 #8C6612;
}

.stars small {
    color: var(--muted);
    font-weight: 700;
}

.status {
    position: absolute;
    top: calc(max(10px, env(safe-area-inset-top)) + 64px);
    left: 10px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    background: rgba(255, 255, 255, .9);
    border: 2px solid var(--line);
}

.chip.warn {
    background: #FFF0C2;
    border-color: var(--gold);
    cursor: pointer;
}

.chip .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, .2);
}

.camctl {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cam {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 2px solid var(--ink);
    background: rgba(255, 246, 233, .94);
    box-shadow: 0 2px 0 var(--ink);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.cam .ic svg {
    width: 20px;
    height: 20px;
}

.dock {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: max(10px, env(safe-area-inset-bottom));
    display: flex;
    gap: 4px;
    padding: 6px;
    background: rgba(255, 246, 233, .96);
    border: 2px solid var(--ink);
    border-radius: 22px;
    box-shadow: 0 4px 0 var(--ink);
    max-width: calc(100vw - 20px);
    overflow-x: auto;
    scrollbar-width: none;
}

.dockbtn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: 0;
    background: transparent;
    padding: 6px 8px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    min-width: 54px;
}

.dockbtn:hover {
    background: var(--surface-2);
}

.dockbtn .ic svg {
    width: 24px;
    height: 24px;
    color: var(--primary-dark);
}

/* Bubbles and floating coins over the 3D world */
.bubble, .floater {
    position: absolute;
    left: 0;
    top: 0;
    margin: -44px 0 0 -22px;
    will-change: transform;
}

.bubble {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 2px solid var(--ink);
    font-size: 18px;
    font-weight: 900;
    box-shadow: 0 2px 0 var(--ink);
}

.bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    margin-left: -6px;
    border: 6px solid transparent;
    border-top-color: var(--ink);
}

.bubble-alert {
    background: var(--gold);
    animation: pulse 1s ease-in-out infinite;
}

.bubble-stars {
    color: var(--gold);
    font-size: 14px;
    text-shadow: 0 1px 0 #8C6612;
}

.bubble-cook {
    background: #FFF0E0;
}

.bubble-angry {
    background: #FBE3E0;
}

@keyframes pulse {
    50% {
        scale: 1.12;
    }
}

.floater {
    font-weight: 900;
    font-size: 18px;
    color: #8C6612;
    text-shadow: 0 2px 0 #fff, 0 0 6px #fff;
    animation: floatup 1.6s ease-out forwards;
}

@keyframes floatup {
    to {
        margin-top: -110px;
        opacity: 0;
    }
}

/* ---------------------------------------------------------------- sheets */

.sheet {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(420px, 100vw);
    background: var(--bg);
    border-left: 2px solid var(--ink);
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform .2s ease;
    box-shadow: var(--shadow);
    z-index: 5;
}

.sheet.in {
    transform: none;
}

.sheet header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: max(14px, env(safe-area-inset-top)) 16px 10px;
    border-bottom: 2px solid var(--line);
}

.sheet h2 {
    margin: 0;
    font-size: 22px;
}

.sheet h3 {
    margin: 18px 0 8px;
    font-size: 16px;
}

.sheet-body {
    overflow-y: auto;
    padding: 14px 16px calc(24px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 640px) {
    .sheet {
        top: auto;
        width: 100vw;
        height: 82dvh;
        border-left: 0;
        border-top: 2px solid var(--ink);
        border-radius: 22px 22px 0 0;
        transform: translateY(105%);
    }
}

.list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dish, .friend, .staff, .rank {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
}

.dish.locked {
    opacity: .55;
}

.dish-icon {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    border-radius: 12px;
    flex: none;
}

.dish-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dish-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}

.dish-act {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.lv {
    color: var(--gold);
    letter-spacing: -1px;
}

.needs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12px;
}

.need {
    padding: 2px 7px;
    border-radius: 999px;
    background: #F4F1EA;
}

.need.ok {
    background: #E7F1D6;
    color: #4E6A1E;
}

.need.miss {
    background: #FBE3E0;
    color: var(--wrong);
}

.switch {
    position: relative;
    width: 46px;
    height: 28px;
    flex: none;
    cursor: pointer;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch i {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--line);
    transition: background .15s;
}

.switch i::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.switch input:checked + i {
    background: var(--olive);
}

.switch input:checked + i::after {
    transform: translateX(18px);
}

.pantry {
    border-top: 2px dashed var(--line);
    padding-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ichip {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--surface);
    border: 2px solid var(--line);
    font-size: 13px;
}

.chips.pick .ichip {
    cursor: pointer;
}

.ichip.wished {
    border-color: var(--berry);
}

.plots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

.plot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border-radius: 16px;
    border: 2px solid #9C7454;
    background: #F1E2CC;
    min-height: 120px;
    justify-content: center;
    font-size: 13px;
    text-align: center;
}

button.plot {
    cursor: pointer;
}

.plot.empty {
    border-style: dashed;
    background: #FAF2E6;
    color: var(--muted);
}

.plot.ripe {
    background: #E7F1D6;
    border-color: var(--olive);
    animation: pulse 1.6s ease-in-out infinite;
}

.plot-ic {
    font-size: 30px;
}

.bar {
    width: 80%;
    height: 8px;
    border-radius: 9px;
    background: #fff;
    overflow: hidden;
}

.bar i {
    display: block;
    height: 100%;
    background: var(--olive);
}

.staff-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.staff-group h3, .staff-group p {
    margin: 0;
}

.staff b {
    flex: 1;
}

.swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--ink);
}

.search input {
    width: 100%;
}

.friend .who {
    font-weight: 800;
    flex: 1;
}

.friend.card {
    flex-wrap: wrap;
}

.friend-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 150px;
}

.friend-act {
    display: flex;
    gap: 6px;
}

.wish {
    font-size: 12px;
    color: var(--berry);
    font-weight: 700;
}

.seg {
    display: flex;
    gap: 4px;
    background: var(--surface-2);
    border-radius: 999px;
    padding: 4px;
}

.seg button {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 8px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

.seg button.on {
    background: var(--surface);
    color: var(--primary-dark);
}

.rank .pos {
    width: 30px;
    text-align: center;
}

.rank .who {
    flex: 1;
    font-weight: 800;
}

.rank.me {
    border-color: var(--primary);
    background: #FFF0E6;
}

.acct {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ---------------------------------------------------------------- build mode */

.buildpanel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 246, 233, .97);
    border-top: 2px solid var(--ink);
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.build-head {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.placing {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
}

.shop {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.shopitem {
    flex: none;
    width: 108px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 6px;
    border-radius: 14px;
    border: 2px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    text-align: center;
    font-size: 12px;
}

.shopitem b {
    font-size: 12px;
    line-height: 1.15;
}

.shopitem.on {
    border-color: var(--primary);
    background: #FFF0E6;
}

.shopitem.locked {
    opacity: .5;
}

.shopitem img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--line);
}

.thumb {
    font-size: 30px;
    line-height: 44px;
    height: 44px;
}

.pop {
    color: var(--olive);
    font-weight: 700;
}

.build-foot {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.cost {
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

.selbar {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 230px;
}

.selcard {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--ink);
    border-radius: 18px;
    padding: 8px 10px;
    box-shadow: 0 3px 0 var(--ink);
    white-space: nowrap;
}

.selbar:empty {
    display: none;
}

/* ---------------------------------------------------------------- visit */

.visitbar {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: max(10px, env(safe-area-inset-bottom));
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(255, 246, 233, .97);
    border: 2px solid var(--ink);
    border-radius: 22px;
    box-shadow: 0 4px 0 var(--ink);
    padding: 10px 14px;
    width: max-content;
    max-width: calc(100vw - 20px);
}

.rate {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 14px;
}

.star {
    border: 0;
    background: transparent;
    font-size: 24px;
    color: var(--gold);
    cursor: pointer;
    padding: 0 2px;
}

.star:hover ~ .star {
    color: var(--line);
}

/* ---------------------------------------------------------------- modals and toasts */

.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(59, 36, 24, .45);
    display: grid;
    place-items: center;
    padding: 16px;
    z-index: 20;
}

.modal {
    background: var(--bg);
    border: 2px solid var(--ink);
    border-radius: 22px;
    box-shadow: 0 6px 0 var(--ink);
    padding: 20px;
    width: 100%;
    max-width: 420px;
    max-height: 90dvh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal h2 {
    margin: 0;
}

.away-art {
    font-size: 54px;
    text-align: center;
}

#toasts {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 30;
    pointer-events: none;
    width: max-content;
    max-width: calc(100vw - 32px);
}

.toast {
    background: var(--ink);
    color: #FFF6E9;
    padding: 10px 16px;
    border-radius: 14px;
    font-weight: 700;
    box-shadow: var(--shadow);
    transition: opacity .4s, transform .4s;
    text-align: center;
}

.toast.good {
    background: var(--olive);
}

.toast.bad {
    background: var(--wrong);
}

.toast.out {
    opacity: 0;
    transform: translateY(-8px);
}

@media (max-width: 640px) {
    .dock {
        gap: 0;
        padding: 4px;
    }

    .dockbtn {
        min-width: 0;
        padding: 6px 5px;
        font-size: 10px;
    }

    .dockbtn .ic svg {
        width: 22px;
        height: 22px;
    }

    .camctl {
        top: auto;
        bottom: 96px;
        transform: none;
    }

    .cam {
        width: 38px;
        height: 38px;
    }

    .rname {
        max-width: 30vw;
    }

    .xpbar {
        width: 54px;
    }

    .pill {
        height: 36px;
        padding: 0 10px;
    }

    .iconpill {
        width: 36px;
    }

    .camctl:has(~ .buildpanel) {
        bottom: 250px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Desktop: the side panel is open, the HUD moves out of its way */
.sheet-open .topbar {
    right: 430px;
}

.sheet-open .camctl {
    right: 430px;
}

.sheet-open .dock {
    left: calc((100% - 420px) / 2);
    max-width: calc(100vw - 440px);
}
