/* Liquid Glass for Cuber Tools (optional, html.lg).
   Clear, transparent surfaces defined only by light: a bright rim, a soft sheen and a floating shadow.
   No blur on page content (smooth on iPad). Frosted blur only where text sits on top of other text. */

/* ---------- tokens ---------- */
:root.lg{
  --lg-bg:linear-gradient(165deg,#e9ecf2 0%,#f3f4f7 45%,#eef1f6 100%);
  --lg-tint1:rgba(120,140,255,.10); --lg-tint2:rgba(80,210,200,.08); --lg-dot:rgba(90,100,130,.10);
  --gl-rim:rgba(255,255,255,.95); --gl-rim2:rgba(255,255,255,.55); --gl-line:rgba(60,70,95,.16);
  --gl-sheen:rgba(255,255,255,.22); --gl-shadow:0 1px 2px rgba(30,40,70,.06),0 10px 28px -12px rgba(30,40,70,.22);
  --gl-frost:rgba(246,247,250,.55); --gl-field:rgba(255,255,255,.35); --gl-pri:rgba(38,80,245,.82); --gl-spec:rgba(255,255,255,.35);
  --paper:transparent;
}
@media (prefers-color-scheme:dark){:root.lg:not([data-theme="light"]){
  --lg-bg:linear-gradient(165deg,#0c0d13 0%,#11131b 50%,#0b0c12 100%);
  --lg-tint1:rgba(90,110,255,.16); --lg-tint2:rgba(40,180,170,.10); --lg-dot:rgba(200,210,255,.07);
  --gl-rim:rgba(255,255,255,.42); --gl-rim2:rgba(255,255,255,.14); --gl-line:rgba(255,255,255,.10);
  --gl-sheen:rgba(255,255,255,.07); --gl-shadow:0 1px 2px rgba(0,0,0,.3),0 14px 32px -14px rgba(0,0,0,.75);
  --gl-frost:rgba(22,24,33,.55); --gl-field:rgba(255,255,255,.06); --gl-pri:rgba(90,125,255,.8); --gl-spec:rgba(255,255,255,.12)}}
:root.lg[data-theme="dark"]{
  --lg-bg:linear-gradient(165deg,#0c0d13 0%,#11131b 50%,#0b0c12 100%);
  --lg-tint1:rgba(90,110,255,.16); --lg-tint2:rgba(40,180,170,.10); --lg-dot:rgba(200,210,255,.07);
  --gl-rim:rgba(255,255,255,.42); --gl-rim2:rgba(255,255,255,.14); --gl-line:rgba(255,255,255,.10);
  --gl-sheen:rgba(255,255,255,.07); --gl-shadow:0 1px 2px rgba(0,0,0,.3),0 14px 32px -14px rgba(0,0,0,.75);
  --gl-frost:rgba(22,24,33,.55); --gl-field:rgba(255,255,255,.06); --gl-pri:rgba(90,125,255,.8); --gl-spec:rgba(255,255,255,.12)}

/* ---------- backdrop: still, light, exactly the screen ---------- */
html.lg{background:#eef0f4;overscroll-behavior-y:none}
:root.lg[data-theme="dark"]{background:#0c0d13}
@media (prefers-color-scheme:dark){:root.lg:not([data-theme="light"]){background:#0c0d13}}
/* sideways overflow is hidden on the page itself only. (overflow-x:clip on html and body made iPad Safari drop pinned buttons while scrolling.) */
html.lg{overflow-x:clip}
html.lg body,html.lg body.u4v{background:transparent!important}
#lgbg{display:none}
html.lg #lgbg{display:block;position:fixed;inset:0;z-index:-1;pointer-events:none;contain:strict;
  background:radial-gradient(70vmax 50vmax at 0% 0%,var(--lg-tint1),transparent 70%),radial-gradient(60vmax 50vmax at 100% 100%,var(--lg-tint2),transparent 70%),var(--lg-bg)}
html.lg #lgbg i{display:none}
html.lg #lgbg b{position:absolute;inset:0;background-image:radial-gradient(var(--lg-dot) 1.2px,transparent 1.6px);background-size:26px 26px}

/* ---------- the glass ---------- */
html.lg :is(.tool,.pnl,.contbtn,.item,.du5-row,.cr5-card,.pc5,.chipb,.themebtn,.btn:not(.pri),.seg,.crumbs a,.tag,.racebar,.lgx,.foot>.wrap,.fab a){
  background:radial-gradient(240px circle at var(--mx,20%) var(--my,-60%),var(--gl-spec),transparent 60%),linear-gradient(180deg,var(--gl-sheen),transparent 38%)!important;
  border:1px solid var(--gl-line)!important;
  box-shadow:var(--gl-shadow),inset 1px 1px 0 var(--gl-rim),inset -1px -1px 0 var(--gl-rim2)!important;
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important;
  color:var(--ink);
}
/* frosted glass: only where text sits over other text */
html.lg :is(.top .wrap,.sheet .box,.toast,.mail-ac,.own-top,.chatp,.lgf){
  background:linear-gradient(180deg,var(--gl-sheen),transparent 40%),var(--gl-frost)!important;
  border:1px solid var(--gl-line)!important;
  box-shadow:var(--gl-shadow),inset 1px 1px 0 var(--gl-rim),inset -1px -1px 0 var(--gl-rim2)!important;
  -webkit-backdrop-filter:blur(20px) saturate(170%);backdrop-filter:blur(20px) saturate(170%);
  color:var(--ink);
}
html.lg .toast{color:var(--ink)!important}
/* fields: a gently recessed, see-through well */
html.lg :is(.in,textarea,select,input.lgx){
  background:var(--gl-field)!important;border:1px solid var(--gl-line)!important;color:var(--ink)!important;
  box-shadow:inset 0 1px 3px rgba(0,0,0,.10),inset 0 -1px 0 var(--gl-rim2)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
/* primary buttons: clear tinted glass */
html.lg .btn.pri{background:linear-gradient(180deg,rgba(255,255,255,.28),transparent 50%),var(--gl-pri)!important;border:1px solid rgba(255,255,255,.35)!important;color:#fff!important;
  box-shadow:0 8px 20px -10px var(--gl-pri),inset 1px 1px 0 rgba(255,255,255,.7),inset -1px -1px 0 rgba(255,255,255,.25)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
/* dark heroes stay dark glass so their white text reads */
html.lg .lgd{background:linear-gradient(180deg,rgba(255,255,255,.08),transparent 40%),rgba(12,14,22,.72)!important;border:1px solid rgba(255,255,255,.12)!important;color:#fff;
  box-shadow:var(--gl-shadow),inset 1px 1px 0 rgba(255,255,255,.3)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html.lg .fab .chat{background:linear-gradient(180deg,rgba(255,255,255,.18),transparent 50%),rgba(15,17,26,.78)!important;color:#fff!important}

/* ---------- shapes: round and soft ---------- */
html.lg :is(.btn,.chipb,.themebtn,.crumbs a,.seg,.fab a,.tag){border-radius:999px!important}
html.lg .seg button{border-radius:999px!important}
html.lg :is(.tool,.pnl,.cr5-card,.pc5,.foot>.wrap){border-radius:26px!important}
html.lg :is(.item,.du5-row,.contbtn){border-radius:20px!important}
html.lg .sheet{background:rgba(10,14,30,.18)}
html.lg .sheet .box{border-radius:30px 30px 0 0!important}
@media (min-width:700px){html.lg .sheet .box{border-radius:30px!important}}
html.lg .seg button[aria-pressed="true"]{background:linear-gradient(180deg,rgba(255,255,255,.75),rgba(255,255,255,.4))!important;color:#111!important;box-shadow:0 3px 10px -4px rgba(0,20,80,.3),inset 0 1px 0 #fff!important}
:root.lg[data-theme="dark"] .seg button[aria-pressed="true"]{background:linear-gradient(180deg,rgba(255,255,255,.22),rgba(255,255,255,.08))!important;color:#fff!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.35)!important}
@media (prefers-color-scheme:dark){:root.lg:not([data-theme="light"]) .seg button[aria-pressed="true"]{background:linear-gradient(180deg,rgba(255,255,255,.22),rgba(255,255,255,.08))!important;color:#fff!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.35)!important}}

/* ---------- details inside cards ---------- */
html.lg :is(.tool .ic,.pc5-st>div,.du5-r,.gsw.ic){background:transparent!important;border:1px solid var(--gl-line)!important;box-shadow:inset 1px 1px 0 var(--gl-rim2)}
html.lg .list>div{background:none;border-bottom-color:var(--gl-line)}
html.lg .tool .stripe{opacity:.16;filter:blur(20px)}
html.lg .tool .meta{background:transparent!important;border:1px solid var(--gl-line);border-radius:999px;padding:3px 10px;align-self:flex-start}
html.lg body.u4v .tool{background-image:none}
html.lg .du5-hero{background:linear-gradient(120deg,rgba(255,77,109,.85),rgba(150,30,60,.8))!important;border-radius:26px!important;box-shadow:0 14px 30px -16px #ff4d6d,inset 1px 1px 0 rgba(255,255,255,.5)!important}

/* ---------- header and footer ---------- */
html.lg .top{background:transparent!important;border:0!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;padding-top:calc(env(safe-area-inset-top,0px) + 8px);pointer-events:none}
html.lg .top .wrap{pointer-events:auto;width:calc(100% - 16px);max-width:1180px;border-radius:24px!important;height:56px}
html.lg .foot{background:transparent!important;border:0!important;padding-bottom:20px}
html.lg .foot>.wrap{padding-top:24px;padding-bottom:24px;width:calc(100% - 16px);max-width:1180px}
html.lg .own{background:color-mix(in srgb,#eef0f4 70%,transparent)!important;-webkit-backdrop-filter:blur(24px);backdrop-filter:blur(24px)}
:root.lg[data-theme="dark"] .own{background:color-mix(in srgb,#0c0d13 70%,transparent)!important}
@media (prefers-color-scheme:dark){:root.lg:not([data-theme="light"]) .own{background:color-mix(in srgb,#0c0d13 70%,transparent)!important}}
html.lg .own-top{border-radius:22px!important;margin:8px 8px 12px;padding:0 12px}

/* ---------- motion: smooth and light ---------- */
html.lg :is(.tool,.item,.contbtn,.btn,.chipb,.themebtn,.fab a,.crumbs a,.seg button){transition:transform .3s cubic-bezier(.3,1.3,.6,1),box-shadow .3s ease!important}
@media (hover:hover){html.lg :is(.tool,.item,.contbtn):hover{transform:translateY(-2px);box-shadow:0 2px 4px rgba(30,40,70,.06),0 16px 34px -14px rgba(30,40,70,.28),inset 1px 1px 0 var(--gl-rim),inset -1px -1px 0 var(--gl-rim2)!important}}
html.lg :is(.btn,.chipb,.themebtn,.fab a,.crumbs a,.seg button):active{transform:scale(.97);transition-duration:.08s!important}
html.lg :is(.tool,.item,.contbtn):active{transform:scale(.985);transition-duration:.08s!important}
html.lg .lg-press{box-shadow:var(--gl-shadow),inset 0 0 0 1px var(--gl-rim),inset 0 0 24px -6px var(--gl-rim)!important}

/* ---------- the switch ---------- */
.lgbtn svg{width:19px;height:19px}
.lgbtn[aria-pressed="true"]{color:var(--blue)}
.lg-tab{display:none!important}

/* ---------- accessibility ---------- */
@media (prefers-reduced-transparency:reduce){html.lg{--gl-frost:rgba(246,247,250,.94)}:root.lg[data-theme="dark"]{--gl-frost:rgba(22,24,33,.94)}}
@media (prefers-reduced-motion:reduce){html.lg *{transition:none!important}}
html.lg.lg-anim *{transition:none!important}
html.lg :is(.cr5-ov,.du5-play,.lc5,.ucut) .btn:not(.pri){background:linear-gradient(180deg,rgba(255,255,255,.2),transparent 50%),rgba(255,255,255,.12)!important;color:#fff!important;border-color:rgba(255,255,255,.3)!important}
/* pad skins are never touched by Liquid Glass */
html.lg :is(.pad,.pad *){-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html.lg .pad:is(.lgx,.lgd,.lgf){background:revert-layer}


/* ===== Pure transparency: no tint anywhere. Things that sit over other text keep only a blur so they stay readable. ===== */
html.lg{--gl-frost:transparent}
html.lg :is(.top .wrap,.toast,.chatp,.mail-ac,.own-top,.lgf){background:linear-gradient(180deg,var(--gl-sheen),transparent 40%)!important;-webkit-backdrop-filter:blur(18px) saturate(160%);backdrop-filter:blur(18px) saturate(160%)}
/* popups: the box is clear; the page behind it is blurred and dimmed instead */
html.lg .sheet{background:rgba(10,14,30,.22)!important;-webkit-backdrop-filter:blur(14px) saturate(140%);backdrop-filter:blur(14px) saturate(140%)}
html.lg .sheet .box{background:linear-gradient(180deg,var(--gl-sheen),transparent 40%)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html.lg .own{background:transparent!important}
html.lg .fab .chat{background:linear-gradient(180deg,var(--gl-sheen),transparent 40%)!important;color:var(--ink)!important}
html.lg .lgd{background:linear-gradient(180deg,rgba(255,255,255,.08),transparent 40%)!important;color:var(--ink)}
html.lg .lgd *{color:inherit}
html.lg .fab a{-webkit-backdrop-filter:blur(14px) saturate(160%)!important;backdrop-filter:blur(14px) saturate(160%)!important}

/* ===== Glass texture: every surface is 100% clear, with only a light glass texture on top
   (soft diagonal reflections plus a very fine grain). No fill colour anywhere. ===== */
:root.lg{--gl-st1:rgba(255,255,255,.34);--gl-st2:rgba(255,255,255,.16);
  --gl-grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 -.18'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E")}
:root.lg[data-theme="dark"]{--gl-st1:rgba(255,255,255,.10);--gl-st2:rgba(255,255,255,.05)}
@media (prefers-color-scheme:dark){:root.lg:not([data-theme="light"]){--gl-st1:rgba(255,255,255,.10);--gl-st2:rgba(255,255,255,.05)}}
html.lg :is(.tool,.pnl,.contbtn,.item,.du5-row,.cr5-card,.pc5,.chipb,.themebtn,.btn:not(.pri),.seg,.crumbs a,.tag,.racebar,.lgx,.lgd,.lgf,.foot>.wrap,.fab a,.fab .chat,.top .wrap,.sheet .box,.toast,.chatp,.mail-ac,.own-top){
  background:
    radial-gradient(240px circle at var(--mx,20%) var(--my,-60%),var(--gl-spec),transparent 60%),
    linear-gradient(118deg,transparent 0 8%,var(--gl-st1) 15%,transparent 23%,transparent 52%,var(--gl-st2) 60%,transparent 68%,transparent 84%,var(--gl-st2) 90%,transparent 96%),
    var(--gl-grain)!important;
  background-size:auto,auto,140px 140px!important}
/* the same grain very faintly over the whole page so the texture covers all of Cuber Tools */
html.lg #lgbg b{background-image:var(--gl-grain),radial-gradient(var(--lg-dot) 1.2px,transparent 1.6px);background-size:140px 140px,26px 26px;opacity:.9}
:root.lg{--gl-grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .25  0 0 0 0 .3  0 0 0 0 .45  0 0 0 .5 -.2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E")}
:root.lg[data-theme="dark"]{--gl-grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .32 -.14'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E")}
@media (prefers-color-scheme:dark){:root.lg:not([data-theme="light"]){--gl-grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .32 -.14'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E")}}
:root.lg{--gl-st1:rgba(255,255,255,.6);--gl-st2:rgba(255,255,255,.3)}
:root.lg[data-theme="dark"]{--gl-st1:rgba(255,255,255,.09);--gl-st2:rgba(255,255,255,.045)}
@media (prefers-color-scheme:dark){:root.lg:not([data-theme="light"]){--gl-st1:rgba(255,255,255,.09);--gl-st2:rgba(255,255,255,.045)}}

/* ===== Translucent glass: a soft see-through frost on every surface, with the glass texture on top ===== */
:root.lg{--gl-tl:rgba(255,255,255,.42)}
:root.lg[data-theme="dark"]{--gl-tl:rgba(30,33,46,.46)}
@media (prefers-color-scheme:dark){:root.lg:not([data-theme="light"]){--gl-tl:rgba(30,33,46,.46)}}
html.lg :is(.tool,.pnl,.contbtn,.item,.du5-row,.cr5-card,.pc5,.chipb,.themebtn,.btn:not(.pri),.seg,.crumbs a,.tag,.racebar,.lgx,.lgf,.foot>.wrap,.fab a,.top .wrap,.sheet .box,.toast,.chatp,.mail-ac,.own-top){
  background:
    radial-gradient(240px circle at var(--mx,20%) var(--my,-60%),var(--gl-spec),transparent 60%),
    linear-gradient(118deg,transparent 0 8%,var(--gl-st1) 15%,transparent 23%,transparent 52%,var(--gl-st2) 60%,transparent 68%,transparent 84%,var(--gl-st2) 90%,transparent 96%),
    var(--gl-grain),
    linear-gradient(var(--gl-tl),var(--gl-tl))!important;
  background-size:auto,auto,140px 140px,auto!important}
/* frosted blur only on the larger pieces, to stay smooth on iPad */
html.lg :is(.tool,.pnl,.contbtn,.cr5-card,.pc5,.top .wrap,.sheet .box,.toast,.chatp,.mail-ac,.own-top,.lgf,.fab a){-webkit-backdrop-filter:blur(14px) saturate(170%)!important;backdrop-filter:blur(14px) saturate(170%)!important}
html.lg .sheet{-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
html.lg :is(.lgd,.fab .chat){background:radial-gradient(240px circle at var(--mx,20%) var(--my,-60%),rgba(255,255,255,.12),transparent 60%),var(--gl-grain),linear-gradient(rgba(14,16,24,.62),rgba(14,16,24,.62))!important;background-size:auto,140px 140px,auto!important;color:#fff!important}
/* maximum translucency: barely-there frost, still blurred behind the larger pieces */
:root.lg{--gl-tl:rgba(255,255,255,.12)}
:root.lg[data-theme="dark"]{--gl-tl:rgba(255,255,255,.04)}
@media (prefers-color-scheme:dark){:root.lg:not([data-theme="light"]){--gl-tl:rgba(255,255,255,.04)}}
html.lg :is(.lgd,.fab .chat){background:radial-gradient(240px circle at var(--mx,20%) var(--my,-60%),rgba(255,255,255,.12),transparent 60%),var(--gl-grain),linear-gradient(rgba(14,16,24,.3),rgba(14,16,24,.3))!important;background-size:auto,140px 140px,auto!important}

/* corner buttons: no live blur (Safari hides fixed blurred elements during scroll); a slightly fuller glass fill instead */
html.lg .fab a,html.lg .fab button{-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html.lg .fab a:not(.chat){background:var(--gl-grain),linear-gradient(rgba(255,255,255,.62),rgba(255,255,255,.62))!important;background-size:140px 140px,auto!important}
:root.lg[data-theme="dark"] .fab a:not(.chat){background:var(--gl-grain),linear-gradient(rgba(30,33,46,.7),rgba(30,33,46,.7))!important;background-size:140px 140px,auto!important}
@media (prefers-color-scheme:dark){:root.lg:not([data-theme="light"]) .fab a:not(.chat){background:var(--gl-grain),linear-gradient(rgba(30,33,46,.7),rgba(30,33,46,.7))!important;background-size:140px 140px,auto!important}}
html.lg .fab .chat{background:var(--gl-grain),linear-gradient(rgba(14,16,24,.72),rgba(14,16,24,.72))!important;background-size:140px 140px,auto!important;color:#fff!important}
