/* Pop: styles shared by index.html and debug.html.
   VOICE: playful arcade, quick and bright
   IDEA: a tall fizzy glass of soda you pop bubbles in
   PICTURE: the glass itself, full of rising glossy bubbles
   COLOUR and TYPE: peach ground, deep teal water, hot pink accent; Baloo 2 + Nunito
   LAYOUT: title row, HUD strip, the glass filling the rest, stacked on phones */
@font-face {
  font-family: 'Baloo 2';
  src: url('../fonts/baloo-2-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
}

@font-face {
  font-family: Nunito;
  src: url('../fonts/nunito-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root{color-scheme:light dark;--bg:light-dark(#ffe4d1,#1d1422);--ink:light-dark(#2a1a2e,#fbe9ff);--soft:light-dark(#fff4ea,#2b1f33);--pink:#ff3d7f;--play:#12b3a8;--playInk:#fff;--line:light-dark(#2a1a2e33,#ffffff33)}
:root[data-theme=light]{color-scheme:light}:root[data-theme=dark]{color-scheme:dark}
*{box-sizing:border-box;min-width:0}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.55 Nunito,system-ui,sans-serif;overflow-x:clip}
/* The page always fits the visible screen (dvh = the part of a phone screen that is really visible): no scrolling.
   The glass takes whatever height is left. */
.wrap{max-width:720px;margin:0 auto;padding:clamp(8px,2vh,16px) max(4vw,12px) clamp(6px,1.5vh,14px);height:100vh;height:100dvh;display:flex;flex-direction:column}
header{display:flex;align-items:center;gap:10px}
h1{font:800 46px/1.05 'Baloo 2',system-ui,sans-serif;margin:0}
.tag{margin:0 auto 0 4px;font-size:15px;opacity:.8}
.ib{width:44px;height:44px;flex:none;border-radius:50%;border:2px solid var(--ink);background:transparent;color:var(--ink);font:800 19px/1 'Baloo 2',sans-serif;cursor:pointer}
.ib.off{opacity:.4;text-decoration:line-through}
.hud{display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;margin:clamp(6px,1.5vh,12px) 0 clamp(6px,1.2vh,10px);flex:none}
/* the header (sound, profile, settings, help) stays usable above every overlay */
header{flex:none;position:relative;z-index:12}
/* The target bar: the most important thing on screen, so it is big and filled with the target colour itself. */
.target{--tc:#ff5a5f;position:relative;overflow:hidden;width:100%;display:flex;align-items:center;gap:14px;background:var(--tc);color:#1b1530;border-radius:22px;padding:8px 18px 20px 8px;box-shadow:0 10px 24px -14px var(--tc);transition:background .25s}
.target canvas{width:64px;height:64px;display:block;flex:none}
.target .tl{font:700 14px/1 Nunito,sans-serif;opacity:.8}
.target b{font:800 clamp(30px,7vw,44px)/1 'Baloo 2',sans-serif;display:block;text-transform:uppercase;letter-spacing:.5px}
/* countdown: a big number with a small label above it */
.target small{display:flex;flex-direction:column;align-items:flex-end;gap:2px;margin-inline-start:auto;text-align:right;white-space:nowrap}
.target small span{font:700 13px/1 Nunito,sans-serif;opacity:.85}
.target small b{font:800 clamp(30px,8vw,42px)/.95 'Baloo 2',sans-serif;font-variant-numeric:tabular-nums;text-transform:none}
/* time strip along the bottom of the bar: thick, so the time left is easy to see at a glance */
.target .time{position:absolute;left:0;bottom:0;height:12px;width:100%;background:#1b1530a6;border-radius:0 6px 6px 0;transform-origin:left;transform:scaleX(1)}
.target.warn .time{background:#1b1530}
.nextchip{display:none;align-items:center;gap:6px;margin-inline-start:auto;background:#1b1530;color:#fff;border-radius:999px;padding:6px 12px 6px 6px;font:800 15px/1 'Baloo 2',sans-serif;white-space:nowrap}
.nextchip i{width:22px;height:22px;border-radius:50%;background:var(--nc,#fff)}
.target.warn .nextchip{display:flex;animation:pulse .45s infinite alternate}
.target.warn small{display:none}
@keyframes pulse{to{transform:scale(1.08)}}
.lives{display:flex;gap:6px;margin-inline-start:auto}
.life{width:16px;height:16px;border-radius:50%;background:var(--pink)}
.life.off{background:transparent;box-shadow:inset 0 0 0 2px var(--line)}
.stat{text-align:right;font-variant-numeric:tabular-nums}
.stat .v{font:800 28px/1 'Baloo 2',sans-serif}
.stat .l{font-size:13px;opacity:.7}
.tank{--tc:#ffffff35;position:relative;flex:1 1 auto;min-height:220px;border-radius:30px;overflow:hidden;background:linear-gradient(170deg,#118496,#0a4a5a 60%,#06303d);box-shadow:inset 0 0 0 5px var(--tc),0 22px 40px -22px #06303d;transition:box-shadow .25s}
.tank.flash{animation:fl .6s}
@keyframes fl{40%{box-shadow:inset 0 0 0 14px #fff,0 22px 40px -22px #06303d}}
.tank>canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:pointer}
/* Menu, result and help cover the whole screen (more room than the glass) and are sized to fit without scrolling. */
.ov{position:fixed;inset:var(--hh,0px) 0 0 0;z-index:10;display:flex;padding:clamp(6px,1.5vh,14px) 14px clamp(8px,2vh,18px);background:#06303df2;color:#effbff;text-align:center;overflow:auto;overscroll-behavior:contain}
.ov[hidden]{display:none}
.card{width:100%;max-width:400px;margin:auto}
.ov h2{font:800 clamp(24px,4.2vh,34px)/1.05 'Baloo 2',sans-serif;margin:0 0 4px;text-wrap:balance}
.ov p{margin:6px 0}
.big{font:800 clamp(40px,8vh,64px)/1 'Baloo 2',sans-serif;color:#ffd23f}
.info{font-size:14px;color:#cfeaf0}
.btn{display:block;width:100%;min-height:46px;margin:clamp(6px,1.2vh,10px) 0 0;border:0;border-radius:14px;background:var(--play);color:var(--playInk);font:800 18px 'Baloo 2',sans-serif;cursor:pointer}
.btn.alt{background:#ffffff1a;box-shadow:inset 0 0 0 2px #ffffff55}
.btn:disabled{opacity:.55;cursor:default}
.btn[hidden]{display:none}
button:focus-visible,.social a:focus-visible{outline:3px solid #ffd23f;outline-offset:2px}
.rules{text-align:left;margin:10px 0 0;padding-left:20px;font-size:15px}
.rules li{margin:4px 0}
.note{font-size:13px;color:#bfe3ea}
.sharebox{margin-top:clamp(8px,1.6vh,14px);padding-top:clamp(8px,1.4vh,12px);border-top:1px solid #ffffff30}
.sharebox h3{font:800 19px/1.1 'Baloo 2',sans-serif;margin:0}
.two{display:flex;gap:8px}.two .btn{flex:1}
pre{white-space:pre-wrap;overflow-wrap:anywhere;text-align:left;background:#00000040;padding:8px 10px;border-radius:10px;font:12px/1.35 ui-monospace,Consolas,monospace;margin:8px 0 0}
.social{display:flex;flex-wrap:wrap;gap:5px;align-items:center;justify-content:center;margin-top:8px;font-size:13px;color:#bfe3ea}
.social a{display:inline-flex;align-items:center;background:#ffffff1a;color:#fff;text-decoration:none;padding:0 10px;border-radius:9px;font-weight:700;min-height:40px}
.social a:hover{background:#ffffff33}
.foot{font-size:12px;opacity:.7;margin:clamp(4px,1vh,10px) 0 0;text-align:center;flex:none}
/* first-time tips: the game pauses, a ring marks the thing, a white box says one short line */
#tip{position:fixed;inset:0;z-index:30;background:#06303d66}
#tip[hidden],#tipRing[hidden]{display:none}
.tipbox{position:fixed;background:#fff;color:#1b1530;border-radius:18px;padding:14px 16px;box-shadow:0 16px 34px -12px #000c;font-size:16px;line-height:1.35}
.tipbox p{margin:0}.tipbox .btn{margin-top:10px}
#tipRing{position:fixed;z-index:31;pointer-events:none;border:4px solid #ffd23f;box-shadow:0 0 0 4px #ffd23f55;animation:ringp .8s infinite alternate}
@keyframes ringp{to{box-shadow:0 0 0 12px #ffd23f22}}
body.calm #tipRing{animation:none}
/* settings */
.setrow{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:clamp(8px,1.6vh,12px);text-align:left;font-weight:700}
.seg{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:4px;background:#00000035;border-radius:12px;padding:3px}
.seg button{min-height:40px;padding:0 12px;border:0;border-radius:9px;background:transparent;color:#cfeaf0;font:700 14px Nunito,sans-serif;cursor:pointer}
.seg button[aria-pressed=true]{background:var(--pink);color:#fff}
.seg button:disabled{opacity:.45;cursor:default}
.note[hidden]{display:none}
.setrow.wide{flex-direction:column;align-items:stretch;gap:6px}.setrow.wide .seg{justify-content:stretch}.setrow.wide .seg button{flex:1}
/* panels opened on top of the menu or result are fully opaque */
#howto,#settings,#profile{background:#06303d}
/* profile */
.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(4px,.9vh,8px);margin-top:clamp(6px,1vh,10px)}
.tiles .tile{background:#ffffff14;border-radius:14px;padding:clamp(3px,.9vh,10px) 8px;display:flex;flex-direction:column;align-items:center}
.tiles b{font:800 clamp(20px,3.6vh,30px)/1.05 'Baloo 2',sans-serif;color:#ffd23f;font-variant-numeric:tabular-nums}
.tiles span{font-weight:700;font-size:14px;line-height:1.2}
.tiles small{font-size:12px;color:#bfe3ea;line-height:1.2}
/* black & white: the whole page turns grey (a filter on the root element keeps the full-screen overlays working);
   symbols are forced on in pop.js. The colorblind palette is drawn by pop.js. */
html.bw{filter:grayscale(1)}
/* quick how-to: a little bubble picture + one short line each */
.how{list-style:none;margin:8px 0 0;padding:0;text-align:left}
.how li{display:flex;align-items:center;gap:12px;margin:clamp(4px,1vh,8px) 0;font-size:15px;line-height:1.3}
.how canvas{width:40px;height:40px;flex:none}
body.calm .tank.flash,body.calm .target.warn .nextchip{animation:none}body.calm .target,body.calm .tank{transition:none}
@media(max-width:600px){h1{font-size:36px}.tag{display:none}header .sp{margin-inline-end:auto}.target canvas{width:52px;height:52px}}
/* short screens (small phones, landscape, laptops): tighter header and target bar, no text preview of the result */
@media(max-height:740px){h1{font-size:32px}.ib{width:40px;height:40px}.target{padding:5px 14px 16px 6px}.target small b{font-size:30px}.target canvas{width:44px;height:44px}.target b{font-size:30px}.stat .v{font-size:24px}.rules{font-size:14px}.rules li{margin:2px 0}}
@media(max-height:640px){#oShare{display:none}.ov p{margin:3px 0}}
@media(prefers-reduced-motion:reduce){.tank.flash,.target.warn .nextchip{animation:none}.target,.tank{transition:none}}
/* very short screens (phone held sideways): smallest header and bar, help in two columns */
@media(max-height:480px){.how{columns:2;column-gap:20px}.how li{break-inside:avoid;font-size:13px;margin:3px 0}.how canvas{width:32px;height:32px}.setrow.wide{flex-direction:row;align-items:center}.setrow.wide .seg button{flex:none}#settings .note:not(#symNote){display:none}.setrow{margin-top:5px}.seg button{min-height:36px}.tiles{grid-template-columns:repeat(4,minmax(0,1fr))}#profile .card,#settings .card{max-width:760px}.tiles small{display:none}h1{font-size:24px}.ib{width:36px;height:36px;font-size:16px}.wrap{padding-top:6px}
  .target{padding:3px 12px 12px 4px;border-radius:16px}.target .time{height:8px}.target small b{font-size:24px}.target small span{font-size:11px}.target canvas{width:34px;height:34px}.target b{font-size:22px}.target .tl{display:none}
  .stat .v{font-size:20px}.stat .l{font-size:11px}.hud{margin:4px 0}.tank{min-height:150px;border-radius:20px}.foot{display:none}
  #howto .card{max-width:760px}.rules{columns:2;column-gap:24px;font-size:13px}.rules li{break-inside:avoid}.ov h2{font-size:22px}}
@media(max-height:400px){.sharebox h3{display:none}.big{font-size:34px}.btn{min-height:40px}.info{font-size:13px}.social{margin-top:4px}.social a{min-height:36px}}
@media(max-height:340px){.how li{font-size:12px;margin:1px 0}.how canvas{width:26px;height:26px}#howto h2{display:none}}
/* short and wide (phone sideways): result in two columns, score left, sharing right */
@media(max-height:400px) and (min-width:540px){#over .card{max-width:760px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);column-gap:18px;align-items:center}
  #over h2,#over .big,#over .info{grid-column:1}#over .sharebox{grid-column:2;grid-row:1/4;margin:0;padding:0;border:0}#over .card>.two{grid-column:1/3}}
@media(max-height:400px) and (min-width:540px){#settings .card{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:20px;align-items:center}
  #settings h2,#settings .close,#settings #symNote{grid-column:1/3}}
@media(max-height:660px){#profile .note{display:none}.tiles small{font-size:11px}}
