:root{font-family:system-ui,'Microsoft YaHei',sans-serif;color:#31516a;background:#dff5ff}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:linear-gradient(#c9efff,#eefbff 70%,#bde7c6)}.balloon-game{max-width:980px;min-height:100vh;margin:auto;padding:18px 22px;position:relative;overflow:hidden}header{text-align:center;position:relative;z-index:2}header a{display:block;text-align:left;color:#4e7890;text-decoration:none;font-weight:700}.eyebrow{margin:12px 0 2px;color:#66a1b8;letter-spacing:3px;font-size:11px;font-weight:800}h1{margin:0;color:#28627b;font-size:clamp(34px,6vw,58px);text-shadow:0 3px #fff;font-weight:900}.hint{margin:8px 0;color:#5c8292;font-size:14px}.topbar{display:flex;justify-content:center;gap:38px;align-items:center;margin:12px auto 0;padding:10px 16px;max-width:600px;border-radius:16px;background:#ffffffa8;color:#47758a;font-weight:700;position:relative;z-index:3}.topbar b{color:#23657c;font-size:20px}.topbar select{border:1px solid #a6d3e1;border-radius:9px;background:#fff;padding:7px;color:#356c80;font:inherit}.sky{position:absolute;inset:160px 8px 205px;overflow:hidden}.balloon{position:absolute;bottom:-90px;width:clamp(72px,11vw,108px);height:clamp(90px,14vw,132px);border:0;border-radius:49% 49% 45% 45%;background:linear-gradient(135deg,#fff6,transparent 42%),var(--c);box-shadow:inset -12px -15px 20px #47362a2a,inset 7px 6px 13px #fff9,0 7px 0 color-mix(in srgb,var(--c),#555 25%),0 12px 16px #46748a29;color:#fff;font-weight:900;font-size:clamp(14px,2.1vw,23px);line-height:1.15;padding:8px;cursor:pointer;text-shadow:0 2px 3px #31526370;animation:float var(--duration) linear infinite;animation-delay:var(--delay);transition:filter .15s,transform .15s}.balloon:after{content:'';position:absolute;bottom:-14px;left:calc(50% - 6px);border:6px solid transparent;border-top:10px solid var(--c)}.balloon:hover,.balloon:focus-visible{filter:brightness(1.12);transform:scale(1.08);outline:3px solid #fff;outline-offset:3px}.balloon.hit{animation:pop .35s forwards;pointer-events:none}.launcher{position:absolute;bottom:22px;left:50%;translate:-50%;width:min(94%,430px);text-align:center;z-index:4}.meaning{display:inline-block;min-width:190px;padding:11px 22px;border-radius:18px;background:#fff8d9;border:3px solid #e9c36e;box-shadow:0 5px #c99e4c;color:#765220;font-size:clamp(17px,4vw,25px);font-weight:900}.bow{height:83px;position:relative;margin:4px auto}.bow-arm{position:absolute;top:4px;width:62px;height:72px;border:8px solid #a46638;border-top:0;border-radius:0 0 55px 55px}.bow-arm.left{left:calc(50% - 64px);transform:rotate(24deg);border-right:0}.bow-arm.right{right:calc(50% - 64px);transform:rotate(-24deg);border-left:0}.string{position:absolute;left:50%;top:5px;height:70px;border-left:2px solid #6c5435;transform:translateX(-50%)}.arrow{position:absolute;left:50%;top:27px;transform:translateX(-50%) rotate(-90deg);font-size:58px;color:#4f3425;text-shadow:0 3px #fff}.launcher p{margin:0;color:#487d8b;font-size:12px;font-weight:700}.message{text-align:center;color:#397487;font-weight:800;min-height:21px;position:absolute;bottom:4px;left:0;right:0}.modal{position:absolute;z-index:8;inset:0;display:grid;place-content:center;justify-items:center;text-align:center;background:#eafaffeb;backdrop-filter:blur(5px)}.modal[hidden]{display:none}.modal>div{font-size:72px}.modal h2{font-size:38px;margin:10px;color:#28627b}.modal p{color:#547d8b}.modal button{border:0;border-radius:15px;padding:15px 32px;background:#f4b84f;box-shadow:0 6px #ca8830;color:#553713;font:800 19px inherit;cursor:pointer}footer{text-align:center;color:#5f8c8c;font-size:11px;margin-top:6px}@keyframes float{0%{translate:0 0;bottom:-100px}25%{translate:var(--sway) -25vh}50%{translate:calc(var(--sway) * -1) -50vh}75%{translate:var(--sway) -75vh}100%{translate:0 -125vh;bottom:0}}@keyframes pop{to{scale:1.4;opacity:0;filter:brightness(1.8)}}@media(max-width:600px){.balloon-game{padding:13px 12px}.hint{font-size:12px}.topbar{gap:15px;font-size:12px}.sky{inset:145px 0 190px}.launcher{bottom:19px}.balloon{width:76px;height:94px;font-size:14px}.message{bottom:2px}}

/* Keep every balloon inside the play area after its initial ascent. */
#sky{position:relative;height:clamp(340px,53svh,590px);overflow:hidden;margin:12px 0 0}.balloon-game{padding-bottom:18px}.balloon{top:0;left:0;bottom:auto;animation:none;font-size:clamp(16px,2vw,22px);overflow-wrap:anywhere;will-change:transform}.balloon.hit{animation:pop .35s forwards}.launcher{position:relative;bottom:auto;left:auto;translate:none;margin:14px auto 20px}.launcher .arrow{transform:translateX(-50%);top:-5px;font-size:65px}.launcher .arrow:after{content:''}.flying-arrow{position:fixed;z-index:20;pointer-events:none;color:#654020;font:bold 64px/1 Georgia;text-shadow:1px 1px #fff}.message{position:relative;bottom:auto;min-height:30px;line-height:1.6;padding:0 12px}.topbar{gap:22px}.modal{position:fixed}.balloon-game footer{margin:8px} @media(max-width:600px){#sky{height:clamp(320px,48svh,470px)}.balloon{width:88px;height:108px;font-size:16px}.launcher{bottom:auto;margin-top:10px}.topbar{gap:14px}.hint{line-height:1.6}.message{bottom:auto}}


/* Expanded arena and smaller targets, shared by touch and desktop. */
.balloon-game{max-width:1280px;padding:12px 16px 16px}.eyebrow{margin:6px 0 0;font-size:10px}h1{font-size:clamp(28px,4vw,42px)}.hint{margin:5px 0;font-size:12px}.topbar{margin-top:8px;padding:7px 12px}#sky{height:max(420px,66svh);margin:6px -6px 0;border-radius:20px;background:radial-gradient(ellipse at 25% 20%,#ffffff50,transparent 55%)}.balloon{width:112px;height:100px;font-size:16px;padding:6px 10px;border-radius:50%;transition:filter .15s;box-shadow:inset -7px -9px 13px #47362a2a,inset 5px 4px 10px #fff9,0 4px 0 color-mix(in srgb,var(--c),#555 25%),0 7px 9px #46748a20}.balloon:hover{transform:none}.balloon:after{bottom:-10px;border-top-width:7px}.balloon.long-word{width:112px;height:100px;border-radius:50%;padding:8px 10px}.launcher{margin:8px auto 4px}.meaning{font-family:inherit;cursor:pointer;touch-action:manipulation;font-size:clamp(17px,3vw,22px);padding:9px 18px;max-width:95%}.meaning:focus-visible{outline:3px solid #28627b;outline-offset:4px}.meaning:hover{background:#fff1ba}.bow{height:58px;scale:.75;margin:0 auto}.launcher p{font-size:11px}.message{font-size:12px;min-height:24px}.balloon-game footer{margin-top:2px}@media(max-width:600px){.balloon-game{padding:10px 10px 12px}header a{font-size:12px}.eyebrow{display:none}h1{font-size:29px;margin-top:5px}.topbar{gap:16px;font-size:11px}.topbar b{font-size:17px}.topbar select{padding:5px}#sky{height:max(400px,64svh);margin-top:6px}.balloon{width:96px;height:86px;font-size:14px;padding:5px 8px;border-radius:50%}.balloon.long-word{width:96px;height:86px;padding:6px 8px}.launcher{margin-top:6px}.meaning{min-width:160px}.launcher p{font-size:10px}}

/* Category watermark: soft blue lettering behind every balloon. */
#sky{isolation:isolate}
#sky::before,#sky::after{position:absolute;left:50%;width:90%;transform:translate(-50%,-50%);text-align:center;pointer-events:none;user-select:none;z-index:-1;overflow-wrap:anywhere;font-weight:900;line-height:1.35;color:rgba(58,131,159,.16);text-shadow:0 2px 0 rgba(255,255,255,.55);letter-spacing:.08em}
#sky::before{content:attr(data-category-title);top:44%;font-size:clamp(38px,8vw,100px)}
#sky::after{content:attr(data-category-edition);top:calc(44% + 82px);font-size:clamp(20px,3.4vw,42px);letter-spacing:.03em;color:rgba(58,131,159,.18)}
@media(max-width:600px){#sky::before{font-size:clamp(32px,10vw,58px)}#sky::after{top:calc(44% + 54px);font-size:clamp(17px,5vw,28px)}}

.level-picker{border:1px solid #a6d3e1;border-radius:9px;background:#fff;padding:7px 12px;color:#356c80;font:inherit;font-weight:700;cursor:pointer}.level-modal{position:fixed;inset:0;z-index:30;display:grid;place-items:center;background:#183b4d88;padding:18px}.level-modal[hidden]{display:none}.level-dialog{position:relative;width:min(760px,100%);max-height:88svh;overflow:auto;background:#f8ffff;border-radius:24px;padding:26px;box-shadow:0 20px 70px #173d4d66}.level-dialog h2{margin:0;color:#28627b;text-align:center;font-size:28px}.level-dialog p{text-align:center;color:#648693;margin:6px 0 18px}.level-close{position:absolute;right:14px;top:10px;border:0;background:transparent;color:#47758a;font-size:30px;cursor:pointer}.level-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:14px}.level-card{position:relative;border:0;border-radius:18px;padding:8px;background:#fff;box-shadow:0 5px 0 #b8d4dc,0 8px 18px #46748a22;color:#28627b;font:900 16px system-ui;cursor:pointer}.level-card:hover,.level-card.current{transform:translateY(-3px);box-shadow:0 7px 0 #8fbcc9,0 12px 20px #46748a33}.level-card-art{height:72px;border-radius:14px;background:linear-gradient(145deg,#bceeff,#fff0b5);display:grid;place-items:center;font-size:38px;margin-bottom:7px}.level-card:nth-child(3n) .level-card-art{background:linear-gradient(145deg,#ffd4d8,#d5c8ff)}.level-card:nth-child(3n+1) .level-card-art{background:linear-gradient(145deg,#c8f1d8,#bde5ff)}.level-check{position:absolute;right:7px;top:7px;width:25px;height:25px;border-radius:50%;background:#4caf79;color:#fff;display:grid;place-items:center;font-size:16px}.level-card.locked{opacity:.5;cursor:default}@media(max-width:600px){.level-dialog{padding:22px 14px}.level-grid{grid-template-columns:repeat(3,1fr);gap:10px}.level-card{font-size:13px;padding:6px}.level-card-art{height:58px;font-size:30px}}
.level-card.incomplete .level-card-art{filter:grayscale(1);opacity:.58}.level-card.completed .level-card-art{filter:none;opacity:1}.level-card.completed{box-shadow:0 5px 0 #8bc89f,0 8px 18px #46748a22}

/* Compact category controls with multiline edition names. */
.topbar{gap:12px;max-width:720px;flex-wrap:wrap}
.category-control{position:relative;display:flex;align-items:center;justify-content:center;min-height:48px;min-width:76px;max-width:240px;border:1px solid #a6d3e1;border-radius:10px;background:#fff;padding:6px 25px 6px 12px;text-align:center}
.category-control::after{content:'▾';position:absolute;right:8px;pointer-events:none;color:#47758a}
.category-caption{display:flex;flex-direction:column;line-height:1.45;overflow-wrap:anywhere;pointer-events:none}
.category-caption small{font-size:.85em;font-weight:600}
.topbar .category-control select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.category-control:focus-within{outline:2px solid #28627b;outline-offset:2px}
.category-control[hidden]{display:none}
.level-stats{display:flex;flex-direction:column;gap:2px;white-space:nowrap;line-height:1.3}
@media(max-width:600px){.topbar{gap:7px;padding:7px}.category-control{min-width:56px;max-width:160px;min-height:46px;padding:5px 20px 5px 7px}.secondary-control{flex:1;min-width:94px}.level-picker{padding:7px}.level-stats{font-size:11px}.level-stats b{font-size:16px}}

/* Game-themed picker buttons and dialogs. */
.topbar{padding:10px;gap:10px;background:#ffffffb3;box-shadow:0 4px 0 #b5dbe659}.picker-button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:52px;border:1px solid #b1d8e6;border-radius:14px;background:linear-gradient(#fff,#edf8fd);box-shadow:0 4px 0 #b4d6e2;color:#356c80;font:800 14px system-ui,'Microsoft YaHei',sans-serif;cursor:pointer;touch-action:manipulation;transition:background .15s,box-shadow .15s}.picker-button:hover{background:#e8f7ff}.picker-button:active{box-shadow:0 2px 0 #b4d6e2}.picker-button:focus-visible{outline:3px solid #438aa7;outline-offset:3px}.picker-icon{font-size:22px;color:#68a4be;line-height:1}.category-control{padding:7px 25px 7px 12px;max-width:260px}.category-control::after{font-size:12px}.category-caption{font-size:14px;line-height:1.35}.category-caption small{font-size:11px;margin-top:2px}.level-picker{padding:7px 13px;background:linear-gradient(#fff6d6,#ffedb2);border-color:#ebcf87;box-shadow:0 4px 0 #d5b56d;color:#826029}.level-picker .picker-icon{color:#bd903c}.level-picker:hover{background:#fff0bc}.level-picker:active{box-shadow:0 2px 0 #d5b56d}.picker-open{overflow:hidden}.level-modal{padding:18px;background:#244f6580;backdrop-filter:blur(7px);overscroll-behavior:contain}.level-dialog{background:linear-gradient(160deg,#f6fdff,#e6f5fc);border:2px solid #ffffffd9;box-shadow:0 8px 0 #93bfce,0 24px 75px #173d4d55;padding:25px;scrollbar-width:thin;overscroll-behavior:contain}.dialog-emblem{text-align:center;font-size:36px;line-height:1.4;color:#77bad5}.level-dialog h2{font-size:26px;text-shadow:0 2px #fff}.level-close{width:38px;height:38px;border-radius:50%;background:#fff9;font-size:28px;line-height:1}.level-close:hover{background:#d6edf7}.category-dialog{width:min(620px,100%)}.category-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:20px 0 10px}.category-option{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:135px;padding:18px 20px;border:2px solid #c9e3ed;border-radius:20px;background:#ffffffd9;box-shadow:0 5px 0 #bcd7e1;color:#356c80;font:inherit;cursor:pointer;touch-action:manipulation}.category-option:hover{background:#edfaff;border-color:#8dc4d7}.category-option.selected{background:linear-gradient(135deg,#e1f5ff,#d3efef);border-color:#69b3c9;box-shadow:0 5px 0 #8cbacb}.category-option-icon{font-size:34px;line-height:1.2}.category-option-copy{text-align:center;overflow-wrap:anywhere;max-width:100%}.category-option-copy strong{display:block;font-size:18px;line-height:1.4}.category-option-copy small{display:block;margin-top:4px;font-size:13px;line-height:1.4;color:#7393a0}.category-option-check{position:absolute;right:10px;top:10px;font-size:14px;color:white}.category-option.selected .category-option-check{display:grid;place-items:center;width:23px;height:23px;border-radius:50%;background:#58ac94}.category-option:focus-visible,.level-card:focus-visible,.level-close:focus-visible{outline:3px solid #438aa7;outline-offset:3px}
@media(max-width:600px){.topbar{gap:7px;padding:8px 6px}.picker-button{font-size:12px;gap:5px;min-height:50px}.picker-icon{font-size:17px}.category-control{padding:6px 18px 6px 7px;min-width:58px}.category-control::after{right:5px}.category-caption{font-size:12px}.category-caption small{font-size:10px}.secondary-control{min-width:94px;max-width:none}.level-picker{padding:7px 8px}.level-picker .picker-icon{display:none}.level-modal{padding:14px}.level-dialog{padding:22px 15px;max-height:86svh;border-radius:24px}.level-dialog p{font-size:13px;margin-bottom:14px}.category-grid{gap:12px}.category-option{min-height:125px;padding:17px 12px}.category-option-copy strong{font-size:17px}.category-option-copy small{font-size:12px}}

/* One category per row, shared by category and grade pickers. */
.category-grid{grid-template-columns:minmax(0,1fr);gap:12px;margin:18px 0 8px}
.category-option{flex-direction:row;justify-content:flex-start;gap:16px;min-height:82px;padding:16px 52px 16px 18px;border-radius:17px;text-align:left}
.category-option-icon{display:grid;place-items:center;flex-shrink:0;width:48px;height:48px;border-radius:14px;background:#eaf6fc;font-size:29px}
.category-option.selected .category-option-icon{background:#ffffff9c}
.category-option-copy{flex:1;min-width:0;text-align:left}
.category-option-copy strong{font-size:18px}
.category-option-copy small{margin-top:3px;font-size:13px}
.category-option-check{right:18px;top:50%;transform:translateY(-50%)}
@media(max-width:600px){.category-grid{gap:10px}.category-option{min-height:76px;padding:13px 46px 13px 14px;gap:13px;border-radius:16px}.category-option-icon{width:32px;height:42px;border-radius:2px;font-size:26px}.category-option-copy strong{font-size:17px}.category-option-copy small{font-size:12px}.category-option-check{right:14px}}

header::after{content:'';display:block;clear:both}.speech-toggle{float:left;position:relative;display:inline-grid;grid-template-columns:1fr 1fr;align-items:center;width:158px;height:32px;margin:0 12px 8px 0;padding:3px;border:1px solid #aacdd9;border-radius:999px;background:#deedf2;color:#738792;font:700 11px system-ui,'Microsoft YaHei',sans-serif;cursor:pointer;isolation:isolate}.speech-toggle-thumb{position:absolute;top:3px;bottom:3px;left:3px;width:calc(50% - 3px);border-radius:999px;background:#fff;box-shadow:0 2px 5px #46687925;transition:transform .2s;z-index:-1}.speech-toggle[aria-checked=false] .speech-toggle-thumb{transform:translateX(100%)}.speech-toggle[aria-checked=true] .speech-on{color:#34795e}.speech-toggle[aria-checked=false] .speech-off{color:#5c7180}.speech-toggle:focus-visible{outline:3px solid #438aa7;outline-offset:3px}@media(max-width:600px){.speech-toggle{width:140px;height:30px;font-size:10px;margin-right:8px}}@media(prefers-reduced-motion:reduce){.speech-toggle-thumb{transition:none}}
header .eyebrow{clear:both}

header{position:relative;padding-top:42px}header .speech-toggle{position:absolute;top:0;left:0;float:none;margin:0}header .member-corner{position:absolute;top:0;right:0;display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 9px;border-radius:999px;background:#ffffff85;color:inherit;text-decoration:none;font-size:12px;font-weight:700;line-height:1;float:none}header .member-corner svg{flex:none}header h1{text-align:center;width:100%;margin-left:auto;margin-right:auto}header .eyebrow{clear:both}@media(max-width:600px){header{padding-top:39px}header .member-corner{height:30px;font-size:11px;gap:4px;padding:0 7px}}

/* Membership benefits dialog, shared by both games. */
.membership-dialog{--member-ink:#28627b;--member-muted:#648693;--member-border:#bbdce8;--member-paper:#e6f5fc;--member-shadow:#93bfce;--member-accent:#cfeef8;width:min(420px,calc(100% - 32px));max-height:85svh;overflow:auto;padding:30px 26px 25px;border:2px solid #ffffffdf;border-radius:26px;background:linear-gradient(150deg,#fbfeff,var(--member-paper));box-shadow:0 7px 0 var(--member-shadow),0 24px 75px #173d4d40;color:var(--member-ink);text-align:center;font-family:system-ui,'Microsoft YaHei',sans-serif}
.membership-dialog::backdrop{background:#244f657a;backdrop-filter:blur(6px)}body:has(.membership-dialog[open]){overflow:hidden}.membership-dialog.membership-warm{--member-ink:#795b2c;--member-muted:#947749;--member-border:#e8d3a2;--member-paper:#fff0cc;--member-shadow:#c9aa66;--member-accent:#ffedbc}.membership-warm::backdrop{background:#503c3270}.membership-emblem{display:grid;place-items:center;width:64px;height:64px;margin:2px auto 15px;border-radius:22px;background:linear-gradient(140deg,#fff,var(--member-accent));border:1px solid var(--member-border);box-shadow:0 4px 0 var(--member-border);color:#c49942;font-size:38px}.membership-dialog h2{margin:0;font-size:26px;line-height:1.4;color:var(--member-ink);text-shadow:0 2px #fff}.membership-subtitle{margin:8px 0 18px;font-size:13px;color:var(--member-muted);line-height:1.6}.membership-dialog .membership-message{margin:0 0 22px;padding:15px 16px;border:1px solid var(--member-border);border-radius:16px;background:#ffffff91;color:var(--member-ink);font-size:14px;line-height:1.9;text-align:left;overflow-wrap:anywhere}.membership-actions{display:grid;gap:12px}.membership-primary,.membership-secondary{display:block;width:100%;box-sizing:border-box;border-radius:13px;padding:12px 14px;font:800 14px/1.5 system-ui,'Microsoft YaHei',sans-serif;text-align:center;text-decoration:none;cursor:pointer}.membership-primary{border:1px solid #e6bd65;background:linear-gradient(#ffdc8e,#f3bf5b);box-shadow:0 4px #cf9e45;color:#70501f}.membership-secondary{border:1px solid var(--member-border);background:#ffffff80;color:var(--member-muted)}.membership-dismiss{position:absolute;top:11px;right:12px;width:34px;height:34px;border:0;border-radius:50%;background:#ffffff9c;color:var(--member-muted);font:26px/1 system-ui;cursor:pointer}.membership-primary:hover{filter:brightness(1.04)}.membership-secondary:hover,.membership-dismiss:hover{background:#fff}.membership-dialog :focus-visible{outline:3px solid var(--member-ink);outline-offset:3px}@media(max-width:600px){.membership-dialog{padding:26px 20px 22px}.membership-dialog h2{font-size:24px}}

.level-card.incomplete{background:#dce2e8;color:#7a8792;box-shadow:0 5px #b7c0ca}.level-card.incomplete .level-card-art{background:#cbd4dd;filter:saturate(.25)}.level-card.completed{background:#ecfae9;color:#3e7754}.level-card.completed .level-card-art{background:linear-gradient(145deg,#c7efcc,#bce7df)}

/* Rounded balloon silhouette, keeping the existing target widths and palette. */
.balloon,.balloon.long-word{width:112px;height:132px;border-radius:50% 50% 48% 48% / 44% 44% 56% 56%;display:flex;align-items:center;justify-content:center;text-align:center;overflow:visible;padding:12px 10px;border:1px solid color-mix(in srgb,var(--c),#735c32 18%);background:radial-gradient(ellipse at 34% 20%,#ffffff66,transparent 52%),var(--c);box-shadow:inset 4px 3px 7px #ffffff70,inset -6px -7px 10px #5d542d20,0 3px 5px #46748a12}
.balloon::before{content:'';position:absolute;top:11%;left:17%;width:29%;height:11%;border-radius:50%;transform:rotate(-36deg);background:linear-gradient(180deg,#fffffff2,#ffffff9c);box-shadow:0 0 3px #ffffff70;pointer-events:none}
.balloon::after{content:'';position:absolute;top:calc(100% - 1px);bottom:auto;left:calc(50% - 8px);width:16px;height:12px;border:0;border-radius:0 0 4px 4px;clip-path:polygon(35% 0,65% 0,100% 78%,76% 100%,24% 100%,0 78%);background:linear-gradient(90deg,#ffffff38,#0000000c),var(--c);box-shadow:inset 0 -2px 0 #735c3220;pointer-events:none}
.balloon-string{position:absolute;top:calc(100% + 10px);left:calc(50% - 9px);width:18px;height:29px;display:block;color:color-mix(in srgb,var(--c),#76643d 24%);pointer-events:none}
.balloon-string svg{display:block;width:100%;height:100%;overflow:visible}
@media(max-width:600px){.balloon,.balloon.long-word{width:96px;height:114px;padding:10px 8px}.balloon-string{height:25px}}

/* Slim reference-style arrow: narrow shaft, pointed head and separated red feathers. */
.arrow,.flying-arrow{position:relative;display:block;width:18px;height:92px;transform-origin:50% 50%;font-size:0;color:transparent;text-shadow:none}
.arrow{left:50%;top:-4px;transform:translateX(-50%)}
.arrow-shaft{position:absolute;left:7px;top:18px;width:4px;height:61px;border-radius:3px;background:linear-gradient(90deg,#ffad24 0%,#ff7b0d 54%,#dc4b0d 100%);box-shadow:inset 1px 0 #ffd968,1px 1px 2px #743b1d35}
.arrow-shaft::after{content:'';position:absolute;left:1px;top:3px;width:1px;height:52px;border-radius:2px;background:#ffe68cbb}
.arrow-head{position:absolute;left:1px;top:0;width:16px;height:25px;border-radius:48% 48% 40% 40%;background:linear-gradient(135deg,#697486 0%,#343b4c 64%,#252938 100%);clip-path:polygon(50% 0,100% 73%,82% 100%,18% 100%,0 73%);box-shadow:inset 3px 2px #a5adba42,0 2px 3px #25304445}
.arrow-fletching{position:absolute;left:7px;bottom:1px;width:4px;height:17px;border-radius:2px;background:#c91820;box-shadow:0 0 1px #87121a}
.arrow-fletching::before,.arrow-fletching::after{content:'';position:absolute;width:13px;height:4px;border-radius:8px 2px 8px 2px;background:linear-gradient(135deg,#ff4939,#d9151e 72%);box-shadow:inset 2px 1px #ff9a7a55}
.arrow-fletching::before{right:1px;top:1px;transform:rotate(-28deg);transform-origin:right center;clip-path:polygon(0 50%,100% 0,74% 100%)}
.arrow-fletching::after{left:1px;top:8px;transform:rotate(28deg);transform-origin:left center;clip-path:polygon(0 0,100% 50%,0 100%)}
.flying-arrow{position:fixed;z-index:20;pointer-events:none;width:20px;height:108px;transform-origin:50% 50%;filter:drop-shadow(0 3px 3px #46321f35)}
.flying-arrow .arrow-shaft{left:8px;top:22px;width:5px;height:72px}.flying-arrow .arrow-head{left:1px;top:0;width:18px;height:29px}.flying-arrow .arrow-fletching{left:8px;bottom:1px}
@media(max-width:600px){.arrow{scale:.82}.flying-arrow{scale:.84}}

.category-option-icon{overflow:hidden}.category-option-icon img{width:100%;height:100%;object-fit:cover}

.category-cover-header{display:grid;justify-items:center;gap:12px;margin:20px 0;color:#356c80;text-align:center}
.category-cover-zoom{position:relative;display:block;width:min(320px,100%);padding:0;border:2px solid #fff;border-radius:16px;overflow:hidden;background:#eaf6fc;cursor:zoom-in;box-shadow:0 4px 16px #356c8020}
.category-cover-zoom img{display:block;width:100%;height:180px;object-fit:contain}
.category-cover-zoom span{display:block;padding:6px;background:#fff;color:#7393a0;font-size:12px}
.category-cover-header strong{font-size:18px;overflow-wrap:anywhere}
.secondary-category-grid{grid-template-columns:minmax(0,1fr)}
.secondary-category-row{display:flex;align-items:center;gap:12px;min-width:0}
.secondary-category-row .category-option{flex:1;min-width:0}
.category-confirm{flex-shrink:0;padding:13px 15px;border:0;border-radius:12px;background:#58ac94;color:#fff;font:700 14px system-ui;cursor:pointer}
.category-confirm:focus-visible,.category-cover-zoom:focus-visible{outline:3px solid #438aa7;outline-offset:3px}
.category-image-dialog{width:fit-content;max-width:94vw;max-height:94dvh;padding:44px 12px 12px;border:0;border-radius:16px;background:#f6fdff;box-shadow:0 20px 80px #173d4d66}
.category-image-dialog::backdrop{background:#173d4dcc}
.category-image-dialog>img{display:block;max-width:88vw;max-height:calc(90dvh - 60px);object-fit:contain}
#closeCategoryImage{position:absolute;right:8px;top:4px;width:36px;height:36px;border:0;border-radius:50%;background:#eaf6fc;color:#356c80;font-size:26px;cursor:pointer}
@media(max-width:600px){.secondary-category-row{gap:8px}.category-confirm{padding:12px 10px;font-size:13px}.category-cover-zoom img{height:160px}.secondary-category-row .category-option{padding-right:34px}}

/* Secondary library picker: fixed cover and independently scrolling list. */
.secondary-picker .category-dialog{display:flex;flex-direction:column;height:min(760px,88svh);max-height:88svh;overflow:hidden;padding:22px 0 0}
.secondary-picker .dialog-emblem,.secondary-picker #categoryDialogTitle,.secondary-picker #categoryDialogHint,.secondary-picker #categoryCoverName{display:none}
.secondary-picker .level-close{z-index:2;top:8px;right:8px;background:transparent;color:#258e90}
.secondary-picker .category-cover-header{flex:0 0 auto;margin:0;position:relative;padding:0 42px 14px;gap:0;border-bottom:0;box-shadow:none}
.secondary-picker .category-cover-zoom{width:100%;border-radius:20px;background:#eaf6fc;box-shadow:0 8px 18px #356c8014}
.secondary-picker .category-cover-zoom img{height:clamp(150px,27svh,240px);width:100%;object-fit:contain}
.secondary-picker .category-cover-zoom:disabled{cursor:default;min-height:180px}
.secondary-picker .category-cover-zoom:disabled span{visibility:hidden}
.secondary-picker .category-cover-zoom span{padding:8px;font-size:14px}
.secondary-picker .secondary-category-grid{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;margin:0;padding:14px 18px 18px;align-content:start;gap:12px;scroll-padding:14px 0}
.secondary-picker .secondary-category-row{position:relative;display:flex;gap:0;flex-shrink:0;border:2px solid #c9e3ed;border-radius:20px;background:#ffffffd9;box-shadow:0 5px 0 #bcd7e1;min-height:94px}
.secondary-picker .secondary-category-row.selected{background:linear-gradient(135deg,#e1f5ff,#d3efef);border-color:#69b3c9;outline:2px solid #398fa9;outline-offset:3px}
.secondary-picker .secondary-category-row .category-option{border:0;box-shadow:none;background:transparent;min-height:90px;padding:16px 18px;justify-content:flex-start;border-radius:18px}
.secondary-picker .secondary-category-row.selected .category-option{padding-right:116px}
.secondary-picker .category-option-copy{text-align:left}
.secondary-picker .category-option-check{display:none}
.secondary-picker .category-confirm{position:absolute;right:16px;top:50%;transform:translateY(-50%);padding:13px 14px;border:0;border-radius:12px;background:linear-gradient(145deg,#58b49f,#379a89);color:#fff;font-weight:750;letter-spacing:.3px;box-shadow:0 3px 7px #338f8026;transition:background .15s,box-shadow .15s}
.category-image-dialog{max-height:94svh;overflow:auto;text-align:center}
.category-image-dialog>img{max-height:calc(90svh - 130px);margin:0 auto}
.category-image-confirm{display:block;width:min(320px,100%);margin:16px auto 2px;padding:15px 24px;border:2px solid #399b87;border-radius:14px;background:#58ac94;color:#fff;font:700 17px system-ui;cursor:pointer;box-shadow:0 4px 0 #368c7b}
.category-image-confirm:focus-visible{outline:3px solid #438aa7;outline-offset:3px}
@media(max-width:600px){.secondary-picker .category-dialog{height:88svh;max-height:88svh;padding-top:22px}.secondary-picker .category-cover-header{padding:0 34px 12px}.secondary-picker .secondary-category-grid{padding:14px 16px 18px}.secondary-picker .secondary-category-row .category-option{padding:14px 6px;gap:14px}.secondary-picker .secondary-category-row.selected .category-option{padding-right:106px}.secondary-picker .category-confirm{right:14px;padding:13px 11px}.secondary-picker .category-option-copy strong{font-size:18px}}
@media(max-height:520px){.secondary-picker .category-cover-zoom img{height:100px}.secondary-picker .category-cover-zoom:disabled{min-height:100px}.secondary-picker .category-cover-header{padding-bottom:10px}.secondary-picker .secondary-category-grid{padding-top:12px}}

/* Preserve hidden state even when component layouts declare display. */
#categoryModal [hidden]{display:none!important}
#categoryModal:not(.secondary-picker) #categoryCoverHeader{display:none!important}

.secondary-picker .category-cover-header::after{content:'';position:absolute;left:7%;right:7%;bottom:0;height:2px;border-radius:99px;background:linear-gradient(90deg,transparent,#a7cbd7 25%,#85b6c5 50%,#a7cbd7 75%,transparent)}
.secondary-picker .category-confirm:hover{background:linear-gradient(145deg,#4da992,#2f8b7c);box-shadow:0 4px 10px #338f8033}
.secondary-picker .category-confirm:active{box-shadow:0 1px 3px #338f8026}

.category-option-heading{display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.category-word-count{font-size:11px;font-weight:400;line-height:1.4;color:#7393a0;white-space:nowrap}

.secondary-picker .category-cover-images{display:flex;justify-content:center;align-items:center;gap:12px;width:100%;min-width:0}
.secondary-picker .category-cover-images .category-cover-zoom{flex:0 1 auto;min-width:0;width:auto;max-width:100%}
.secondary-picker .category-cover-images .category-cover-zoom img{width:auto;max-width:100%;object-fit:contain}
.secondary-picker .category-cover-images.two-images .category-cover-zoom{flex:1 1 0;width:calc(50% - 6px)}
.secondary-picker .category-cover-images.two-images .category-cover-zoom img{width:100%}
@media(max-width:600px){.secondary-picker .category-cover-images{gap:8px}.secondary-picker .category-cover-images.two-images .category-cover-zoom{border-radius:12px}}

/* Compact secondary cards leave more space for full library names. */
.secondary-picker .secondary-category-grid{padding-left:10px;padding-right:10px;gap:10px}
.secondary-picker .secondary-category-row{min-height:76px;border-radius:17px;align-items:center}
.secondary-picker .secondary-category-row .category-option,.secondary-picker .secondary-category-row.selected .category-option{min-height:72px;padding:9px 8px;gap:9px;border-radius:15px;flex:1;min-width:0}
.secondary-picker .category-option-icon{width:36px;height:48px;border-radius:0;background:transparent;font-size:28px}
.secondary-picker .category-option-icon img{object-fit:contain;border-radius:0}
.secondary-picker .category-option-copy{max-width:none;min-width:0}
.secondary-picker .category-option-copy strong{font-size:18px;line-height:1.35;overflow-wrap:anywhere}
.secondary-picker .category-option-heading{gap:3px}
.secondary-picker .category-confirm{position:static;transform:none;flex:0 0 auto;right:auto;top:auto;margin-right:8px;padding:11px 10px;border-radius:11px;font-size:13px;letter-spacing:0;white-space:nowrap}
@media(max-width:600px){.secondary-picker .secondary-category-row .category-option,.secondary-picker .secondary-category-row.selected .category-option{padding:8px 6px;gap:7px}.secondary-picker .category-option-icon{width:30px;height:42px}.secondary-picker .category-confirm{margin-right:6px;padding:11px 8px;font-size:12px}.secondary-picker .category-option-copy strong{font-size:17px}}

.category-option-meta{display:flex;align-items:baseline;flex-wrap:wrap;gap:3px 10px;font-size:11px;font-weight:400;line-height:1.4;color:#7393a0}
.category-description{overflow-wrap:anywhere}

/* Center short library content as one compact group; allow long titles to shrink. */
.secondary-picker .secondary-category-row{justify-content:center;padding:0 8px}
.secondary-picker .secondary-category-row .category-option,.secondary-picker .secondary-category-row.selected .category-option{flex:0 1 auto;width:auto}
.secondary-picker .category-confirm{margin:0 0 0 6px}
@media(max-width:600px){.secondary-picker .secondary-category-row{padding:0 6px}.secondary-picker .category-confirm{margin:0 0 0 4px}}

/* Fixed root tabs and independent library list. */
.secondary-picker .category-root-tabs{display:flex;flex:0 0 auto;gap:8px;overflow-x:auto;padding:8px 42px 16px 16px;border-bottom:1px solid #b7d7e0;scrollbar-width:thin}
.category-root-tab{flex:0 0 auto;border:1px solid #bddde7;border-radius:12px;background:#ffffffb3;color:#537e8e;padding:10px 18px;font:700 16px system-ui;cursor:pointer}
.category-root-tab[aria-selected=true]{background:linear-gradient(135deg,#68bba9,#399c8d);border-color:#429e90;color:#fff;box-shadow:0 3px 8px #368f8025}
.category-root-tab:focus-visible,.category-library-zoom:focus-visible{outline:3px solid #438aa7;outline-offset:2px}
.secondary-picker .secondary-category-row{justify-content:flex-start;gap:15px;padding:4px 16px;min-height:88px;cursor:pointer}
.category-library-images{display:flex;align-items:center;gap:5px;flex:0 0 auto;max-width:46%}
.category-library-zoom{display:block;flex:0 1 auto;min-width:0;border:0;padding:0;background:transparent;cursor:zoom-in}
.category-library-zoom img{display:block;height:78px;width:auto;max-width:100%;object-fit:contain;border-radius:0}
.category-library-placeholder{display:grid;place-items:center;width:42px;height:78px;font-size:30px}
.secondary-picker .secondary-category-row .category-option,.secondary-picker .secondary-category-row.selected .category-option{flex:1;align-self:stretch;min-width:0;min-height:0;padding:5px 0;gap:8px;justify-content:space-between}
.category-library-check{flex:0 0 25px;color:#389a84;font-size:24px;font-weight:800;line-height:1}
.secondary-picker .category-option-meta{margin-top:4px}
@media(max-width:600px){.category-root-tab{padding:9px 13px;font-size:15px}.secondary-picker .secondary-category-row{gap:12px;padding:4px 12px}.category-library-images{gap:4px}.category-library-zoom img{height:72px}.category-library-placeholder{height:72px}.category-library-check{flex-basis:20px;font-size:22px}}

.category-library-zoom{border-radius:5px;overflow:hidden}
.category-library-zoom img{border-radius:5px;object-fit:fill}

.library-theme-balloon{--lp-ink:#356c80;--lp-line:#8dbccb;--lp-bg:#eaf6fc;--lp-selected:#d3efef;--lp-accent:#58ac94;--lp-shadow:#356c8033}

.secondary-picker .category-dialog{padding-top:44px}
.secondary-picker .level-close{top:7px;right:10px;width:30px;height:30px;background:#ffffffa6;border:1px solid #b1d8e6;font-size:24px}
.secondary-picker .category-root-tabs{padding:4px 14px 12px}
