.levels-page { padding-block: 48px 62px; }
.levels-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.levels-heading h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.18; margin: 10px 0 12px; letter-spacing: -.065em; }
.levels-heading p:not(.eyebrow) { color: var(--muted); font-size: 17px; }
.animal-scene { position: relative; overflow: hidden; border: 1px solid #b1915355; border-radius: 13px; }
.animal-scene > img { height: auto; margin-top: -3.29%; }
.animal { position: absolute; width: 20%; height: 36.1%; top: 12.9%; background: transparent; border: 2px solid transparent; border-radius: 12px; cursor: pointer; transition: background .18s, border-color .18s; }
.animal:hover { background: #ffd78818; border-color: #f8dda67a; }
.animal:focus-visible { outline: 3px solid #fff; outline-offset: -5px; background: #ffd78822; }
.animal-1, .animal-6 { left: 0; }
.animal-2, .animal-7 { left: 20%; }
.animal-3, .animal-8 { left: 40%; }
.animal-4, .animal-9 { left: 60%; }
.animal-5, .animal-10 { left: 80%; }
.animal-6, .animal-7, .animal-8, .animal-9, .animal-10 { top: 50.1%; height: 48.85%; }
.animal-name { position: absolute; height: 1px; width: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mobile-levels { display: none; }
.level-choice, .level-navigation button { color: var(--cream); border: 1px solid var(--stroke); background: var(--surface); padding: 11px 14px; border-radius: 7px; font: inherit; cursor: pointer; min-height: 46px; }
.level-choice { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.level-choice span { color: var(--gold); }
.level-choice:hover, .level-navigation button:hover:not(:disabled) { border-color: var(--gold); }
.level-choice:focus-visible, #level-dialog button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
#level-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #9d854e; border-radius: 14px; background: #10221d; color: var(--cream); overflow: auto; }
#level-dialog::backdrop { background: #020805c9; backdrop-filter: blur(5px); }
.level-dialog-inner { position: relative; padding: 37px 30px 25px; }
#close-level { position: absolute; right: 10px; top: 8px; width: 44px; height: 44px; background: transparent; border: 0; color: var(--muted); font-size: 30px; cursor: pointer; border-radius: 7px; }
#level-title { font-size: clamp(30px, 7vw, 43px); color: #f0d6a1; margin-top: 12px; padding-right: 20px; }
#level-description { margin-block: 21px 31px; font-size: 21px; line-height: 1.85; }
.level-navigation { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 18px; border-top: 1px solid var(--stroke); }
.level-navigation button { padding: 9px 10px; font-size: 14px; }
.level-navigation button:disabled { opacity: .35; cursor: default; }
#level-position { white-space: nowrap; font-size: 13px; color: var(--muted); }
.level-texts details { margin-top: 10px; padding: 12px; border: 1px solid var(--stroke); border-radius: 8px; }
.level-texts p { margin-top: 8px; }
nav a[aria-current="page"] { color: var(--gold); }
@media (max-width: 700px) {
  .levels-page { padding-block: 30px 40px; }
  .levels-heading { flex-direction: column; align-items: flex-start; gap: 14px; }
  .levels-heading p:not(.eyebrow) { font-size: 16px; }
  .mobile-levels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }
  .animal { display: none; }
  .level-dialog-inner { padding: 36px 20px 20px; }
  #level-description { font-size: 19px; }
}
.animal::after { content: attr(data-display-level); position: absolute; top: 7px; right: 8px; background: #12291fda; color: #fff4d9; border: 1px solid #dfbe78; padding: 2px 8px; border-radius: 5px; font: 700 12px var(--sans); }
#preview-leaves { margin-top: 13px; cursor: pointer; }
/* Character cards share the original illustration and load no extra artwork. */
.animal-tapped { background:#fff1a52a; border-color:#f9de9a; box-shadow:inset 0 0 35px #ffe6a53a; }
#level-dialog { width:min(540px,calc(100% - 28px)); border-color:#50775c; background:radial-gradient(ellipse at 50% 12%,#254d37 0, #11271e 43%,#0c1d17 80%); box-shadow:0 30px 100px #0009; overscroll-behavior:contain; }
#level-dialog::backdrop { background:#020b08bd; backdrop-filter:blur(7px); }
.level-dialog-inner { padding:28px 30px 22px; text-align:center; }
#close-level { z-index:3; background:#0a1a1580; border:1px solid #537b5a55; }
.character-stage { position:relative; width:250px; height:238px; max-width:100%; margin:0 auto; display:grid; place-items:center; isolation:isolate; }
.character-halo { position:absolute; width:224px; height:224px; border:1px solid #c8df8a55; border-radius:50%; background:radial-gradient(circle,#b7e98c22,transparent 72%); box-shadow:0 0 0 12px #c8df8a06,0 0 0 25px #c8df8a04; }
#character-play { position:relative; display:block; width:188px; height:188px; padding:0; border:3px solid #dfca86; border-radius:50%; cursor:pointer; background:#bb9353; box-shadow:0 12px 32px #0007,inset 0 0 0 4px #f5e7b780; transform-origin:50% 85%; -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
#character-play:hover { border-color:#fff0b2; }
#character-play:focus-visible { outline:3px solid #85f2bb; outline-offset:7px; }
#character-portrait { display:block; width:100%; height:100%; border-radius:50%; background-image:url('/levels.png'); background-size:500% auto; background-repeat:no-repeat; }
.character-level { position:absolute; bottom:15px; left:50%; transform:translateX(-50%); background:#e7ce89; color:#1e2918; border:3px solid #1b3326; border-radius:20px; padding:2px 14px; font-size:13px; font-weight:800; letter-spacing:.04em; }
#character-particles { position:absolute; inset:0; pointer-events:none; z-index:3; }
.character-particle { position:absolute; top:48%; left:50%; color:#efdfa5; font-size:20px; filter:drop-shadow(0 2px 4px #142b14); }
#character-reaction { position:absolute; z-index:4; bottom:-23px; left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100vw - 72px); border:1px solid #92bc7d66; border-radius:14px 14px 14px 3px; padding:7px 13px; background:#e7efd5; color:#28432c; font-size:13px; font-weight:700; box-shadow:0 5px 15px #0003; }
.character-hint { margin:34px 0 18px; font-size:12px; color:#b7c7b2; }
.character-eyebrow { font-size:10px; letter-spacing:.19em; color:#a5bc96; }
#level-title { padding:0; margin-top:6px; font-size:32px; letter-spacing:-.04em; }
#level-description { margin:17px 0; font-size:18px; line-height:1.85; color:#e4e9de; text-wrap:pretty; min-height:3.7em; }
#level-cost { display:inline-block; margin:0 0 18px; padding:5px 13px; border-radius:20px; background:#a0d78b13; color:#bbdda4; font-size:13px; border:1px solid #8fbf7540; }
.character-dots { display:flex; justify-content:center; flex-wrap:wrap; gap:5px; margin:0 0 17px; }
.character-dots button { width:30px; height:30px; border:1px solid #456148; border-radius:50%; font:600 11px var(--sans); background:transparent; color:#b9c7b3; cursor:pointer; padding:0; }
.character-dots button[aria-pressed="true"] { background:#d8c58b; color:#1a2c20; border-color:#d8c58b; box-shadow:0 0 14px #dfd59833; }
.level-navigation { padding-top:15px; }
.level-navigation button { font-size:13px; padding:8px 10px; background:#183326; border-color:#426448; }
#level-dialog[data-animal="9"] { border-color:#d5b95e; background:radial-gradient(ellipse at 50% 12%,#56502b 0,#262b1c 43%,#111e16 80%); }
#level-dialog[data-animal="9"] .character-halo { box-shadow:0 0 45px #f6dd7133,0 0 0 12px #f5dc8a0b,0 0 0 25px #f5dc8a06; border-color:#e6c66e99; }
@media(max-width:700px) { .level-dialog-inner { padding:22px 20px 18px; } .character-stage { width:220px; height:210px; } #character-play { width:166px; height:166px; } .character-halo { width:196px; height:196px; } #level-description { font-size:17px; margin:14px 0; } #level-title { font-size:29px; } .character-hint { margin-bottom:14px; } .character-dots button { width:28px; height:28px; } }
@media(prefers-reduced-motion:reduce) { .animal, #character-play { transition:none; } .character-particle { display:none; } }

.character-eyebrow { justify-content:center; }
.character-dots button { min-width:32px; min-height:32px; }

/* Keep introduction and personal progress within one balanced header. */
.levels-page{padding-block:40px 64px}
.levels-hero{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:40px;align-items:center;margin-bottom:36px}
.levels-intro{min-width:0;padding-block:8px}
.levels-intro h1{font-size:clamp(36px,4.2vw,54px);line-height:1.18;letter-spacing:-.055em;margin:12px 0 18px;text-wrap:balance}
.levels-lead{font-size:18px;line-height:1.75;color:#e0ece5;margin:0 0 12px}
.levels-description{font-size:15px;line-height:1.8;color:var(--muted);margin:0}
.levels-actions{display:flex;align-items:center;flex-wrap:wrap;gap:16px 22px;margin-top:24px}
.levels-actions .button{font-size:14px;min-height:44px;padding:10px 16px}
.levels-actions .text-link{font-size:14px;white-space:nowrap}
.mobile-line{display:none}
.levels-page .level-growth-card{min-width:0;padding:24px;border-radius:16px;background:linear-gradient(145deg,#17362a,#0f241b);border-color:#39614c;box-shadow:0 12px 40px #0002}
.levels-page .level-growth-card h2{font-size:19px;line-height:1.4;margin:0}
.levels-page .member-rank{margin-top:12px;font-size:16px}
.levels-page .leaf-total{font-size:38px!important;margin-top:12px!important}
.levels-page .growth-caption{margin-bottom:10px!important}
.levels-page .next-rank{margin-top:14px;font-size:15px}
.levels-page .growth-guide-link{margin-top:12px}
.levels-page .leaf-history{margin-top:14px;padding-top:12px}
.levels-gallery-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.levels-gallery-heading h2{font-size:21px;letter-spacing:-.035em;margin:0}
.levels-gallery-heading p{font-size:14px;color:var(--muted);margin:0}
.levels-page .animal-scene{border-radius:16px}
.levels-page .growth-rules{margin-top:40px;padding-top:30px;border-top:1px solid var(--stroke)}
.levels-page .growth-rules>h2{font-size:30px;line-height:1.35}
.levels-page .growth-rules>.growth-intro{max-width:880px;font-size:16px;line-height:1.8}
.levels-page .growth-tables{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
@media(max-width:900px){.levels-hero{grid-template-columns:minmax(0,1fr) 280px;gap:24px}.levels-intro h1{font-size:40px}.levels-lead{font-size:16px}.levels-description{font-size:14px}.levels-page .level-growth-card{padding:20px}.levels-gallery-heading{align-items:flex-start;flex-direction:column;gap:4px}}
@media(max-width:700px){.levels-page{padding-block:28px 40px}.levels-hero{grid-template-columns:minmax(0,1fr);gap:24px;margin-bottom:28px}.levels-intro{padding:0}.levels-intro h1{font-size:38px;margin:10px 0 14px}.levels-lead{font-size:16px}.mobile-line{display:block}.levels-actions{gap:14px 18px;margin-top:20px}.levels-page .level-growth-card{padding:20px}.levels-page .level-growth-card .leaf-total{margin-top:8px!important}.levels-gallery-heading h2{font-size:20px}.levels-gallery-heading p{font-size:14px}.levels-page .growth-tables{grid-template-columns:minmax(0,1fr);gap:24px}.levels-page .growth-rules{margin-top:30px;padding-top:24px}.levels-page .growth-rules>h2{font-size:26px}.levels-page .growth-details{padding:18px}.levels-page .growth-table{font-size:14px}}
@media(max-width:360px){.levels-intro h1{font-size:34px}.levels-actions{align-items:flex-start;flex-direction:column}}

/* Use the card's width for a compact summary rather than a tall list. */
.levels-page .level-growth-card{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px;row-gap:10px;align-content:start}
.levels-page .level-growth-card h2{grid-column:1;grid-row:1;font-size:18px}
.levels-page .level-growth-card .member-rank{grid-column:2;grid-row:1;align-self:center;margin:0;font-size:14px}
.levels-page .level-growth-card .leaf-total{grid-column:1;grid-row:2;margin:2px 0 0!important}
.levels-page .level-growth-card>.growth-caption{grid-column:2;grid-row:2;align-self:center;text-align:right;margin:0!important;font-size:13px}
.levels-page .level-growth-card .next-rank{grid-column:1/-1;margin:4px 0 0}
.levels-page .level-growth-card .growth-progress{grid-column:1/-1;margin:0}
.levels-page .level-growth-card .growth-guide-link{grid-column:1/-1;margin-top:2px}
.levels-page .level-growth-card .leaf-history{grid-column:1/-1;margin-top:2px;padding-top:10px}
.levels-page .level-growth-card>.button{grid-column:1/-1;font-size:14px;text-align:center}
.levels-intro h1{font-size:clamp(36px,3.8vw,48px)}
@media(max-width:700px){.levels-intro h1{font-size:36px;max-width:340px}.levels-page .level-growth-card{row-gap:10px}.levels-page .level-growth-card .leaf-total{font-size:34px!important}}
@media(max-width:360px){.levels-intro h1{font-size:32px}.levels-page .level-growth-card{padding:18px}.levels-page .level-growth-card h2{font-size:16px}.levels-page .level-growth-card .member-rank{font-size:13px}}
.levels-page .level-growth-card:not(:has(.member-rank)){display:block}
.levels-page .level-growth-card:not(:has(.member-rank))>.growth-caption{text-align:left;margin:12px 0 18px!important;font-size:15px}
.levels-page .level-growth-card>.growth-caption~.growth-caption{grid-column:1/-1;grid-row:auto;text-align:left}
