/* SPACE ANT — storybook UI: warm paper, coloured-pencil outlines, watercolour buttons */
:root {
  --paper: #fbf3e2; --paper2: #f3e3c4; --paper3: #ead6b0;
  --ink: #5b3a2e; --ink2: #8a6a58; --line: rgba(91, 58, 46, .55);
  --red: #e8574a; --green: #5fae5a; --blue: #5aa6d8; --gold: #f2c14a; --honey: #f2a33c; --pink: #ff8fb3; --violet: #8a74d8;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --font: 'Fredoka', 'Trebuchet MS', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --hand: 'Patrick Hand', 'Comic Sans MS', 'Fredoka', cursive;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #bfe3f2; color: var(--ink); font-family: var(--font); user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
canvas#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui .sheet, #ui .nav, #ui .side-btns, #ui .btn, #ui .iconbtn, #ui .pill, #ui .boost-btn { pointer-events: auto; }
.hidden { display: none !important; }
button { font-family: var(--font); color: inherit; }

/* ── paper surfaces */
.paper {
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(255,255,255,.55), rgba(255,255,255,0) 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(214,180,130,.25), rgba(214,180,130,0) 70%),
    var(--paper);
  border: 2.5px solid var(--line); border-radius: 22px 26px 20px 24px / 24px 20px 26px 22px;
  box-shadow: 0 6px 0 rgba(91,58,46,.18), 0 14px 30px rgba(60,40,30,.18), inset 0 0 0 4px rgba(255,255,255,.35);
}

/* ── buttons: watercolour blobs with a pencil rim */
.btn {
  --c: var(--green); --c2: #3f8a40;
  position: relative; border: 2.5px solid rgba(70,40,30,.7); border-radius: 18px 20px 17px 21px / 20px 17px 21px 18px;
  background: radial-gradient(120% 120% at 25% 15%, rgba(255,255,255,.55), rgba(255,255,255,0) 45%), linear-gradient(180deg, var(--c), var(--c2));
  color: #fffaf0; font-weight: 700; font-size: 16px; letter-spacing: .3px; padding: 10px 16px; cursor: pointer;
  text-shadow: 0 1.5px 0 rgba(60,30,20,.45); box-shadow: 0 4px 0 rgba(70,40,30,.35), inset 0 -3px 0 rgba(0,0,0,.12);
  transition: transform .08s, box-shadow .08s, filter .15s; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(70,40,30,.35); }
.btn.red { --c: #f07a62; --c2: #d4483c; }
.btn.blue { --c: #7cc0ea; --c2: #3f88c0; }
.btn.gold { --c: #ffd77a; --c2: #e8a630; color: #5b3a2e; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.btn.violet { --c: #a896ec; --c2: #6c56c0; }
.btn.paperbtn { --c: #fffaf0; --c2: #efdfc0; color: var(--ink); text-shadow: none; }
.btn.small { font-size: 13px; padding: 6px 10px; min-height: 34px; border-radius: 13px 15px 12px 14px; }
.btn.big { font-size: 22px; padding: 12px 26px; min-height: 56px; }
.btn[disabled], .btn.off { filter: grayscale(.85) brightness(1.05); opacity: .7; }
.btn .ad { font-size: 10px; background: rgba(0,0,0,.25); padding: 2px 5px; border-radius: 6px; }

/* ── top bar */
.topbar { position: fixed; left: 0; right: 0; top: 0; padding: calc(var(--sat) + 8px) calc(var(--sar) + 10px) 0 calc(var(--sal) + 10px); display: flex; gap: 6px; align-items: center; pointer-events: none; z-index: 5; }
.topbar > * { pointer-events: auto; }
.pill { display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px 0 4px; font-weight: 700; font-size: 15px; background: rgba(255,250,240,.92); border: 2px solid var(--line); border-radius: 18px; box-shadow: 0 3px 0 rgba(91,58,46,.15); min-width: 0; }
.pill img, .pill canvas { width: 28px; height: 28px; flex: none; }
.pill .plus { width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff; font-size: 17px; line-height: 20px; text-align: center; border: 2px solid rgba(70,40,30,.6); margin-left: 2px; flex: none; }
.pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .grow { flex: 1; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: rgba(255,250,240,.92); display: grid; place-items: center; box-shadow: 0 3px 0 rgba(91,58,46,.15); cursor: pointer; padding: 0; position: relative; flex: none; }
.iconbtn svg { width: 22px; height: 22px; }
.dot { position: absolute; top: -2px; right: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }

/* ── hangar */
.goal { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--sat) + 52px); text-align: center; pointer-events: none; z-index: 4; width: min(92vw, 380px); }
.goal .g0 { font-family: var(--hand); font-size: 14px; color: #9a5ad8; letter-spacing: 0.02em; }
.goal .g1 { font-family: var(--hand); font-size: 18px; color: var(--ink2); }
.goal .g2 { font-weight: 700; font-size: 22px; line-height: 1.1; }
.goal .bar { height: 10px; border-radius: 6px; background: rgba(91,58,46,.15); margin: 6px 20px 0; overflow: hidden; border: 1.5px solid var(--line); }
.goal .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd77a, #f2a33c); border-radius: 6px; }
.side-btns { position: fixed; right: calc(var(--sar) + 10px); top: calc(var(--sat) + 120px); display: flex; flex-direction: column; gap: 10px; z-index: 4; }
.side-btns.left { right: auto; left: calc(var(--sal) + 10px); }
.side-btn { width: 54px; height: 54px; border-radius: 18px; border: 2px solid var(--line); background: rgba(255,250,240,.94); box-shadow: 0 3px 0 rgba(91,58,46,.18); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--ink); position: relative; cursor: pointer; padding: 2px; }
.side-btn svg, .side-btn canvas, .side-btn img { width: 28px; height: 28px; }
.side-btn.offer { background: radial-gradient(circle at 30% 20%, #fff6d0, #ffd77a); }
.side-btn .t { font-size: 9px; color: #c0392b; }
.launch-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--sab) + 74px); display: flex; justify-content: center; z-index: 6; pointer-events: none; }
.launch-wrap .btn { pointer-events: auto; font-size: 26px; padding: 12px 40px; min-height: 62px; --c: #ff8a6a; --c2: #e0483c; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

.nav { position: fixed; left: 0; right: 0; bottom: 0; padding: 6px calc(var(--sar) + 6px) calc(var(--sab) + 6px) calc(var(--sal) + 6px); display: flex; gap: 4px; z-index: 7; background: linear-gradient(180deg, rgba(251,243,226,0), rgba(251,243,226,.0) 0%, rgba(243,227,196,.97) 18%); }
.nav button { flex: 1; min-width: 0; height: 58px; border: 2px solid var(--line); border-radius: 16px 18px 15px 17px; background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11px; font-weight: 700; color: var(--ink); position: relative; box-shadow: 0 3px 0 rgba(91,58,46,.15); cursor: pointer; padding: 0; }
.nav button svg { width: 26px; height: 26px; }
.nav button.on { background: #fff4c8; transform: translateY(-3px); box-shadow: 0 6px 0 rgba(91,58,46,.18); }

/* ── sheet panels */
.sheet { position: fixed; left: calc(var(--sal) + 6px); right: calc(var(--sar) + 6px); bottom: calc(var(--sab) + 70px); height: min(62vh, 560px); z-index: 6; display: flex; flex-direction: column; animation: slideup .22s ease-out; }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
.sheet.still { animation: none; }
.sheet-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px 4px; }
.sheet-h h2 { margin: 0; font-size: 21px; flex: 1; }
.sheet-h .x { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); background: #fff8ea; font-size: 18px; font-weight: 700; cursor: pointer; }
.tabs { display: flex; gap: 5px; padding: 4px 10px 6px; overflow-x: auto; scrollbar-width: none; flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 2px solid var(--line); background: #fffaf0; border-radius: 14px; padding: 5px 10px; font-weight: 600; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 4px; position: relative; }
.tabs button.on { background: #ffe9a8; }
.tabs button canvas, .tabs button img { width: 22px; height: 22px; }
.scroll { flex: 1; overflow-y: auto; padding: 4px 10px 12px; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.scroll::-webkit-scrollbar { width: 0; }

.card { display: flex; gap: 10px; align-items: center; padding: 8px; margin-bottom: 8px; background: rgba(255,252,244,.85); border: 2px solid rgba(91,58,46,.35); border-radius: 16px 18px 15px 17px; position: relative; }
.card.eq { background: #fff3c4; border-color: rgba(200,140,40,.7); }
.card.locked { opacity: 1; }
.card.locked > .ic, .card.locked > .body > .nm, .card.locked > .body > .ds, .card.locked > .body > .st, .card.locked > .act > div { opacity: .62; } /* the crown button and the deal stay bright */
.card .ic { width: 58px; height: 58px; flex: none; display: grid; place-items: center; background: radial-gradient(circle at 40% 35%, #fffaf0, #f0dfbc); border-radius: 14px; border: 1.5px solid rgba(91,58,46,.25); }
.card .ic canvas, .card .ic img { width: 54px; height: 54px; }
.card .body { flex: 1; min-width: 0; }
.card .nm { font-weight: 700; font-size: 15px; line-height: 1.15; }
.card .ds { font-size: 12px; color: var(--ink2); line-height: 1.25; margin-top: 2px; }
.card .st { font-size: 11.5px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 3px 8px; color: var(--ink); }
.card .st b { color: #2f7a3a; }
.card .act { display: flex; flex-direction: column; gap: 4px; align-items: stretch; flex: none; }
.lv { display: flex; gap: 2px; margin-top: 4px; }
.lv i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(91,58,46,.5); background: #fff; }
.lv i.on { background: #f2b33c; }
.cost { display: inline-flex; align-items: center; gap: 3px; }
.cost img, .cost canvas { width: 18px; height: 18px; }
.tag { position: absolute; top: -8px; right: 8px; font-size: 10px; font-weight: 700; background: var(--red); color: #fff; padding: 2px 7px; border-radius: 9px; border: 1.5px solid #fff; }
.tag.g { background: var(--green); }
.section { font-family: var(--hand); font-size: 19px; color: var(--ink2); margin: 6px 4px 4px; }
.note { font-size: 12.5px; color: var(--ink2); margin: 4px 4px 8px; line-height: 1.35; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { padding: 8px; text-align: center; background: rgba(255,252,244,.85); border: 2px solid rgba(91,58,46,.35); border-radius: 16px; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tile .nm { font-weight: 700; font-size: 14px; }
.tile .ds { font-size: 11.5px; color: var(--ink2); }
.tile canvas, .tile img { width: 64px; height: 64px; }
.tile.on { background: #fff3c4; }
.tile.claim { border-color: #e8a630; background: #fff8dc; box-shadow: 0 0 0 3px #ffd75a, 0 0 14px rgba(255,200,80,.75); animation: claimglow 1.4s ease-in-out infinite; }
.tile.claim .ds { color: #c0392b; font-weight: 700; }
@keyframes claimglow { 50% { box-shadow: 0 0 0 3px #ffd75a, 0 0 22px rgba(255,200,80,1); } }
.pinbar { display: flex; padding: 8px 10px 10px; border-top: 2px dashed rgba(91,58,46,.2); }
.pinbar .btn { flex: 1; }

/* ── modal */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(60,40,40,.35); padding: calc(var(--sat) + 16px) 14px calc(var(--sab) + 16px); animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.modal .box { width: min(100%, 380px); max-height: 100%; overflow-y: auto; padding: 16px 16px 14px; text-align: center; animation: pop .25s cubic-bezier(.34,1.56,.64,1); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.modal h2 { margin: 2px 0 6px; font-size: 24px; }
.modal p { margin: 6px 0; font-size: 15px; line-height: 1.35; }
.modal .row { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.modal .row .btn { flex: 1; min-width: 120px; }
.modal canvas.art, .modal img.art { width: 120px; height: 120px; }

/* ── story dialog */
.story { position: fixed; left: 12px; right: 12px; bottom: calc(var(--sab) + 22vh); max-width: 560px; margin: 0 auto; z-index: 25; display: flex; gap: 10px; align-items: flex-end; animation: slideup .25s; cursor: pointer; }
.story .who { width: 118px; height: 118px; flex: none; filter: drop-shadow(0 4px 0 rgba(91,58,46,.2)); }
.story .bubble { flex: 1; padding: 12px 16px 14px; min-height: 92px; }
.story .name { font-weight: 700; font-size: 17px; color: var(--red); }
.story .txt { font-family: var(--hand); font-size: 25px; line-height: 1.2; }
.story .more { font-size: 13px; color: var(--ink2); text-align: right; }

/* ── toasts & flight banners */
.toasts { position: fixed; left: 0; right: 0; top: calc(var(--sat) + 52px); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 40; pointer-events: none; }
.toast { background: rgba(255,250,240,.96); border: 2px solid var(--line); border-radius: 16px; padding: 8px 14px; font-weight: 600; font-size: 14px; box-shadow: 0 6px 18px rgba(60,40,30,.2); animation: toast 2.6s forwards; max-width: 88vw; text-align: center; }
@keyframes toast { 0% { transform: translateY(-10px); opacity: 0; } 10%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }

/* ── flight HUD */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.hud > * { pointer-events: auto; }
.hud-top { position: absolute; left: 0; right: 0; top: 0; padding: calc(var(--sat) + 8px) calc(var(--sar) + 10px) 0 calc(var(--sal) + 10px); display: flex; align-items: flex-start; gap: 8px; pointer-events: none; }
.hud-alt { background: rgba(255,250,240,.9); border: 2px solid var(--line); border-radius: 16px; padding: 4px 12px 5px; min-width: 128px; box-shadow: 0 3px 0 rgba(91,58,46,.15); }
.hud-alt .a { font-weight: 700; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.hud-alt .z { font-size: 12px; color: var(--ink2); font-weight: 600; white-space: nowrap; }
.hud-crumbs { margin-left: auto; }
.hud-hp { display: flex; gap: 2px; flex-wrap: wrap; max-width: 140px; justify-content: flex-end; margin-top: 4px; }
.hud-hp i { width: 16px; height: 15px; background: no-repeat center/contain; }
.fuel { position: absolute; left: calc(var(--sal) + 10px); top: calc(var(--sat) + 70px); width: 22px; height: 38vh; max-height: 260px; border: 2.5px solid var(--line); border-radius: 12px; background: rgba(255,250,240,.75); overflow: hidden; }
.fuel i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, #ff9a4a, #ffd75a); border-radius: 0 0 9px 9px; }
.fuel b { position: absolute; left: 50%; top: 4px; transform: translateX(-50%); font-size: 9px; font-weight: 700; color: var(--ink2); writing-mode: vertical-rl; }
.alti { position: absolute; right: calc(var(--sar) + 8px); top: calc(var(--sat) + 96px); bottom: calc(var(--sab) + 120px); width: 26px; }
.alti .track { position: absolute; left: 11px; top: 0; bottom: 0; width: 4px; background: rgba(91,58,46,.25); border-radius: 2px; }
.alti .mk { position: absolute; left: 4px; width: 18px; height: 3px; background: rgba(91,58,46,.45); border-radius: 2px; }
.alti .best { position: absolute; left: -2px; width: 30px; height: 3px; background: #e8574a; border-radius: 2px; }
.alti .me { position: absolute; left: 1px; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%; background: #fff4c8; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; }
.boosters { position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 12px); display: flex; justify-content: center; gap: 8px; pointer-events: none; }
.hp-num { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 3px; background: rgba(255,250,240,.9); border: 2px solid var(--line); border-radius: 12px; padding: 1px 8px 1px 4px; }
.boost-btn { pointer-events: auto; width: 52px; height: 52px; border-radius: 50%; border: 3px solid rgba(70,40,30,.7); background: radial-gradient(circle at 35% 25%, #fff6d0, #ffb84a); box-shadow: 0 4px 0 rgba(70,40,30,.35); display: grid; place-items: center; position: relative; cursor: pointer; padding: 0; }
.boost-btn canvas { width: 36px; height: 36px; }
.boost-btn.used { filter: grayscale(1); opacity: .45; }
.boost-btn.ready { animation: pulse 0.9s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(255,200,80,.45), 0 4px 0 rgba(70,40,30,.35); } }
.boost-btn .k { position: absolute; bottom: -6px; font-size: 10px; background: var(--ink); color: #fff; border-radius: 8px; padding: 1px 6px; }
.pausebtn { pointer-events: auto; }
.hint { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); text-align: center; font-family: var(--hand); font-size: 24px; color: #fff; text-shadow: 0 2px 0 rgba(60,30,30,.55), 0 0 12px rgba(60,30,30,.35); pointer-events: none; width: max-content; max-width: calc(100vw - 40px); line-height: 1.15; text-wrap: balance; padding: 6px 14px 8px; border-radius: 18px; background: rgba(60,35,30,.38); box-sizing: border-box; }
.hint .hand { width: 54px; height: 54px; margin: 0 auto 4px; animation: swipe 1.6s ease-in-out infinite; }
@keyframes swipe { 0%, 100% { transform: translateX(-40px); } 50% { transform: translateX(40px); } }
.zone-banner { position: absolute; left: 0; right: 0; top: 28%; text-align: center; pointer-events: none; animation: banner 2.8s forwards; }
.zone-banner .s { font-family: var(--hand); font-size: 20px; color: #fff; text-shadow: 0 2px 0 rgba(60,30,30,.5); }
.zone-banner .n { font-weight: 700; font-size: 34px; color: #fffaf0; text-shadow: 0 3px 0 rgba(91,58,46,.65), 0 0 18px rgba(60,30,30,.3); }
@keyframes banner { 0% { opacity: 0; transform: scale(.8); } 12%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-20px); } }

/* ── results */
.result .big { font-weight: 700; font-size: 38px; line-height: 1; margin: 6px 0 2px; }
.result .sub { font-family: var(--hand); font-size: 19px; color: var(--ink2); }
.result .rows { text-align: left; margin: 10px 4px; font-size: 15px; }
.result .rows div { display: flex; justify-content: space-between; padding: 3px 2px; border-bottom: 1.5px dashed rgba(91,58,46,.2); }
.result .total { font-weight: 700; font-size: 20px; }
.record { display: inline-block; background: #ffd77a; border: 2px solid var(--line); border-radius: 12px; padding: 2px 10px; font-weight: 700; font-size: 13px; transform: rotate(-3deg); margin-top: 4px; }

/* ── studio intro (TeachMe Games), painted like the game: watercolour sky, paper sticker badge, the pilot ant */
.studio { position: fixed; inset: 0; z-index: 100; overflow: hidden; background: linear-gradient(180deg, #a9d6ef 0%, #cfe8f1 45%, #f6ead2 100%); transition: opacity .42s, transform .42s; --S: min(60vw, 270px); font-family: var(--font); }
.studio::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: multiply; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .42 0 0 0 0 .32 0 0 0 .32 -.08'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"); }
.studio.leaving { opacity: 0; transform: scale(1.06); }
.st-rays { position: absolute; left: 50%; top: 42%; width: 200vmax; height: 200vmax; margin: -100vmax 0 0 -100vmax; opacity: .22; background: repeating-conic-gradient(from 0deg, #fffaf0 0deg 7deg, transparent 7deg 18deg); -webkit-mask: radial-gradient(circle, #000 0, transparent 45%); mask: radial-gradient(circle, #000 0, transparent 45%); animation: spin 40s linear infinite; }
.studio::before { content: ''; position: absolute; left: 50%; top: 42%; width: 120vmin; height: 120vmin; margin: -60vmin 0 0 -60vmin; background: radial-gradient(circle, rgba(255,246,214,.95) 0%, rgba(255,236,190,.45) 30%, rgba(255,236,190,0) 62%); }
@keyframes spin { to { transform: rotate(360deg); } }
.st-cloud { position: absolute; width: 46vmin; height: 22vmin; background: radial-gradient(circle at 30% 64%, #fff 0 22%, transparent 23%), radial-gradient(circle at 50% 48%, #fff 0 30%, transparent 31%), radial-gradient(circle at 70% 60%, #fff 0 24%, transparent 25%), radial-gradient(ellipse 46% 26% at 50% 72%, #fff 0 99%, transparent 100%); opacity: .8; filter: drop-shadow(0 4px 0 rgba(150,175,215,.35)); animation: drift 9s ease-in-out infinite alternate; }
.st-cloud.c1 { left: -12vmin; top: 12%; } .st-cloud.c2 { right: -16vmin; top: 22%; transform: scale(.8); animation-delay: -3s; } .st-cloud.c3 { left: 8%; bottom: 14%; transform: scale(.7); animation-delay: -6s; opacity: .6; }
@keyframes drift { to { translate: 5vmin 0; } }
.st-col { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: -6vh; }
.st-stage { position: relative; width: var(--S); height: var(--S); }
.st-badge { width: 100%; height: 100%; animation: pop2 .65s cubic-bezier(.34,1.56,.64,1) .15s both; overflow: visible; }
.st-badge .b-book { transform-origin: 50% 72%; transform-box: view-box; animation: book .55s cubic-bezier(.34,1.56,.64,1) .4s both; }
.st-badge .b-ant { animation: peek .6s cubic-bezier(.34,1.7,.64,1) .5s both; }
.st-badge .b-cap { animation: cap .6s cubic-bezier(.34,1.4,.64,1) .8s both; }
.st-badge .b-tassel { transform-origin: 50% 23%; transform-box: view-box; animation: tassel 1.6s ease-out 1.25s both; }
.st-badge .b-star { transform-origin: 26% 28%; transform-box: view-box; animation: star 2.4s ease-in-out 1s infinite; }
.st-badge .b-shine { animation: shine .7s ease-in 1.55s both; }
.st-rocket { position: absolute; left: 0; top: 0; width: 15%; pointer-events: none; animation: fly 1.1s cubic-bezier(.45,0,.4,1) 1.05s both; }
.st-rocket .fl { transform-origin: 50% 70%; transform-box: view-box; animation: flame .09s steps(2) infinite alternate; }
.st-word { display: flex; margin-top: 12px; font-size: min(15vw, 66px); font-weight: 700; color: #fffaf0; -webkit-text-stroke: 3px #5b3a2e; paint-order: stroke fill; letter-spacing: 1px; }
.st-word span { display: inline-block; animation: letter .5s cubic-bezier(.34,1.8,.64,1) both; text-shadow: 0 5px 0 #5b3a2e; }
.st-word .me { color: #ff8a6a; }
.st-word span:nth-child(odd) { rotate: -3deg; } .st-word span:nth-child(even) { rotate: 2deg; }
.st-word span:nth-child(1) { animation-delay: .85s; } .st-word span:nth-child(2) { animation-delay: .91s; } .st-word span:nth-child(3) { animation-delay: .97s; } .st-word span:nth-child(4) { animation-delay: 1.03s; } .st-word span:nth-child(5) { animation-delay: 1.09s; } .st-word span:nth-child(6) { animation-delay: 1.2s; } .st-word span:nth-child(7) { animation-delay: 1.26s; }
.st-games { margin-top: 4px; font-family: var(--hand); font-size: min(8.5vw, 36px); letter-spacing: .5em; margin-left: .5em; color: #5b3a2e; background: rgba(255,250,240,.8); padding: 0 .3em 0 .8em; border-radius: 14px; box-shadow: 0 3px 0 rgba(91,58,46,.25); animation: games .8s cubic-bezier(.22,1,.36,1) 1.4s both; }
@keyframes pop2 { from { transform: scale(0) rotate(-25deg); } to { transform: none; } }
@keyframes book { from { transform: scaleY(0); } to { transform: none; } }
@keyframes peek { from { opacity: 0; transform: translateY(26%); } 40% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes cap { from { opacity: 0; transform: translateY(-45%) rotate(-14deg); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes tassel { 25% { transform: rotate(16deg); } 57% { transform: rotate(-10deg); } to { transform: none; } }
@keyframes star { 50% { transform: scale(1.2) rotate(18deg); } }
@keyframes shine { from { transform: skewX(-22deg) translateX(0); } to { transform: skewX(-22deg) translateX(300px); } }
@keyframes fly { from { opacity: 0; transform: translate(-60%, 560%) rotate(40deg) scale(.6); } 15% { opacity: 1; } 85% { opacity: 1; } to { opacity: 0; transform: translate(720%, -160%) rotate(52deg) scale(1); } }
@keyframes flame { to { transform: scaleY(.75); } }
@keyframes letter { from { opacity: 0; transform: translateY(.6em) scale(.4); } 50% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes games { from { opacity: 0; transform: scaleX(.55); } to { opacity: 1; transform: none; } }

/* ── loading screen */
.loading { position: fixed; inset: 0; z-index: 90; background: #bfe3f2; transition: opacity .5s; }
.loading.leaving { opacity: 0; pointer-events: none; }
.load-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.load-title { position: absolute; left: 0; right: 0; top: calc(var(--sat) + 9vh); text-align: center; display: flex; flex-direction: column; align-items: center; line-height: .9; }
.load-title span { font-weight: 700; font-size: min(22vw, 104px); color: #fffaf0; -webkit-text-stroke: 4px #5b3a2e; paint-order: stroke fill; text-shadow: 0 6px 0 #5b3a2e; letter-spacing: 2px; }
.load-title .lt-ant { color: #ff8a6a; margin-top: -4px; transform: rotate(-3deg); }
.load-title small { font-family: var(--hand); font-size: 22px; color: var(--ink); margin-top: 10px; background: rgba(255,250,240,.75); padding: 2px 12px; border-radius: 12px; }
.load-foot { position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 6vh); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 24px; }
.load-bar { position: relative; width: min(80vw, 340px); height: 20px; border: 3px solid var(--ink); border-radius: 12px; background: rgba(255,250,240,.9); }
.load-bar i { position: absolute; left: 2px; top: 2px; bottom: 2px; width: 0; border-radius: 8px; background: linear-gradient(90deg, #ffd77a, #f2a33c); transition: width .15s; }
.load-bar b { position: absolute; top: -34px; left: 0; width: 40px; height: 40px; margin-left: -20px; background: no-repeat center/contain; transition: left .15s; animation: hop .4s ease-in-out infinite alternate; }
@keyframes hop { to { transform: translateY(-4px); } }
.load-pct { font-weight: 700; font-size: 15px; background: rgba(255,250,240,.85); padding: 2px 10px; border-radius: 10px; }
.load-tip { font-size: 14px; max-width: 340px; text-align: center; min-height: 58px; box-sizing: border-box; background: rgba(255,250,240,.75); padding: 4px 10px; border-radius: 12px; }
.load-tip b { color: #c0392b; }

/* ── tutorial pointer */
.tut-hand { position: fixed; z-index: 45; width: 56px; height: 56px; pointer-events: none; animation: tap 1s ease-in-out infinite; filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); }
@keyframes tap { 50% { transform: translate(6px, 8px) scale(.92); } }
.tut-tip { position: fixed; z-index: 45; left: 50%; transform: translateX(-50%); width: min(86vw, 340px); padding: 8px 12px; text-align: center; font-family: var(--hand); font-size: 19px; pointer-events: none; }
.glow { filter: drop-shadow(0 0 4px #ffd75a) drop-shadow(0 0 10px rgba(255,200,80,.8)); animation: glowp 1.4s ease-in-out infinite; }
@keyframes glowp { 50% { filter: drop-shadow(0 0 7px #ffd75a) drop-shadow(0 0 16px rgba(255,200,80,.9)); } }

/* fake ad (test mode) */
.fakead { position: fixed; inset: 0; z-index: 60; background: #2a2440; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-size: 18px; text-align: center; padding: 20px; }
.fakead .tm { font-size: 12px; opacity: .7; }

@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; width: 560px; transform: translateX(-50%); }
  @keyframes slideup { from { transform: translate(-50%, 40px); opacity: 0; } to { transform: translate(-50%, 0); } }
}
@media (max-height: 680px) {
  .sheet { height: 58vh; }
  .nav button { height: 50px; font-size: 10px; }
  .nav button svg { width: 22px; height: 22px; }
  .launch-wrap { bottom: calc(var(--sab) + 62px); }
  .launch-wrap .btn { min-height: 52px; font-size: 22px; padding: 8px 30px; }
  .goal { top: calc(var(--sat) + 46px); }
  .goal .g2 { font-size: 18px; }
}

/* parachute button (shown while falling) */
.chute-btn { pointer-events: auto; position: absolute; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); min-width: 170px; height: 64px; border-radius: 32px; border: 3px solid rgba(70,40,30,.75); background: radial-gradient(circle at 35% 25%, #fff2e8, #ff7a5a); box-shadow: 0 5px 0 rgba(70,40,30,.35); display: flex; align-items: center; justify-content: center; gap: 8px; font: 700 18px var(--round, 'Fredoka', sans-serif); color: #4a2418; cursor: pointer; }
.chute-btn i { font-style: normal; font-size: 30px; }
.chute-btn.hidden, .boosters.hidden { display: none; }
.chute-btn.urgent { animation: chuteUrgent 0.45s ease-in-out infinite; background: radial-gradient(circle at 35% 25%, #fff6c8, #ff4a3a); }
@keyframes chuteUrgent { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.12); } }
.chute-btn.wait { filter: grayscale(0.85); opacity: .55; pointer-events: none; }

/* ── comic page (first time at a zone) */
.comic { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: calc(var(--sat) + 10px) 10px calc(var(--sab) + 10px); background: rgba(40,28,40,.55); animation: fadein .3s; }
.comic.leaving { opacity: 0; transition: opacity .25s; }
@keyframes fadein { from { opacity: 0; } }
.cpage { width: min(100%, 560px); max-height: 100%; overflow-y: auto; overflow-x: hidden; padding: 10px 10px 12px; border-radius: 18px; display: flex; flex-direction: column; gap: 8px; animation: slideup .3s ease-out; }
.chead { display: flex; align-items: baseline; gap: 8px; padding: 0 4px; }
.chead span { white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .08em; }
.chead b { font-size: 20px; }
.chead small { margin-left: auto; font-size: 12px; color: var(--ink2); }
.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.cpanel { position: relative; aspect-ratio: 1 / 1; border: 3px solid var(--ink); border-radius: 6px; overflow: hidden; background: #fffaf0; opacity: .14; filter: saturate(.3); transform: scale(.97); transition: opacity .35s, filter .35s, transform .35s; }
.cpanel.wide { grid-column: span 2; aspect-ratio: 16 / 8; }
.cpanel.on { opacity: 1; filter: none; transform: none; }
.cpanel.now { box-shadow: 0 0 0 3px #ffd75a; }
.cpanel .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ccap { position: absolute; left: 5px; right: 5px; bottom: 5px; padding: 4px 7px; background: #fff3c4; border: 2px solid var(--ink); border-radius: 4px; font-family: var(--hand); font-size: 15px; line-height: 1.15; box-shadow: 2px 2px 0 rgba(91,58,46,.35); }
.cbubble { position: absolute; top: 6px; right: 6px; max-width: 64%; padding: 4px 9px 5px; background: #fff; border: 2px solid var(--ink); border-radius: 14px; font-weight: 700; font-size: 13px; line-height: 1.15; }
.cbubble b { display: block; font-size: 10px; color: var(--red); }
.cbubble::after { content: ''; position: absolute; left: 14px; bottom: -9px; border: 7px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.cnext { align-self: center; margin-top: 2px; }
.cnext.waiting { visibility: hidden; pointer-events: none; } /* keeps its place, so nothing jumps when it appears */

/* Royal Collection */
.card.royal { background: linear-gradient(135deg, #fbf3ff, #fff8e6); border-color: #b48ad8; }
.card.royal.eq { background: linear-gradient(135deg, #efe4ff, #fff1c8); }
.royalnote { color: #6c46a8; font-weight: 600; }

/* opening comic: full screen, panels slide in, slow Ken Burns inside each panel */
.comic.cine { background: radial-gradient(circle at 50% 40%, #2a2450, #0e0c1c); }
.comic-curtain { position: fixed; inset: 0; z-index: 69; background: radial-gradient(circle at 50% 40%, #2a2450, #0e0c1c); animation: fadein .3s; }
.comic-curtain.leaving { opacity: 0; transition: opacity .3s; }
.comic.cine .cpage { width: min(100%, 620px); }
.cpanel.from-l { transform: translateX(-30px) scale(.97); } .cpanel.from-r { transform: translateX(30px) scale(.97); }
.cpanel.from-u { transform: translateY(-24px) scale(.97); } .cpanel.from-d { transform: translateY(24px) scale(.97); }
.cine .cpanel { opacity: 0; transition: opacity .6s, transform .7s cubic-bezier(.22,1,.36,1), filter .4s; }
.cine .cpanel.on { opacity: 1; transform: none; }
.cine .cpanel.on .art { animation: kenburns 12s ease-in-out infinite alternate; }
.cine .cpanel.from-r.on .art { animation-name: kenburns2; }
@keyframes kenburns { from { transform: scale(1.04) translate(1%, 1%); } to { transform: scale(1.16) translate(-2%, -1.5%); } }
@keyframes kenburns2 { from { transform: scale(1.15) translate(-2%, 0); } to { transform: scale(1.04) translate(1.5%, 1%); } }
.cskip { position: fixed; top: calc(var(--sat) + 12px); right: 14px; z-index: 72; padding: 6px 14px; border-radius: 16px; border: 2px solid rgba(255,255,255,.6); background: rgba(20,16,40,.5); color: #fff; font: 700 14px var(--font); }
/* forced tutorial: everything but the highlighted spot is blocked */
.tut-block { position: fixed; z-index: 44; background: transparent; }
/* the tutorial spotlight: the screen dims around a soft rounded opening with a gently breathing golden rim */
.tut-spot { position: fixed; z-index: 44; pointer-events: none; box-shadow: 0 0 0 200vmax rgba(30,20,30,.5), 0 0 0 3px rgba(255,215,90,.95), 0 0 22px 6px rgba(255,200,80,.55); animation: spot 1.6s ease-in-out infinite; }
@keyframes spot { 50% { box-shadow: 0 0 0 200vmax rgba(30,20,30,.5), 0 0 0 5px rgba(255,215,90,.75), 0 0 30px 10px rgba(255,200,80,.35); } }

/* workshop: picture tabs, all seven on one row */
.tabs.icons { overflow: visible; gap: 4px; padding: 4px 8px 6px; }
.tabs.icons button { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 1px; padding: 4px 2px 3px; border-radius: 12px; font-size: 10px; line-height: 1; }
.tabs.icons button canvas, .tabs.icons button img { width: 34px; height: 34px; }
.tabs.icons .tl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ── settings: icon tiles with ON/OFF switches (same layout as DogiDoku) */
.modal .box.settings { width: min(100%, 400px); text-align: left; overflow: hidden; padding: 12px 14px 10px; }
.modal .box.settings h2 { margin: 0 0 2px; }
.modal .box.settings h2 { text-align: center; }
.set-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.set-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 9px 4px 8px; border-radius: 18px 20px 17px 19px; border: 2px solid #f0e1d2; background: #fffdf9; box-shadow: 0 3px 0 rgba(120,80,50,.18); font: inherit; color: var(--ink); cursor: pointer; transition: transform .1s; }
.set-tile:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(120,80,50,.18); }
.set-ic { position: relative; width: 46px; height: 46px; transition: opacity .15s, filter .15s; }
.set-tile.off .set-ic { opacity: .45; filter: grayscale(.9); }
.set-ic .slash { display: none; position: absolute; left: 21px; top: -4px; width: 4px; height: 54px; border-radius: 2px; background: #b9a294; transform: rotate(-45deg); box-shadow: 0 0 0 2px #fffdf9; }
.set-tile.off .slash { display: block; }
.set-sw { position: relative; width: 62px; height: 26px; border-radius: 13px; display: flex; align-items: center; justify-content: flex-start; padding: 0 8px; background: #6bbf59; box-shadow: inset 0 2px 3px rgba(0,0,0,.15); transition: background .15s; }
.set-sw b { font-size: 11px; color: #fff; letter-spacing: .5px; }
.set-sw .knob { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: right .15s; }
.set-tile.off .set-sw { background: #e6dbd0; justify-content: flex-end; }
.set-tile.off .set-sw b { color: #9e8c80; }
.set-tile.off .set-sw .knob { right: 38px; }
.set-lb { font-weight: 700; font-size: 14px; color: #7a4e45; }
.set-tile.off .set-lb { color: #b9a294; }
.set-sub { font-size: 12px; color: #a08474; }
.set-card { margin-top: 9px; padding: 8px 12px 10px; border-radius: 18px; border: 2px solid #f0e1d2; background: #fffdf9; box-shadow: 0 3px 0 rgba(120,80,50,.14); }
.set-h { font-weight: 800; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; color: #b07a55; margin-bottom: 6px; }
.set-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.set-opt { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 14px; border: 2px solid #f0e1d2; background: #fbf3e2; font: inherit; text-align: left; cursor: pointer; }
.set-opt.sel { border-color: #6bbf59; background: #eef8e6; box-shadow: 0 0 0 2px rgba(107,191,89,.25); }
.set-opt:not(.sel) canvas { opacity: .55; filter: grayscale(.6); }
.set-pilot { display: flex; align-items: center; gap: 12px; }
.set-pilot canvas { border-radius: 50%; background: #fbf3e2; border: 2px solid #f0e1d2; }
.set-name { font-weight: 800; font-size: 17px; color: #7a4e45; }
.set-pilot { padding: 6px 12px; }
.set-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.set-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; min-height: 50px; font-size: 14px !important; line-height: 1.15; border-radius: 16px; border: 2px solid #f0e1d2; background: #fffdf9; box-shadow: 0 3px 0 rgba(120,80,50,.14); font: inherit; font-weight: 700; font-size: 16px; color: #7a4e45; cursor: pointer; text-align: left; }
.set-row:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(120,80,50,.14); }
.set-row span { flex: 1; }
.set-row em { display: none; }
.set-invite { width: 100%; margin-top: 9px; background: #fff3f3; border-color: #f6d0cc; }
.set-invite small { display: block; font-size: 12px; font-weight: 600; color: #b07a6e; }
.set-reset { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px auto 0; min-height: 36px; padding: 4px 12px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 700; color: #d4483c; text-decoration: underline; cursor: pointer; }
.set-ver { text-align: center; font-size: 11.5px; color: #b9a69a; margin: 2px 0 0; }
/* short phones: the settings still fit on one screen without scrolling */
@media (max-height: 640px) { .set-pilot { display: none; } .set-tile { padding: 7px 4px 6px; gap: 4px; } .set-ic { transform: scale(.85); margin: -3px 0; } }

/* honey page header */
.honey-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 2px; padding: 10px 12px; border-radius: 16px; background: linear-gradient(#fff6dc, #ffe9b0); border: 2px solid #f2d08a; }
.honey-head .hh-n { font-weight: 800; font-size: 22px; color: #8a5a1a; }
.honey-head .hh-d { font-size: 12.5px; color: #8a6a48; line-height: 1.3; }

/* nest view: the pad's buttons step aside while you look around the anthill */
body.nestview .topbar, body.nestview .goal, body.nestview .side-btns, body.nestview .launch-wrap, body.nestview .nav { opacity: 0; pointer-events: none; transition: opacity .25s; }
.topbar, .goal, .side-btns, .launch-wrap, .nav { transition: opacity .25s; }
/* centred without a transform: the pressed-button effect sets its own transform and would throw the button aside */
.nest-back { display: none; position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; top: calc(var(--sat, 0px) + 14px); z-index: 20; }
body.nestview .nest-back { display: block; }
.seeds-head { background: linear-gradient(#fbf6e0, #f2e2b0); border-color: #e2c880; }
.seeds-head .hh-n { color: #7a5a1a; }
/* tabs that share one row evenly (no sideways scroll) */
.tabs.fit { overflow: visible; gap: 4px; padding: 4px 8px 6px; }
.tabs.fit button { flex: 1 1 0; min-width: 0; justify-content: center; padding: 5px 2px; font-size: 12.5px; white-space: nowrap; }
/* "Tap to play" keeps its place from the start (fades in, nothing above it jumps) */
#tapBegin { transition: opacity .35s; }
#tapBegin.pending { visibility: hidden; opacity: 0; pointer-events: none; }
.card .deal { margin-top: 4px; font-size: 11.5px; line-height: 1.25; color: #6c4fb0; background: #f2ecff; border-radius: 8px; padding: 3px 6px; }
/* nest view: nothing of the pad can be tapped by accident (children set their own pointer-events) */
body.nestview .topbar, body.nestview .goal, body.nestview .side-btns, body.nestview .launch-wrap, body.nestview .nav,
body.nestview .topbar *, body.nestview .goal *, body.nestview .side-btns *, body.nestview .launch-wrap *, body.nestview .nav * { pointer-events: none !important; }
body.nestview .topbar, body.nestview .goal, body.nestview .side-btns, body.nestview .launch-wrap, body.nestview .nav { visibility: hidden; transition: opacity .25s, visibility 0s .25s; }

/* burdens (expedition handicaps) */
.burdens { display: flex; flex-direction: column; gap: 6px; }
.burden { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; border-radius: 14px; border: 2px solid #f0e1d2; background: #fffdf9; font: inherit; cursor: pointer; }
.burden .bi { font-size: 26px; width: 34px; text-align: center; filter: grayscale(.6); opacity: .7; }
.burden .bb { flex: 1; } .burden .nm { font-weight: 700; color: #6a4436; } .burden .ds { font-size: 12px; color: #8a6a58; line-height: 1.25; }
.burden .bp { font-weight: 800; font-size: 13px; color: #8a6ad0; white-space: nowrap; }
.burden.on { border-color: #e8a630; background: #fff4d6; box-shadow: 0 0 0 2px rgba(232,166,48,.25); }
.burden.on .bi { filter: none; opacity: 1; }
.burden.ro { cursor: default; }

/* weekly event */
.modal .box.event { text-align: left; }
.ev-hero { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; color: #fffaf0; margin-bottom: 6px; }
.ev-hero h2 { color: #fffaf0; margin: 0; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.ev-ic { font-size: 40px; line-height: 1; } .ev-ic.big { font-size: 56px; text-align: center; }
.ev-time { font-size: 13px; font-weight: 700; opacity: .9; }
.ev-blurb { font-family: var(--hand); font-size: 17px !important; }
.ev-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px 6px; margin: 4px 0 6px; }
.ev-step { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; text-align: center; color: #a08474; }
.ev-step i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #d8c4b0; background: #fffaf0; }
.ev-step.ms i { border-color: #e8a630; }
.ev-step.on i { background: #6bbf59; border-color: #3f8a40; } .ev-step.on { color: #3f6a34; font-weight: 700; }
.ev-rws { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.ev-rw { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 5px 8px; border-radius: 10px; background: #fbf3e2; }
.ev-rw.got { background: #eef8e6; color: #3f6a34; }
.ev-prize { background: #fff6dc; border-color: #f2d08a; }
.goal .g0.ev { font-weight: 700; color: #8a4a20; }
/* a launch site under a night sky (the Moon base): light text for the goal */
body.dark-pad .goal { color: #fff6e0; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
body.dark-pad .goal .g0.ev { color: #ffd77a; }

/* event postcard: the painting fills the header, the title sits on a soft shade at the bottom */
.ev-hero.pc { aspect-ratio: 16 / 9; align-items: flex-end; padding: 10px 12px; position: relative; overflow: hidden; }
.ev-hero.pc::before { content: ''; position: absolute; inset: 45% 0 0 0; background: linear-gradient(rgba(20,14,30,0), rgba(20,14,30,.72)); }
.ev-hero.pc > * { position: relative; }

/* rewards as pictures */
.rw-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; justify-content: center; margin: 3px 0; }
.card .rw-chips, .tile .rw-chips { justify-content: flex-start; }
.tile .rw-chips { justify-content: center; }
.rw-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px 1px 3px; border-radius: 12px; background: rgba(255,248,230,.85); border: 1.5px solid #f0e1d2; font-size: 13px; color: #7a4e45; }
.rw-chips.big { gap: 10px; margin: 10px 0 14px; }
.rw-chips.big .rw-chip { flex-direction: column; padding: 8px 12px 6px; border-radius: 18px; font-size: 18px; min-width: 76px; }
.modal .box.reward { text-align: center; }
.rw-burst { font-size: 34px; line-height: 1; animation: pop .5s cubic-bezier(.34,1.56,.64,1); }
.rw-sub { margin: 0; color: #a08474; }
/* Welcome back */
.wb-art { display: flex; justify-content: center; gap: 4px; margin: 4px 0 -4px; }
.wb-sub { margin: 0 0 8px; color: #a08474; font-size: 14px; }
/* field-guide card for a critter seen for the first time */
.crit-card { position: absolute; left: 50%; top: calc(var(--sat) + 74px); transform: translateX(-50%); width: min(88vw, 340px); display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-left: 6px solid var(--kc); pointer-events: none; animation: pop .3s cubic-bezier(.34,1.56,.64,1); transition: opacity .35s, transform .35s; z-index: 6; }
.crit-card.out { opacity: 0; transform: translateX(-50%) translateY(-10px); }
.crit-ring { flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(255,255,255,.9) 45%, color-mix(in srgb, var(--kc) 45%, transparent) 70%, transparent 72%); }
.crit-pic { width: 46px; height: 46px; object-fit: contain; }
.crit-nm { font-weight: 800; font-size: 15px; color: #6a4038; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crit-tag { font-style: normal; font-size: 11px; letter-spacing: .6px; color: #fff; background: var(--kc); padding: 1px 7px; border-radius: 9px; }
.crit-tx { font-size: 13px; color: #8a6a5e; line-height: 1.25; }
