@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap');

:root {
    --ink: #203129;
    --forest: #203a2e;
    --forest-2: #315342;
    --moss: #839578;
    --cream: #f3ecda;
    --paper: #fffaf0;
    --gold: #d9ad59;
    --gold-light: #f1d994;
    --terracotta: #a85e43;
    --line: rgba(30, 53, 42, .2);
    --shadow: 0 14px 35px rgba(19, 34, 27, .2);
    --topbar: 42px;
}

* { box-sizing: border-box; }
html { background: #1b2e25; min-width: 320px; }
body {
    color: var(--ink);
    font-family: "DM Sans", sans-serif;
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
}
button { font: inherit; -webkit-tap-highlight-color: transparent; }

.topbar {
    align-items: center;
    background: #17291f;
    border-bottom: 1px solid rgba(255,255,255,.12);
    color: white;
    display: flex;
    height: var(--topbar);
    justify-content: space-between;
    padding: 0 16px;
    position: relative;
    z-index: 20;
}
.brand {
    color: #fff8df;
    font-family: "Fraunces", serif;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}
.brand span { color: var(--gold-light); margin-right: 5px; }
.topbar nav { display: flex; gap: 3px; }
.topbar nav button {
    background: transparent;
    border: 0;
    border-left: 1px solid rgba(255,255,255,.13);
    color: rgba(255,255,255,.72);
    cursor: pointer;
    font-size: 11px;
    padding: 5px 12px;
}
.topbar nav button:hover { color: white; }

.game-grid {
    display: grid;
    grid-template-columns: minmax(310px, 30%) minmax(470px, 1fr) minmax(270px, 18%);
    height: calc(100vh - var(--topbar));
}
.game-grid > * { min-width: 0; }

.clicker-column {
    background:
        linear-gradient(rgba(25,45,35,.68), rgba(19,36,27,.86)),
        url("../images/journey.webp") 57% center / cover;
    border-right: 7px ridge rgba(229,205,148,.44);
    color: white;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    position: relative;
}
.clicker-column::after {
    background: radial-gradient(circle at center, transparent 25%, rgba(4,16,10,.28) 100%);
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}
.column-title, .resource-counter, .clicker-stage, .left-stats, .focus-button { position: relative; z-index: 2; }
.column-title {
    background: linear-gradient(90deg, transparent, rgba(15,27,21,.78), transparent);
    padding: 13px 10px 10px;
    text-align: center;
}
.column-title small {
    color: var(--gold-light);
    display: block;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .16em;
}
.column-title strong {
    display: block;
    font-family: "Fraunces", serif;
    font-size: 18px;
    margin-top: 3px;
}
.resource-counter {
    background: rgba(9,20,14,.46);
    border-bottom: 1px solid rgba(255,255,255,.09);
    border-top: 1px solid rgba(255,255,255,.09);
    padding: 8px;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0,0,0,.45);
}
.resource-counter strong {
    display: block;
    font-family: "Fraunces", serif;
    font-size: clamp(23px, 2.2vw, 33px);
    line-height: 1.1;
}
.resource-counter > span { font-size: 11px; opacity: .78; }

.clicker-stage {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    min-height: 210px;
    overflow: hidden;
    position: relative;
}
.knowledge-flow {
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}
.knowledge-particle {
    animation: knowledge-rise var(--duration) linear var(--delay) infinite;
    bottom: -14%;
    color: #ffedaf;
    font-family: "Fraunces", serif;
    font-size: var(--size);
    left: var(--x);
    opacity: 0;
    position: absolute;
    text-shadow: 0 0 9px rgba(255,225,136,.42);
    will-change: transform, opacity;
}
@keyframes knowledge-rise {
    0% { opacity: 0; transform: translate3d(0, 20px, 0) rotate(-12deg) scale(.75); }
    12% { opacity: var(--alpha); }
    74% { opacity: var(--alpha); }
    100% { opacity: 0; transform: translate3d(var(--drift), -105vh, 0) rotate(42deg) scale(1.12); }
}
.light-rays {
    animation: slow-spin 60s linear infinite;
    background: repeating-conic-gradient(from 0deg, rgba(255,239,182,.14) 0 7deg, transparent 7deg 19deg);
    border-radius: 50%;
    height: min(46vw, 650px);
    filter: blur(.35px);
    -webkit-mask-image: radial-gradient(circle, #000 0 24%, rgba(0,0,0,.66) 43%, transparent 67%);
    mask-image: radial-gradient(circle, #000 0 24%, rgba(0,0,0,.66) 43%, transparent 67%);
    opacity: .62;
    position: absolute;
    width: min(46vw, 650px);
    z-index: 0;
}
@keyframes slow-spin { to { transform: rotate(360deg); } }
.main-action {
    background:
        radial-gradient(circle at 50% 39%, rgba(255,251,221,.72) 0 8%, rgba(255,246,201,.23) 24%, transparent 43%),
        linear-gradient(145deg, #f4dfa0 0%, #e5bd61 45%, #c58b38 78%, #98612b 100%);
    background-clip: padding-box;
    border: 7px solid rgba(255,248,215,.35);
    border-radius: 50%;
    box-shadow:
        0 0 0 2px rgba(69,45,23,.55),
        0 0 0 13px rgba(222,190,116,.11),
        0 23px 48px rgba(4,16,9,.54),
        inset 0 -18px 28px rgba(101,58,23,.2),
        inset 0 13px 22px rgba(255,252,227,.35);
    color: #fff7db;
    cursor: pointer;
    height: clamp(180px, 20vw, 270px);
    position: relative;
    isolation: isolate;
    text-shadow: 0 2px 6px rgba(0,0,0,.45);
    transition: filter .15s, transform .08s;
    width: clamp(180px, 20vw, 270px);
    z-index: 2;
}
.main-action:hover { filter: brightness(1.1); transform: scale(1.025); }
.main-action:active, .main-action.is-clicked { transform: scale(.93); }
.main-action:focus-visible { outline: 4px solid #fff; outline-offset: 5px; }
.mind-rings {
    border: 1px solid rgba(255,250,221,.4);
    border-radius: 50%;
    inset: 15%;
    position: absolute;
}
.mind-rings::after {
    border: 1px dashed rgba(255,250,221,.34);
    border-radius: 50%;
    content: "";
    inset: 15%;
    position: absolute;
}
.mind-icon {
    display: block;
    font-family: serif;
    font-size: clamp(54px, 6vw, 78px);
    line-height: .8;
    transform: rotate(-32deg);
}
.action-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
    margin-top: 12px;
}
.clicker-stage > p {
    background: rgba(14,29,21,.5);
    border-radius: 20px;
    font-size: 10px;
    margin: 13px 0 0;
    padding: 5px 10px;
    position: relative;
    z-index: 2;
}

.left-stats {
    background: rgba(10,24,16,.66);
    border-bottom: 1px solid rgba(255,255,255,.1);
    border-top: 1px solid rgba(255,255,255,.12);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 9px 6px;
}
.left-stats > div { border-right: 1px solid rgba(255,255,255,.12); text-align: center; }
.left-stats > div:last-child { border: 0; }
.left-stats span { color: var(--gold-light); font-size: 15px; }
.left-stats small { display: block; font-size: 7px; letter-spacing: .06em; opacity: .6; text-transform: uppercase; }
.left-stats strong { display: block; font-family: "Fraunces", serif; font-size: 13px; margin-top: 2px; }
.focus-button {
    align-items: center;
    background: linear-gradient(#f0dfae, #cfaa66);
    border: 0;
    color: #2d4337;
    cursor: pointer;
    display: flex;
    gap: 10px;
    justify-content: center;
    min-height: 48px;
    padding: 8px 12px;
}
.focus-button > span:first-child { font-size: 22px; }
.focus-button strong, .focus-button small { display: block; text-align: left; }
.focus-button strong { font-family: "Fraunces", serif; font-size: 13px; }
.focus-button small { font-size: 8px; opacity: .74; }
.focus-button:disabled { cursor: default; filter: grayscale(.7); opacity: .7; }

.story-column {
    background:
        linear-gradient(rgba(36,63,49,.73), rgba(16,35,25,.93)),
        url("../images/journey.webp") 28% center / cover;
    border-right: 7px ridge rgba(82,70,45,.28);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    scrollbar-color: #84927b transparent;
}
.news-ticker {
    align-items: center;
    background: #e4d7b8;
    border-bottom: 1px solid #bdae89;
    display: flex;
    min-height: 34px;
}
.news-ticker span {
    align-self: stretch;
    align-items: center;
    background: var(--terracotta);
    color: white;
    display: flex;
    flex: 0 0 auto;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .08em;
    padding: 0 10px;
}
.news-ticker p {
    animation: news-in .4s ease;
    font-family: "Fraunces", serif;
    font-size: 11px;
    margin: 0;
    overflow: hidden;
    padding: 0 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@keyframes news-in { from { opacity: 0; transform: translateY(4px); } }

.career-scene {
    background: url("../images/journey.webp") center 43% / cover;
    flex: 0 0 190px;
    min-height: 190px;
    overflow: hidden;
    position: relative;
}
.scene-shade { background: linear-gradient(90deg, rgba(21,37,28,.83), rgba(21,37,28,.22) 72%), linear-gradient(0deg, rgba(18,31,23,.5), transparent 65%); inset: 0; position: absolute; }
.scene-copy {
    bottom: 23px;
    color: white;
    left: 32px;
    max-width: 430px;
    position: absolute;
    right: 25px;
}
.scene-copy small { color: var(--gold-light); font-size: 8px; font-weight: 700; letter-spacing: .15em; }
.scene-copy h1 { font-family: "Fraunces", serif; font-size: clamp(24px, 2.6vw, 39px); letter-spacing: -.035em; line-height: 1; margin: 6px 0 8px; }
.scene-copy p { font-size: 11px; line-height: 1.55; margin: 0; max-width: 380px; opacity: .86; }
.clarity-event {
    animation: clarity-pulse 1.6s ease-in-out infinite;
    background: radial-gradient(circle, #fffbd7, #e1b85e 48%, #87642d 70%);
    border: 4px solid rgba(255,255,255,.48);
    border-radius: 50%;
    box-shadow: 0 0 35px #ffe699;
    color: #2e4838;
    cursor: pointer;
    height: 78px;
    position: absolute;
    right: 9%;
    top: 18%;
    width: 78px;
}
.clarity-event span { display: block; font-size: 27px; }
.clarity-event small { display: block; font-size: 8px; font-weight: 700; }
@keyframes clarity-pulse { 50% { filter: brightness(1.22); transform: scale(1.08) rotate(5deg); } }

.progress-card {
    background: #263e32;
    color: white;
    flex: 0 0 auto;
    padding: 13px 22px;
}
.progress-heading { align-items: end; display: flex; justify-content: space-between; }
.progress-heading small { color: #c1cbbd; display: block; font-size: 7px; letter-spacing: .1em; }
.progress-heading strong { font-family: "Fraunces", serif; font-size: 14px; }
.progress-heading > span { color: #dce5d7; font-size: 9px; }
.progress-track { background: rgba(255,255,255,.13); border-radius: 5px; height: 6px; margin-top: 9px; overflow: hidden; }
.progress-track span { background: linear-gradient(90deg, #ba9450, #f0d48d); display: block; height: 100%; transition: width .3s; width: 0; }

.empire-strip {
    background:
        linear-gradient(rgba(246,231,197,.88), rgba(211,188,139,.9)),
        repeating-linear-gradient(90deg, transparent 0 42px, rgba(71,50,28,.13) 42px 43px);
    border-bottom: 6px ridge rgba(75,57,31,.42);
    border-top: 6px ridge rgba(75,57,31,.42);
    display: flex;
    flex: 1 1 360px;
    flex-direction: column;
    min-height: 280px;
    overflow: hidden;
    position: relative;
}
.strip-label {
    align-items: center;
    background: rgba(39,57,45,.86);
    color: white;
    display: flex;
    flex: 0 0 38px;
    justify-content: space-between;
    padding: 0 17px;
}
.strip-label span { color: var(--gold-light); font-family: "Fraunces", serif; font-size: 14px; font-weight: 700; letter-spacing: .06em; }
.strip-label small { font-size: 9px; opacity: .72; }
.empire-rows {
    display: grid;
    flex: 1 1 auto;
    grid-auto-rows: minmax(42px, 1fr);
    min-height: 0;
    overflow: hidden;
}
.empire-lane {
    align-items: center;
    border-bottom: 1px solid rgba(69,51,28,.14);
    display: flex;
    min-height: 42px;
    overflow: hidden;
    padding: 3px 13px;
    position: relative;
}
.empire-lane::after {
    background: rgba(75,55,31,.16);
    bottom: 2px;
    content: "";
    height: 1px;
    left: 0;
    position: absolute;
    right: 0;
}
.lane-label {
    background: rgba(39,57,45,.78);
    border-radius: 8px;
    color: white;
    flex: 0 0 138px;
    font-family: "Fraunces", serif;
    font-size: 10px;
    margin-right: 12px;
    overflow: hidden;
    padding: 7px 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lane-actors { align-items: center; display: flex; gap: 5px; min-width: 0; }
.lane-actor {
    animation: actor-bob 2.4s ease-in-out infinite alternate;
    background: #0d4a4b;
    border: 1px solid rgba(47,70,55,.22);
    border-radius: 10px;
    display: inline-block;
    filter: drop-shadow(0 2px 1px rgba(0,0,0,.25));
    height: clamp(36px, 3.47vw, 51px);
    object-fit: contain;
    width: clamp(36px, 3.47vw, 51px);
}
.lane-actor:nth-child(3n) { animation-delay: -.8s; }
.lane-actor:nth-child(4n) { animation-delay: -1.4s; }
.lane-more { color: #364b3d; font-size: 12px; font-weight: 700; margin-left: 4px; white-space: nowrap; }
.lane-overflow {
    align-items: center;
    background: linear-gradient(145deg, #496752, #233f32);
    border: 2px solid rgba(255,244,196,.58);
    border-radius: 10px;
    box-shadow: 0 3px 7px rgba(31,47,37,.25);
    color: #fff4c9;
    display: flex;
    flex: 0 0 auto;
    font-family: "Fraunces", serif;
    font-size: clamp(12px, 1vw, 16px);
    font-weight: 700;
    height: clamp(36px, 3.47vw, 51px);
    justify-content: center;
    width: clamp(36px, 3.47vw, 51px);
}
.lane-empty-icon { color: #455a4b; font-size: 32px; }
@keyframes actor-bob { to { transform: translateY(-2px); } }

.career-world {
    background:
        linear-gradient(rgba(24,47,35,.28), rgba(16,35,25,.82)),
        url("../images/journey.webp") center 62% / cover;
    flex: 0 0 122px;
    min-height: 122px;
    overflow: hidden;
    padding: 8px;
}
.career-path {
    background: rgba(250,245,229,.91);
    border: 2px ridge rgba(190,158,99,.75);
    box-shadow: 0 12px 35px rgba(12,27,18,.3);
    margin: 0 auto;
    max-width: none;
    padding: 8px 10px;
}
.section-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 6px; }
.section-heading small, .store-heading small { color: #7d897f; display: block; font-size: 7px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.section-heading h2, .store-heading h2 { font-family: "Fraunces", serif; font-size: 18px; margin: 1px 0 0; }
.section-heading > span { background: #e2e7dc; border-radius: 15px; color: #58705b; font-size: 8px; padding: 6px 9px; }
.career-path ol { display: flex; gap: 5px; list-style: none; margin: 0; overflow-x: auto; padding: 0 0 3px; }
.career-path li {
    align-items: center;
    background: rgba(255,255,255,.52);
    border: 1px solid rgba(49,74,59,.12);
    border-radius: 8px;
    display: grid;
    flex: 0 0 168px;
    gap: 7px;
    grid-template-columns: 27px 1fr;
    min-height: 45px;
    padding: 5px 7px;
}
.career-path .node { align-items: center; background: #e5e8df; border-radius: 50%; display: flex; height: 26px; justify-content: center; width: 26px; }
.career-path .done .node { background: var(--forest-2); color: white; }
.career-path .current { border-color: #c8a25c; box-shadow: inset 3px 0 #c8a25c; }
.career-path .current .node { background: var(--gold-light); }
.career-path strong { display: block; font-family: "Fraunces", serif; font-size: 10px; }
.career-path small { color: #7d867f; display: block; font-size: 7px; }
.career-path .status { display: none; }

.store-column {
    background:
        linear-gradient(rgba(28,48,38,.72), rgba(14,31,23,.91)),
        url("../images/journey.webp") 84% center / cover;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.upgrade-shelf {
    background: rgba(218,202,165,.95);
    border-bottom: 5px ridge rgba(100,80,46,.34);
    padding: 9px 10px 11px;
}
.store-heading { align-items: end; display: flex; justify-content: space-between; }
.store-heading h2 { font-size: 19px; }
.perk-list {
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 8px;
}
.perk {
    background: linear-gradient(145deg, #fff8db, #d5bd7c);
    border: 2px ridge #a78349;
    color: var(--ink);
    cursor: pointer;
    height: 48px;
    overflow: hidden;
    padding: 3px;
    position: relative;
    text-align: center;
}
.perk span { display: block; font-size: 20px; line-height: 1.15; }
.perk small { display: block; font-size: 6px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perk:disabled { cursor: default; filter: grayscale(1); opacity: .38; }
.perk.owned { background: #81917a; color: white; filter: none; opacity: .65; }

.producer-heading {
    background: #263e32;
    color: white;
    min-height: 48px;
    padding: 7px 9px;
}
.producer-heading small { color: #aebcaf; }
.trade-switch { display: grid; gap: 1px; }
.trade-switch button {
    background: transparent;
    border: 0;
    color: #93a197;
    cursor: pointer;
    font-size: 7px;
    font-weight: 700;
    padding: 1px 4px;
    text-align: right;
    text-transform: uppercase;
}
.trade-switch button.active { color: #fff; text-shadow: 0 0 7px rgba(255,255,255,.6); }
.producer-toolbar {
    align-items: center;
    background: rgba(14,27,20,.92);
    border-bottom: 2px solid rgba(255,255,255,.12);
    display: flex;
    justify-content: flex-end;
    min-height: 29px;
    padding: 3px 7px;
}
.buy-modes { display: flex; gap: 2px; }
.buy-modes button {
    background: #40594b;
    border: 1px solid rgba(255,255,255,.14);
    color: #dbe4d9;
    cursor: pointer;
    font-size: 8px;
    padding: 5px 6px;
}
.buy-modes button.active { background: var(--gold); color: #24362c; font-weight: 700; }
.producer-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-color: #758676 #d7cfbd; }
.store-footer {
    background: rgba(13,30,22,.96);
    border-top: 1px solid rgba(255,255,255,.14);
    color: rgba(255,255,255,.64);
    flex: 0 0 auto;
    font-size: 9px;
    line-height: 1.45;
    padding: 8px 10px;
    text-align: center;
}
.store-footer span { display: block; }
.producer {
    align-items: center;
    background:
        linear-gradient(90deg, rgba(232,235,222,.94), rgba(180,192,178,.89)),
        url("../images/journey.webp") center / cover;
    border: 0;
    border-bottom: 1px solid #afa282;
    box-shadow: inset 0 1px rgba(255,255,255,.7);
    color: var(--ink);
    cursor: pointer;
    display: grid;
    gap: 8px;
    grid-template-columns: 54px 1fr auto;
    min-height: 76px;
    padding: 6px 9px;
    text-align: left;
    transition: filter .15s, padding .15s;
    width: 100%;
}
.producer:hover:not(:disabled), .producer:focus-visible { filter: brightness(1.12); outline: 2px solid #f0d286; outline-offset: -2px; padding-left: 13px; }
.producer:disabled { cursor: default; filter: grayscale(.65); opacity: .55; }
.producer-icon { align-items: center; background: #0d4a4b; border: 1px solid rgba(41,62,50,.17); border-radius: 12px; display: flex; font-size: 27px; height: 52px; justify-content: center; overflow: hidden; width: 52px; }
.producer-icon img { height: 100%; object-fit: contain; width: 100%; }
.producer h3 { font-family: "Fraunces", serif; font-size: 14px; margin: 0; }
.producer p { color: #6f786f; font-size: 7px; line-height: 1.3; margin: 2px 0 0; }
.producer-price { color: #5d6d5c; display: block; font-size: 9px; font-weight: 700; margin-top: 3px; }
.producer-owned {
    color: rgba(39,57,47,.43);
    font-family: "Fraunces", serif;
    font-size: 31px;
    min-width: 38px;
    text-align: right;
}
.producer.locked h3 { color: #56625b; font-size: 23px; letter-spacing: .08em; }
.producer.locked .producer-icon { background: #26382f; color: #9aa59e; filter: brightness(.65); }
.producer.transaction-sell .producer-price { color: #35774d; }
.producer.cannot-afford .producer-price { color: #a84f4f; }

.producer-tooltip {
    background:
        linear-gradient(rgba(17,24,20,.97), rgba(9,15,11,.98)),
        url("../images/journey.webp") center / cover;
    border: 4px ridge #a77e48;
    box-shadow: 0 16px 45px rgba(0,0,0,.52);
    color: #f5f1e8;
    max-width: 620px;
    min-width: 390px;
    padding: 17px 21px 19px;
    pointer-events: none;
    position: fixed;
    width: min(43vw, 620px);
    z-index: 150;
}
.producer-tooltip[hidden] { display: none; }
.tooltip-head {
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.18);
    display: grid;
    gap: 12px;
    grid-template-columns: 48px 1fr auto;
    padding-bottom: 10px;
}
.tooltip-head > span {
    align-items: center;
    background: rgba(255,255,255,.08);
    border-radius: 50%;
    display: flex;
    font-size: 28px;
    height: 44px;
    justify-content: center;
    width: 44px;
}
.tooltip-head > span img { border-radius: 10px; height: 100%; object-fit: contain; width: 100%; }
.tooltip-head h3 { font-family: "Fraunces", serif; font-size: 21px; margin: 0; }
.tooltip-head small { background: #e1e1d9; border-radius: 3px; color: #17251e; font-size: 8px; padding: 2px 5px; }
.tooltip-head > strong { color: #f09b8e; font-family: "Fraunces", serif; font-size: 17px; text-align: right; }
.producer-tooltip blockquote {
    color: #aaa9a6;
    font-family: "Fraunces", serif;
    font-size: 13px;
    font-style: italic;
    margin: 14px 0;
    text-align: center;
}
.producer-tooltip ul { display: grid; gap: 4px; list-style: none; margin: 0; padding: 0; }
.producer-tooltip li {
    background: rgba(255,255,255,.08);
    border-radius: 9px;
    font-size: 10px;
    padding: 5px 9px 5px 17px;
    position: relative;
}
.producer-tooltip li::before {
    background: #e9ede7;
    border-radius: 50%;
    content: "";
    height: 6px;
    left: 5px;
    position: absolute;
    top: 9px;
    width: 6px;
}
.producer-tooltip li b { color: #fff; }

.float-number {
    animation: float-away .9s ease-out forwards;
    color: #fff3b9;
    font-family: "Fraunces", serif;
    font-size: 20px;
    font-weight: 700;
    pointer-events: none;
    position: fixed;
    text-shadow: 0 2px 8px #000;
    z-index: 60;
}
@keyframes float-away { to { opacity: 0; transform: translateY(-70px) scale(1.18); } }
.toast-region { bottom: 18px; display: grid; gap: 6px; left: 50%; position: fixed; transform: translateX(-50%); z-index: 100; }
.toast { animation: toast-in .3s ease; background: #1e352a; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; box-shadow: var(--shadow); color: white; font-size: 10px; max-width: 340px; padding: 10px 14px; text-align: center; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

dialog {
    background: var(--paper);
    border: 3px ridge #b89c64;
    border-radius: 10px;
    box-shadow: 0 25px 80px rgba(12,25,17,.52);
    color: var(--ink);
    max-width: 470px;
    padding: 32px;
    text-align: center;
}
dialog::backdrop { background: rgba(15,29,21,.7); backdrop-filter: blur(4px); }
dialog h2 { font-family: "Fraunces", serif; font-size: 30px; margin: 4px 0 14px; }
dialog > p:not(.eyebrow) { color: #667169; font-size: 12px; line-height: 1.6; }
.eyebrow { color: #9b7030; font-size: 8px; font-weight: 700; letter-spacing: .15em; margin: 0; }
.dialog-leaf { color: #71866f; font-size: 31px; }
.dialog-actions { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.dialog-actions button { border: 1px solid var(--line); cursor: pointer; padding: 9px 14px; }
.dialog-actions button:last-child { background: var(--forest); color: white; }
.dialog-actions .danger-action {
    background: #9e4b3b;
    border-color: #7b372c;
    color: white;
}
.dialog-close { background: transparent; border: 0; color: #6a756e; cursor: pointer; font-size: 24px; position: absolute; right: 10px; top: 7px; }
.wide-dialog { max-width: 650px; text-align: left; }
.wide-dialog h2, .wide-dialog > .eyebrow, .wide-dialog > .dialog-intro { text-align: center; }
.dialog-intro { margin: 0 auto 20px; max-width: 490px; }
.instructions-list { display: grid; gap: 7px; list-style: none; margin: 20px 0 0; padding: 0; }
.instructions-list li {
    align-items: center;
    background: #eee9dc;
    border: 1px solid rgba(41,66,56,.1);
    border-radius: 9px;
    display: grid;
    gap: 11px;
    grid-template-columns: 37px 1fr;
    padding: 9px 11px;
}
.instructions-list li > span {
    align-items: center;
    background: var(--forest);
    border-radius: 50%;
    color: #fff1bf;
    display: flex;
    font-family: "Fraunces", serif;
    font-size: 17px;
    height: 34px;
    justify-content: center;
    width: 34px;
}
.instructions-list strong { display: block; font-family: "Fraunces", serif; font-size: 12px; margin-bottom: 2px; }
.instructions-list p { color: #6d776f; font-size: 9px; line-height: 1.4; margin: 0; }
.mechanics-note {
    background: linear-gradient(135deg, #294438, #1d342b);
    border: 1px solid rgba(218,177,87,.58);
    border-radius: 10px;
    box-shadow: inset 0 1px rgba(255,255,255,.08);
    margin-top: 12px;
    padding: 13px 15px;
}
.mechanics-note > strong {
    color: #f1d994;
    display: block;
    font-family: "Fraunces", Georgia, serif;
    font-size: 15px;
    margin-bottom: 6px;
}
.mechanics-note p { color: rgba(255,255,255,.82); font-size: 10px; line-height: 1.5; margin: 5px 0 0; }
.mechanics-note b, .mechanics-note em { color: #fff6d5; }
.wide-dialog .dialog-actions { justify-content: center; }
.reset-symbol { transform: rotate(-20deg); }
#statsList { display: grid; gap: 1px; grid-template-columns: 1fr 1fr; margin: 20px 0 0; text-align: left; }
#statsList dt, #statsList dd { background: #eee9dc; font-size: 10px; margin: 0; padding: 8px; }
#statsList dd { font-family: "Fraunces", serif; font-weight: 700; text-align: right; }

@media (max-width: 960px) {
    body { overflow: auto; }
    .game-grid { grid-template-columns: minmax(290px, 42%) 1fr; height: calc(100vh - var(--topbar)); }
    .story-column { border-right: 0; }
    .store-column { grid-column: 1 / -1; min-height: 600px; overflow: visible; }
    .producer-list { overflow: visible; }
    .producer-tooltip { display: none !important; }
}
@media (max-width: 680px) {
    :root { --topbar: 38px; }
    .brand { font-size: 15px; }
    .topbar { padding: 0 8px; }
    .topbar nav button { font-size: 8px; padding: 5px 6px; }
    .game-grid { display: flex; flex-direction: column; height: auto; }
    .clicker-column { border-bottom: 6px ridge rgba(229,205,148,.44); border-right: 0; min-height: 630px; }
    .story-column { border-bottom: 6px ridge rgba(82,70,45,.28); overflow: visible; }
    .career-scene { min-height: 330px; }
    .empire-strip { flex-basis: 520px; }
    .career-world { flex-basis: 132px; min-height: 132px; }
    .store-column { min-height: 0; }
    .producer-list { max-height: none; }
    .perk-list { grid-template-columns: repeat(3, 1fr); }
    dialog { max-height: calc(100vh - 24px); max-width: calc(100vw - 24px); overflow-y: auto; padding: 25px 18px; }
}
@media (max-width: 480px) {
    .brand { font-size: 0; }
    .brand span { font-size: 17px; margin: 0; }
    .topbar nav button { font-size: 0; min-width: 31px; padding: 5px; }
    #instructionsButton::after { content: "?"; font-size: 12px; font-weight: 700; }
    #statsButton::after { content: "▥"; font-size: 12px; }
    #resetButton::after { content: "↺"; font-size: 14px; }
    #soundButton::after { content: "♪"; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
