/* Player levels. Colours are the game's own tokens from styles.css (--ink, --line, --lavender, --cream, --shadow). */
.xp-bar{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;align-items:center;margin:10px 0 4px}
.xp-level{font:15px Georgia,serif;color:var(--ink);white-space:nowrap}
.xp-track{height:10px;border-radius:999px;background:#eee4f4;overflow:hidden;border:2px solid #a57cc5;box-shadow:inset 0 1px 2px #51346f33}
.xp-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,#64429a 0%,#7e55b7 60%,#a77bd3 100%);box-shadow:inset 0 1px #ffffff80,inset -1px 0 #573581;transition:width .4s ease}
.xp-next{grid-column:1/-1;margin:0;font-size:13px;color:var(--muted)}
.xp-how{grid-column:1/-1;margin:0;font-size:12px;color:#80698a}

/* A tiny journey: current milestone, paw-step progress and the actual next doorway. */
.xp-chip{display:grid;grid-template-columns:52px minmax(54px,1fr) 58px;align-items:center;gap:8px;flex:0 1 330px;min-width:280px;height:64px;padding:5px 8px;border-radius:18px;background:var(--cream);border:1px solid #b795d6;box-shadow:0 3px 0 #b795d6,0 8px 18px #b4a0dc33;color:var(--ink);text-align:left;cursor:pointer;transition:transform .15s,box-shadow .15s}
.xp-chip:hover{transform:translateY(-1px)}
.xp-chip:active{transform:translateY(2px);box-shadow:0 1px 0 #b795d6}
.xp-chip-badge{display:grid;place-items:center;align-self:center;width:48px;height:48px;min-width:0;border:2px solid #071d32;border-radius:50%;background:#fff8e6;box-shadow:0 2px 0 #c8aedc;color:#392553;line-height:1}
.xp-chip-number{display:flex;align-items:baseline;gap:2px;color:#392553;font:700 11px/1 system-ui,sans-serif;white-space:nowrap}
.xp-chip-number b{font:700 22px/1 Georgia,serif}
.xp-chip-body{display:block;min-width:0}
.xp-chip-title{display:block;max-width:58px;overflow:hidden;text-overflow:ellipsis;text-align:center;font:700 11px/1.1 system-ui,sans-serif;color:var(--ink);white-space:nowrap}
.xp-chip-progress{display:grid;gap:4px;min-width:0;text-align:center}
.xp-chip .xp-track{position:relative;display:block;min-width:28px;height:9px;border:0;overflow:visible;box-shadow:none;background:#e4d7ed}
.xp-chip .xp-fill{display:block}
.xp-chip-marker{position:absolute;z-index:2;top:50%;width:16px;height:21px;transform:translate(-50%,-72%);transition:left .4s ease;pointer-events:none}
.xp-chip-marker::before{content:'';position:absolute;top:0;left:1px;width:12px;height:12px;border:2px solid #071d32;border-radius:50% 50% 50% 0;background:#b49ad8;box-shadow:0 1px 0 #ffffff99;transform:rotate(-45deg)}
.xp-chip-marker::after{content:'';position:absolute;top:5px;left:6px;width:5px;height:5px;border-radius:50%;background:#fff8e6}
.xp-chip-destination{display:grid;justify-items:center;align-content:center;gap:1px;min-width:0}
.xp-chip-destination>img{width:28px;height:28px;object-fit:contain}
.xp-chip-gate{display:inline-flex;align-items:center;gap:2px;color:#725326;font-size:9px;font-weight:700;line-height:1;white-space:nowrap}
.xp-chip-lock{display:block;width:12px;height:14px;object-fit:contain}
.xp-chip-summary{font:700 10px/1.2 system-ui,sans-serif;color:#54337b;font-variant-numeric:tabular-nums}
/* Confirmed XP stays legible while the little hearts and stars burst around it. */
.xp-burst{position:fixed;z-index:9;top:max(18px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;gap:12px;width:min(310px,calc(100vw - 36px));padding:14px 18px;border:3px solid #071d32;border-radius:28px;background:#fff8e6;box-shadow:0 5px 0 #b795d6,0 12px 28px #4f3c6633;color:#3a2a4a;pointer-events:none;animation:level-pop .55s cubic-bezier(.2,1.35,.45,1) both}
.xp-burst-mascot{position:relative;width:76px;height:82px;object-fit:contain;animation:xp-mascot-hop .65s ease-out both}
.xp-burst-copy{position:relative;display:grid;gap:3px;text-align:center}
.xp-burst-label{font:700 12px/1.2 system-ui,sans-serif;color:#76518d}
.xp-burst-gain{font:900 34px/1.1 system-ui,sans-serif;color:#54337b;letter-spacing:-1px}
.xp-burst-total{font:700 14px/1.3 system-ui,sans-serif;font-variant-numeric:tabular-nums}
.xp-burst-sparks{position:absolute;inset:0;overflow:hidden;border-radius:24px}
.xp-burst-spark{position:absolute;left:50%;top:50%;font-size:20px;line-height:1;color:#ae567f;text-shadow:0 1px #fff;animation:xp-spark 1.15s var(--delay) ease-out both}
.xp-burst-spark:nth-child(even){color:#99702b}
@keyframes xp-spark{0%{opacity:0;transform:translate(-50%,-50%) scale(.3)}20%{opacity:1}100%{opacity:0;transform:translate(calc(-50% + var(--x)),calc(-50% + var(--y))) rotate(35deg) scale(.8)}}
@keyframes xp-mascot-hop{0%,100%{transform:translateY(0) rotate(0)}45%{transform:translateY(-8px) rotate(-9deg)}70%{transform:translateY(1px) rotate(5deg)}}
@media(prefers-reduced-motion:reduce){.xp-burst,.xp-burst-mascot{animation:none}.xp-burst-sparks{display:none}}
@media(min-width:761px) and (max-width:1100px){.site-header:has(.xp-chip) .header-note{display:none}.site-header .xp-chip{margin-left:auto}}

/* A tiny celebration, deliberately not a modal: leveling up should feel like a reward, not a detour. */
.level-up-popover{position:fixed;z-index:8;top:max(12px,env(safe-area-inset-top));left:50%;display:grid;grid-template-columns:36px minmax(0,1fr) auto;align-items:center;gap:10px;width:min(380px,calc(100vw - 28px));padding:8px 10px 8px 12px;border:2px solid #071d32;border-radius:22px;background:linear-gradient(135deg,#fff8de,#f4e8ff);box-shadow:0 5px 0 #b795d6,0 14px 28px #4f3c662e;color:var(--ink);transform:translateX(-50%);animation:level-pop .5s cubic-bezier(.2,1.35,.45,1) both}
.level-up-popover>img{width:36px;height:36px}.level-up-copy{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 8px;min-width:0}.level-up-kicker{margin:0;color:#65477d;font:700 15px/1 Georgia,serif}.level-up-copy strong{font:16px/1.2 Georgia,serif}
.level-up-dismiss{padding:7px 9px;border:1px solid #9d7bc1;border-radius:11px;background:#fffaf0;color:#60456f;font:600 12px/1.1 inherit;cursor:pointer}.level-up-dismiss:hover{background:#eee0f5}
.level-up-go{grid-column:1/-1;padding:8px 12px;border:2px solid #071d32;border-radius:12px;background:#b795d6;color:#071d32;font:700 14px/1.1 inherit;cursor:pointer}.level-up-go:hover{background:#c9ade3}
@keyframes level-pop{from{opacity:0;transform:translate(-50%,-22px) scale(.78)}60%{opacity:1;transform:translate(-50%,3px) scale(1.04)}to{opacity:1;transform:translate(-50%,0) scale(1)}}

/* The ladder: one row per level and the surface it opens. */
.level-ladder{list-style:none;margin:14px 0 4px;padding:0;display:grid;gap:6px;max-height:min(52vh,430px);overflow-y:auto}
.level-step{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:10px;align-items:center;padding:8px 10px;border-radius:16px;border:1px solid transparent}
.level-step-badge{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;font:700 14px/1 Georgia,serif;background:#e8dcf0;color:#53386e;border:2px solid #cab1df}
.level-step-text{display:grid;min-width:0}
.level-step-text strong{font:17px/1.25 Georgia,serif;font-weight:400}
.level-step-line{font-size:12px;line-height:1.35;color:var(--muted)}
.level-step-tag{font-size:11px;padding:3px 9px;border-radius:20px;background:#e8dcf0;color:#654d79;white-space:nowrap}
.level-step[data-state=here]{background:#eee0f5;border-color:#b795d6}
.level-step[data-state=here] .level-step-badge{background:linear-gradient(135deg,#f7e7bf,#f1d493);border-color:#071d32;color:#071d32}
.level-step[data-state=here] .level-step-tag{background:#f4dfbf;color:#6b4f2a}
.level-step[data-state=next]{border-color:#ded0e4;border-style:dashed}
.level-step:is([data-state=next],[data-state=locked]) .level-step-tag{background:transparent;border:1px solid #ded0e4;color:var(--muted)}
.level-step[data-state=locked]{opacity:.62}
.level-step[data-state=locked] .level-step-badge{background:transparent;border-style:dashed}
.level-step:is([data-state=locked],[data-state=open]) .level-step-line{display:none}
dialog .xp-bar{margin-top:0}

/* The one pending card: the only new thing on the page, and its only exit is its one button. */
/* Tappable, so it reads as a button: raised edge, a shadow under it and a chevron. */

/* Before the wallet opens the profile's hud has nothing in it, so it takes no room either. Scoped to
   levels-on: with levels off an empty hud keeps the space it always took. */
body.levels-on .profile-hud:empty{display:none}

/* The one "new" pip, on whichever doorway the player has not opened yet. A doorway tile already spends its
   ::after on a chevron and the daily card its ::before on a glow, so each carrier uses whichever side is free. */
.new-pip{position:relative}
.new-pip::before{content:'new';position:absolute;z-index:2;top:-10px;left:10px;padding:2px 9px;border-radius:20px;font:11px/1.5 inherit;letter-spacing:.5px;background:#f4dfbf;color:#77567f;border:1px solid #e8cda9;pointer-events:none}
/* On a nav tab it rides in the corner rather than stretching the label. */
.bottom-nav .new-pip::before{top:0;right:2px;left:auto;padding:1px 6px;border:2px solid #071d32;font-size:10px;font-weight:700}
@media(max-width:760px){.site-header:has(.xp-chip){flex-wrap:wrap}.site-header .xp-chip{order:3;flex:1 0 100%;min-width:0;width:100%;margin:6px 0 0}.xp-chip{padding:5px 8px}.level-up-popover{grid-template-columns:32px minmax(0,1fr) auto;gap:8px;padding:7px 8px 7px 10px}.level-up-popover>img{width:32px;height:32px}.level-up-copy strong{font-size:15px}.level-up-dismiss{padding:6px 7px}}
@media(prefers-reduced-motion:reduce){.xp-fill{transition:none}.xp-chip:active{transform:none}.level-up-popover{animation:none}}
/* The first level-up card explains XP and levels in three pictures (levelTutorialStrip in how-it-works.mjs). */
.level-tutorial-wrap{margin:0 0 16px;padding:12px 0 0;border-top:1px dashed #ded0e4}
.level-tutorial-title{margin:0;font-size:11px;letter-spacing:2px;text-transform:uppercase;color:#81658b;font-weight:400}
.level-tutorial.comic-strip{margin-top:8px}
/* Everything unlocked: just the level badge, beside the wordmark instead of a full-width bar under it. */
.xp-chip.xp-chip-top{grid-template-columns:48px;flex:0 0 auto;width:auto;min-width:0;height:auto;padding:4px;border-radius:50%}
.xp-chip-top :is(.xp-chip-body,.xp-chip-destination){display:none}
@media(max-width:760px){.site-header .xp-chip.xp-chip-top{order:0;flex:0 0 auto;width:auto;margin:0}}

/* Today's first row is the next step: the one highlighted tile, with its action spelled out. */
.home-today .activity-tile.next-step{min-height:84px;padding:14px 34px 14px 14px;border-color:#8b6bb0;background:linear-gradient(135deg,#fff8e6,#f1e2fc);box-shadow:0 5px 0 #8b6bb0,0 10px 22px #60427730}
.home-today .activity-tile.next-step .activity-tile-art{width:54px;height:54px;flex-basis:54px}
.home-today .activity-tile.next-step .activity-tile-hook{-webkit-line-clamp:2;color:#624d70}
.home-today .activity-tile.next-step:active{box-shadow:0 2px 0 #8b6bb0,0 4px 10px #60427730}

/* Guides are a small ⓘ beside the screen's heading or controls; the guide itself opens as a dialog. */
.feature-guide{display:inline-flex;vertical-align:middle}
.feature-guide-help.card-info{width:28px;height:28px;font-size:15px;box-shadow:0 2px 0 #d7c6e5}
.feature-guide-help.feature-guide-new{border-color:#9d7cc1;background:#f4dfbf;animation:guide-new 1.6s ease-in-out 3}
@keyframes guide-new{50%{box-shadow:0 0 0 6px #b795d644}}
/* Hosts that are forms or pages: the ⓘ rides in the top-right corner instead of taking a row. */
:is(form,.daily-page,.wardrobe,.activity-screen,.world-card,.monster-grow,.garden-shop-sheet)>.feature-guide{float:right;margin:0 0 4px 8px;position:relative;z-index:1}
.visitor-guide-anchor{display:flex;justify-content:flex-end;width:100%}
.guide-slot{display:inline-flex;align-items:center}
.found-title-row{display:flex;align-items:center;gap:10px}.found-title-row>h1{margin-bottom:0}
.feature-guide-sheet{width:min(360px,calc(100vw - 32px));padding:20px 22px;border:2px solid #071d32;border-radius:22px;background:#fffaf0;box-shadow:0 5px 0 #b795d6,0 18px 40px #4f3c6640;color:var(--ink);text-align:left}
.feature-guide-sheet::backdrop{background:#2a1d3a55}
.feature-guide-sheet h2{margin:0 0 6px;font-size:21px}
.feature-guide-sheet p{margin:0 0 14px;font-size:15px;line-height:1.5;color:#624d70}
.feature-guide-sheet button{min-height:44px}
@media(prefers-reduced-motion:reduce){.feature-guide-help.feature-guide-new{animation:none}}
/* Home's Today list reads as a quest log: each row opens with a checkbox that ticks once today's part is done. */
.activity-tile .quest-check{display:none}
.home-today .activity-tile .quest-check{display:grid;place-items:center;flex:0 0 26px;width:26px;height:26px;border:2.5px solid #8b6bb0;border-radius:8px;background:#fffdf9;box-shadow:inset 0 2px 0 #e9dcf3}
.home-today .activity-tile[data-done=true] .quest-check{border-color:#6f9a4f;background:#8fbf62;box-shadow:0 2px 0 #5d8541}
.home-today .activity-tile[data-done=true] .quest-check::after{content:'';width:7px;height:13px;margin-top:-3px;border:solid #fffdf9;border-width:0 3px 3px 0;transform:rotate(45deg)}
.home-today .activity-tile[data-done=true]{border-color:#c9d9b8;background:linear-gradient(180deg,#fbfdf6,#eef5e4);box-shadow:0 3px 0 #c9d9b8}
.home-today .activity-tile[data-done=true] .activity-tile-text strong{color:#6f7f62;text-decoration:line-through;text-decoration-color:#8fbf62;text-decoration-thickness:2px}
.home-today .activity-tile[data-done=true] .activity-tile-art{opacity:.6}
.home-today .activity-tile .activity-tile-art{width:40px;height:40px;flex-basis:40px}
.home-today .activity-tile.next-step .quest-check{border-color:#6b4a98;box-shadow:inset 0 2px 0 #e9dcf3,0 0 0 4px #b795d633}
.home-today .activity-tile.next-step .activity-tile-art{width:44px;height:44px;flex-basis:44px}
.home-today-title{font-size:12px}
/* A finished daily quest waiting to be claimed: a glowing gold "!" box and its XP spelled out. */
.quest-xp{font:700 11px/1.3 system-ui,sans-serif;color:#7a5aa3}
.home-today .activity-tile[data-claim=true]{border-color:#d89a2b;background:linear-gradient(135deg,#fff6dc,#ffeec4);box-shadow:0 4px 0 #d89a2b,0 8px 18px #d89a2b33}
.home-today .activity-tile[data-claim=true] .quest-check{border-color:#c47f10;background:#ffd166;box-shadow:0 0 0 4px #ffd16655;animation:quest-ready 1.4s ease-in-out infinite}
.home-today .activity-tile[data-claim=true] .quest-check::after{content:'!';font:900 16px/1 system-ui,sans-serif;color:#5b3a00}
.home-today .activity-tile[data-claim=true] .quest-xp{color:#9a5f00;font-size:12px}
.home-today .activity-tile[data-done=true] .quest-xp{color:#5d8541}
/* The daily answer is complete when it is posted. Keep its familiar green tick while its separate XP bonus is ready. */
.home-today .activity-tile[data-quest=daily][data-done=true][data-claim=true]{border-color:#c9d9b8;background:linear-gradient(180deg,#fbfdf6,#eef5e4);box-shadow:0 3px 0 #c9d9b8}
.home-today .activity-tile[data-quest=daily][data-done=true][data-claim=true] .quest-check{border-color:#6f9a4f;background:#8fbf62;box-shadow:0 2px 0 #5d8541;animation:none}
.home-today .activity-tile[data-quest=daily][data-done=true][data-claim=true] .quest-check::after{content:'';width:7px;height:13px;margin-top:-3px;border:solid #fffdf9;border-width:0 3px 3px 0;transform:rotate(45deg)}
/* The ready row's big claim button: it spans the row under the title, so the reward is the obvious thing to tap. */
.home-today .activity-tile[data-claim=true]{flex-wrap:wrap;row-gap:10px;padding-right:12px}
.home-today .activity-tile[data-claim=true]::after{display:none}
.home-today .activity-tile[data-claim=true] .activity-tile-text{flex:1 1 0}
.quest-claim{display:none}
.home-today .activity-tile .quest-claim{display:flex;align-items:center;justify-content:center;flex:1 0 100%;min-height:52px;border:2.5px solid #7a4a00;border-radius:16px;background:linear-gradient(180deg,#ffe08a,#ffc53d);box-shadow:0 4px 0 #b77a12,inset 0 2px 0 #fff3c4;color:#4a2c00;font:900 19px/1.1 system-ui,sans-serif;letter-spacing:.01em}
.home-today .activity-tile[data-claim=true]:active .quest-claim{transform:translateY(2px);box-shadow:0 2px 0 #b77a12,inset 0 2px 0 #fff3c4}
@keyframes quest-ready{50%{box-shadow:0 0 0 8px #ffd16622}}
@media(prefers-reduced-motion:reduce){.home-today .activity-tile[data-claim=true] .quest-check{animation:none}}
/* Finch-style level bar under Home's postcard: a chunky outlined bar, the level and this level's XP over it. */
.xp-chip-head{display:none}
.home-level{width:100%;margin:14px 0 2px}
.home-level .xp-chip{grid-template-columns:minmax(0,1fr) 64px;gap:12px;width:100%;min-width:0;height:auto;padding:12px 14px;border:2px solid #071d32;border-radius:24px;background:linear-gradient(160deg,#fffaf0,#f6ecff);box-shadow:0 5px 0 #b795d6,0 12px 24px #9d7cc12e}
.home-level .xp-chip-badge{display:none}
.home-level .xp-chip-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:0 2px 6px}
.home-level .xp-chip-level{font:19px/1.1 Georgia,serif;color:#392553}
.home-level .xp-chip-count{font:700 12px/1 system-ui,sans-serif;color:#65477d;font-variant-numeric:tabular-nums;white-space:nowrap}
.home-level .xp-chip-progress{gap:6px;text-align:left}
.home-level .xp-chip .xp-track{height:20px;border:2px solid #071d32;border-radius:999px;background:#efe4f7;overflow:hidden;box-shadow:inset 0 3px 0 #dccbeb}
.home-level .xp-chip .xp-fill{position:relative;height:100%;border-radius:999px;background:linear-gradient(180deg,#b894ea 0%,#8a5fc4 55%,#6f47a8 100%);box-shadow:inset 0 -2px 0 #00000022}
.home-level .xp-chip .xp-fill::after{content:'';position:absolute;left:8px;right:8px;top:3px;height:4px;border-radius:999px;background:#ffffff80}
.home-level .xp-chip-marker{display:none}
.home-level .xp-chip-summary{font:600 11px/1.3 system-ui,sans-serif;color:#65477d}
.home-level .xp-chip-destination>img{width:32px;height:32px}
.home-level .xp-chip.xp-chip-top{grid-template-columns:minmax(0,1fr);border-radius:24px;padding:12px 14px}
.home-level .xp-chip-top .xp-chip-body{display:block}
@media(min-width:1000px) and (orientation:landscape){.postcard-home>.home-level{grid-area:level;margin:0 0 6px}}
