*{box-sizing:border-box}html,body{margin:0;height:100%;height:var(--app-h,100dvh);background:#0b0418;overflow:hidden;font-family:"Trebuchet MS",system-ui,sans-serif;color:#fff;touch-action:none;user-select:none;-webkit-user-select:none;overscroll-behavior:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%}
input{user-select:text;-webkit-user-select:text;font-size:16px;touch-action:manipulation}button{touch-action:manipulation}
canvas{display:block;position:fixed;left:0;top:0;width:100vw;height:100%;height:100dvh}
.hidden{display:none!important}
.overlay{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:rgba(10,3,25,.55);text-align:center;padding:16px;overflow:auto}
h1{font-size:clamp(40px,9vw,88px);margin:0;letter-spacing:4px;line-height:.95;background:linear-gradient(#ffe36e,#ff3ea5 60%,#7b2cff);-webkit-background-clip:text;background-clip:text;color:transparent;filter:drop-shadow(0 0 12px #ff3ea5aa)}
h1 span{display:block;font-size:.55em;letter-spacing:12px}
h2{margin:0;font-size:clamp(24px,5vw,40px);color:#ffe36e;text-shadow:0 0 10px #ff3ea5}
.tag{opacity:.85;margin:4px}
.menu{display:flex;flex-direction:column;gap:10px;min-width:220px}
button{font:inherit;font-weight:bold;letter-spacing:2px;color:#fff;background:#2a0f55;border:2px solid #ff3ea5;border-radius:10px;padding:10px 18px;cursor:pointer;box-shadow:0 0 12px #ff3ea566}
button:hover,button:focus-visible{background:#ff3ea5;outline:3px solid #ffe36e}
button.big{font-size:22px;padding:14px}
.small{font-size:14px}.dim{opacity:.55}
.list{text-align:left;max-width:560px;line-height:1.5}
.pk{display:inline-block;min-width:26px;text-align:center;border-radius:6px;padding:0 4px;color:#000;font-weight:bold}
.pk.g{background:#5cf2ff}.pk.s{background:#9b8cff}.pk.x{background:#ffe36e}.pk.b{background:#ff7a3c}
.opts{display:flex;flex-direction:column;gap:10px;text-align:left;font-size:17px}
.opts input[type=checkbox]{width:20px;height:20px;vertical-align:middle;margin-right:8px}
select,input{font:inherit}
.scorelist{min-width:240px;text-align:left;font-family:monospace;font-size:20px}
.dash{font-family:monospace;font-size:28px;color:#5cf2ff;border:2px solid #5cf2ff;padding:6px 16px;border-radius:8px;letter-spacing:3px}
.bigscore{font-size:64px;margin:0;color:#ffe36e}
#nameIn{width:80px;text-transform:uppercase;text-align:center;font-size:22px}
.hudbtn{position:fixed;top:10px;width:46px;height:46px;padding:0;font-size:20px}
#btnPause{right:66px}#btnMute{right:12px}
.burstbtn{white-space:nowrap;letter-spacing:0;position:fixed;right:16px;bottom:20px;width:80px;height:80px;border-radius:50%;font-size:18px;background:#ff7a3c;border-color:#ffe36e}
.burstbtn.empty{opacity:.35}
#toast{position:fixed;left:50%;top:18%;transform:translateX(-50%);font-weight:bold;font-size:22px;color:#ffe36e;text-shadow:0 0 8px #000,0 0 12px #ff3ea5;pointer-events:none;transition:opacity .4s;opacity:0;text-align:center;max-width:80vw}
body.hc .overlay{background:#000e}body.hc button{background:#000;border-color:#fff;box-shadow:none}body.hc h2{color:#fff;text-shadow:none}
@media (prefers-reduced-motion:reduce){#toast{transition:none}}

.rollbtn{position:fixed;right:110px;bottom:28px;width:66px;height:66px;border-radius:50%;padding:0;font-size:15px;background:#1d4a7a;border-color:#bfe4ff}.rollbtn.empty{opacity:.35}
@media (max-width:600px){#toast{top:36%;font-size:18px;width:90%}}
.glist{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:8px;max-width:920px;width:100%;max-height:60vh;overflow:auto;padding:4px}
.gcard{background:#1a0b33;border:1px solid #553;border-radius:8px;padding:8px;text-align:left;font-size:13px;display:flex;flex-direction:column;gap:3px;opacity:.7}
.gcard.ok{border-color:#ffe36e;opacity:1;box-shadow:0 0 8px #ffe36e55}
.gcard span{opacity:.75;font-size:12px}
#credit{position:fixed;left:calc(8px + env(safe-area-inset-left));bottom:calc(6px + env(safe-area-inset-bottom));z-index:60;pointer-events:none;font:600 11px/1.2 system-ui,sans-serif;color:#fff;background:rgba(10,8,24,.55);padding:3px 7px;border-radius:9px;letter-spacing:.3px;text-shadow:0 1px 2px #000;user-select:none}
@media (max-width:600px){#credit{font-size:10px;max-width:calc(100vw - 24px)}}
.disclaimer{font-size:12px;opacity:.75;margin-top:6px}
.rothint{display:none;color:#5cf2ff}
@media (orientation:portrait) and (max-width:700px){.rothint{display:block}}
.menu .share{background:#000;border-color:#e8e8e8}
body.playing #credit .fdisc{display:none}
@media (min-width:900px){body.playing #credit .fdisc{display:inline}}
@media (max-width:600px){#toast{top:30%}}
.tipbox{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:center;margin:2px 0 10px;padding:6px 10px;border:1px solid rgba(255,227,110,.35);border-radius:12px;background:rgba(20,8,40,.55)}
.tiplabel{font-size:12px;color:#ffe36e;letter-spacing:1px;text-transform:uppercase}
.tipbox .tipbtn{font-size:12px;padding:6px 12px;min-height:0;border-width:1px}
@media (max-height:500px){#credit .fdisc{display:none}body:not(.playing) #credit .fdisc{display:inline}body:not(.playing) #credit{font-size:9px}.overlay{bottom:calc(26px + env(safe-area-inset-bottom));padding-bottom:8px;justify-content:safe center}}
/* short landscape phones: fit the whole game over screen, RELAUNCH included, without scrolling */
@media (max-height:500px){#over{gap:5px;padding-top:8px}#over h2{font-size:20px;margin:0}#over .bigscore{font-size:34px;margin:0;line-height:1}#over #overTip{display:none}#over p{margin:0}#over .menu{flex-direction:row;flex-wrap:wrap;justify-content:center;gap:8px}#over .menu button{padding:8px 14px;font-size:14px;min-width:0}#over .tipbox{margin:0}#over .tipbox .tipbtn{padding:5px 10px}#over form button{padding:6px 12px}}
#credit .fpriv a{pointer-events:auto;color:#9ff;text-decoration:underline}
body.playing #credit .fpriv{display:none}
#rf-counter{margin-top:2px}
@media (max-height:500px){#title #rf-counter{font-size:10px;padding:.3em .5em;position:fixed;right:calc(8px + env(safe-area-inset-right));bottom:calc(6px + env(safe-area-inset-bottom));margin:0;z-index:61}}

/* keep fixed controls inside the safe area and above browser bars */
.hudbtn{top:calc(10px + env(safe-area-inset-top))}#btnPause{right:calc(66px + env(safe-area-inset-right))}#btnMute{right:calc(12px + env(safe-area-inset-right))}
.burstbtn{right:calc(16px + env(safe-area-inset-right));bottom:calc(20px + env(safe-area-inset-bottom))}
.rollbtn{right:calc(110px + env(safe-area-inset-right));bottom:calc(28px + env(safe-area-inset-bottom))}
.overlay{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right));padding-top:max(16px,env(safe-area-inset-top));height:var(--app-h,100dvh);bottom:auto}
@media (max-height:500px){.overlay{height:calc(var(--app-h,100dvh) - 26px - env(safe-area-inset-bottom))}}
