@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500&display=swap');
:root{color-scheme:dark;--cream:#f7edce;--gold:#e8bb63;--green:#213e31}*{box-sizing:border-box}body{margin:0;background:#102b26;color:var(--cream);font-family:'DM Sans',sans-serif}header{height:85px;display:flex;align-items:center;justify-content:space-between;max-width:1440px;margin:auto;padding:0 44px}.brand{font-family:Georgia,serif;font-size:27px;font-weight:bold;color:var(--cream);text-decoration:none}.brand span{font:10px 'DM Sans',sans-serif;letter-spacing:3px;margin-left:17px;vertical-align:middle}.edition{font-size:10px;letter-spacing:2.7px;opacity:.55}button{font:600 13px 'DM Sans',sans-serif;cursor:pointer;color:var(--cream);background:#ffffff0b;border:1px solid #f7edce33;border-radius:7px;padding:12px 18px;transition:transform .2s,background .2s}button:hover{background:#ffffff20;transform:translateY(-2px)}button:focus-visible{outline:3px solid var(--gold);outline-offset:4px}main{max-width:1440px;margin:auto;padding:0 34px}#game-shell{position:relative;aspect-ratio:16/9;overflow:hidden;border:1px solid #e6c78b36;border-radius:12px;box-shadow:0 18px 65px #00171199;background:#86aaa0}#game{width:100%;height:100%}canvas{display:block!important;width:100%!important;height:100%!important}#overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:linear-gradient(90deg,#082620db,#0c292d61 66%,#0c292d0a)}#overlay:empty{display:none}.menu{width:100%;padding:5% 7%;position:relative}.eyebrow{font-size:11px;letter-spacing:3px;color:#f0d89a;margin:0 0 22px;text-transform:uppercase}.menu h1{font-family:'Playfair Display',Georgia,serif;font-size:clamp(40px,6.8vw,98px);line-height:.96;letter-spacing:-3px;margin:0;font-weight:600;text-shadow:0 3px 20px #12302744}.menu h1 span{font-style:italic;font-size:.74em;color:#edc981}.menu .subtitle{font-family:'Playfair Display',Georgia,serif;font-size:clamp(15px,2vw,27px);margin:22px 0 15px}.menu .description{font-size:clamp(11px,1.05vw,15px);line-height:1.8;max-width:370px;color:#e1e7cdcc}.actions{display:flex;gap:12px;margin-top:27px}.primary{background:var(--gold);color:#263a2c;border-color:var(--gold);min-width:155px;padding:16px 26px}.primary:hover{background:#ffda87}.menu .note{font-size:10px;letter-spacing:1.6px;margin-top:33px;color:#e0e9c18c}.center-card{text-align:center;max-width:650px;border:1px solid #eddda755;border-radius:18px;background:#173a30f5;padding:38px 48px;box-shadow:0 20px 80px #001e21aa}.center-card h2{font:500 38px 'Playfair Display',Georgia,serif;margin:8px 0 18px}.center-card p{line-height:1.8;color:#dae1c8}.center-card .actions{justify-content:center}.center-card .eyebrow{margin-bottom:12px}.stats{display:flex;justify-content:center;gap:45px;margin:25px 0}.stats strong{display:block;font-size:32px;color:var(--gold)}.stats span{font-size:11px;letter-spacing:2px;text-transform:uppercase}#hud{position:absolute;inset:0;pointer-events:none;padding:24px}.hud-left,.hud-right{display:flex;align-items:center;gap:13px;position:absolute;top:24px}.hud-right{right:24px}.hud-right button{pointer-events:auto;background:#173a30dd}.hud-right span{font-size:10px;letter-spacing:2px;background:#173a30bc;padding:12px 17px;border-radius:7px}.pill{display:flex;align-items:center;gap:8px;background:#193a30df;border:1px solid #efdcab55;border-radius:9px;padding:7px 15px;height:48px}.pill img{height:34px;width:28px;object-fit:contain}.pill b{font-size:23px}.pill span{font-size:13px;color:#c8d1b5}.hearts{color:#ef886f;font-size:25px;letter-spacing:2px}#toast{position:absolute;left:50%;top:90px;transform:translateX(-50%);font-size:13px;background:#183b30eb;border:1px solid #ebce8e55;padding:12px 22px;border-radius:30px;opacity:0;transition:opacity .4s;white-space:nowrap}#progress{position:absolute;bottom:0;left:0;right:0;height:3px;background:#102c2844}#progress i{display:block;height:100%;width:0;background:#edc77d}footer{display:flex;justify-content:space-between;align-items:center;font-size:10px;color:#c2cdb5a6;padding:23px 4px;gap:15px}footer>span:nth-child(2){font-family:Georgia,serif;font-style:italic;font-size:13px}kbd{font:9px 'DM Sans',sans-serif;border:1px solid #e6e1bb32;border-radius:3px;padding:3px 6px;margin-right:4px;color:#e4dfc2}em{padding:0 10px}@media(max-width:800px){header{height:60px;padding:0 20px}.edition{display:none}main{padding:0 12px}.menu{padding:5%}.menu .description,.menu .note{display:none}.actions{margin-top:15px}.primary{padding:10px 18px}.hud-right span{display:none}footer>span:nth-child(2){display:none}.center-card{padding:15px}.center-card h2{font-size:25px}}

/* Touch controls live outside the canvas, so they remain sharp and accept multitouch. */
#touch-controls,#mobile-hint,.touch-guide{display:none}
[hidden]{display:none!important}
#touch-controls{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;justify-content:space-between;gap:16px;padding:12px max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left))}
.direction-pad,.action-pad{display:flex;gap:12px}
#touch-controls button{width:64px;height:64px;min-width:48px;border-radius:18px;border:2px solid #f5dfab75;background:#173d32df;color:#f7edce;font-size:16px;touch-action:none;transform:none;box-shadow:0 4px 0 #071e1bc4}
#touch-controls button[data-control=jump]{background:#e8bb63;color:#223c2e;width:78px}
#touch-controls button.held{background:#f7df9b;color:#172f29;transform:translateY(3px);box-shadow:none}
@media(pointer:coarse),(max-width:600px),(max-width:950px) and (max-height:500px){
 body{overscroll-behavior:none}header{height:52px;padding:0 12px}.brand{font-size:22px}.brand span{font-size:8px;letter-spacing:2px;margin-left:8px}.edition{display:none}header button{min-height:44px;padding:8px 12px}
 main{padding:0 8px}#game-shell{border-radius:8px}#game{touch-action:none}#touch-controls{display:flex}#mobile-hint{display:block;text-align:center;font-size:12px;line-height:1.5;margin:10px;color:#d1d6bd}.touch-guide{display:block}footer{display:none}
 .menu{padding:16px 20px}.menu .eyebrow{font-size:8px;margin-bottom:10px;letter-spacing:2px}.menu h1{font-size:clamp(28px,7vw,60px);letter-spacing:-1px}.menu .subtitle{font-size:14px;margin:12px 0}.menu .note,.menu .description{display:none}.actions{gap:8px;margin-top:12px}.actions button{min-height:44px;font-size:12px;padding:10px 14px}.primary{min-width:120px}
 #overlay{overflow:auto;align-items:safe center}.center-card{max-height:100%;overflow:auto;margin:4px;padding:12px 18px}.center-card h2{font-size:24px;margin:5px 0 10px}.center-card p{font-size:12px;line-height:1.5;margin:8px 0}.center-card .eyebrow{font-size:8px}.stats{gap:20px;margin:12px 0}.stats strong{font-size:22px}
 #hud{padding:8px}.hud-left,.hud-right{top:8px;gap:6px}.hud-right{right:8px}.hud-right span{display:none}.pill{height:36px;padding:4px 8px;gap:5px}.pill img{height:26px;width:22px}.pill b{font-size:17px}.pill span{font-size:11px}.hearts{font-size:19px;letter-spacing:0}#pause{min-width:44px;min-height:44px;padding:6px}#toast{top:54px;max-width:88%;white-space:normal;text-align:center;font-size:10px;padding:7px 12px}
}
@media(pointer:coarse) and (orientation:landscape),(max-width:950px) and (max-height:500px){
 body{height:100dvh;overflow:hidden}header{height:36px;padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}header button{min-height:32px;padding:4px 12px}main{padding:0;width:100%}#game-shell{width:min(100vw,calc((100dvh - 36px)*16/9));margin:auto;border-radius:0}#mobile-hint{display:none}#touch-controls{display:flex;position:fixed;bottom:max(4px,env(safe-area-inset-bottom));left:0;right:0;pointer-events:none;padding-top:0;padding-bottom:0}#touch-controls button{pointer-events:auto;width:58px;height:54px;border-radius:15px}#touch-controls button[data-control=jump]{width:72px}.menu{padding:16px 5%}
}

#loading{position:absolute;inset:0;z-index:50;background:#173a30;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;color:#f4dfad}#loading strong{font:600 28px Georgia,serif}#loading span{font-size:13px}
/* Language remains available on the menu, in play and on pause screens. */
#language{font:inherit;font-size:13px;color:#f5ecd6;background:#213b33;border:1px solid #5b7162;border-radius:9px;padding:8px 28px 8px 10px;min-height:44px;margin-left:auto;margin-right:8px;width:112px;min-width:112px;max-width:none;flex-shrink:0;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23f5ecd6' stroke-width='1.5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;cursor:pointer}#language:focus-visible{outline:2px solid #e8c470;outline-offset:2px}header #sound{margin-left:0}@media(max-width:600px){#language{font-size:12px;padding:6px 28px 6px 10px;margin-right:5px;width:104px;min-width:104px}header .brand span{display:none}}
header{column-gap:18px}#language{margin-right:0}@media(max-width:600px){header{column-gap:7px}}

/* Labels determine action-button width in both languages, including landscape. */
#touch-controls button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;padding:0 12px;line-height:1;white-space:nowrap}
#touch-controls .action-pad button{width:max-content;min-width:82px;font-size:14px}
@media(max-width:400px){
 #touch-controls{gap:12px;padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
 .direction-pad,.action-pad{gap:8px}
 #touch-controls .direction-pad button{width:52px}
 #touch-controls .action-pad button{min-width:72px;padding-inline:10px}
}

/* Stories have their own space below the forest, leaving the scene unobstructed. */
#story-strip{height:44px;display:flex;align-items:center;justify-content:center;pointer-events:none}
#story-strip #toast{position:static;transform:none;max-width:100%;margin:0;padding:6px 14px;border:0;border-radius:0;background:transparent;color:#eee4c5;font-size:12px;line-height:16px;white-space:normal;text-align:center;pointer-events:none}
#notice-toast{position:absolute;top:78px;left:24px;max-width:220px;font-size:11px;line-height:1.3;padding:5px 9px;background:#183b30e8;border-radius:7px;opacity:0;transition:opacity .25s;pointer-events:none}
@media(pointer:coarse),(max-width:600px),(max-width:950px) and (max-height:500px){
 #notice-toast{top:49px;left:8px;font-size:10px;max-width:180px}
 #story-strip #toast{font-size:11px;line-height:15px;padding:6px 12px}
}
@media(pointer:coarse) and (orientation:landscape),(max-width:950px) and (max-height:500px){
 #game-shell{width:min(100vw,calc((100dvh - 80px - env(safe-area-inset-bottom))*16/9))}
 #story-strip{position:fixed;bottom:env(safe-area-inset-bottom);left:0;right:0;height:44px;background:#102b26}
 #touch-controls{bottom:max(48px,calc(48px + env(safe-area-inset-bottom)))}
}
