/* FocusGrove 3D kit, slice S1 (route fg-3d-s1-1127, parent #238; owner 27/11 11:40 "toan bo giao dien app game pi phai chuyen sang 3D trau truot"). Loaded AFTER app.css (templates/layout.php fgHeadLinks).
   Tokens = work/in/PLAN-3D.md section 2 (new --u3- names, none clash with app.css). Looks only: no rule, score, ticket or data changes. CSP style-src 'self': no inline style anywhere, all 3D lives in .css files.
   Light: key from upper left, cast shadow down-right; depth = base edge + body gradient + inner bevel + soft shadow (4 layers max); only transform and opacity ever move (PLAN-3D section 4). */
:root{
 /* light */
 --u3-hi:rgba(255,255,255,.55); --u3-hi-soft:rgba(255,255,255,.22); --u3-lo:rgba(0,0,0,.28);
 /* gold (IMG-07 sheet values) */
 --u3-gold-hi:#FFE28A; --u3-gold:#F4B63F; --u3-gold-lo:#D98E12; --u3-gold-base:#A86A08; --u3-gold-edge:#7A4A00; --u3-gold-ink:#2B1D00;
 /* emerald gem (IMG-07 + app --primary); --u3-gem-top keeps the type slice's measured gradient (white on gem 5.3, 4.85 at the label) */
 --u3-gem-hi:#5FD08F; --u3-gem:#1E7A4C; --u3-gem-lo:#155C39; --u3-gem-base:#0E3F27; --u3-gem-ink:#FFFFFF; --u3-gem-top:#2FA06B;
 /* warm wood + parchment */
 --u3-wood-hi:#B98750; --u3-wood:#8A5A2B; --u3-wood-lo:#5E3B1A; --u3-paper:#FBF4E2; --u3-paper-line:#D9C9A0; --u3-paper-ink:#2A2112; --u3-paper-low:#EADDB8; --u3-paper-base:#A38B4E;
 /* sky glass (night) */
 --u3-glass:rgba(34,48,90,.78); --u3-glass-line:rgba(255,255,255,.14); --u3-night:#1A2342; --u3-night-deep:#0B1128;
 /* stone (disabled) */
 --u3-stone-hi:#8A92A6; --u3-stone:#626B82; --u3-stone-base:#454C60; --u3-stone-ink:#E6E9F2;
 /* status */
 --u3-ruby:#B3261E; --u3-sky:#1F5F99;
 /* rank shields I-V (approved BAO-CAO-CHU.md:24, used ONLY inside the shield plate; first used by slice S2) */
 --u3-rk1:#2A7F50; --u3-rk2:#2A6FDB; --u3-rk3:#7B3FE4; --u3-rk4:#C8420C; --u3-rk5-edge:#7A4A00; --u3-rk5-hi:#FFD86B;
 /* depth recipes (shadow offsets point down-right); each component sets --u3-base for its own edge colour and spells the list out, a root-level var() would freeze the fallback */
 --u3-e1:0 1px 0 var(--u3-hi-soft) inset,0 2px 4px rgba(0,0,0,.25);
 --u3-e2:0 1px 0 var(--u3-hi) inset,0 -3px 0 var(--u3-lo) inset,0 4px 0 var(--u3-base,#000),0 8px 14px rgba(0,0,0,.30);
 --u3-e3:0 1px 0 var(--u3-hi) inset,0 -4px 0 var(--u3-lo) inset,0 6px 0 var(--u3-base,#000),0 14px 24px rgba(0,0,0,.34);
 --u3-press:0 1px 0 var(--u3-hi-soft) inset,0 -1px 0 var(--u3-lo) inset,0 1px 0 var(--u3-base,#000);
 /* shape + size */
 --u3-r-btn:16px; --u3-r-panel:22px; --u3-r-chip:999px; --u3-tap:52px;
 /* motion */
 --u3-t-press:80ms; --u3-t-ui:140ms; --u3-t-moment:900ms; --u3-ease:cubic-bezier(.2,.8,.2,1); --u3-sheen-every:10s;
}

/* ===== button kit: gem (default) / gold / cream (secondary) / stone (disabled); 56 px tall, label live text, max 2 lines inside the box ===== */
button,.button,.u3-btn-gem{
 --u3-base:var(--u3-gem-base); --u3-top:var(--u3-gem-top); --u3-mid:var(--u3-gem); --u3-bot:var(--u3-gem-lo); --u3-ink:var(--u3-gem-ink); --u3-ink-shadow:rgba(0,0,0,.3);
 min-height:56px;padding:8px var(--s4);border:0;border-radius:var(--u3-r-btn);font-family:var(--f-head);font-weight:700;letter-spacing:.01em;line-height:1.1;text-wrap:balance;
 color:var(--u3-ink);text-shadow:0 1px 0 var(--u3-ink-shadow);
 background:linear-gradient(180deg,var(--u3-hi) 0,rgba(255,255,255,.14) 16%,rgba(255,255,255,0) 38%),linear-gradient(180deg,var(--u3-top) 0,var(--u3-mid) 26%,var(--u3-bot) 100%);
 box-shadow:inset 0 1px 0 var(--u3-hi),inset 0 -3px 0 var(--u3-lo),0 4px 0 var(--u3-base),0 8px 14px rgba(5,9,24,.3);
 transition:transform var(--u3-t-press) var(--u3-ease);
}
button.reward,.button.reward,.mail-claim,.btn-gold,.u3-btn-gold{
 --u3-base:var(--u3-gold-base); --u3-top:var(--u3-gold-hi); --u3-mid:var(--u3-gold); --u3-bot:var(--u3-gold-lo); --u3-ink:var(--u3-gold-ink); --u3-ink-shadow:rgba(255,255,255,.4);
 background:linear-gradient(180deg,rgba(255,255,255,.5) 0,rgba(255,255,255,.14) 22%,rgba(255,255,255,0) 44%),linear-gradient(180deg,var(--u3-top) 0,var(--u3-mid) 55%,var(--u3-bot) 100%);
}
button.secondary,.button.secondary,.u3-btn-cream{
 --u3-base:var(--u3-paper-base); --u3-top:#FFFFFF; --u3-mid:var(--u3-paper); --u3-bot:var(--u3-paper-low); --u3-ink:var(--u3-paper-ink); --u3-ink-shadow:transparent;
 border:2px solid var(--u3-gold-lo);
 background:linear-gradient(180deg,rgba(255,255,255,.85) 0,rgba(255,255,255,.2) 40%,rgba(255,255,255,0) 46%),linear-gradient(180deg,var(--u3-mid) 0,var(--u3-paper) 40%,var(--u3-bot) 100%);
 box-shadow:inset 0 1px 0 #fff,inset 0 -3px 0 rgba(120,90,30,.16),0 4px 0 var(--u3-base),0 8px 14px rgba(5,9,24,.22);
}
button:disabled,button:disabled.reward,button:disabled.secondary,.button[aria-disabled="true"],.u3-btn-stone{
 --u3-base:var(--u3-stone-base); --u3-ink:var(--u3-stone-ink); --u3-ink-shadow:transparent;
 border:0;color:var(--u3-stone-ink);text-shadow:none;
 background:linear-gradient(180deg,rgba(255,255,255,.18) 0,rgba(255,255,255,0) 40%),linear-gradient(180deg,var(--u3-stone-hi) 0,var(--u3-stone) 30%,var(--u3-stone-base) 100%);
 box-shadow:inset 0 1px 0 var(--u3-hi-soft),inset 0 -2px 0 var(--u3-lo),0 3px 0 var(--u3-stone-base);
}
button:disabled,.button[aria-disabled="true"]{opacity:1;cursor:not-allowed;transform:none;filter:none}
/* pressed: the base shrinks 4 px -> 1 px and the body drops 3 px (transform only moves; the shadow list switches at once) */
button:active:not(:disabled),.button:active:not([aria-disabled="true"]),.u3-btn-gem:active,.u3-btn-gold:active,.u3-btn-cream:active,.u3-btn-stone:active{
 transform:translateY(3px);box-shadow:inset 0 1px 0 var(--u3-hi-soft),inset 0 -1px 0 var(--u3-lo),0 1px 0 var(--u3-base);filter:brightness(.97);
}
@media(hover:hover){button:hover:not(:disabled),.button:hover:not([aria-disabled="true"]){filter:brightness(1.06)}}
/* reduced motion (OS) and the in-app motion preference: nothing moves, the pressed shadow still shows */
@media(prefers-reduced-motion:reduce){html:not([data-motion="full"]) :is(button,.button,.u3-btn-gem,.u3-btn-gold,.u3-btn-cream,.u3-btn-stone){transition:none}html:not([data-motion="full"]) :is(button,.button,.u3-btn-gem,.u3-btn-gold,.u3-btn-cream,.u3-btn-stone):active{transform:none}}
html[data-motion="reduce"] :is(button,.button,.u3-btn-gem,.u3-btn-gold,.u3-btn-cream,.u3-btn-stone){transition:none}
html[data-motion="reduce"] :is(button,.button,.u3-btn-gem,.u3-btn-gold,.u3-btn-cream,.u3-btn-stone):active{transform:none}
/* sign-in: the Pi button is gold and is disabled until the Pi SDK answers; that wait stays gold, dimmed (it is not a locked state) */
.signin-page #pi-sign-in:disabled{--u3-base:var(--u3-gold-base);--u3-ink:var(--u3-gold-ink);color:var(--u3-gold-ink);opacity:.7;cursor:not-allowed;background:linear-gradient(180deg,rgba(255,255,255,.5) 0,rgba(255,255,255,.14) 22%,rgba(255,255,255,0) 44%),linear-gradient(180deg,var(--u3-gold-hi) 0,var(--u3-gold) 55%,var(--u3-gold-lo) 100%);box-shadow:inset 0 1px 0 var(--u3-hi),inset 0 -3px 0 var(--u3-lo),0 4px 0 var(--u3-gold-base),0 8px 14px rgba(5,9,24,.3)}

/* ===== panels: glass over the night sky, paper for long reading ===== */
.u3-panel-glass{
 box-sizing:border-box;border-radius:var(--u3-r-panel);color:var(--on-night,#F3F6EE);
 background:radial-gradient(120% 90% at 50% 0,rgba(255,255,255,.1) 0,rgba(255,255,255,0) 60%),linear-gradient(var(--u3-glass),var(--u3-glass)),var(--u3-night);
 box-shadow:inset 0 1px 0 var(--u3-hi-soft),inset 0 0 0 1px var(--u3-glass-line),0 8px 18px rgba(5,9,24,.35);
}
.u3-panel-paper{
 box-sizing:border-box;border-radius:var(--u3-r-panel);color:var(--u3-paper-ink);
 background:linear-gradient(180deg,#FFFDF5 0,var(--u3-paper) 18%,var(--u3-paper) 100%);
 box-shadow:inset 0 1px 0 #fff,inset 0 0 0 1px var(--u3-paper-line),0 6px 14px rgba(5,9,24,.25);
}
/* dialog sheet: glass body, gold rim, opaque (the page behind never shows through the words) */
dialog.sheet.u3-panel-glass{border:0;padding:var(--s5);color:var(--on-night,#F3F6EE);background:radial-gradient(120% 90% at 50% 0,rgba(255,255,255,.1) 0,rgba(255,255,255,0) 60%),linear-gradient(var(--u3-glass),var(--u3-glass)),var(--u3-night);box-shadow:inset 0 1px 0 var(--u3-hi-soft),inset 0 0 0 2px rgba(244,182,63,.6),0 12px 28px rgba(5,9,24,.5)}
dialog.sheet.u3-panel-glass::backdrop{background:rgba(11,17,40,.62)}
dialog.guest-prompt.u3-panel-glass h2{color:var(--u3-gold-hi)}
dialog.guest-prompt.u3-panel-glass .guest-get-pi{color:var(--u3-gold-hi)}

/* ===== chips + masthead: glass chip with a gold hairline, geometry of the old chip (2 px border, >= 44 px) ===== */
:is(.u3-chip,.signin-page .lang-switch,.fg-stage .masthead .lang-switch){
 color:var(--on-night,#F3F6EE);border-color:rgba(244,182,63,.62);
 background:linear-gradient(180deg,rgba(255,255,255,.16) 0,rgba(255,255,255,0) 52%),linear-gradient(var(--u3-glass),var(--u3-glass)),var(--u3-night);
 box-shadow:inset 0 1px 0 var(--u3-hi-soft),inset 0 -2px 0 rgba(0,0,0,.28),0 2px 0 rgba(5,9,24,.55);
}
.g2-try .guest-try-note{background:linear-gradient(180deg,rgba(255,255,255,.12) 0,rgba(255,255,255,0) 60%),rgba(11,17,40,.78);box-shadow:inset 0 1px 0 var(--u3-hi-soft),0 2px 0 rgba(5,9,24,.5)}
/* minute chips of the Try / home form: night glass chip, selected = gem with a gold ring (same box as before: 58 px, 15 px radius) */
.g2-tok-face{background:linear-gradient(180deg,rgba(255,255,255,.16) 0,rgba(255,255,255,0) 46%),linear-gradient(180deg,#2E3F73,#202C54);box-shadow:inset 0 0 0 2px var(--panel-edge),inset 0 1px 0 var(--u3-hi-soft),inset 0 -3px 0 rgba(0,0,0,.28),0 4px 0 var(--u3-night-deep)}
.g2-token input:checked+.g2-tok-face{background:linear-gradient(180deg,rgba(255,255,255,.34) 0,rgba(255,255,255,.08) 24%,rgba(255,255,255,0) 40%),linear-gradient(180deg,var(--u3-gem-top) 0,var(--u3-gem) 40%,var(--u3-gem-lo) 100%);box-shadow:inset 0 0 0 2px var(--u3-gold),inset 0 1px 0 var(--u3-hi),inset 0 -3px 0 var(--u3-lo),0 4px 0 var(--u3-gem-base)}
.g2-token input:active+.g2-tok-face{box-shadow:inset 0 0 0 2px var(--panel-edge),inset 0 1px 0 var(--u3-hi-soft),0 1px 0 var(--u3-night-deep)}

/* ===== sign-in lockup: IMG-04 crest (the owner's logo, 27/11 12:28), one light sweep every 10 s, fireflies behind; the name also stays live text in the page (visually hidden here: the painted crest carries the word) ===== */
.signin-page .wordmark{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.u3-lockup{position:relative;display:block;width:136px;margin:var(--s2) auto 0;aspect-ratio:256/259}
.u3-crest{position:relative;display:block;width:100%;aspect-ratio:256/259}
.u3-crest img{position:relative;display:block;width:100%;height:auto;aspect-ratio:256/259;filter:drop-shadow(0 6px 8px rgba(0,0,0,.45))}
.u3-flies{position:absolute;inset:-12% -40% -4%;pointer-events:none}
.u3-fly{position:absolute;width:5px;height:5px;border-radius:50%;background:#FFD66B;box-shadow:0 0 6px 1px rgba(255,214,107,.85);opacity:0;animation:u3-fly 6s ease-in-out infinite;will-change:transform,opacity}
.u3-fly:nth-child(1){left:6%;bottom:18%;animation-delay:-.4s}.u3-fly:nth-child(2){left:20%;bottom:70%;animation-delay:-2.1s;animation-duration:7s}.u3-fly:nth-child(3){left:12%;bottom:44%;animation-delay:-4.3s}
.u3-fly:nth-child(4){left:90%;bottom:24%;animation-delay:-1.2s;animation-duration:7s}.u3-fly:nth-child(5){left:80%;bottom:74%;animation-delay:-3.2s}.u3-fly:nth-child(6){left:94%;bottom:50%;animation-delay:-5.1s;animation-duration:5s}
.u3-fly:nth-child(7){left:50%;bottom:92%;animation-delay:-2.7s;animation-duration:8s}
@keyframes u3-fly{0%{opacity:0;transform:translate3d(0,0,0)}25%{opacity:.9}70%{opacity:.7}100%{opacity:0;transform:translate3d(6px,-22px,0)}}
/* the light sweep: a soft diagonal band travels across the crest once every --u3-sheen-every, clipped to the crest's own silhouette (mask = the same webp) */
.u3-sweep{position:absolute;inset:0;overflow:hidden;pointer-events:none;
 -webkit-mask:url(/assets/ui/crest-fg-256.70c212a7.webp) center/100% 100% no-repeat;mask:url(/assets/ui/crest-fg-256.70c212a7.webp) center/100% 100% no-repeat}
.u3-sweep::after{content:"";position:absolute;top:-10%;bottom:-10%;left:0;width:42%;
 background:linear-gradient(100deg,rgba(255,246,214,0) 0,rgba(255,246,214,.78) 50%,rgba(255,246,214,0) 100%);
 transform:translateX(-130%) skewX(-16deg);animation:u3-sweep var(--u3-sheen-every) linear 1.4s infinite;will-change:transform}
@keyframes u3-sweep{0%{transform:translateX(-130%) skewX(-16deg)}9%,100%{transform:translateX(330%) skewX(-16deg)}}
[dir="rtl"] .u3-sweep::after{left:auto;right:0;transform:translateX(130%) skewX(16deg);animation-name:u3-sweep-rtl}
@keyframes u3-sweep-rtl{0%{transform:translateX(130%) skewX(16deg)}9%,100%{transform:translateX(-330%) skewX(16deg)}}
/* reduced motion (OS) or in-app "reduce": the crest stands still and finished; no sweep, no fireflies */
@media(prefers-reduced-motion:reduce){html:not([data-motion="full"]) .u3-lockup :is(.u3-sweep,.u3-flies){display:none}html:not([data-motion="full"]) .u3-sweep::after,html:not([data-motion="full"]) .u3-fly{animation:none;will-change:auto}}
html[data-motion="reduce"] .u3-lockup :is(.u3-sweep,.u3-flies){display:none}
html[data-motion="reduce"] .u3-sweep::after,html[data-motion="reduce"] .u3-fly{animation:none;will-change:auto}

/* sign-in status line: toast.js wraps #signin-status into .status-line after first paint; both states take the same box (small type, 1.4 line, 8 px above and below, 24 px start padding = the icon + gap) so nothing below moves when the wrap happens */
.focus-card>#signin-status{margin:var(--s2) 0;padding-inline-start:24px;font-size:var(--fs-small);font-weight:500;line-height:1.4;color:var(--night-muted)}

/* ===== locked tiles (sign-in): stone plaque + the painted IMG-34 lock; the label stays live text ===== */
.guest-locked button.u3-btn-stone{height:100%;cursor:pointer;color:var(--u3-stone-ink);text-shadow:none}
.guest-panel.u3-panel-glass{position:relative;isolation:isolate;background:none;box-shadow:none}
/* the glass plate bleeds 12 px outside the content box (pseudo-element), so the panel keeps its old width and its text wraps exactly as before: no layout shift when the font swaps */
.guest-panel.u3-panel-glass::before{content:"";position:absolute;inset:calc(-1*var(--s3));z-index:-1;border-radius:var(--u3-r-panel);background:radial-gradient(120% 90% at 50% 0,rgba(255,255,255,.1) 0,rgba(255,255,255,0) 60%),linear-gradient(var(--u3-glass),var(--u3-glass)),var(--u3-night);box-shadow:inset 0 1px 0 var(--u3-hi-soft),inset 0 0 0 1px var(--u3-glass-line),0 8px 18px rgba(5,9,24,.35)}
.guest-lock-ico{display:block;width:32px;height:32px;flex:none}
.guest-lock-img{display:block;width:32px;height:32px;filter:drop-shadow(0 2px 2px rgba(0,0,0,.4))}
