/* LAST CITY / dark command interface.
   CSS-only presentation; gameplay values feed the purchase meters. */
:root {
    color-scheme: dark;
    --background: #080a12;
    --panel: #111522;
    --panel-light: #171d2d;
    --border: #293249;
    --text: #edf3ff;
    --muted: #a1afc7;
    --blue: #65e4ed;
    --purple: #ab94ff;
    --yellow: #65e4ed;
    --orange: #91a6ff;
    --green: #73e5b6;
    --surface: linear-gradient(145deg, #151a29, #101420);
}

body {
    background: radial-gradient(ellipse at 85% 0%, #27204645, transparent 45%),
        radial-gradient(ellipse at 5% 35%, #11374335, transparent 40%), #080a12;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    line-height: 1.5;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: linear-gradient(#a5baff04 1px, transparent 1px),
        linear-gradient(90deg, #a5baff04 1px, transparent 1px);
    background-size: 48px 48px;
}
button { font-family: inherit; touch-action: manipulation; }
button:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
button:not(:disabled) {
    transition: transform 140ms ease, background-color 180ms ease,
        border-color 180ms ease, box-shadow 180ms ease;
}
/* Higher specificity than existing hover effects; disabled controls never press. */
body button:active:not(:disabled) { transform: scale(.97); }
body button.energy-pickup:active:not(:disabled) { transform: translate(-50%, -50%) scale(.94); }

.top-header { max-width: 1580px; padding: 28px 28px 24px; }
.studio-name { color: var(--blue); letter-spacing: 3px; }
.logo-section h1 { font-size: clamp(24px, 3vw, 34px); letter-spacing: 6px; }
.tagline { color: var(--muted); font-size: 12px; }
.secondary-button, .danger-button { background: #111522; min-height: 42px; border-radius: 9px; }
.secondary-button { color: #cbd6ea; border-color: var(--border); }
.danger-button { color: #ff9aaa; border-color: #6a374a; }
.game-container {
    width: calc(100% - 56px);
    max-width: 1524px;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    column-gap: 24px;
    align-items: start;
    padding-bottom: 70px;
}
.game-container > * { grid-column: 2; min-width: 0; }
.game-container > .game-mode-tabs {
    grid-column: 1;
    grid-row: 1 / span 12;
    position: sticky;
    top: 24px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 10px;
    background: var(--surface);
    border-color: var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 35px #0003;
}
.game-mode-tabs::before {
    content: "COMMAND / 01";
    padding: 3px 10px 14px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 2px;
}
.game-mode-tab { width: 100%; min-height: 46px; text-align: left; font-size: 12px; padding: 12px 10px; }
.game-mode-tab.active {
    color: var(--blue);
    background: #65e4ed0d;
    box-shadow: inset 2px 0 var(--blue);
}
.game-mode-tab.active .ready-badge { color: var(--blue); background: #65e4ed1a; }
.stage-tabs { gap: 7px; margin-bottom: 18px; flex-wrap: wrap; }
.stage-tab { min-height: 40px; background: #111522; border: 1px solid var(--border); border-radius: 8px; font-size: 11px; }
.stage-tab.active { color: var(--blue); background: #65e4ed0e; border-color: #65e4ed70; box-shadow: none; }
.stage-tab.locked { opacity: .65; }
.milestone-panel { background: var(--surface); border-color: var(--border); border-radius: 12px; }
.milestone-progress { height: 4px; background: #252d43; }
.milestone-progress div { background: linear-gradient(90deg, var(--blue), var(--purple)); box-shadow: none; }
.eyebrow { color: var(--muted); font-size: 9px; letter-spacing: 2px; }
.tutorial-hint { background: #111a27; border-color: #293e52; color: #b7c9df; margin: 0 0 8px; }
.auto-save-indicator { justify-self: end; margin: 0 0 16px; padding: 4px; }

.stage-panel.active { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.stage-panel > * { min-width: 0; }
.stage-panel > .resource-section { order: -2; margin: 0; }
.stage-panel > .next-purchase { order: -1; }
.resource-section { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.resource-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    min-height: 105px;
    padding: 18px;
    box-shadow: none;
}
.resource-card:hover { transform: none; border-color: #465572; }
.resource-card:first-child {
    grid-column: 1 / -1;
    min-height: 170px;
    justify-content: center;
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, #65e4ed0b, transparent 65%), var(--surface);
    border-top-color: #65e4ed55;
}
.resource-card:first-child h2 {
    color: var(--text);
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.15;
    letter-spacing: -2px;
    font-weight: 700;
    text-shadow: 0 0 30px #65e4ed15;
    overflow-wrap: anywhere;
}
.resource-card h2 { color: var(--text); font-size: 23px; font-variant-numeric: tabular-nums; }
.resource-icon { background: #65e4ed0a; border: 1px solid #65e4ed22; border-radius: 12px; font-size: 24px; width: 46px; height: 46px; flex-shrink: 0; }
.resource-label { color: var(--muted); font-size: 10px; letter-spacing: 2px; }
.resource-rate { color: var(--green); font-size: 11px; }
.next-purchase {
    padding: 16px 20px;
    background: #121827;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.next-purchase > strong { display: block; margin: 5px 0 8px; font-size: 14px; font-weight: 600; }
.next-purchase > small { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }

.city-panel, .building-panel, .upgrade-section, .dispatch-card, .contracts-card,
.badge-section, .stat-group, .stats-hero, .companion-panel {
    background: var(--surface);
    border-color: var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 25px #0002;
}
.game-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; margin: 0; }
.city-panel { padding: 24px; }
.city-header h2, .panel-heading h2 { font-size: 19px; letter-spacing: -.4px; }
.city-level { background: #080e1977; border-color: var(--border); }
.city-visual { background: radial-gradient(ellipse, #65e4ed0a, transparent 70%); border-color: #26334a; }
.energy-button {
    color: #09121d;
    background: linear-gradient(120deg, #65e4ed, #94adff);
    border: 1px solid #9febf2;
    border-radius: 12px;
    box-shadow: 0 6px 25px #65e4ed15;
    min-height: 68px;
}
.energy-button:hover { box-shadow: 0 6px 30px #65e4ed30; }
.building-panel { padding: 18px; align-self: start; }
.building-card { background: #121827; border-color: #27324a; border-radius: 10px; padding: 15px; margin-bottom: 10px; box-shadow: none; }
.building-card:hover { transform: none; border-color: #465572; }
.building-icon { width: 38px; height: 38px; font-size: 21px; background: #ffffff06; border-color: var(--border); }
.building-top h3 { font-size: 12px; }
.building-top p, .building-stats { color: var(--muted); font-size: 10px; }
.buy-button, .rebirth-button, .zone-unlock, .dispatch-button {
    background: #18333f;
    color: #c4f6fb;
    border: 1px solid #3f6976;
    border-radius: 8px;
    box-shadow: none;
}
.buy-button:disabled, .rebirth-button:disabled { opacity: .65; background: #182031; color: #a1afc7; border-color: var(--border); }
.buy-amount { background: #171e2e; border-color: var(--border); color: var(--muted); }
.buy-amount.active { color: var(--blue); background: #65e4ed14; border-color: #65e4ed60; }
.zone-scene { border-color: var(--border); border-radius: 14px; }
.zone-workshop { background: #111522; border-color: var(--border); border-radius: 12px; }
.infrastructure-grid button { background: #161d2d; border-color: #33425c; text-align: left; }
.infrastructure-grid button:disabled { opacity: 1; color: var(--muted); }
.infrastructure-grid button > .purchase-progress { margin-top: 10px; }
.infrastructure-grid button > .purchase-progress .purchase-track { margin: 0; }

/* Shop on the left, persistent resource dashboard on the right. */
.upgrade-sidebar { display: none; }
body.upgrades-open .stage-panel.active {
    display: grid;
    grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    align-items: start;
    gap: 20px;
}
body.upgrades-open .upgrade-sidebar {
    display: block;
    grid-column: 1;
    grid-row: 1 / span 3;
    background: #0e121e;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #465572 #0e121e;
}
body.upgrades-open .stage-panel > .resource-section { display: grid; grid-column: 2; grid-row: 1; }
body.upgrades-open .stage-panel > .next-purchase { grid-column: 2; grid-row: 2; }
body.upgrades-open .game-layout { display: block; grid-column: 2; grid-row: 3; }
body.upgrades-open .game-layout .building-panel { display: none; }
.upgrade-sidebar .upgrade-section { padding: 0; margin: 0; background: none; border: 0; box-shadow: none; }
.upgrade-sidebar .upgrade-section + .upgrade-section { padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--border); }
.upgrade-sidebar .panel-heading { align-items: start; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.upgrade-sidebar .panel-heading h2 { font-size: 16px; }
.upgrade-sidebar .upgrade-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.upgrade-card {
    text-align: left;
    padding: 16px;
    border-radius: 10px;
    background: #171e2e;
    border: 1px solid #35425a;
    box-shadow: none;
    min-width: 0;
}
.upgrade-card:not(:disabled) { border-color: #65e4ed66; background: #152832; box-shadow: none; }
.upgrade-card:not(:disabled)::after { display: none; }
.upgrade-card:disabled { opacity: 1; cursor: not-allowed; background: #151a28; }
.upgrade-card.maxed { border-color: #73e5b644; background: #73e5b607; }
.upgrade-name { color: var(--text); font-size: 13px; font-weight: 600; }
.upgrade-desc { color: var(--muted); font-size: 11px; line-height: 1.6; }
.upgrade-meta { color: #b9c8df; font-size: 10px; margin-top: 12px; }
.tech-icon { float: right; font-size: 21px; margin-left: 8px; }
.purchase-progress { display: block; margin-top: 12px; }
.purchase-track { display: block; height: 4px; border-radius: 99px; background: #303a51; overflow: hidden; }
.purchase-track > span {
    display: block;
    height: 100%;
    width: var(--purchase-progress, 0%);
    background: linear-gradient(90deg, #65cbd7, #aa94ff);
    border-radius: inherit;
    transition: width 300ms ease;
}
.purchase-status { display: block; color: #acbcd2; font-size: 10px; margin-top: 7px; font-weight: 400; }
.funded .purchase-track > span { background: var(--green); }
.funded .purchase-status, .maxed .purchase-status { color: var(--green); }
.stats-hero { border-color: var(--border); }
.stats-panel { max-width: 1524px; }
.game-container > .stats-panel { width: 100%; margin: 0; }
.stage-reset-dock { background: #121827f5; border-color: var(--border); border-radius: 12px; box-shadow: 0 8px 40px #0006; }

@media (max-width: 1180px) {
    .game-container { grid-template-columns: minmax(0, 1fr); width: calc(100% - 40px); }
    .game-container > * { grid-column: 1; }
    .game-container > .game-mode-tabs { grid-row: 1; position: static; flex-direction: row; flex-wrap: wrap; padding: 6px; gap: 4px; }
    .game-mode-tabs::before { display: none; }
    .game-mode-tab { width: auto; flex: 1; text-align: center; }
    .game-mode-tab.active { box-shadow: inset 0 -2px var(--blue); }
    .top-header { padding-inline: 20px; }
}
@media (max-width: 820px) {
    .game-layout { grid-template-columns: minmax(0, 1fr); }
    body.upgrades-open .stage-panel.active { display: flex; flex-direction: column; }
    body.upgrades-open .stage-panel > .resource-section,
    body.upgrades-open .stage-panel > .next-purchase,
    body.upgrades-open .upgrade-sidebar,
    body.upgrades-open .game-layout { width: 100%; }
    body.upgrades-open .game-layout { order: 2; }
    body.upgrades-open .upgrade-sidebar { position: static; max-height: none; overflow: visible; }
    .resource-section { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .resource-card:not(:first-child) { flex-direction: column; text-align: center; gap: 8px; padding: 12px 6px; }
    .resource-card:not(:first-child) .resource-icon { display: none; }
}
@media (max-width: 520px) {
    .game-container { width: calc(100% - 24px); }
    .top-header { padding: 20px 12px; flex-wrap: wrap; gap: 16px; }
    .logo-section h1 { font-size: 27px; }
    .header-buttons { width: 100%; gap: 6px; }
    .header-buttons button { flex: 1; padding: 10px 8px; }
    .game-mode-tab { flex: 1 0 42%; font-size: 11px; }
    .stage-tabs { gap: 5px; }
    .stage-tab { flex: 1 0 30%; padding: 9px 6px; font-size: 10px; }
    .resource-card:first-child { min-height: 150px; padding: 20px 12px; }
    .resource-card:first-child h2 { font-size: 40px; }
    .resource-card h2 { font-size: 20px; }
    .resource-label { font-size: 8px; letter-spacing: 1px; }
    .resource-rate { font-size: 10px; }
    .milestone-panel { padding: 14px; gap: 10px; grid-template-columns: minmax(0, 1fr) auto; }
    .milestone-copy { grid-column: 1 / -1; }
    .city-panel { padding: 18px 14px; }
    .city-header { flex-wrap: wrap; gap: 12px; }
    body.upgrades-open .upgrade-sidebar { padding: 14px; }
    .upgrade-card { min-height: 44px; }
}
/* Egg reveal: fixed-size tiles keep the winning card precisely under the marker. */
body.hatch-open { overflow: hidden; }
.hatch-modal {
    width: min(520px, calc(100vw - 28px));
    max-height: calc(100dvh - 28px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: #111522;
    color: var(--text);
    box-shadow: 0 30px 100px #0009;
    --hatch-color: #ab94ff;
}
.hatch-modal:not([open]) { display: none; }
.hatch-modal::backdrop { background: #060914f5; backdrop-filter: blur(6px); }
.hatch-card {
    padding: 30px;
    text-align: center;
    border: 1px solid #ab94ff55;
    border-radius: inherit;
    background: radial-gradient(ellipse at 50% 0, #ab94ff15, transparent 70%), #111522;
}
.hatch-card h2 { margin: 7px 0 24px; font-size: 25px; letter-spacing: -.5px; }
.hatch-reel {
    position: relative;
    height: 168px;
    overflow: hidden;
    border: 1px solid #34415a;
    border-radius: 14px;
    background: #080c17;
}
.hatch-reel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, #080c17e6, transparent 28%, transparent 72%, #080c17e6);
}
.hatch-pointer {
    position: absolute;
    z-index: 2;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: linear-gradient(#65e4ed, transparent 30%, transparent 70%, #65e4ed);
    pointer-events: none;
}
.hatch-pointer::before, .hatch-pointer::after {
    content: "";
    position: absolute;
    left: -5px;
    width: 12px;
    height: 12px;
    background: #65e4ed;
    transform: rotate(45deg);
    box-shadow: 0 0 15px #65e4ed44;
}
.hatch-pointer::before { top: -6px; }
.hatch-pointer::after { bottom: -6px; }
.hatch-strip {
    position: absolute;
    top: 22px;
    left: 50%;
    display: flex;
    gap: 12px;
    width: max-content;
    transform: translateX(-55px);
    transition: transform 4000ms cubic-bezier(.12, .85, .15, 1);
    will-change: transform;
}
.hatch-strip.rolling, .hatch-strip.settled { transform: translateX(var(--hatch-target)); }
.hatch-strip.settled { transition: none; will-change: auto; }
.hatch-tile {
    width: 110px;
    height: 122px;
    flex: 0 0 110px;
    display: grid;
    place-content: center;
    gap: 8px;
    border: 1px solid #414366;
    border-radius: 12px;
    background: linear-gradient(140deg, #24233b, #141b2c);
}
.hatch-tile strong { font-size: 44px; line-height: 1; color: #d4c8ff; }
.hatch-tile small { font-size: 8px; letter-spacing: 2px; color: #a1afc7; }
.hatch-status { min-height: 20px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.hatch-result { margin: 18px 0; }
.hatch-result[hidden] { display: none; }
.hatch-rarity { color: var(--hatch-color); font-size: 10px; letter-spacing: 3px; text-transform: uppercase; }
.hatch-result h3 { font-size: 27px; margin: 5px 0; }
.hatch-result p { font-size: 14px; color: var(--green); }
.hatch-result small { display: block; color: var(--muted); font-size: 11px; margin-top: 8px; }
.hatch-revealed .winner { border-color: var(--hatch-color); box-shadow: 0 0 28px color-mix(in srgb, var(--hatch-color) 30%, transparent); }
.hatch-revealed .winner strong { animation: companionReveal 500ms ease-out; font-size: 48px; }
.hatch-revealed .winner small { visibility: hidden; }
.hatch-action {
    display: block;
    width: 100%;
    min-height: 46px;
    margin-top: 20px;
    padding: 12px;
    border: 1px solid #6973a7;
    border-radius: 10px;
    background: #252e48;
    color: #e7edff;
    font-weight: 600;
    cursor: pointer;
}
.hatch-revealed .hatch-action { background: #173d43; border-color: #65e4ed77; color: #c4f6fb; }
.hatch-preference { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; margin-top: 10px; font-size: 11px; color: var(--muted); cursor: pointer; }
.hatch-preference input { width: 17px; height: 17px; accent-color: #65e4ed; }
@keyframes companionReveal {
    from { opacity: 0; transform: scale(.65); }
    65% { opacity: 1; transform: scale(1.12); }
    to { transform: scale(1); }
}
@media (max-width: 520px) {
    .hatch-card { padding: 22px 16px; }
    .hatch-card h2 { font-size: 22px; }
    .hatch-result h3 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .hatch-strip { transition: none; }
    .hatch-revealed .winner strong { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
    body button:not(:disabled), .purchase-track > span { transition: none; }
    body button:active:not(:disabled) { transform: none; }
    body button.energy-pickup:active:not(:disabled) { transform: translate(-50%, -50%); }
}

/* Illustrated companions, owned inventory and gold conversions. */
.pet-atlas-ember { --pet-atlas: url('../../assets/pets/ember.png'); }
.pet-atlas-moss { --pet-atlas: url('../../assets/pets/moss.png'); }
.pet-atlas-clockwork { --pet-atlas: url('../../assets/pets/clockwork.png'); }
.pet-atlas-prism { --pet-atlas: url('../../assets/pets/prism.png'); }
.pet-atlas-astral { --pet-atlas: url('../../assets/pets/astral.png'); }
.pet-art {
    display: block;
    width: 128px;
    height: 128px;
    flex: 0 0 auto;
    background-image: var(--pet-atlas);
    background-repeat: no-repeat;
    background-size: 300% 200%;
    background-position: var(--pet-x) var(--pet-y);
}
.pet-card > .pet-art { width: min(128px, 100%); height: auto; aspect-ratio: 1; margin: 0 auto 12px; }
.pet-art.gold-art { filter: grayscale(1) sepia(1) saturate(3) drop-shadow(0 0 8px #ffc24755); }
.companion-tabs, .inventory-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.companion-tabs button, .inventory-filters button {
    min-height: 42px; padding: 10px 14px; background: #151e2e;
    border: 1px solid var(--border); border-radius: 8px; color: var(--muted); cursor: pointer;
}
.companion-tabs button[aria-pressed="true"], .inventory-filters button[aria-pressed="true"] { color: var(--blue); border-color: #65e4ed77; background: #65e4ed0c; }
.inventory-equipped { padding: 18px; background: #080c1744; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 22px; }
.pet-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.pet-slots button, .pet-slot-empty { display: grid; justify-items: center; align-content: center; min-height: 156px; padding: 12px 6px; border: 1px solid #39556a; border-radius: 10px; background: #121b2c; color: var(--text); cursor: pointer; }
.pet-slots .pet-art { width: 80px; height: 80px; }
.pet-slots strong { font-size: 11px; margin-top: 5px; }
.pet-slots small { color: var(--muted); font-size: 10px; margin-top: 4px; }
.pet-slot-empty { border-style: dashed; border-color: #344058; cursor: default; }
.pet-slot-empty > span { font-size: 27px; color: #52627e; }
.inventory-equipped > p:last-child { color: var(--muted); font-size: 11px; }
.inventory-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inventory-heading h3 { font-size: 18px; }
.inventory-heading > span { color: var(--muted); font-size: 12px; }
.inventory-grid, .egg-pet-list { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.inventory-pet { position: relative; background: #151b2a; }
.inventory-pet.equipped-pet { box-shadow: inset 0 0 0 1px #65e4ed77; }
.inventory-pet.gold-pet { background: radial-gradient(ellipse at 50% 20%, #ffc24712, transparent 65%), #191c26; }
.inventory-pet > .pet-quantity { position: absolute; top: 10px; right: 10px; padding: 4px 8px; background: #05090fbf; color: #e5eeff; border-radius: 6px; font-size: 12px; margin: 0; }
.inventory-pet button { min-height: 44px; font-size: 11px; }
.inventory-pet .pet-merge-button { color: #ffe2a0; border-color: #9c7846; background: #ffc2470c; }
.inventory-pet button:disabled { opacity: .6; cursor: not-allowed; }
.gold-label { display: block; margin-top: 17px; font-size: 10px; color: #ffd46a; }
.inventory-empty { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 40px 20px; border: 1px dashed var(--border); border-radius: 12px; font-size: 13px; }
.hatch-reel { height: 192px; }
.hatch-tile { height: 146px; gap: 5px; border-color: var(--tile-rarity); }
.hatch-tile > span { display: block; margin: 0; }
.hatch-tile .pet-art { width: 86px; height: 86px; margin: auto; }
.hatch-tile small { max-width: 102px; font-size: 10px; color: #dae5f5; letter-spacing: 0; line-height: 1.2; }
.hatch-revealed .winner small { visibility: visible; }
.hatch-revealed .winner .pet-art { animation: companionReveal 500ms ease-out; }
body.pet-merge-open { overflow: hidden; }
.pet-merge-modal .hatch-card { border-color: #ffd46a66; }
.merge-preview { display: flex; align-items: center; justify-content: center; gap: 12px; }
.merge-preview > span:not(.pet-art) { font-size: 25px; color: var(--muted); }
.merge-preview .pet-art { width: 118px; height: 118px; }
.merge-power { color: #ffd46a; font-size: 13px; margin: 8px 0 20px; }
.merge-choices { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.merge-choices button { min-height: 60px; padding: 10px 4px; border: 1px solid #3c4962; border-radius: 8px; background: #151e2e; color: #d9e5f5; cursor: pointer; font-size: 11px; }
.merge-choices small { display: block; margin-top: 4px; color: #ffd46a; }
.merge-choices button[aria-pressed="true"] { background: #ffd46a15; border-color: #ffd46a; }
.merge-choices button:disabled { opacity: .35; cursor: not-allowed; }
.merge-odds { display: block; color: #ffd46a; margin: 18px 0 12px; font-size: 14px; }
.merge-warning { font-size: 12px; line-height: 1.7; color: #ffc0b3; padding: 14px; border: 1px solid #ff889533; border-radius: 10px; background: #ff889509; }
.merge-cancel { background: transparent; margin-top: 10px; color: var(--muted); }
.hatch-action[hidden] { display: none; }
.equipment-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.equipment-controls button { min-height: 44px; padding: 10px 14px; color: #dce8f5; background: #172637; border: 1px solid #3e586e; border-radius: 8px; cursor: pointer; font-size: 11px; }
.equipment-controls button[aria-pressed="true"] { background: #65e4ed13; color: var(--blue); border-color: #65e4ed88; }
.equipment-hint { display: block; color: var(--muted); font-size: 10px; margin-top: 9px; }
.auto-hatch-status { color: var(--muted); font-size: 11px; margin: 10px 0; }
.egg-controls button[aria-pressed="true"] { border-color: #ff8895; color: #ffb5be; background: #ff889511; }
.auto-hatch-stop { background: #ff88950c; border-color: #ff889577; color: #ffc0ca; margin-top: 10px; }
@media (max-width: 520px) {
    .inventory-grid, .egg-pet-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pet-card > .pet-art { width: min(105px, 100%); height: auto; }
    .pet-slots { gap: 6px; }
    .pet-slots .pet-art { width: 64px; height: 64px; }
    .pet-slots strong { font-size: 10px; }
    .pet-slots small { font-size: 9px; }
    .companion-tabs button { flex: 1; padding: 10px 6px; font-size: 11px; }
    .inventory-filters button { padding: 9px 11px; font-size: 11px; }
    .merge-preview .pet-art { width: 95px; height: 95px; }
}
@media (prefers-reduced-motion: reduce) { .hatch-revealed .winner .pet-art { animation: none; } }
