:root {
    --ink: #20313b;
    --muted: #6d7c75;
    --paper: #fffaf0;
    --panel: rgba(255, 250, 240, 0.94);
    --green: #4f9d69;
    --green-deep: #28724e;
    --aqua: #7cc9b8;
    --gold: #f1b94e;
    --rose: #e76f75;
    --shadow: 0 18px 45px rgba(34, 67, 57, 0.22);
    --tile-width: 78px;
    --tile-height: 39px;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        linear-gradient(180deg, rgba(124, 201, 184, 0.42), rgba(255, 250, 240, 0.72)),
        #dff4ec;
}

button,
input {
    font: inherit;
}

a {
    color: var(--green-deep);
    font-weight: 800;
    text-decoration: none;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 18% 12%, rgba(241, 185, 78, 0.34), transparent 28%),
        linear-gradient(135deg, #c9efe4, #fff6dd 58%, #f5c5b7);
}

.auth-panel {
    width: min(100%, 430px);
    display: grid;
    gap: 22px;
    padding: 28px;
    border: 3px solid rgba(47, 113, 79, 0.18);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--green-deep);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.auth-panel h1 {
    margin: 0;
    font-size: clamp(2rem, 8vw, 3.4rem);
    line-height: 1;
}

.auth-copy,
.switch-link {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form label {
    display: grid;
    gap: 7px;
    color: #3c564c;
    font-size: 0.92rem;
    font-weight: 800;
}

.auth-form input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 2px solid rgba(40, 114, 78, 0.22);
    border-radius: 8px;
    background: #fffdf8;
    color: var(--ink);
    outline: none;
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.auth-form input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(79, 157, 105, 0.16);
}

.auth-form button {
    min-height: 50px;
    border: 0;
    border-radius: 8px;
    color: white;
    background: linear-gradient(180deg, var(--green), var(--green-deep));
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(40, 114, 78, 0.24);
}

.message {
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 800;
}

.message.error {
    color: #81333a;
    background: rgba(231, 111, 117, 0.16);
}

.game-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(137, 210, 198, 0.72), rgba(203, 236, 211, 0.62)),
        #9ed9cf;
}

.top-bar,
.bottom-bar,
.side-tools {
    position: fixed;
    z-index: 30;
}

.top-bar {
    top: 10px;
    left: 10px;
    right: 10px;
    min-height: 56px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 2px solid rgba(255, 255, 255, 0.62);
    border-radius: 8px;
    background: rgba(255, 250, 240, 0.78);
    box-shadow: 0 10px 30px rgba(32, 49, 59, 0.14);
    backdrop-filter: blur(14px);
}

.brand-mark {
    width: 74px;
    min-height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: white;
    background: linear-gradient(180deg, #5ba46f, #2c7f58);
    font-size: 1rem;
    font-weight: 950;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.14);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

.stat-pill {
    min-width: 76px;
    padding: 6px 9px;
    border-radius: 8px;
    background: #fffdf7;
    box-shadow: inset 0 -2px 0 rgba(32, 49, 59, 0.08);
}

.stat-pill span {
    display: block;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
}

.stat-pill strong {
    display: block;
    margin-top: 3px;
    font-size: 1rem;
}

.logout-link {
    padding: 9px 10px;
    border-radius: 8px;
    background: rgba(40, 114, 78, 0.1);
    font-size: 0.86rem;
}

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

.game-stage.dragging {
    cursor: grabbing;
}

.camera-help {
    position: fixed;
    top: 92px;
    left: 50%;
    z-index: 15;
    translate: -50% 0;
    max-width: calc(100vw - 32px);
    padding: 8px 12px;
    border-radius: 8px;
    color: rgba(32, 49, 59, 0.76);
    background: rgba(255, 250, 240, 0.62);
    font-size: 0.78rem;
    font-weight: 800;
    pointer-events: none;
    display: none;
}

.island-world {
    position: absolute;
    left: 50%;
    top: 44%;
    width: 1px;
    height: 1px;
    transform-origin: 0 0;
    transition: transform 90ms ease-out;
}

.tile-layer,
.object-layer {
    position: absolute;
    left: 0;
    top: 0;
}

.tile,
.placed-object {
    position: absolute;
    transform-origin: 50% 74%;
}

.tile {
    width: var(--tile-width);
    height: var(--tile-height);
    display: grid;
    place-items: center;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 52%),
        #70b86f;
    box-shadow: inset 0 -6px 0 rgba(39, 111, 70, 0.1);
    cursor: pointer;
    transition: filter 140ms ease, translate 140ms ease;
}

.tile::after {
    content: "";
    width: 68%;
    height: 56%;
    opacity: 0.16;
    background-image: url("../tiles/grass.png");
    background-size: cover;
}

.tile.edge {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 50%),
        #76bf78;
}

.tile:hover,
.tile.target {
    filter: brightness(1.12) saturate(1.08);
    translate: 0 -2px;
}

.tile.water {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 50%),
        #65b9ca;
}

.placed-object {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    padding: 2px;
    border: 0;
    background: transparent;
    cursor: grab;
    transition: translate 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.placed-object img {
    max-width: 72px;
    max-height: 72px;
    image-rendering: pixelated;
    filter: drop-shadow(0 12px 7px rgba(32, 49, 59, 0.23));
    pointer-events: none;
}

.placed-object:hover {
    translate: 0 -5px;
    filter: brightness(1.08);
}

.placed-object.selected {
    filter: drop-shadow(0 0 0.55rem rgba(241, 185, 78, 0.95));
}

.side-tools {
    right: 12px;
    top: 86px;
    display: grid;
    gap: 10px;
}

.tool-button {
    width: 42px;
    aspect-ratio: 1;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    color: var(--ink);
    background: rgba(255, 250, 240, 0.82);
    font-size: 1.2rem;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(32, 49, 59, 0.16);
    transition: transform 150ms ease, background 150ms ease;
}

.tool-button:hover,
.tool-button.active {
    transform: translateY(-2px);
    background: #fff6cf;
}

.tool-button.danger {
    color: #8f3137;
}

.bottom-bar {
    left: 10px;
    right: 10px;
    bottom: 10px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 2px solid rgba(255, 255, 255, 0.62);
    border-radius: 8px;
    background: rgba(255, 250, 240, 0.82);
    box-shadow: 0 14px 36px rgba(32, 49, 59, 0.18);
    backdrop-filter: blur(14px);
}

.mode-chip {
    min-width: 92px;
    padding: 10px 12px;
    border-radius: 8px;
    color: white;
    background: linear-gradient(180deg, var(--gold), #d88935);
    font-weight: 950;
    text-align: center;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}

.inventory {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 76px;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.inventory-item {
    min-height: 66px;
    display: grid;
    grid-template-rows: 36px 1fr;
    gap: 3px;
    align-items: center;
    justify-items: center;
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--ink);
    background: #fffdf8;
    cursor: pointer;
    box-shadow: inset 0 -3px 0 rgba(32, 49, 59, 0.08);
    transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.inventory-item:hover,
.inventory-item.active {
    border-color: var(--gold);
    transform: translateY(-2px);
    background: #fff7d7;
}

.inventory-item img {
    max-width: 46px;
    max-height: 42px;
    image-rendering: pixelated;
}

.asset-figure {
    position: relative;
    display: block;
    width: 58px;
    height: 58px;
    transform-origin: 50% 82%;
    filter: drop-shadow(0 12px 7px rgba(32, 49, 59, 0.23));
    pointer-events: none;
}

.asset-figure.mini {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 5px 3px rgba(32, 49, 59, 0.16));
}

.asset-figure::before,
.asset-figure::after {
    content: "";
    position: absolute;
    display: block;
}

.asset-figure.bush::before {
    left: 12%;
    bottom: 10%;
    width: 76%;
    height: 52%;
    border-radius: 50% 50% 42% 42%;
    background: linear-gradient(180deg, #7ed36f, #2f8d56);
    box-shadow: -10px 5px 0 -2px #49a95c, 11px 6px 0 -3px #5fbd63;
}

.asset-figure.flower::before {
    left: 47%;
    bottom: 14%;
    width: 8%;
    height: 46%;
    border-radius: 10px;
    background: #347c48;
    box-shadow: -13px 7px 0 -2px #4da75f, 12px 9px 0 -2px #4da75f;
}

.asset-figure.flower::after {
    left: 28%;
    bottom: 49%;
    width: 44%;
    height: 28%;
    border-radius: 999px;
    background: #f4d35e;
    box-shadow: -8px 3px 0 -2px #e76f75, 8px 2px 0 -2px #e76f75, 0 -7px 0 -3px #f49aa1;
}

.asset-figure.tree::before {
    left: 43%;
    bottom: 10%;
    width: 14%;
    height: 42%;
    border-radius: 4px;
    background: linear-gradient(180deg, #9a663f, #6f4530);
}

.asset-figure.tree::after {
    left: 16%;
    bottom: 38%;
    width: 68%;
    height: 52%;
    border-radius: 50%;
    background: linear-gradient(180deg, #83d56f, #3e9f55);
    box-shadow: -9px 13px 0 -4px #4ba85a, 10px 12px 0 -5px #63bd60;
}

.asset-figure.crop::before {
    left: 13%;
    bottom: 12%;
    width: 74%;
    height: 28%;
    border-radius: 50%;
    background: #8a6042;
    transform: skewX(-18deg);
}

.asset-figure.crop::after {
    left: 21%;
    bottom: 29%;
    width: 8%;
    height: 24%;
    border-radius: 10px 10px 0 0;
    background: #65b95e;
    box-shadow: 12px -4px 0 #75c96a, 24px 1px 0 #4fa95a, 34px -5px 0 #7fd06d;
}

.asset-figure.chair::before {
    left: 24%;
    bottom: 23%;
    width: 46%;
    height: 28%;
    border-radius: 6px;
    background: #bf7d48;
    box-shadow: 0 -22px 0 -6px #d59658;
}

.asset-figure.chair::after {
    left: 27%;
    bottom: 7%;
    width: 7%;
    height: 22%;
    border-radius: 4px;
    background: #7a4c33;
    box-shadow: 22px 0 0 #7a4c33;
}

.asset-figure.table::before {
    left: 14%;
    bottom: 34%;
    width: 72%;
    height: 22%;
    border-radius: 50%;
    background: #d69654;
    box-shadow: inset 0 -6px 0 rgba(96, 56, 33, 0.16);
}

.asset-figure.table::after {
    left: 29%;
    bottom: 10%;
    width: 8%;
    height: 28%;
    border-radius: 4px;
    background: #7a4c33;
    box-shadow: 19px 0 0 #7a4c33;
}

.asset-figure.crate::before {
    left: 17%;
    bottom: 13%;
    width: 66%;
    height: 52%;
    border-radius: 6px;
    background: linear-gradient(135deg, #c58143, #8a5536);
    box-shadow: inset 0 0 0 4px rgba(88, 51, 34, 0.22);
}

.asset-figure.crate::after {
    left: 24%;
    bottom: 35%;
    width: 52%;
    height: 5px;
    border-radius: 5px;
    background: rgba(88, 51, 34, 0.36);
    transform: rotate(-32deg);
}

.asset-figure.lamp::before {
    left: 47%;
    bottom: 12%;
    width: 7%;
    height: 48%;
    border-radius: 4px;
    background: #5c493b;
}

.asset-figure.lamp::after {
    left: 29%;
    bottom: 55%;
    width: 42%;
    height: 28%;
    border-radius: 50% 50% 40% 40%;
    background: linear-gradient(180deg, #ffe58d, #f1b94e);
    box-shadow: 0 0 16px rgba(241, 185, 78, 0.62);
}

.asset-figure.wall::before {
    left: 14%;
    bottom: 16%;
    width: 72%;
    height: 45%;
    border-radius: 5px;
    background:
        linear-gradient(90deg, transparent 48%, rgba(114, 72, 48, 0.22) 48% 52%, transparent 52%),
        linear-gradient(180deg, #dfb37a, #b77b4b);
    box-shadow: inset 0 -5px 0 rgba(78, 49, 32, 0.18);
}

.asset-figure.roof::before {
    left: 10%;
    bottom: 24%;
    width: 80%;
    height: 46%;
    clip-path: polygon(50% 0, 100% 62%, 88% 100%, 12% 100%, 0 62%);
    background: linear-gradient(180deg, #d7654f, #9d3f3e);
}

.asset-figure.house::before {
    left: 14%;
    bottom: 12%;
    width: 72%;
    height: 44%;
    border-radius: 6px;
    background: linear-gradient(180deg, #efc88b, #c38a56);
    box-shadow: inset 0 -5px 0 rgba(78, 49, 32, 0.16);
}

.asset-figure.house::after {
    left: 8%;
    bottom: 48%;
    width: 84%;
    height: 38%;
    clip-path: polygon(50% 0, 100% 72%, 88% 100%, 12% 100%, 0 72%);
    background: linear-gradient(180deg, #db6a52, #9d3f3e);
}

.asset-figure.fence::before {
    left: 9%;
    bottom: 20%;
    width: 82%;
    height: 10%;
    border-radius: 5px;
    background: #b87949;
    box-shadow: 0 -13px 0 #d19759;
}

.asset-figure.fence::after {
    left: 18%;
    bottom: 12%;
    width: 8%;
    height: 45%;
    border-radius: 5px 5px 2px 2px;
    background: #8a5536;
    box-shadow: 18px 0 0 #8a5536, 36px 0 0 #8a5536;
}

.asset-figure.hero::before {
    left: 35%;
    bottom: 13%;
    width: 30%;
    height: 42%;
    border-radius: 12px 12px 8px 8px;
    background: linear-gradient(180deg, #5ca6d8 0 48%, #435f9d 48% 100%);
}

.asset-figure.hero::after {
    left: 32%;
    bottom: 55%;
    width: 36%;
    height: 33%;
    border-radius: 46% 46% 42% 42%;
    background: #f0b47d;
    box-shadow: inset 0 9px 0 #6e4634, -10px 27px 0 -7px #f0b47d, 10px 27px 0 -7px #f0b47d;
}

.inventory-item span {
    max-width: 78px;
    overflow: hidden;
    color: #4d5e58;
    font-size: 0.72rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 118px;
    z-index: 50;
    min-width: 210px;
    max-width: calc(100vw - 32px);
    padding: 12px 14px;
    border-radius: 8px;
    color: white;
    background: rgba(32, 49, 59, 0.92);
    font-weight: 800;
    text-align: center;
    opacity: 0;
    transform: translate(-50%, 12px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (max-width: 760px) {
    .top-bar {
        grid-template-columns: 1fr auto;
        align-items: start;
    }

    .brand-mark {
        width: 76px;
    }

    .stats {
        grid-column: 1 / -1;
        order: 3;
        justify-content: start;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .stat-pill {
        min-width: 78px;
    }

    .camera-help {
        display: none;
    }

    .side-tools {
        top: 150px;
        right: 10px;
    }

    .bottom-bar {
        left: 8px;
        right: 8px;
        bottom: 8px;
        grid-template-columns: 1fr;
    }

    .mode-chip {
        min-width: 0;
        padding: 9px 12px;
    }

    .inventory {
        grid-auto-columns: 76px;
    }

    .inventory-item {
        min-height: 70px;
    }
}

.tile.water {
    border-color: rgba(255, 255, 255, 0.12);
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.32), transparent 18%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 52%),
        #5eb6c7;
    box-shadow: inset 0 -7px 0 rgba(31, 103, 129, 0.18);
    cursor: default;
}

.tile.water::after {
    opacity: 0;
}

.tile.dock {
    cursor: pointer;
    background:
        linear-gradient(90deg, rgba(97, 58, 34, 0.18) 0 18%, transparent 18% 34%, rgba(97, 58, 34, 0.18) 34% 52%, transparent 52% 70%, rgba(97, 58, 34, 0.18) 70% 100%),
        linear-gradient(135deg, #bd8450, #875737);
    box-shadow: inset 0 -7px 0 rgba(83, 49, 31, 0.22), 0 9px 14px rgba(36, 91, 112, 0.18);
}

.tile.dock::after {
    opacity: 0;
}

.map-prop {
    position: absolute;
    width: 92px;
    height: 70px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.boat-prop span {
    position: absolute;
    left: 12px;
    top: 22px;
    width: 70px;
    height: 30px;
    border-radius: 55% 45% 60% 60%;
    background: linear-gradient(180deg, #e8b66a, #9b6038);
    box-shadow: inset 0 -7px 0 rgba(73, 43, 28, 0.24), 0 12px 12px rgba(31, 103, 129, 0.22);
    transform: rotate(-12deg);
}

.boat-prop span::before {
    content: "";
    position: absolute;
    left: 34px;
    bottom: 22px;
    width: 5px;
    height: 38px;
    border-radius: 4px;
    background: #5d3e2b;
}

.boat-prop span::after {
    content: "";
    position: absolute;
    left: 39px;
    bottom: 29px;
    width: 30px;
    height: 25px;
    clip-path: polygon(0 0, 100% 48%, 0 100%);
    background: #fff4d8;
}

.placed-object.plant.sprout .asset-figure {
    transform: scale(0.58);
    opacity: 0.76;
}

.placed-object.plant.growing .asset-figure {
    transform: scale(0.82);
    opacity: 0.9;
}

.placed-object.plant.ripe .asset-figure {
    transform: scale(1);
}

.placed-object.plant.sprout .asset-figure.tree::after,
.placed-object.plant.sprout .asset-figure.bush::before {
    background: linear-gradient(180deg, #91cd62, #4a9656);
}

.placed-object.plant.growing .asset-figure.flower::after {
    opacity: 0.45;
}

.placed-object.connect-east .asset-figure.fence::before,
.placed-object.connect-west .asset-figure.fence::before {
    left: -3%;
    width: 106%;
}

.placed-object.connect-north .asset-figure.fence,
.placed-object.connect-south .asset-figure.fence {
    transform: rotate(90deg);
}

.placed-object.connect-north.connect-south .asset-figure.fence::before {
    left: -11%;
    width: 122%;
}

.placed-object.connect-east.connect-west.connect-north .asset-figure.fence::after,
.placed-object.connect-east.connect-west.connect-south .asset-figure.fence::after,
.placed-object.connect-north.connect-south.connect-east .asset-figure.fence::after,
.placed-object.connect-north.connect-south.connect-west .asset-figure.fence::after {
    box-shadow: 18px 0 0 #8a5536, 36px 0 0 #8a5536, 18px -17px 0 -1px #b87949;
}

.day-night {
    position: fixed;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    background: transparent;
    mix-blend-mode: multiply;
    transition: background 900ms ease;
}

.day-night.dusk {
    background: rgba(238, 157, 96, 0.18);
}

.day-night.night {
    background: rgba(28, 49, 91, 0.42);
}

.stat-pill > span:not(.coin-icon):not(.hud-icon) {
    display: inline-block;
}

.coin-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    vertical-align: -4px;
    border: 2px solid #c8872f;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff4a8 0 18%, #f4ca56 19% 64%, #d9902d 65% 100%);
    box-shadow: inset 0 -2px 0 rgba(109, 70, 22, 0.18), 0 2px 4px rgba(32, 49, 59, 0.12);
}

.coin-icon.tiny {
    width: 13px;
    height: 13px;
    margin-right: 3px;
    vertical-align: -2px;
    border-width: 1px;
}

.hud-icon {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 18px;
    margin-right: 5px;
    border-radius: 6px;
    color: white;
    background: #3f8f64;
    font-size: 0.54rem;
    font-weight: 950;
}

.placed-object.building {
    width: 92px;
    height: 92px;
}

.placed-object.ready::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f1b94e;
    box-shadow: 0 0 0 3px rgba(255, 250, 240, 0.9), 0 0 14px rgba(241, 185, 78, 0.82);
}

.panel-stack {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 76px;
    z-index: 32;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(230px, 340px);
    gap: 10px;
    align-items: end;
    transition: transform 180ms ease, opacity 180ms ease;
}

.panel-stack.collapsed {
    transform: translateY(calc(100% + 18px));
    opacity: 0;
    pointer-events: none;
}

.game-panel {
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.62);
    border-radius: 8px;
    background: rgba(255, 250, 240, 0.84);
    box-shadow: 0 14px 34px rgba(32, 49, 59, 0.16);
    backdrop-filter: blur(14px);
}

.panel-title {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border: 0;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
    font-weight: 950;
}

.panel-title strong {
    padding: 5px 8px;
    border-radius: 8px;
    color: #2c6549;
    background: rgba(79, 157, 105, 0.14);
    font-size: 0.72rem;
}

.panel-body {
    max-height: 180px;
    overflow: hidden;
    padding: 0 10px 10px;
    transition: max-height 180ms ease, padding 180ms ease;
}

.panel-body.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.bottom-bar {
    display: flex;
    padding: 8px 10px;
}

.bottom-bar.compact {
    right: auto;
    min-width: 0;
}

.mode-chip {
    border: 0;
    cursor: pointer;
}

.quick-status {
    min-width: 0;
    display: flex;
    gap: 8px;
    align-items: center;
    color: #4d5e58;
    font-size: 0.82rem;
    font-weight: 850;
}

.quick-status span {
    overflow: hidden;
    max-width: 34vw;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.54);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-item {
    grid-template-rows: 32px 17px 16px;
}

.inventory-item strong {
    display: inline-flex;
    align-items: center;
    color: #84612b;
    font-size: 0.7rem;
    font-weight: 950;
}

.bank-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.money-action {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    color: white;
    background: linear-gradient(180deg, #4f9d69, #28724e);
    font-weight: 950;
    cursor: pointer;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.14);
}

.money-action[data-repay] {
    background: linear-gradient(180deg, #e2a64c, #bd7430);
}

.asset-figure.house {
    width: 74px;
    height: 74px;
}

.asset-figure.house::before {
    box-shadow: inset 0 -5px 0 rgba(78, 49, 32, 0.16), inset 18px 0 0 -10px #a86f4f, inset -18px 0 0 -10px #ffe0a3;
}

@media (max-width: 760px) {
    .top-bar {
        left: 8px;
        right: 8px;
        gap: 8px;
    }

    .stats {
        width: 100%;
    }

    .side-tools {
        top: 138px;
    }

    .tool-button {
        width: 40px;
    }

    .panel-stack {
        left: 8px;
        right: 8px;
        bottom: 72px;
        grid-template-columns: 1fr;
    }

    .panel-body {
        max-height: 156px;
    }

    .inventory {
        grid-auto-columns: 72px;
    }

    .inventory-item {
        min-height: 66px;
    }

    .bank-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-status {
        width: 100%;
        justify-content: space-between;
    }

    .quick-status span {
        max-width: 44vw;
    }
}
