*{box-sizing:border-box;margin:0}
html{--T:max(12px,env(safe-area-inset-top));--R:max(10px,env(safe-area-inset-right));--B:max(12px,env(safe-area-inset-bottom));--L:max(10px,env(safe-area-inset-left));--shell:#26345a;--deep:#141c33;--key:#b4bfce;--side:#77839b;--ink:#1a2340;height:100%;background:#d6d2c8;color:#c9d0da;font:700 clamp(15px,2vh,22px)/1.2 system-ui,sans-serif}
body{height:100%;height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;overflow:hidden;padding:var(--T) var(--R) 0 var(--L);touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
#phone{--p:3rem;flex:1 0 auto;display:flex;flex-direction:column;align-items:center;gap:.75rem;max-height:100%;width:min(100%,calc((100dvh - 12px - 14rem)*5/3 + 2*var(--p)));padding:0 var(--p) max(1.25rem,var(--B));background:var(--shell);border:3px solid var(--deep);border-bottom:0;border-radius:50% 50% 0 0/5.5rem 5.5rem 0 0}
h1{display:grid;justify-items:center;font-size:1.5em;letter-spacing:.3em;text-indent:.3em}
h1:before{content:"";width:4.75rem;height:.75rem;margin:1.25rem 0 .75rem;border-radius:1rem;background:#10172b}
#screen{width:100%;aspect-ratio:5/3;min-height:0;display:grid;place-items:center}
html:not(.touch) #screen{flex:1 1 0;aspect-ratio:auto}
/* screen window: black glass, deeper chin with the 3310's curved lower edge; inner corners stay square */
#lcd{--b:clamp(8px,2vmin,24px);--c:calc(var(--b)*2.4);box-sizing:content-box;border:var(--b) solid #0c0f15;border-bottom-width:var(--c);border-radius:var(--b) var(--b) 50% 50%/var(--b) var(--b) var(--c) var(--c);background:#a4b48c;cursor:pointer;image-rendering:pixelated}
#bar{display:grid;grid:auto/1fr auto 1fr;align-items:center;gap:min(1rem,2.5vw);width:100%}
#hi{justify-self:start;width:min-content;text-align:center;font-size:min(1em,4.4vw)}
/* rubber keys: flat colours, a darker lower edge for depth, pressed = pushed in + green backlight */
button,kbd{font:inherit;color:var(--ink);background:var(--key);border:0;border-bottom:5px solid var(--side);min-height:3.5rem;padding:0 1rem;cursor:pointer;touch-action:none}
button:active,button.on,#play:active,#pad b.on{background:#a4b48c;border-bottom-width:2px;translate:0 3px}
button:focus-visible{outline:3px solid #a4b48c;outline-offset:3px}
#play{display:flex;align-items:center;justify-content:center;gap:.4em;font-size:clamp(16px,5vmin,1.3em);white-space:nowrap;padding:0 8px;width:clamp(124px,40vw,15rem);height:clamp(56px,13vmin + 24px,4.25rem);border-radius:50%/34% 34% 66% 66%;background:#e8ebf0;border-bottom-color:#9aa5b8}
#mute{justify-self:end;display:flex;align-items:center;gap:3px;padding:0 .7rem;border-radius:1.5rem}
.muted #mute .on,#mute .off{display:none}
.muted #mute .off{display:inline}
#help{font-weight:400;font-size:.875em;text-align:center;text-wrap:balance}
#help span{white-space:nowrap;margin:0 .4em}
kbd{display:inline-block;font-weight:700;min-height:0;padding:.15em .45em;border:2px solid var(--key);border-radius:.45em;background:none;color:inherit;cursor:auto}
#ctl,#tip{display:none}
.touch{background:var(--shell);font-size:16px}
.touch body{justify-content:flex-start;gap:min(12px,2vh);padding-bottom:var(--B)}
.touch #phone{display:contents}
.touch #help{display:none}
.touch #ctl{display:flex;flex-wrap:wrap;align-content:flex-end;width:100%;justify-content:space-between;align-items:center}
/* d-pad: four rubber keys in a dark well; the hub under them leans toward the pressed direction */
#pad{--s:min(40vmin,170px);position:relative;width:var(--s);height:var(--s);border-radius:50%;background:var(--deep);touch-action:none}
#pad *{position:absolute;pointer-events:none}
#pad b{z-index:1;display:grid;place-items:center;border-radius:28%;background:var(--key);border-bottom:4px solid var(--side)}
#pad b:before{content:"";width:42%;height:36%;background:var(--ink);clip-path:polygon(50% 0,100% 100%,0 100%)}
#pad b:nth-child(1){inset:4% 34% 64%}
#pad b:nth-child(2){inset:34% 4% 34% 64%}
#pad b:nth-child(3){inset:64% 34% 4%}
#pad b:nth-child(4){inset:34% 64% 34% 4%}
#pad b:nth-child(2):before{rotate:90deg}
#pad b:nth-child(3):before{rotate:180deg}
#pad b:nth-child(4):before{rotate:270deg}
#pad i{inset:36%;border-radius:50%;background:var(--side)}
#fire{--s:min(30vmin,124px);width:var(--s);height:var(--s);border-radius:50%;padding:0;font-size:min(22px,calc(var(--s)*.2));border:min(9px,calc(var(--s)*.08)) solid var(--deep)}
#fire.on{translate:none}
@media (orientation:portrait){
.touch h1{flex:1 0 auto;align-content:end}
.touch h1:before{margin:4px 0 12px}
.touch #ctl{flex:2 0 auto}
#pad{--s:min(48vmin,210px)}
#fire{--s:min(37vmin,160px)}
.touch #tip{display:block;align-self:center;text-align:center;font-weight:400;font-size:14px;margin-top:auto}
}
@media (orientation:portrait) and (max-height:620px){.touch #tip{display:none}}
@media (orientation:portrait) and (max-height:560px){.touch h1{font-size:0}.touch h1:before{margin:0}}
@media (orientation:landscape){
.touch h1,.touch #hi{position:fixed;left:calc(var(--L) + 4px);top:var(--T);font-size:15px;text-indent:0;width:auto}
.touch #hi{top:calc(var(--T) + 26px)}
.touch h1:before{display:none}
.touch #mute{position:fixed;right:var(--R);top:var(--T)}
.touch #screen,.touch #bar{width:auto;align-self:stretch;margin:0 calc(min(40vmin,170px) + 12px)}
.touch #screen{flex:1 1 0;aspect-ratio:auto}
.touch #play{grid-column:2}
.touch #ctl{position:fixed;inset:auto 0 0;pointer-events:none;padding:0 var(--R) var(--B) var(--L)}
.touch #ctl>*{pointer-events:auto}
}
