:root{color-scheme:dark;--ink:#293f43;--panel:#29464e;--paper:#f4e7c6;--cream:#f6edcf;--muted:#ced8c8;--gold:#efc77d;--green:#b9d7af;--line:#ba9360;--common:#d0dccd;--uncommon:#9edbbd;--rare:#b4ccff;--legendary:#ffd17c;font-family:Georgia,'Times New Roman',serif;background:#1e353e;color:var(--cream)}
*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(ellipse at 18% 0,#496269 0,transparent 60%),#1e353e}button,input,select,textarea{font:inherit}button{border:2px solid #90a393;border-radius:2px;background:#36575c;color:var(--cream);padding:10px 16px;cursor:pointer;box-shadow:0 3px #132d35;transition:background .15s}button:hover:not(:disabled){background:#486e6b}button:disabled{cursor:default;opacity:.6}button:focus-visible,a:focus-visible,canvas:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid var(--gold);outline-offset:3px}.quiet{background:transparent;border-color:#7f9690}.primary{background:var(--gold);color:#293f43;border-color:#c49b59;font-weight:bold}.primary:hover:not(:disabled){background:#ffdf9b}[hidden]{display:none!important}
.shell{max-width:1680px;margin:auto;padding:12px 24px;min-height:100vh}.topbar{display:flex;align-items:center;gap:22px;justify-content:space-between;min-height:51px;padding-bottom:9px;border-bottom:1px solid #7c9385}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--cream);font-size:24px;line-height:1.1}.brand small{display:block;font:10px/1.7 system-ui;letter-spacing:1.4px;color:var(--gold);margin-top:3px}.brand-icon{font-size:28px;color:var(--gold);border:2px solid var(--line);padding:0 6px}#player-name{margin-left:auto;color:var(--muted);font-size:14px}#menu-button{font:14px system-ui;white-space:nowrap}.chapter{display:flex;justify-content:space-between;gap:10px;padding:10px 0;font:11px system-ui;letter-spacing:1px;color:var(--muted)}#save-indicator{letter-spacing:0;color:var(--green)}
.scene-layout{border:3px solid #8b795a;background:#263f47;box-shadow:5px 5px #142c34;overflow:hidden}.scene-wrap{width:100%;background:#2f4853}#world{display:block;width:min(100%,calc((100vh - 295px)*2));height:auto;margin:auto;image-rendering:pixelated;cursor:crosshair}.scene-caption{display:flex;justify-content:space-between;gap:12px;padding:9px 16px;background:#344f55;color:#f0e6c8;font-size:14px}.keyhint{white-space:nowrap;font:12px system-ui;color:var(--gold)}.location-panel{display:grid;grid-template-columns:minmax(160px,1fr) auto minmax(200px,.7fr);gap:0 25px;padding:13px 18px;background:var(--paper);color:var(--ink);border-top:3px solid var(--line);align-items:center}.location-panel .eyebrow{grid-column:1;color:#6b542e;font-size:11px}.location-panel h1{grid-column:1;font-size:27px;margin:4px 0}.location-panel>#location-description,.ticket{display:none}.progress-row{grid-column:2;grid-row:1/3;display:flex;gap:25px}.progress-row strong{font-size:27px;font-weight:normal}.progress-row strong span{font-size:15px;color:#52635b}.progress-row small{display:block;font:10px system-ui;letter-spacing:.8px;margin-top:4px;color:#52635b}.location-panel>#interact-button{grid-column:3;grid-row:1/3;font-size:15px}.location-panel>#interaction-hint{grid-column:1/4;color:#52635b;margin:7px 0 0;font-size:13px}.eyebrow{font:12px system-ui;letter-spacing:1.5px;color:var(--gold)}h1,h2,h3{font-weight:normal}h2{font-size:28px;margin:8px 0}h3{font-size:19px;margin:0}p{color:var(--muted);line-height:1.5;margin:10px 0}.small{font-size:14px;line-height:1.5}.row{display:flex;align-items:center;gap:8px}footer{display:flex;justify-content:space-between;gap:15px;padding:11px 0 0;color:#c3cdbd;font:11px system-ui}
dialog{background:#29464e;border:3px solid var(--line);border-radius:3px;color:var(--cream);padding:22px;width:min(760px,94vw);max-height:94vh;box-shadow:7px 7px #142c34,0 22px 70px #0007}dialog::backdrop{background:#0e252cc9;backdrop-filter:blur(3px)}.dialog-top{display:flex;align-items:center;justify-content:space-between;gap:15px}.icon-button{padding:5px 10px;background:transparent;border-color:#9caf9d}#modal-title{margin:10px 0 18px}#modal.map-dialog{width:min(1040px,96vw);padding:16px 22px}#modal.map-dialog #modal-title{margin:6px 0 10px}.settings-grid{display:grid;gap:13px}.settings-grid button{text-align:left}.import-input{width:100%;min-height:100px;background:#173039;border:1px solid #94a597;color:var(--cream);padding:12px;font:12px/1.5 monospace}.error{color:#ffcfb9!important}.toast{position:fixed;z-index:100;bottom:20px;left:50%;transform:translateX(-50%);background:var(--gold);color:var(--ink);padding:13px 22px;border:2px solid #fff0c2;box-shadow:4px 4px #152e36;font:14px system-ui;max-width:90vw}.help-list{line-height:1.65;color:var(--muted);padding-left:24px}.help-list li{margin:12px 0}.help-list strong{color:var(--cream)}
#game-menu{width:min(670px,94vw);padding:22px 30px;background:repeating-linear-gradient(0deg,#ffffff03 0 1px,transparent 1px 5px),#29464e}.menu-heading{text-align:center;padding:12px 0}.menu-heading h2{font-size:36px;margin:5px 0}.menu-book{display:block;color:var(--gold);font-size:42px;line-height:1}.menu-heading p{font-size:15px;margin:8px 0 15px}#menu-resume{display:block;width:100%;font-size:18px;padding:13px}#game-menu nav{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:22px}#game-menu nav button{padding:14px 12px;text-align:left;background:var(--paper);color:var(--ink);border-color:#bd9c69;font-size:16px}#game-menu nav button:hover{background:#fff2d2}.menu-footnote{text-align:center;font:13px system-ui;margin:22px 0 0}#game-menu nav button:focus-visible{outline-color:#fff3b9}
#library-dialog{width:min(1120px,95vw)}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-top:16px}.section-heading button{font-size:14px}.library-section>p{margin-top:0}.shelves{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:22px}.shelf{background:#493f36;border:7px solid #94714f;border-top-width:5px;border-bottom:12px solid #bc9567;box-shadow:inset 0 6px #292b2888,0 5px #142e3588;position:relative;padding:14px 8px 0;display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:4px;min-height:125px}.shelf::after{content:attr(data-label);position:absolute;bottom:-31px;left:0;color:var(--cream);font:12px system-ui;letter-spacing:1px}.shelf-slot{height:88px;border:1px dashed #d0b989;box-shadow:none;padding:0;min-width:0;background:#cfb78a0c;position:relative}.shelf-slot:empty::after{content:'·';color:#dfc797}.shelf-slot:empty:hover{background:#d2b07233}.shelf.active-shelf{outline:3px solid var(--gold);outline-offset:4px}.book{border:1px solid #eedba1;background:var(--spine,#738d85);border-radius:1px;padding:0;width:100%;height:100%;min-height:76px;position:relative;box-shadow:inset 3px 0 #ffffff33,inset -3px 0 #0003;overflow:hidden;color:#fff3ce}.book::before,.book::after{content:'';height:2px;background:currentColor;opacity:.8;position:absolute;left:4px;right:4px;top:7px}.book::after{top:auto;bottom:8px}.book span{display:block;writing-mode:vertical-rl;font:bold 10px Georgia;line-height:1.1;margin:auto;max-height:65px;overflow:hidden;white-space:nowrap;text-shadow:1px 1px #293f43}.book.selected{outline:3px solid var(--gold);outline-offset:2px}.stack-area{display:flex;align-items:center;gap:24px;margin-top:44px;padding:20px;background:#203d45;border:2px solid #7d998a}.stack-area p{margin:5px 0}.book-stack{display:flex;flex-wrap:wrap;gap:7px;align-items:flex-end;flex:1;min-height:84px}.book-stack>.book{height:85px;width:29px;flex-shrink:0}.stack-empty{font:italic 14px Georgia;color:var(--muted)}.placement-on .shelf-slot{border:2px dashed #eacb90}.placement-on .book{cursor:grab}.album{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;max-height:50vh;overflow:auto}.album-entry{min-height:110px;padding:12px 8px;text-align:center;background:#36575b;font-size:13px}.album-entry.unknown{border:1px dashed #91a393;background:transparent;color:#bac6b8}.album-entry strong{display:block;font-size:20px;margin-bottom:8px}.rarity{font:bold 13px system-ui;text-transform:uppercase;letter-spacing:1.5px;color:var(--rarity,var(--gold))}.book-detail{text-align:center;padding:18px}.large-book{width:104px;height:143px;margin:0 auto 22px;background:var(--spine);box-shadow:inset 10px 0 #0003,7px 6px #142f37;border:2px solid #e7d9a8;display:grid;place-items:center;font-size:40px;color:#ffe4ab}.book-detail h3{font-size:28px;max-width:580px;margin:0 auto}.book-detail>p:not(.rarity){font-size:16px}.book-detail>p.small{font-size:14px}
#puzzle-dialog{width:min(1180px,97vw);height:min(850px,96vh);max-height:96vh;margin:auto;padding:14px 22px;position:relative}#puzzle-dialog>.dialog-top{position:sticky;top:-14px;background:#29464e;z-index:10;padding:6px 0}#puzzle-title{margin:6px 0 12px;font-size:27px}#puzzle-kicker{font-size:11px}#pause-cover{position:absolute;inset:84px 0 0;background:#233e48fa;z-index:11;text-align:center;padding:90px 20px 20px}#pause-cover strong{font-size:36px;font-weight:normal}#pause-cover p{font-size:17px;margin:14px 0 25px}#pause-cover button{margin:6px}
.pack-stage{text-align:center;padding:12px 0 5px}.sealed-pack{--tear:0%;width:218px;height:294px;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;margin:0 auto 20px;border:3px solid #ebcb91;background:repeating-linear-gradient(90deg,#ffffff06 0 2px,transparent 2px 5px),linear-gradient(135deg,#819b87,#416768 60%,#294c57);box-shadow:inset 7px 0 #ffffff16,inset -7px 0 #112e3844,6px 7px #152f38;touch-action:none;user-select:none;overflow:hidden}.sealed-pack:hover:not(:disabled){background:#527b75}.pack-seal{position:absolute;top:0;left:0;right:0;height:45px;padding-top:13px;background:linear-gradient(90deg,#f2d18e var(--tear),#d3bd88 var(--tear));color:#293f43;font:11px system-ui;letter-spacing:1px;border-bottom:2px dashed #f7ddb0}.pack-emblem{font-size:58px;color:#f3dba4}.sealed-pack strong{font-size:16px;letter-spacing:1px}.pack-subtitle{font:11px system-ui;letter-spacing:2px;color:#f1e4be}.pack-bottom{position:absolute;bottom:15px;font:10px system-ui;letter-spacing:1px}.pack-instructions{max-width:420px;margin:0 auto 12px}.pack-assurance{text-align:center}.sealed-pack.is-opening{animation:wrapper-open .62s ease-in both;pointer-events:none}.sealed-pack.is-opening .pack-seal{transform:translate(30px,-35px) rotate(16deg);transition:transform .35s}.pack-reveal{position:relative;isolation:isolate;overflow:hidden;background:color-mix(in srgb,var(--rarity) 9%,#29464e);border:2px solid color-mix(in srgb,var(--rarity) 60%,transparent);animation:story-arrives .4s ease-out;padding:28px 20px}.pack-reveal .large-book{position:relative;z-index:1}.pack-reveal p,.pack-reveal h3,.pack-reveal button{position:relative;z-index:1}.pack-reveal button{margin:13px 5px 0}.reveal-aura{position:absolute;z-index:0;width:300px;height:280px;top:-27px;left:calc(50% - 150px);border-radius:50%;background:radial-gradient(ellipse,var(--rarity),transparent 69%);opacity:.2}.tier-rare .reveal-aura,.tier-legendary .reveal-aura{opacity:.65;animation:aura-breathe 2s ease-in-out 2}.tier-legendary .large-book{box-shadow:inset 10px 0 #0003,0 0 25px #f1c57966,7px 6px #142f37}.confetti{position:absolute;inset:0;pointer-events:none;overflow:hidden}.confetti i{position:absolute;left:var(--x);top:-20px;width:6px;height:11px;background:#efbd67;animation:confetti-fall 1.7s var(--delay) ease-out both;transform:rotate(var(--r))}.confetti i:nth-child(3n){background:#a6bdea}.confetti i:nth-child(3n + 1){background:#a8d8bb}@keyframes wrapper-open{0%{transform:scale(1)}35%{transform:rotate(-4deg) scale(1.06)}100%{opacity:0;transform:translateY(45px) scale(.85)}}@keyframes story-arrives{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}@keyframes aura-breathe{50%{opacity:.9;transform:scale(1.12)}}@keyframes confetti-fall{to{top:105%;transform:translateX(25px) rotate(calc(var(--r) + 300deg));opacity:0}}
@media(max-height:760px){.menu-heading{padding:6px 0}.menu-heading h2{font-size:31px}.menu-book{font-size:32px}#game-menu nav{gap:10px;margin-top:16px}#game-menu nav button{padding:12px}.menu-footnote{margin-top:16px}}
@media(max-width:760px){.shell{padding:10px}.brand{font-size:19px}.brand-icon,.brand small,#player-name,.scene-caption .keyhint,footer span:last-child{display:none}.chapter{font-size:10px;letter-spacing:0}.scene-caption{font-size:12px;padding:8px}#world{width:100%}.location-panel{grid-template-columns:1fr auto;padding:12px;gap:6px 12px}.location-panel h1{font-size:23px}.location-panel>#interact-button{grid-column:1/3;grid-row:3}.location-panel>#interaction-hint{grid-column:1/3}.progress-row{gap:12px}.progress-row small{font-size:9px}.shelves{grid-template-columns:1fr;gap:40px}.section-heading,.stack-area{align-items:flex-start;flex-direction:column}.album{grid-template-columns:repeat(3,1fr)}dialog{padding:16px}#puzzle-dialog{padding:10px}#puzzle-title{font-size:22px}#game-menu{padding:16px}#game-menu nav{gap:8px}#game-menu nav button{font-size:14px;padding:12px 8px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}.confetti{display:none}.sealed-pack.is-opening{opacity:1}}

/* Pack rewards burst from the parcel into the viewport; the effect never blocks controls. */
#modal>.dialog-top,#modal>#modal-title,#modal>#modal-body{position:relative;z-index:2}
.pack-confetti{position:fixed;inset:0;z-index:1;overflow:visible;pointer-events:none}
.pack-confetti i{position:absolute;left:var(--x);top:var(--y);width:7px;height:12px;border-radius:1px;background:hsl(var(--hue) 72% 72%);box-shadow:0 1px 2px #152e3666;opacity:0;animation:pack-confetti-burst 1.32s var(--delay) cubic-bezier(.12,.62,.3,1) both}
.pack-confetti i:nth-child(4n){width:9px;height:7px;border-radius:50%}
.pack-confetti i:nth-child(5n){width:5px;height:15px}
@keyframes pack-confetti-burst{0%{opacity:0;transform:translate(-50%,-50%) scale(.3)}9%{opacity:.98;transform:translate(-50%,-50%) scale(1.05)}100%{opacity:0;transform:translate(-50%,-50%) translate(var(--dx),var(--dy)) rotate(var(--spin)) scale(.7)}}

.game-choices{display:grid;grid-template-columns:1fr 1fr;gap:18px;padding:18px 0}.game-choices button{padding:24px 14px} [data-retry-rewards]{font-size:12px}

.penguin-name-controls{display:flex;align-items:end;gap:8px;flex-wrap:wrap;min-width:0}
.penguin-name-controls .save-name-field{flex:1 1 140px;min-width:0}
.penguin-name-suggestion{font:14px/1.3 system-ui;padding:8px 10px;min-height:38px}
