/* Nov 14 2026: the grade result fits the screen (every slab).
   The buttons stay pinned to the bottom, the subgrades sit in a 2x2 grid, and on wide screens the slab sits beside the details. */
#gradeOv { overflow-x:hidden; }
/* the burst used to grow to 1.6x and stay there invisibly, so the window scrolled ~700px of nothing */
#gradeOv .grade-burst { inset:0; }
#gradeOv .grade-burst.go { animation:gburst2 1s ease; }
@keyframes gburst2 { 0% { opacity:0; transform:scale(.5); } 35% { opacity:1; } 100% { opacity:0; transform:scale(1.25); } }

#gradeOv .grade-side { display:flex; flex-direction:column; min-width:0; }
#gradeOv .grade-subs { display:grid; grid-template-columns:1fr 1fr; gap:5px; max-width:290px; width:100%; }
#gradeOv .gsub { padding:5px 9px; min-width:0; }
#gradeOv .fhs-after { order:1; margin:2px auto 8px; }
#gradeOv .grade-side > .confirm-btns { order:2; }

/* pinned footer: always on screen once the grade is in */
#gradeOv .grade-side > .confirm-btns { position:sticky; bottom:0; z-index:4; justify-content:center;
  margin:4px -22px -22px; padding:12px 22px calc(16px + env(safe-area-inset-bottom, 0px)); border-radius:0 0 16px 16px; }
#gradeOv.g-done .grade-side > .confirm-btns { background:linear-gradient(180deg, transparent, var(--card) 14px); }

/* the first slab: the hand and the line under the slab already say how to peel, and the chip covered the ribbon */
#gradeOv.g-guided .gr-film-tip { display:none !important; }
#gradeOv .gr-firstrib { margin:0 0 8px; }

@media (min-width:900px) {
  #gradeOv .grade-box { max-width:640px; display:grid; grid-template-columns:250px minmax(0,1fr); column-gap:28px; align-items:center; }
  #gradeOv .grade-box > .gr-firstrib { grid-column:1 / -1; }
  #gradeOv .grade-box > .grade-slab, #gradeOv .grade-box > .grade-mail { grid-column:1; margin:4px auto 10px; }
  #gradeOv .grade-side { grid-column:2; }
  #gradeOv .grade-side > .confirm-btns { position:static; margin:8px 0 0; padding:0; background:none !important; }
  #gradeOv .grade-slab { width:236px; }
  /* rays, ring and flash centre on the slab, not the middle of the window */
  #gradeOv .grade-rays, #gradeOv .grade-ring { left:147px; top:52%; }
}

/* ---- the first slab: special for everyone, and it climbs with the grade ---- */
#gradeOv.g-first .grade-rays { background:repeating-conic-gradient(from 0deg,rgba(255,214,90,0) 0 7deg,rgba(255,214,90,.3) 9deg 12deg,rgba(255,214,90,0) 14deg 22deg);
  opacity:.65; animation:graysIn .7s ease-out both, graysSpin 30s linear infinite; }
#gradeOv.g-first.g-great .grade-rays { opacity:.9; animation:graysIn .7s ease-out both, graysSpin 24s linear infinite; }
#gradeOv.g-first.g-gem .grade-rays { opacity:1; animation:graysIn .6s ease-out both, graysSpin 16s linear infinite; }
#gradeOv.g-first .grade-slab { box-shadow:0 8px 0 #8a6d00, 0 0 34px rgba(255,203,5,.35), 0 18px 40px rgba(0,0,0,.55); }
#gradeOv.g-first.g-great .grade-slab { box-shadow:0 8px 0 #8a6d00, 0 0 48px rgba(255,203,5,.45), 0 0 26px rgba(150,195,255,.35), 0 18px 40px rgba(0,0,0,.6); }
#gradeOv.g-first.g-gem .grade-slab { box-shadow:0 8px 0 #a6820a, 0 0 70px rgba(255,203,5,.6), 0 18px 40px rgba(0,0,0,.6); }
/* the grade word is gold on a first slab, whatever the grade */
#gradeOv.g-first.g-solid .gg-word, #gradeOv.g-first.g-loved .gg-word { font-size:20px; letter-spacing:.28em; padding-left:.28em;
  background:linear-gradient(100deg,#b8860b 0%,#ffd54a 30%,#fff6cf 40%,#ffd54a 50%,#b8860b 75%); background-size:250% 100%;
  -webkit-background-clip:text; background-clip:text; color:transparent; filter:drop-shadow(0 0 8px rgba(255,203,5,.35)); }
#gradeOv.g-first .gg-odds { color:#e9dfae; }
/* a slow shine across a first slab under 9 too */
#gradeOv.g-first.g-loved .grade-win::after { content:""; position:absolute; inset:0; pointer-events:none; mix-blend-mode:screen; background:linear-gradient(105deg,transparent 40%,rgba(255,240,200,.45) 50%,transparent 60%) no-repeat; background-size:300% 100%; background-position:160% 0; animation:gsweep 3.2s cubic-bezier(.45,.05,.3,1) .3s 1 both; }

/* the finished first slab tilts under the mouse or a finger, with a glint that follows */
#gradeOv .grade-slab.g-tilt { transform:perspective(800px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)); transition:transform .6s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease; touch-action:pan-y; cursor:grab; }
#gradeOv .grade-slab.g-tilt.tilting { transition:transform .08s linear, box-shadow .3s ease; }
#gradeOv .grade-slab.g-tilt::after { content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; z-index:5; mix-blend-mode:screen; opacity:0; transition:opacity .35s ease;
  background:linear-gradient(105deg, transparent calc(var(--gx,50%) - 24%), rgba(255,250,225,.38) var(--gx,50%), transparent calc(var(--gx,50%) + 24%)); }
#gradeOv .grade-slab.g-tilt.tilting::after { opacity:1; }

@media (prefers-reduced-motion: reduce) { #gradeOv .grade-slab.g-tilt { transform:none !important; } #gradeOv .grade-slab.g-tilt::after { display:none; } #gradeOv.g-first .grade-rays { animation:none !important; } }
body.reduce-motion #gradeOv .grade-slab.g-tilt { transform:none !important; }
/* a 9 to 9.5 first slab is gold too (the silver word read as a step down from a gold 7) */
#gradeOv.g-first.g-great .gg-word { color:#ffd54a !important; text-shadow:0 1px 0 rgba(0,0,0,.35), 0 0 16px rgba(255,203,5,.55) !important; }
/* the grader's note can read as a knock ("clearly lopsided"); on a first slab the subgrades and the scale explain it */
#gradeOv.g-guided .grade-note { display:none; }
/* Nov 14 2026: a close X once the grade is in (closing earlier would skip saving it), and the heart says what it does */
#gradeOv .grade-x { position:absolute; top:10px; right:10px; z-index:6; width:34px; height:34px; border-radius:50%; border:1px solid rgba(255,255,255,.16); background:rgba(10,12,30,.55);
  color:var(--ink); font:inherit; font-size:15px; cursor:pointer; opacity:0; visibility:hidden; transition:opacity .3s ease; }
#gradeOv.g-done .grade-x { opacity:1; visibility:visible; }
#gradeOv .grade-x:hover { background:rgba(255,255,255,.12); }
#gradeOv .grade-x:focus-visible { outline:2px solid #fff; outline-offset:2px; }
#gradeOv .grade-like { width:auto; min-width:44px; padding:0 14px; border-radius:999px; font-size:18px; display:inline-flex; align-items:center; justify-content:center; gap:2px; }
#gradeOv .grade-like .gl-lab { font-size:13px; font-weight:800; color:var(--ink); }
#gradeOv .grade-like[aria-pressed="true"] .gl-lab { color:#ffb3c8; }
#gradeOv .grade-like { flex:none; white-space:nowrap; height:44px; }
@media (max-width:899px) { #gradeOv .grade-side > .confirm-btns #gradeBtn { flex:1 1 0; min-width:0; } #gradeOv .grade-side > .confirm-btns { flex-wrap:wrap; } }
/* Nov 14 2026 c: grades under 9 get their own small moment (the big ones stay bigger) */
#gradeOv.g-solid:not(.g-first) .grade-rays { background:repeating-conic-gradient(from 0deg,rgba(255,226,170,0) 0 8deg,rgba(255,226,170,.16) 10deg 12deg,rgba(255,226,170,0) 14deg 24deg);
  opacity:.5; animation:graysIn .8s ease-out both, graysSpin 40s linear infinite; }
#gradeOv.g-solid:not(.g-first) .gg-word { font-size:18px; color:#f3e3bd; text-shadow:0 0 14px rgba(255,214,150,.35); }
#gradeOv.g-loved:not(.g-first) .gg-word { font-size:16px; color:#e2e6fa; }
#gradeOv.g-loved:not(.g-first) .grade-win::after { content:""; position:absolute; inset:0; pointer-events:none; mix-blend-mode:screen;
  background:linear-gradient(105deg,transparent 40%,rgba(230,236,255,.35) 50%,transparent 60%) no-repeat; background-size:300% 100%; background-position:160% 0;
  animation:gsweep 2.6s cubic-bezier(.45,.05,.3,1) .3s 1 both; }
/* the scale on every slab: a little smaller when it isn't the first */
#gradeOv:not(.g-first) .gr-scale span { min-width:56px; padding:4px 5px; }
@media (prefers-reduced-motion: reduce) { #gradeOv.g-solid .grade-rays { animation:none !important; } #gradeOv.g-loved .grade-win::after { animation:none !important; } }
/* computers: details start level with the top of the slab instead of floating in the middle */
@media (min-width:900px) { #gradeOv .grade-box { align-items:start; } #gradeOv .grade-side { padding-top:14px; } }
