* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1410; color: #f4f1e6; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
button { font: inherit; font-size: 15px; background: #ffd166; color: #14211a; border: 0; border-bottom: 3px solid #b8892a; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
button:disabled { background: #4a5a50; color: #9aa89e; border-bottom-color: #2d3a32; cursor: default; }
button.ghost { background: #2f4a3b; color: #f4f1e6; border-bottom-color: #1c2e24; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #a8c686; outline-offset: 2px; }
[hidden] { display: none !important; }

/* The map fills the screen. Everything else floats over it and stays out of the way. */
.stage { position: fixed; inset: 0; overflow: hidden; background: #0b1410; }
#town { display: block; width: 100%; height: 100%; image-rendering: pixelated; touch-action: manipulation; }

.hud { position: absolute; display: flex; gap: 8px; align-items: center; z-index: 1; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-top-left { top: 10px; left: 10px; flex-direction: column; align-items: flex-start; gap: 6px; }
.hud-top-right { top: 10px; right: 10px; }
.hud-bottom-left { bottom: 12px; left: 12px; }
.hud-bottom-right { bottom: 12px; right: 12px; }
.chip { margin: 0; background: #0b1410d9; border: 2px solid #2b1a12; border-radius: 999px; padding: 5px 12px; font-size: 14px; box-shadow: 0 2px 0 #0006; }
.chip strong { color: #ffd166; }
.place-chip span { color: #a8c686; }
.status { color: #cfe3c0; font-size: 13px; padding: 3px 10px; }
.status.down { color: #ff8f7a; border-color: #ff8f7a; }
.record { color: #cfe3c0; margin-left: 6px; }
.round { width: 42px; height: 42px; padding: 0; border-radius: 50%; font-size: 20px; background: #0b1410d9; color: #f4f1e6; border: 2px solid #2b1a12; border-bottom-width: 4px; }
.chip-btn { background: #fbf5e3; color: #2b1a12; border: 2px solid #2b1a12; border-bottom-width: 4px; border-radius: 999px; padding: 6px 14px; font-weight: bold; display: flex; align-items: center; gap: 6px; }
.partner-btn { padding: 3px 14px 3px 4px; }
.partner-btn img { object-fit: contain; width: 34px; height: 34px; }
.charm-chip { color: #ffd166; }
.action { font-weight: bold; font-size: 17px; padding: 10px 18px; border: 2px solid #2b1a12; border-bottom-width: 5px; border-radius: 999px; animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(-3px); } }

/* Pop-ups that open from the floating buttons. */
.pop { position: absolute; z-index: 3; background: #fbf5e3; color: #2b1a12; border: 3px solid #2b1a12; border-radius: 10px; padding: 12px; box-shadow: 4px 4px 0 #0008; max-width: min(420px, calc(100% - 24px)); }
.pop-left { left: 12px; bottom: 66px; }
.pop-right { right: 10px; top: 60px; display: flex; flex-direction: column; gap: 8px; min-width: 240px; }
/* Weekly rankings: the notice board, opened from the board itself or the menu. */
.ranks-pop { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 24px)); max-height: calc(100% - 140px); overflow-y: auto; z-index: 4; }
.ranks-list { list-style: none; margin: 0 0 8px; padding: 0; }
.ranks-list li { display: grid; grid-template-columns: 2.2em 1fr auto; gap: 8px; align-items: baseline; padding: 5px 6px; border-bottom: 1px dashed #c9b98f; font-size: 15px; }
.ranks-list li.me { background: #ffd166; border-radius: 6px; font-weight: bold; }
.ranks-list li.gap { border-bottom: none; text-align: center; display: block; color: #7a6a4f; }
.ranks-list .pts { font-weight: bold; white-space: nowrap; }
.ranks-list .rec { display: block; font-size: 12px; color: #6b5a3e; font-weight: normal; }
.pop-title { margin: 0 0 8px; font-weight: bold; }
.pop-note { margin: 8px 0 0; font-size: 13px; color: #6b4a2b; }
.menu .pop-note { margin: 0; }
.busy { display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: 15px; }
.bus-home { color: #2b1a12; font-size: 14px; }
.partners { display: flex; gap: 6px; flex-wrap: wrap; }
.partners button { display: flex; align-items: center; gap: 4px; padding: 4px 10px 4px 4px; background: #efe4c4; color: #2b1a12; border-bottom-color: #c9b98f; font-size: 14px; }
.partners button img { object-fit: contain; width: 30px; height: 30px; }
.partners button[aria-checked="true"] { background: #ffd166; border-bottom-color: #b8892a; outline: 2px solid #2b1a12; }
/* A saved trainer's party: each Checkling with a Rest button, then the Den with Join buttons. */
.team-row { display: flex; align-items: center; gap: 4px; }
.partners .team-row { flex-basis: 100%; }
.partners .team-row .pick { flex: 1; }
.partners .den-btn, .den .den-btn { padding: 4px 10px; font-size: 13px; background: #fbf5e3; color: #2b1a12; border: 2px solid #2b1a12; border-bottom-width: 3px; border-radius: 8px; }
.den-btn:disabled { opacity: 0.45; }
.den { margin-top: 10px; max-height: 32vh; overflow-y: auto; }
.den .pop-title { margin: 0 0 6px; }
.den-row { padding: 2px 0; font-size: 14px; }
.den-row img { object-fit: contain; width: 26px; height: 26px; }
.den-row span { flex: 1; }
.name-form { display: flex; gap: 4px; flex: 1; }
.name-form input { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 4px 8px; border: 2px solid #2b1a12; border-radius: 8px; background: #fffaf0; color: #2b1a12; }
.phrases { display: flex; flex-wrap: wrap; gap: 8px; width: 380px; }
.phrases button { background: #efe4c4; color: #2b1a12; border-bottom-color: #c9b98f; }

/* Touch screens get a walking pad. Keyboards and mice do not need one. */
.pad { position: absolute; z-index: 1; right: 16px; bottom: 70px; display: none; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(2, 52px); gap: 4px; opacity: 0.85; }
@media (pointer: coarse) { .pad { display: grid; } }
.pad button { padding: 0; background: #fbf5e3cc; color: #2b1a12; border: 2px solid #2b1a12; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pad [data-d="u"] { grid-column: 2; grid-row: 1; }
.pad [data-d="l"] { grid-column: 1; grid-row: 2; }
.pad [data-d="d"] { grid-column: 2; grid-row: 2; }
.pad [data-d="r"] { grid-column: 3; grid-row: 2; }

/* Tutorial tips pop up in the world when they are useful, one at a time. */
.tip { position: absolute; z-index: 6; top: 64px; left: 50%; transform: translateX(-50%); width: max-content; display: flex; gap: 12px; align-items: center; background: #fbf5e3; color: #2b1a12; border: 3px solid #2b1a12; border-radius: 10px; padding: 10px 12px 10px 16px; box-shadow: 4px 4px 0 #0008; max-width: min(560px, calc(100vw - 24px)); animation: drop 260ms ease-out; }
.tip p { margin: 0; font-size: 16px; line-height: 1.35; }
.tip button { flex: none; }
@keyframes drop { from { transform: translate(-50%, -14px); opacity: 0; } }

.toast { position: absolute; z-index: 2; left: 50%; bottom: 70px; transform: translateX(-50%); background: #0b1410e6; border: 2px solid #ffd166; padding: 8px 14px; border-radius: 6px; font-size: 15px; max-width: 90%; text-align: center; }
.paused { position: absolute; z-index: 4; top: 10px; left: 50%; transform: translateX(-50%); background: #0b1410e6; border: 2px solid #ff8f7a; color: #ffd8cf; padding: 6px 14px; border-radius: 4px; font-size: 15px; }
.ask { position: absolute; z-index: 5; inset: 0; display: grid; place-content: center; background: #0b1410b3; text-align: center; }
.ask p { background: #20352a; border: 3px solid #ffd166; padding: 16px 22px; margin: 0 0 12px; font-size: 18px; border-radius: 4px; }
.ask-row { display: flex; gap: 10px; justify-content: center; }

/* The teacher page still uses the plain layout. */
.frame { max-width: 800px; margin: 0 auto; padding: 16px; }
h1 { margin: 0; font-size: 26px; letter-spacing: 1px; color: #ffd166; }
html:has(.teacher), body:has(.teacher) { overflow: auto; height: auto; }
.teacher .status { margin: 0; font-size: 15px; color: #cfe3c0; }
.teacher .help { color: #9fb59a; font-size: 14px; }
.teacher .top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.teacher .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.teacher input { font: inherit; font-size: 15px; padding: 7px 9px; border-radius: 4px; border: 2px solid #2f4a3b; background: #0b1410; color: #f4f1e6; min-width: 260px; }
.teacher h2 { font-size: 18px; color: #ffd166; margin: 22px 0 8px; }
.teacher table { width: 100%; border-collapse: collapse; font-size: 14px; }
.teacher th, .teacher td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #2f4a3b; }

/* ---------- battles ---------- */
.battle { position: absolute; inset: 0; z-index: 4; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: #0b1410; z-index: 2; }
.battle[hidden] { display: none; }
.b-scene { position: relative; overflow: hidden; background: #6f9b45 url(/art/bg-battle-meadow.png) center / cover no-repeat; image-rendering: pixelated; }
.b-mon { position: absolute; transition: opacity 400ms, transform 400ms; }
.b-foe-mon { right: 13%; top: 10%; height: 38%; }
.b-foe-mon:where(:not(.sprite-book-pose)) { animation: bob 1.6s steps(2) infinite; }
.b-me-mon { left: 11%; bottom: -4%; height: 56%; }
.b-me-mon.sprite-book-pose { bottom: 1%; }
.b-mon.down { opacity: 0; transform: translateY(30%); }
.b-mon.hit { animation: hit 360ms steps(4); }
.b-mon.lunge-foe { transform: translate(-6%, 6%); }
.b-mon.lunge-me { transform: translate(6%, -6%); }
@keyframes bob { 50% { transform: translateY(-3%); } }
@keyframes hit { 0%, 50% { opacity: 0.2; transform: translateX(-4%); } 25%, 75% { opacity: 1; transform: translateX(4%); } 100% { opacity: 1; transform: none; } }
.b-ko { position: absolute; width: 20%; image-rendering: pixelated; animation: spin 1.2s linear infinite; }
.b-ko[hidden] { display: none; }
.b-foe-ko { right: 16%; top: 6%; }
.b-me-ko { left: 14%; bottom: 44%; }
@keyframes spin { 50% { transform: scale(1.1, 0.9); } }
.b-pop { position: absolute; font-size: 26px; font-weight: bold; color: #fff6e0; text-shadow: 2px 2px 0 #2b1a12, -2px -2px 0 #2b1a12, 2px -2px 0 #2b1a12, -2px 2px 0 #2b1a12; animation: pop 900ms ease-out forwards; pointer-events: none; }
.b-pop[hidden] { display: none; }
.b-pop.strong { color: #ffd166; }
.b-foe-pop { right: 24%; top: 12%; }
.b-me-pop { left: 24%; bottom: 40%; }
@keyframes pop { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-40px); opacity: 0; } }
.b-card { position: absolute; background: #fbf5e3; color: #2b1a12; border: 4px solid #2b1a12; border-radius: 6px; padding: 6px 10px 8px; min-width: 38%; box-shadow: 4px 4px 0 #2b1a1255; }
.b-foe-card { left: 4%; top: 6%; }
.b-me-card { right: 4%; bottom: 6%; }
.b-card p { margin: 0; }
.b-name { font-size: 18px; font-weight: bold; display: flex; align-items: center; gap: 6px; }
.b-name img { width: 22px; height: 22px; image-rendering: pixelated; }
.b-lv { font-size: 14px; font-weight: normal; margin-left: auto; }
.b-trainer { font-size: 13px; color: #6b4a2b; }
.b-bar { position: relative; height: 12px; margin-top: 5px; background: #4a3a2a; border: 2px solid #2b1a12; border-radius: 6px; overflow: hidden; }
.b-bar span { position: absolute; inset: 0 auto 0 0; width: 100%; background: #52b36a; transition: width 600ms steps(12), background-color 300ms; }
.b-bar span.mid { background: #e9b949; }
.b-bar span.low { background: #e4572e; }
.b-bar.b-st { height: 8px; }
.b-bar.b-st span { background: #669bbc; }
.b-num { font-size: 13px; text-align: right; }
.b-bottom { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; padding: 10px; background: #20352a; border-top: 4px solid #2b1a12; }
.b-talk { background: #fbf5e3; color: #2b1a12; border: 3px solid #2b1a12; border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.b-msg { margin: 0; font-size: 17px; line-height: 1.35; min-height: 46px; }
.b-clock { height: 8px; background: #d8ccae; border-radius: 4px; overflow: hidden; }
.b-clock span { display: block; height: 100%; width: 100%; background: #2f4a3b; }
.b-clock-text { margin: 0; font-size: 13px; color: #6b4a2b; }
.b-moves { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.b-moves button { min-width: 0; text-align: left; display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 7px 9px; font-size: 16px; }
.b-moves button .ic { grid-row: 1 / 3; width: 26px; height: 26px; image-rendering: pixelated; }
.b-moves button .k { font-weight: bold; }
.b-moves button small { font-size: 12px; opacity: 0.85; line-height: 1.25; }
.b-moves button.picked { outline: 3px solid #fff6e0; outline-offset: -3px; }
.b-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.b-wild { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.b-wild[hidden] { display: none; }
.b-wild button { padding: 6px 9px; font-size: 15px; }
.b-done { display: flex; flex-direction: column; gap: 10px; justify-content: center; flex: 1; }
.b-done[hidden], .b-moves[hidden] { display: none; }
.b-giveup { position: absolute; top: 8px; right: 8px; font-size: 13px; padding: 5px 9px; opacity: 0.85; }
.b-giveup[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .b-foe-mon, .b-ko { animation: none; } .b-mon.hit { animation: none; } }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.b-mon.shake { animation: shake 420ms steps(4) 1; }
.b-mon.caught { opacity: 0; transform: scale(0.2); }

/* Phones: keep the top corners from crowding each other. */
@media (max-width: 560px) { .me-chip { display: none; } .tip { top: 90px; } }

/* ---------- care ---------- */
.care-btn { position: relative; }
.care-flag { position: absolute; top: -8px; right: -8px; background: #c0392b; color: #fff; border: 2px solid #2b1a12; border-radius: 999px; font-size: 11px; padding: 1px 6px; white-space: nowrap; }
.care-pop { width: min(380px, calc(100% - 24px)); max-height: calc(100% - 90px); overflow-y: auto; }
.care-head { display: flex; gap: 10px; align-items: center; }
.care-head img { object-fit: contain; width: 64px; height: 64px; }
.care-head .pop-title { margin: 0; font-size: 17px; }
.care-sub { margin: 2px 0 0; font-size: 13px; color: #6b4a2b; }
.care-switch { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.care-switch button { padding: 3px 10px; font-size: 13px; border-radius: 999px; border: 2px solid #2b1a12; background: #fff8e4; color: #2b1a12; }
.care-switch button[aria-selected="true"] { background: #2f4a3b; color: #f4f1e6; }
.care-bars { display: grid; grid-template-columns: 5.2em 1fr 2.6em; gap: 4px 8px; align-items: center; font-size: 14px; margin: 6px 0; }
.care-bar { height: 12px; background: #e6dcc2; border: 2px solid #2b1a12; border-radius: 6px; overflow: hidden; }
.care-bar > i { display: block; height: 100%; background: #3f8a4e; }
.care-bar.low > i { background: #c0392b; }
.care-bar.mid > i { background: #d9a031; }
.care-weight { position: relative; height: 12px; border: 2px solid #2b1a12; border-radius: 6px; background: linear-gradient(90deg, #c0392b 0 20%, #d9a031 20% 32%, #3f8a4e 32% 68%, #d9a031 68% 80%, #c0392b 80%); }
.care-weight > i { position: absolute; top: -5px; width: 4px; height: 18px; background: #2b1a12; border-radius: 2px; transform: translateX(-2px); }
.care-tags { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.care-tag { font-size: 13px; padding: 5px 8px; border-radius: 6px; background: #fff1c9; border-left: 4px solid #d9a031; }
.care-tag.sick { background: #fde2dc; border-left-color: #c0392b; }
.care-tag b { display: block; }
.care-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.care-actions button { font-size: 14px; padding: 8px 6px; }
.care-actions button small { display: block; font-weight: normal; font-size: 11px; opacity: .85; }
.care-actions .risky { grid-column: 1 / -1; background: #5b2a6e; }
.care-msg { min-height: 1.3em; margin: 8px 0 0; font-size: 14px; }
.card-pop { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100% - 24px)); max-height: calc(100% - 120px); overflow-y: auto; z-index: 7; }
.report-item { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; }
.report-item img { object-fit: contain; width: 48px; height: 48px; }
.report-item ul { margin: 2px 0 0; padding-left: 18px; font-size: 14px; }
.report-item li.sick, .report-item li.cond { color: #a5281b; font-weight: bold; }
.report-item li.good { color: #2f6b3a; }
.stone { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; padding: 8px; margin: 0 0 8px; border-radius: 8px; background: #e9e4d6; }
.stone.mine { background: #f3e2b0; }
.stone img { width: 56px; height: 56px; image-rendering: pixelated; }
.stone .who { font-weight: bold; }
.stone .line { font-style: italic; margin: 3px 0; }
.stone .meta { font-size: 12px; color: #6b5a3e; }
.hatch-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hatch-pick button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; }
.hatch-pick img { object-fit: contain; width: 56px; height: 56px; }
.bus-row { display: flex; gap: 8px; margin-top: 10px; }
.bus-row button { flex: 1; }

/* Resident conversations use the browser's modal focus and Escape handling. */
.resident-dialog { color: #392d20; background: #faf2da; width: min(530px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); overflow: auto; border: 3px solid #4b422e; border-radius: 12px; padding: 22px; box-shadow: 0 8px 0 #322c2399, 0 20px 65px #12241966; }
.resident-dialog::backdrop { background: #10251d70; }
.resident-dialog h2 { font-size: 26px; margin: 2px 0 0; letter-spacing: -.7px; }
.resident-heading { display: flex; align-items: center; gap: 15px; border-bottom: 1px solid #cbbc96; padding-bottom: 12px; }
.resident-heading img { width: 64px; height: 84px; object-fit: none; object-position: -64px -8px; image-rendering: pixelated; background: #dedfc0; border-radius: 8px; }
.resident-eyebrow { color: #5c6942; font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; margin: 0 0 4px; font-weight: bold; }
.resident-text { font-size: 17px; line-height: 1.65; margin: 18px 0; }
.resident-choices { display: grid; gap: 9px; }
.resident-choices button { text-align: left; color: #f8f3df; background: #415b43; border: 1px solid #304b35; border-bottom-width: 3px; padding: 12px 14px; min-height: 44px; }
.resident-choices button:hover { background: #304d34; }
.resident-dialog button:focus-visible { outline-color: #8b5b1b; }
.resident-close { margin-top: 16px; color: #574a35; border: 0; background: transparent; padding: 8px 0; text-decoration: underline; min-height: 44px; }
.journal-note { font-size: 13px; color: #64543e; line-height: 1.55; }
.resident-directory article { border-top: 1px solid #cbbc96; padding: 12px 0; }
.resident-directory h4 { margin: 0 0 6px; font-size: 15px; }
.resident-directory p { margin: 4px 0; font-size: 13px; line-height: 1.5; }
.resident-memory { color: #67543b; }
.resident-directory article > div { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.resident-directory button { min-height: 44px; font-size: 13px; }
#journalEntries article { border-top: 1px solid #cbbc96; margin: 14px 0; padding-top: 10px; }
#journalEntries h3 { font-size: 15px; margin: 0; }
#journalEntries p { font-size: 14px; line-height: 1.6; }
.world-cue { position: absolute; z-index: 3; top: 78px; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(500px, calc(100% - 28px)); padding: 12px 18px; background: #faf2da; color: #392d20; border: 2px solid #8b784e; border-radius: 8px; box-shadow: 0 4px 0 #372e2c55; font-size: 14px; line-height: 1.5; }
@media (max-width: 560px) { #talkBtn { font-size: 12px; padding: 10px; } .resident-dialog { padding: 16px; } .resident-text { font-size: 15px; } .world-cue { top: 104px; } }
/* The name chip never runs off the screen: long names shorten with an ellipsis, and narrower screens drop "You are". */
.me-chip { max-width: min(46vw, 420px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .me-label { display: none; } }
/* Ghosts: the Checkling's own art, pale and see through with a cold glow. */
.ghostly { opacity: 0.66; filter: grayscale(0.6) brightness(1.3) drop-shadow(0 0 10px rgba(140, 205, 255, 0.95)); }
.b-mon.ghostly.down { opacity: 0; }
.b-mon.fading { animation: fade 900ms ease-in-out 1; }
@keyframes fade { 0%, 100% { opacity: 0.66; } 40%, 60% { opacity: 0.08; } }
@media (prefers-reduced-motion: reduce) { .b-mon.fading { animation: none; opacity: 0.2; } }
/* Attack effects (battle-fx.js). Each piece is absolutely placed in the battle scene and removed when it ends. */
.fx { position: absolute; pointer-events: none; z-index: 3; }
.fx-orb { border-radius: 50%; background: radial-gradient(circle at 40% 40%, #fff 0 18%, var(--core) 34%, var(--glow) 70%, transparent 72%); box-shadow: 0 0 18px 6px var(--glow); }
.fx-wisp { border-radius: 50% 50% 50% 0; background: radial-gradient(circle, var(--core) 0 20%, var(--glow) 60%, transparent 72%); filter: blur(2px); box-shadow: 0 0 22px 8px var(--glow); }
.fx-star { background: var(--core); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); filter: drop-shadow(0 0 8px var(--glow)) drop-shadow(0 0 3px var(--glow)); }
.fx-gear { border-radius: 50%; background: radial-gradient(circle, #0000 0 22%, var(--glow) 23% 48%, #0000 49%), repeating-conic-gradient(var(--core) 0 22deg, #0000 22deg 45deg); box-shadow: 0 0 12px 3px var(--glow); }
.fx-leaves i { position: absolute; width: 55%; height: 30%; border-radius: 0 100% 0 100%; background: linear-gradient(135deg, var(--core), var(--glow)); box-shadow: 0 0 6px var(--glow); }
.fx-leaves i:nth-child(1) { left: 0; top: 10%; transform: rotate(20deg); }
.fx-leaves i:nth-child(2) { right: 0; top: 40%; transform: rotate(140deg); }
.fx-leaves i:nth-child(3) { left: 20%; bottom: 0; transform: rotate(260deg); }
.fx-rocks i { position: absolute; width: 45%; height: 45%; background: var(--core); clip-path: polygon(20% 0, 100% 20%, 80% 100%, 0 70%); box-shadow: inset -4px -4px 0 var(--glow); }
.fx-rocks i:nth-child(2) { left: 55%; top: 10%; } .fx-rocks i:nth-child(3) { left: 25%; top: 55%; }
.fx-shard { background: var(--core); clip-path: polygon(20% 0, 100% 25%, 75% 100%, 0 65%); filter: drop-shadow(2px 2px 0 var(--glow)); }
.fx-bolt { width: 72px; background: linear-gradient(var(--core), #fff); clip-path: polygon(55% 0, 20% 48%, 48% 48%, 25% 100%, 82% 38%, 52% 38%, 78% 0); filter: drop-shadow(0 0 10px var(--glow)) drop-shadow(0 0 4px #fff); }
.fx-ring { border-radius: 50%; border: 6px solid var(--core); box-shadow: 0 0 18px 4px var(--glow), inset 0 0 14px 2px var(--glow); }
.fx-spark { width: 8px; height: 8px; border-radius: 2px; background: var(--core); box-shadow: 0 0 8px 2px var(--glow); }
.fx-flash { inset: 0; }
.fx-shield { border-radius: 50%; border: 3px solid rgba(200, 235, 255, 0.95); background: radial-gradient(circle, rgba(170, 220, 255, 0.05) 50%, rgba(170, 220, 255, 0.35)); box-shadow: 0 0 20px rgba(150, 210, 255, 0.8); }
.fx-plus { width: 10px; height: 10px; background: var(--core); clip-path: polygon(38% 0, 62% 0, 62% 38%, 100% 38%, 100% 62%, 62% 62%, 62% 100%, 38% 100%, 38% 62%, 0 62%, 0 38%, 38% 38%); filter: drop-shadow(0 0 4px var(--core)); }
/* Learning moves. */
.learn-move { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; padding: 8px; border: 2px solid #2b1a12; border-radius: 8px; background: #fff; }
.learn-move b { font-size: 15px; }
.learn-move small { grid-column: 2; font-size: 12px; color: #4a3424; }
.learn-move img { width: 22px; height: 22px; grid-row: span 2; image-rendering: pixelated; }
.learn-new { background: #fff6cf; border-color: #b8860b; }
.learn-forget { display: grid; gap: 6px; margin: 8px 0; }
.learn-forget button { text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; font-size: 14px; }
.learn-forget button small { grid-column: 2; font-weight: normal; font-size: 11px; opacity: .85; }
.learn-forget button img { grid-row: span 2; width: 20px; height: 20px; }
/* The gym. */
.gym-pop { width: min(560px, calc(100% - 24px)); }
.gym-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.gym-head img { width: 56px; height: 56px; object-fit: contain; }
.gym-head .pop-title { margin: 0; font-size: 18px; }
.gym-label { margin: 10px 0 4px; font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: .06em; color: #6b4a2b; }
.gym-known { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gym-known .learn-move { padding: 5px 7px; }
.gym-moves { display: grid; gap: 8px; }
.gym-move { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px; border: 2px solid #2b1a12; border-radius: 8px; background: #fff; }
.gym-move .gm-name { font-weight: bold; display: flex; gap: 6px; align-items: center; }
.gym-move .gm-name img { width: 20px; height: 20px; }
.gym-move .gm-detail { grid-column: 1; font-size: 12px; color: #4a3424; }
.gym-move .gm-bar { grid-column: 1; height: 8px; background: #e4dccb; border-radius: 4px; overflow: hidden; }
.gym-move .gm-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f3a712, #ffd166); }
.gym-move .gm-pts { grid-column: 1; font-size: 11px; color: #6b4a2b; }
.gym-move .gm-btns { grid-column: 2; grid-row: 1 / span 4; display: grid; gap: 4px; }
.gym-move.done { opacity: .6; }
/* Mini games. */
.game-overlay { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: #0b1410e6; }
.game-overlay[hidden] { display: none; }
.game-card { width: min(640px, calc(100% - 24px)); background: #fbf5e3; color: #2b1a12; border: 3px solid #2b1a12; border-radius: 12px; padding: 16px; box-shadow: 6px 6px 0 #0008; }
.game-title { margin: 0; font-size: 22px; font-weight: bold; }
.game-how { margin: 4px 0 10px; font-size: 14px; color: #4a3424; }
.game-stage { position: relative; height: 240px; border: 3px solid #2b1a12; border-radius: 10px; overflow: hidden; background: radial-gradient(circle at 50% 120%, #3c6b3a, #1d3324 70%); touch-action: none; user-select: none; }
.game-score { margin: 10px 0 0; font-size: 16px; font-weight: bold; min-height: 1.3em; }
.gm-track { position: absolute; left: 6%; right: 6%; top: 46%; height: 34px; border-radius: 17px; background: #102018; border: 3px solid #f4f1e6; }
.gm-zone { position: absolute; top: 0; bottom: 0; background: linear-gradient(#ffe27a, #f3a712); border-radius: 12px; box-shadow: 0 0 14px #ffd166; }
.gm-zone.core { background: #fff; box-shadow: 0 0 12px #fff; }
.gm-marker { position: absolute; top: -12px; width: 8px; height: 52px; margin-left: -4px; background: #fff; border: 2px solid #2b1a12; border-radius: 4px; }
.gm-gauge { position: absolute; left: 50%; bottom: 18px; width: 64px; height: 190px; margin-left: -32px; border: 3px solid #f4f1e6; border-radius: 12px; background: #102018; overflow: hidden; }
.gm-gauge i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, #4aa8ff, #bff0ff); }
.gm-band { position: absolute; left: -2px; right: -2px; background: #ffd16655; border-top: 3px solid #ffd166; border-bottom: 3px solid #ffd166; }
.gm-hold { position: absolute; right: 14px; bottom: 14px; padding: 14px 18px; font-size: 16px; }
.gm-arrow { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; display: grid; place-items: center; font-size: 64px; color: #fff; text-shadow: 0 0 12px #ffd166; }
.gm-ring { position: absolute; left: 50%; top: 50%; border: 5px solid #ffd166; border-radius: 50%; transform: translate(-50%, -50%); }
.gm-pads { position: absolute; left: 8px; bottom: 8px; display: grid; grid-template-columns: repeat(4, 48px); gap: 6px; }
.gm-pads button { height: 44px; font-size: 22px; padding: 0; }
.gm-target { position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 0; padding: 0; background: radial-gradient(circle, #fff 0 18%, #e5533d 19% 38%, #fff 39% 56%, #e5533d 57%); box-shadow: 0 0 10px #000a; cursor: pointer; }
.gm-pop { position: absolute; transform: translate(-50%, -50%); font-weight: bold; font-size: 20px; color: #fff; text-shadow: 2px 2px 0 #2b1a12; pointer-events: none; }
.gm-left { position: absolute; right: 10px; top: 8px; color: #f4f1e6; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .gm-zone { box-shadow: none; } }
/* The Checkaverse Gazette: a small newspaper. */
.paper-pop { width: min(520px, calc(100% - 24px)); background: #f3ecd8; font-family: Georgia, "Times New Roman", serif; }
.paper-mast { margin: 0; text-align: center; font-size: 26px; font-weight: bold; letter-spacing: .02em; border-bottom: 3px double #2b1a12; padding-bottom: 4px; }
.paper-date { margin: 4px 0 10px; text-align: center; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: #6b4a2b; }
.paper-stories article { padding: 8px 0; border-bottom: 1px solid #c9b994; }
.paper-stories article:first-child h3 { font-size: 21px; }
.paper-stories h3 { margin: 0 0 4px; font-size: 17px; line-height: 1.2; }
.paper-stories p { margin: 0; font-size: 14px; line-height: 1.4; }
.paper-quotes { margin: 10px 0 6px; padding: 8px 10px; background: #e9dfc4; border-left: 4px solid #2b1a12; }
.paper-quotes h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.paper-quotes p { margin: 0 0 6px; font-size: 14px; font-style: italic; }
.paper-quotes p b { font-style: normal; }
/* Mail. */
.mail-list { display: grid; gap: 8px; margin-bottom: 8px; }
.mail-list .letter { background: #fffdf5; border: 2px solid #2b1a12; border-radius: 6px; padding: 8px 10px; }
.mail-list .letter.new { border-color: #b8860b; box-shadow: 0 0 0 2px #ffd166; }
.mail-list .letter b { display: block; font-size: 13px; margin-bottom: 2px; }
.mail-list .letter p { margin: 0; font-size: 14px; line-height: 1.4; }
