/* Märchenwald: parchment controls, woodland ink, painted units. */
:root{color-scheme:light;--ink:#24483d;--panel:#f5ebd0;--line:#b2b18a;--text:#294b40;--muted:#657256;--gold:#936d22}
html,body{background:#8d9f68;color:var(--text)}canvas,img{image-rendering:auto}
button{background:#ece4c7;color:#294b40;border:1px solid #a8ab7d;border-radius:10px;box-shadow:inset 0 1px #fff8df,0 2px 0 #73816140}button:hover{background:#e0dec0}button:focus-visible,summary:focus-visible{outline-color:#447f70}.primary{background:#376b59;color:#fff6dc;border-color:#244d40;box-shadow:inset 0 1px #648c70,0 2px 0 #244d4030}.primary:hover{background:#2e5c4d}
h2,h3,.tower-card strong,.hud strong,.modal h2,.choice strong,.tower-menu-head h3{font-family:Georgia,serif;font-weight:700;letter-spacing:0}.hud strong{font-size:17px}.hud,.wave-controls span,.game-menu summary,.game-menu>div,.sheet,.modal,#build-panel,#build-info{background:#f5ebd0f7;color:#294b40;border:1px solid #a2a578;border-radius:14px;box-shadow:inset 0 1px #fff9e7,0 4px 15px #334e3425}.hud{gap:9px}.hud small,.tower-menu-head small,.tower-level-badge small,.tower-content small,.tower-stats span,.tower-connections small,#sell small{color:#647256}.hud #lives{color:#ab533e}.hud #build-credits{color:#294f40}.hud button{background:#e8e1bf;box-shadow:none}.wave-controls span{color:#405b46}.game-menu summary{color:#3d6450}.sheet h2,.sheet h3,.modal h2,#build-info strong{color:#294f40}.close,.close-inspector{color:#5d7156;box-shadow:none}.tower-card,.choice,.branch,.unlock-choice{background:#eee5c9;border-radius:10px}.overlay{background:#263f35b8}.choice .reward-kind{letter-spacing:0;text-transform:none}.choice p{color:#657256}.research-status,.tower-upgrade-note,.tower-connections{background:#e7e1c7}.tower-menu-head{background:#e9e2c5;border-bottom-color:#b4b18a}.tower-portrait{background:#dce1bc;border-radius:8px;box-shadow:none}.tower-level-badge{color:#526a45;font-family:Georgia,serif}.tower-menu-head p{color:#896b30}.tower-tabs{background:#e3dfc3;border-bottom-color:#b4b18a}.tower-tabs button{color:#67745b;border-radius:0}.tower-tabs button[aria-selected=true]{color:#244f3e;background:#f5ebd0;border-bottom-color:#648865}.tower-stats{border-color:#b4b18a}.tower-stats>div{background:#e7e5cc;border-color:#b4b18a}.tower-stats strong{color:#2d5141;font-family:Georgia,serif}.tower-content h4{color:#2d5141}.tower-section-heading h4{color:#836622}.tower-content p{color:#657256}.tower-actions{background:#e5e1c5;border-color:#b4b18a}#inspector[data-side=below] .tower-actions{border-bottom-color:#b4b18a}#inspector .tower-actions #sell{color:#647256;border-color:#a8ab7d}.tower-path-picker button[aria-pressed=true]{background:#d6dfbb;color:#294f40;border-color:#6b8d65}.tower-stage-list li,.tower-synergy,.tower-path-intro{border-color:#b4b18a}.tower-stage-list .installed h4,.tower-stage-list .installed .tower-stage-state{color:#896b26}.tower-stage-list .researched .tower-stage-state,.tower-synergy.owned .tower-synergy-title small,.tower-hint,.tower-bonus{color:#357b6c!important}.tower-bonus{border-color:#b4b18a}.target-priority-label{color:#52694b}.target-priority-label select{background:#fff4da;color:#294f40;border-color:#a7ad82;border-radius:8px}.target-priority-label select:focus-visible{outline-color:#477967}#build-panel{border-color:#9aa37a}#build-info{border-color:#a8ab7d}#build-info .hold-hint{color:#3f7866}.build-icon small{color:#896b26}.build-icon[aria-expanded=true]{background:#d8e3bb;border-color:#5c875f}#close-shop{color:#5a7155}#build-confirm{border-color:#b4b18a}.pad-input{box-shadow:none;border:0;background:transparent}.pad-input:hover{background:#f6e3a31f}.pad-input:focus-visible{outline-color:#3c7760;border-radius:50%}#notice{background:#f8e7ae;color:#405636;border-color:#b59d54;box-shadow:0 3px 10px #35503330;border-radius:10px}
.rarity-common{--rarity-color:#e7bb50}.rarity-rare{--rarity-color:#79bfff}.rarity-legendary{--rarity-color:#c5a5eb}.choice.rarity-common,.choice.rarity-rare,.choice.rarity-legendary{box-shadow:inset 0 3px var(--rarity-color),0 2px 0 #73816130}.rarity-badge,.choice .rarity-badge{background:#26473e;color:var(--rarity-color);border-radius:5px}.choice .rarity-badge+strong{color:#294f40}.tower-content .compact-effect{color:#387966}.tower-content{scrollbar-color:#91a477 #e7e5cc}
@media(max-width:500px){.hud strong{font-size:14px}.hud small{font-size:9px}.hud{gap:6px}.tower-menu-head h3{font-size:15px}}

/* Soft pixel-art pass: warm storybook palette, crisp silhouettes and frames. */
canvas,img{image-rendering:pixelated}
button,.hud,.wave-controls span,.game-menu summary,.game-menu>div,.sheet,.modal,#build-panel,#build-info,.tower-card,.choice,.branch,.unlock-choice,.tower-portrait,.target-priority-label select,#notice{border-radius:3px}
button,.hud,.wave-controls span,.game-menu summary,.game-menu>div,.sheet,.modal,#build-panel,#build-info{border-width:2px;box-shadow:inset 0 2px #fff8df,2px 2px #52674566}
.primary{box-shadow:inset 0 2px #7f9c72,2px 2px #284d3c66}
h2,h3,.tower-card strong,.hud strong,.modal h2,.choice strong,.tower-menu-head h3,.tower-level-badge,.tower-stats strong{font-family:'Courier New',monospace;font-weight:700;letter-spacing:-.4px}
.tower-tabs button{border-radius:0}.pad-input{border:0;box-shadow:none}.pad-input:focus-visible{border-radius:3px}.rarity-badge,.choice .rarity-badge{border-radius:2px}

/* Path previews keep the mobile picker compact. */
.tower-path-picker button img{display:block;width:32px;height:38px;object-fit:contain;image-rendering:pixelated;margin:0 auto 3px}

.hud #build-mode{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:70px;padding:5px 8px;height:auto}.hud #build-mode small{font-size:10px}.hud #build-mode strong{font-size:20px}.tower-actions .compact-effect{margin:0;font-size:12px;line-height:1.4}.board canvas:focus-visible{outline:3px solid #edc56b;outline-offset:-4px}

@media(max-width:360px){.hud{display:grid;grid-template-columns:48px 64px 30px 44px 44px;gap:2px;padding:3px 4px}.hud #build-mode{min-width:64px;padding:3px 4px}.hud #build-mode small{font-size:9px}.hud #build-mode strong{font-size:16px}.hud strong{font-size:12px}}

/* The night offers three compact, illustrated reward tablets. */
.reward-selection .modal{width:min(790px,100%);padding:28px;background:#f5ebd0;border:3px solid #8a9870;box-shadow:inset 0 0 0 5px #e1dbb9,0 16px 70px #18372c66}
.reward-selection .modal-symbol{display:none}.reward-selection .modal h2{font-size:25px;line-height:1.2;margin-bottom:8px}.reward-selection .modal>p{color:#647256;font-size:13px;margin-bottom:20px}
.reward-selection #choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.reward-selection #draft-tools{justify-content:center;gap:8px;margin:0 0 18px}.reward-selection #draft-tools button{flex:0 1 auto;min-width:0;box-shadow:none;background:transparent;border:1px solid #b5b793;padding:6px 12px;font-size:12px}.reward-selection #draft-tools small{display:inline-block;padding:2px 5px;background:#e3dfc1;font-size:11px;margin-left:4px}.reward-selection #draft-help{min-width:44px;font-weight:bold}
.reward-selection .choice-block{display:flex;min-width:0}.reward-selection .reward-card{position:relative;isolation:isolate;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:0;min-height:258px;height:100%;width:100%;padding:48px 14px 0;text-align:center;overflow:hidden;background:#eee4c6;border:2px solid #aa9c6b;border-top:4px solid #a28a4f;box-shadow:inset 0 0 0 4px #f8f0d9,0 4px 0 #6b795233;transition:background .15s,border-color .15s}
.reward-selection .reward-card:hover{background:#f7edd4;border-color:#536f50}.reward-selection .reward-card:focus-visible{outline:3px solid #3f7867;outline-offset:3px}
.reward-selection .reward-card.rarity-rare{border-color:#6393a2;background:#e7e8d4}.reward-selection .reward-card.rarity-legendary{border-color:#8b68a9;background:#ece1ee;box-shadow:inset 0 0 0 4px #f7edf5,0 4px 0 #71508433}
.reward-selection .reward-card .rarity-badge{position:absolute;right:10px;top:10px;font-size:10px;padding:2px 7px;margin:0;float:none;border:0;background:#435a40;color:#f5edcf;border-radius:2px}.reward-selection .rarity-rare .rarity-badge{background:#456b7c;color:#eef8f5}.reward-selection .rarity-legendary .rarity-badge{background:#795294;color:#fff2ff}
.reward-selection .reward-card .reward-emblem{display:grid;place-items:center;width:74px;height:74px;margin:0 0 14px;float:none;background:#d7d9b7;border:1px solid #b4b38a;box-shadow:inset 0 0 0 4px #e8e2c5}.reward-selection .rarity-rare .reward-emblem{background:#c9d8cf;border-color:#9fb6ad;box-shadow:inset 0 0 0 4px #dde6d8}.reward-selection .rarity-legendary .reward-emblem{background:#d6c2df;border-color:#b9a1c7;box-shadow:inset 0 0 0 4px #e6d8eb}
.reward-selection .reward-emblem .upgrade-icon{width:54px;height:54px}.reward-selection .reward-card .reward-kind{font:11px/1.3 'Trebuchet MS',sans-serif;color:#617154;margin:0 0 6px}.reward-selection .reward-card strong{font:700 18px/1.2 'Courier New',monospace;letter-spacing:-.5px;color:#294f40;overflow-wrap:anywhere;margin:0 0 18px}.reward-selection .reward-card .reward-card-link{display:block;float:none;margin:auto -14px 0;padding:10px 5px;width:calc(100% + 28px);border-top:1px solid #a9ae89;background:#e2dfc2;font:12px/1.2 'Trebuchet MS',sans-serif;color:#456647}.reward-selection .rarity-legendary .reward-card-link{background:#decee4;border-color:#c3accd;color:#704988}.reward-selection .rarity-rare .reward-card-link{background:#d9e1cd;border-color:#a7baae;color:#456b7c}
.reward-selection .reward-card .card-sparkles{position:absolute;inset:0;pointer-events:none;margin:0;float:none;z-index:2}.card-sparkles i{position:absolute;font-style:normal;font-size:17px;color:#fff5bc;text-shadow:0 0 6px #fff5bc,0 0 10px #b38bc6;animation:legend-sparkle 3s ease-in-out infinite;opacity:.15}.card-sparkles i:nth-child(1){left:9%;top:28%;animation-delay:-.3s}.card-sparkles i:nth-child(2){right:10%;top:40%;animation-delay:-1.8s}.card-sparkles i:nth-child(3){left:18%;bottom:24%;animation-delay:-1.1s}.card-sparkles i:nth-child(4){right:23%;top:15%;animation-delay:-2.4s;font-size:12px}.card-sparkles i:nth-child(5){right:9%;bottom:9%;animation-delay:-.8s;font-size:12px}
@keyframes legend-sparkle{0%,70%,100%{opacity:.12;transform:scale(.6) rotate(0)}35%{opacity:1;transform:scale(1.1) rotate(18deg)}}
#reward-popup{width:min(440px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain;padding:24px;border:3px solid #8a9870;border-radius:4px;background:#f5ebd0;color:#294f40;box-shadow:inset 0 0 0 4px #e1dbb9,0 18px 60px #18372c77}
#reward-popup::backdrop{background:#1d362dcc;backdrop-filter:blur(3px)}.reward-close{position:absolute;right:8px;top:8px;background:transparent;box-shadow:none;border:0;font-size:18px;z-index:2}.reward-detail-head{padding-top:6px;text-align:center}.reward-detail-head>.rarity-badge{background:#435a40;color:#f5edcf;border:0;margin:0 0 10px}.reward-detail-head.rarity-legendary>.rarity-badge{background:#795294;color:#fff2ff}.reward-detail-head.rarity-rare>.rarity-badge{background:#456b7c;color:#eef8f5}.reward-detail-emblem{display:grid;place-items:center;margin:4px auto 14px;width:84px;height:84px;background:#e1ddbe;border:1px solid #b4b38a}.reward-detail-emblem .upgrade-icon{width:64px;height:64px}.reward-detail-head small{display:block;color:#647256;margin:0 0 6px;font-size:12px}#reward-popup h2{font:700 23px/1.25 'Courier New',monospace;color:#294f40;margin:0 24px 18px;overflow-wrap:anywhere}#reward-popup>h2{padding-top:14px;margin-left:0}#reward-popup p{font-size:14px;line-height:1.6;color:#405b46;margin:12px 0}#reward-popup .reward-scope{font-size:12px;color:#647256;border-left:3px solid #91a477;padding-left:12px}#reward-popup .reward-owned{font-size:12px;color:#647256}.reward-detail-actions{display:grid;gap:8px;margin-top:22px}.reward-detail-actions button{min-height:46px}.reward-detail-actions>.primary{font-weight:bold}.reward-detail-actions>#reward-back{background:transparent;box-shadow:none;border-color:transparent;color:#647256}
.hud #build-mode[aria-pressed=true]{background:#376b59;color:#fff6dc;border-color:#294f40;box-shadow:inset 0 0 0 2px #82a17d}.hud #build-mode[aria-pressed=true] small,.hud #build-mode[aria-pressed=true] strong{color:#fff6dc}canvas.building{cursor:crosshair}
@media(max-width:540px){.reward-selection .modal{padding:20px 14px}.reward-selection .modal h2{font-size:21px}.reward-selection .modal>p{font-size:12px;margin-bottom:14px}.reward-selection #draft-tools{gap:6px;margin-bottom:12px}.reward-selection #draft-tools button{padding:5px 8px;font-size:11px}.reward-selection #choices{grid-template-columns:1fr;gap:10px}.reward-selection .reward-card{min-height:112px;display:grid;grid-template-columns:60px minmax(0,1fr);grid-template-rows:auto auto auto;column-gap:12px;padding:16px 12px;text-align:left;align-content:center}.reward-selection .reward-card .rarity-badge{position:static;justify-self:start;grid-column:2;grid-row:1;margin:0 0 4px}.reward-selection .reward-card .reward-emblem{grid-row:1/5;grid-column:1;width:60px;height:66px;margin:0;align-self:center}.reward-selection .reward-emblem .upgrade-icon{width:44px;height:44px}.reward-selection .reward-card .reward-kind{grid-column:2;grid-row:2;font-size:10px;margin:0 0 4px}.reward-selection .reward-card strong{grid-column:2;grid-row:3;font-size:16px;margin:0 0 5px}.reward-selection .reward-card .reward-card-link{grid-column:2;grid-row:4;background:transparent;border:0;padding:0;margin:0;width:auto;font-size:11px}.reward-selection .event-card{min-height:100px}.reward-selection .event-card .reward-emblem{grid-row:1/5}.reward-selection .event-card .reward-kind{grid-row:1}.reward-selection .event-card strong{grid-row:2}.reward-selection .event-card .reward-card-link{grid-row:3}#reward-popup{padding:20px}#reward-popup h2{font-size:21px}}
@media(orientation:landscape) and (max-height:500px){.reward-selection .modal{padding:16px 18px}.reward-selection .modal h2{font-size:19px}.reward-selection .modal>p{margin-bottom:10px}.reward-selection #draft-tools{margin-bottom:10px}.reward-selection .reward-card{min-height:188px;padding-top:38px}.reward-selection .reward-card .reward-emblem{width:52px;height:52px;margin-bottom:8px}.reward-selection .reward-emblem .upgrade-icon{width:40px;height:40px}.reward-selection .reward-card strong{font-size:15px;margin-bottom:12px}.reward-selection .reward-card .reward-card-link{padding:8px}.reward-selection .reward-card .reward-kind{font-size:10px}#reward-popup .reward-detail-emblem{width:56px;height:56px;margin-bottom:8px}.reward-detail-emblem .upgrade-icon{width:44px;height:44px}}
@media(prefers-reduced-motion:reduce){.card-sparkles i{animation:none;opacity:.8;transform:none}.reward-selection .reward-card{transition:none}}
@media(max-width:540px) and (max-height:620px){.reward-selection .modal{padding:16px 12px}.reward-selection .modal h2{font-size:19px}.reward-selection .modal>p{margin-bottom:10px}.reward-selection #draft-tools{margin-bottom:10px}.reward-selection .reward-card{min-height:100px;padding:12px 10px;column-gap:10px}.reward-selection .reward-card strong{font-size:15px}.reward-selection .reward-card .reward-emblem{width:56px;height:62px}}
@media(orientation:landscape) and (max-height:500px){.reward-selection .modal{padding:12px 14px}.reward-selection .modal h2{font-size:18px;margin-bottom:4px}.reward-selection .modal>p{font-size:12px;margin-bottom:8px}.reward-selection #draft-tools{margin-bottom:8px}.reward-selection .reward-card{min-height:178px}.reward-selection .reward-card .reward-emblem{margin-bottom:6px}.reward-selection .reward-card strong{margin-bottom:6px}}
