.ph-game{width:100%;max-width:760px;margin:auto;color:#3e3c46;--ph-accent:#638f82;--ph-wash:#edf4ed}.ph-moon-lander{--ph-accent:#78769f;--ph-wash:#f0eff8}.ph-treasure-platformer{--ph-accent:#b48363;--ph-wash:#f7f0e7}.ph-hud{display:grid;grid-template-columns:1fr 1fr 1fr 44px;align-items:center;gap:12px;padding:13px 15px;margin-bottom:14px;border:1px solid #e3e1dc;border-radius:16px;background:#fffdf9}.ph-hud>div{min-width:0;display:flex;flex-direction:column;gap:5px}.ph-hud span{font-size:.7rem;color:#8c8690}.ph-hud strong{font-size:1rem;color:#4c4555;line-height:1.25;font-variant-numeric:tabular-nums}.ph-game button{font-family:inherit;cursor:pointer;touch-action:manipulation}.ph-game button:disabled{opacity:.42;cursor:default}.ph-pause{width:44px;height:44px;border:1px solid #d9d4df;border-radius:13px;background:#fff;color:#73617e;font-size:20px;font-weight:700}.ph-stage{position:relative;isolation:isolate;aspect-ratio:8/5;border:1px solid #dedad6;border-radius:22px;overflow:hidden;background:#dce7dc;box-shadow:0 12px 30px #3449360b}.ph-arena{display:block;width:100%;height:100%;touch-action:none;outline-offset:-4px}.ph-arena:focus-visible{outline:3px solid #a8b5a1}.ph-overlay{position:absolute;inset:0;display:grid;place-items:center;padding:16px;background:#30314338;backdrop-filter:blur(4px);overflow-y:auto}.ph-overlay[hidden]{display:none}.ph-dialog{width:min(100%,380px);padding:25px;box-sizing:border-box;text-align:center;border:1px solid #fff;border-radius:21px;background:#fffcf8f7;box-shadow:0 14px 38px #3023382b}.ph-eyebrow{display:block;font-size:.65rem;letter-spacing:.1em;font-weight:800;text-transform:uppercase;color:#918195}.ph-dialog h3{margin:10px 0 14px;font-size:clamp(1.22rem,3vw,1.8rem);line-height:1.12;letter-spacing:-.03em;color:#554b58}.ph-dialog ul{padding:0;margin:13px 0 19px;list-style:none;font-size:.81rem;line-height:1.5;color:#817587}.ph-dialog li+li{margin-top:6px}.ph-dialog p{font-size:.87rem;line-height:1.55;color:#837487;margin:12px 0 18px}.ph-primary{min-height:47px;padding:12px 21px;border:0;border-radius:13px;background:var(--ph-accent);color:#fff;font-size:.93rem;font-weight:800;box-shadow:0 3px 0 #26383b20}.ph-dialog .ph-primary{display:block;width:100%}.ph-secondary{min-height:44px;padding:10px 14px;border:0;background:transparent;color:#8a7892;margin-top:8px;font-size:.8rem}.ph-status{min-height:1.5em;margin:13px 0 15px;font-size:.81rem;line-height:1.5;text-align:center;color:#8a7d8c}.ph-controls{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:12px;user-select:none}.ph-slider{display:flex;align-items:center;gap:12px;width:100%;max-width:410px;font-size:.8rem;color:#8b7d8f}.ph-slider input{flex:1;min-width:0;min-height:44px;accent-color:var(--ph-accent);touch-action:pan-x}.ph-slider output{width:44px;text-align:right;font-size:.77rem;font-variant-numeric:tabular-nums}.ph-slider:first-child{margin-top:-6px}.ph-pad{display:flex;align-items:stretch;justify-content:center;gap:10px}.ph-pad>button{min-width:54px;min-height:49px;border:1px solid #dcd5e2;border-radius:14px;background:var(--ph-wash);color:#776981;font-size:23px;font-weight:700;touch-action:none;box-shadow:0 3px 0 #dfd7e426}.ph-pad>button.ph-primary{min-width:133px;background:var(--ph-accent);border:0;color:#fff;font-size:.93rem}.ph-pad>button:active:not(:disabled){transform:translateY(2px)}.ph-help,.ph-limits{margin:15px auto 0;max-width:550px;text-align:center;font-size:.76rem;line-height:1.55;color:#8f8297}.ph-limits{padding:10px;border:1px solid #e4deee;border-radius:12px;background:#f5f2f9;margin-top:10px;font-size:.74rem}.ph-result a{display:inline-block;margin-top:13px;font-size:.76rem;color:#94809e}.ph-sparkles{font-size:33px;color:#c3a46c;letter-spacing:20px;margin:0 -20px 12px 0;animation:ph-celebrate .7s ease-out both}.ph-sparkles i{font-style:normal;color:#9bbfaf}.ph-terminal .ph-stage,.ph-terminal .ph-arena{min-height:340px}.ph-game button:focus-visible,.ph-game input:focus-visible,.ph-game a:focus-visible{outline:3px solid #6b5684;outline-offset:3px}@keyframes ph-celebrate{from{opacity:0;transform:translateY(12px) scale(.7)}to{opacity:1;transform:none}}
@media(max-width:560px){.ph-hud{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:14px;row-gap:11px;padding:12px}.ph-hud strong{font-size:.92rem;overflow-wrap:anywhere}.ph-hud span{font-size:.69rem}.ph-pause{justify-self:end}.ph-stage{min-height:310px;aspect-ratio:auto;border-radius:17px}.ph-arena{height:100%;min-height:310px;aspect-ratio:8/5}.ph-overlay{padding:12px}.ph-dialog{padding:20px 17px;max-width:330px;border-radius:17px}.ph-dialog h3{font-size:1.34rem}.ph-dialog ul{font-size:.77rem;margin-bottom:16px}.ph-dialog p{font-size:.81rem}.ph-pad{gap:8px}.ph-pad>button{min-width:48px;min-height:48px}.ph-pad>button.ph-primary{min-width:126px}.ph-help{font-size:.72rem}.ph-terminal .ph-stage,.ph-terminal .ph-arena{min-height:350px}}
@media(max-width:360px){.ph-pad{gap:6px}.ph-pad>button{min-width:44px}.ph-pad>button.ph-primary{min-width:120px}.ph-primary{padding:11px 15px;font-size:.86rem}.ph-dialog{padding:18px 13px}.ph-dialog h3{font-size:1.2rem}.ph-dialog li{font-size:.74rem}.ph-slider{gap:9px}.ph-hud strong{font-size:.87rem}.ph-limits{font-size:.7rem}.ph-terminal .ph-stage,.ph-terminal .ph-arena{min-height:370px}}
@media(prefers-reduced-motion:reduce){.ph-sparkles{animation:none}.ph-pad>button:active:not(:disabled){transform:none}}.ph-reduced .ph-sparkles{animation:none}
/* Flat controls; on phones the scene keeps its natural proportions. */
.ph-primary,.ph-pad>button{box-shadow:none}.ph-pad>button:active:not(:disabled){transform:none;filter:brightness(.96)}
@media(max-width:560px){
 .ph-stage,.ph-terminal .ph-stage{min-height:0;aspect-ratio:auto}
 .ph-arena,.ph-terminal .ph-arena{width:100%;height:auto;min-height:0;aspect-ratio:8/5}
 .ph-overlay{position:static;padding:12px;background:#f6f3ee;backdrop-filter:none;overflow:visible}
 .ph-overlay[hidden]{display:none}
 .ph-dialog{width:100%;max-width:none;padding:15px 12px;border-radius:12px;border:1px solid #e4ddd3;box-shadow:none}
}
.ph-limits [data-ph-sideways]{display:block;margin-bottom:5px;font-size:.77rem;color:#736181;font-weight:800}
