/* Wave Purple — stat plates, "Animation 2" (rolling cuboids). Staging.
   Animation 1 = the original static plates (kept in the page, class .sf-legacy, hidden while 2 is on).
   Switch: <html data-stats-anim="1|2">  (later: written by the admin). Test override: ?anim=1 */

/* ---------- switch ---------- */
html[data-stats-anim="1"] .sf-new{ display:none !important; }
html:not([data-stats-anim="1"]) .sf-legacy{ display:none !important; }

/* ---------- shared metal look ---------- */
.sf-face,.sf-legacy-plate{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  font-family:'Space Grotesk',system-ui,sans-serif; color:var(--sf-c0,#14141c); text-align:center;
  border-radius:9px; border:1px solid #6d6f75; overflow:hidden;   /* 9px = live .stat-box */
  background:
    repeating-linear-gradient(90deg,rgba(255,255,255,.28) 0 1px,rgba(0,0,0,.05) 1px 2px),
    linear-gradient(180deg,#f1f2f4 0%,#c9cbd0 55%,#b4b6bb 100%);
  box-shadow:inset 0 1px 0 #fff, inset 0 -2px 3px rgba(0,0,0,.18), 0 2px 5px rgba(0,0,0,.45);
  position:relative;
}
.sf-face::before,.sf-face::after,.sf-legacy-plate::before,.sf-legacy-plate::after{
  content:""; position:absolute; top:50%; width:6px; height:6px; margin-top:-3px; border-radius:50%;
  background:radial-gradient(circle at 35% 30%,#fff,#9a9ca2 60%,#5d5f64); box-shadow:0 0 0 1px rgba(0,0,0,.35); }
.sf-face::before,.sf-legacy-plate::before{ left:9px } .sf-face::after,.sf-legacy-plate::after{ right:9px }

/* live page: the new block sits inside #statBoxes (whatever layout that has), taking the full row */
#statBoxes:has(> .sf-new){ width:100%; min-width:min(340px,100%); box-sizing:border-box; }
#statBoxes > .sf-new{ grid-column:1 / -1; flex:1 0 100%; width:100%; max-width:400px; margin:0 auto; min-width:0; }
#statBoxes > .sf-new .sf-stats{ width:100%; }

/* ---------- identical footprint for Animation 1 and 2 ---------- */
.sf-slot{ width:400px; max-width:100%; }
.sf-stats,.sf-legacy-grid{
  --sf-h:50px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:var(--sf-h); gap:8px; width:100%;   /* = the live .stat-boxes grid (operators.css): 8px gap, plates 130 x 50 */
}
.sf-legacy-plate{ gap:2px; height:var(--sf-h); }

/* ---------- the cuboid ---------- */
.sf-plate,.sf-ticker{ position:relative; height:var(--sf-h); perspective:720px; cursor:pointer; -webkit-tap-highlight-color:transparent; outline:none; }
.sf-cube{ position:relative; width:100%; height:100%; transform-style:preserve-3d;
  transform:translateZ(calc(var(--sf-h) / -2)) rotateX(var(--sf-rx,0deg));
  transition:transform .85s cubic-bezier(.5,.05,.2,1); will-change:transform; }
.sf-face{ position:absolute; inset:0; backface-visibility:hidden; -webkit-backface-visibility:hidden; }
.sf-face--0{ transform:rotateX(0deg)    translateZ(calc(var(--sf-h) / 2)); }
.sf-face--1{ transform:rotateX(-90deg)  translateZ(calc(var(--sf-h) / 2)); }
.sf-face--2{ transform:rotateX(-180deg) translateZ(calc(var(--sf-h) / 2)); }
.sf-face--3{ transform:rotateX(-270deg) translateZ(calc(var(--sf-h) / 2)); }
.sf-plate:focus-visible,.sf-ticker:focus-visible{ outline:2px solid #c9a6ff; outline-offset:3px; border-radius:12px; }

/* face content */
.sf-in{ box-sizing:border-box; width:100%; padding:0 21px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; }
.sf-num{ font-size:clamp(24px,3.3vw,31px); font-weight:700; line-height:1; letter-spacing:.5px; font-variant-numeric:tabular-nums; }
.sf-lbl{ font-size:11px; font-weight:600; letter-spacing:2.2px; text-transform:uppercase; color:var(--sf-c2,#3a3b44); }
.sf-lbl--sm{ font-size:10px; letter-spacing:1.8px; line-height:1.15; }
.sf-in:has(.sf-lbl--sm){ gap:1px; }
.sf-list{ font-family:'Space Grotesk','Noto Sans Devanagari','Noto Sans Gurmukhi','Noto Sans Oriya','Noto Sans Malayalam','Noto Sans Bengali','Noto Sans Tamil','Noto Sans Telugu','Noto Sans Kannada',system-ui,sans-serif;
  font-size:13px; font-weight:600; line-height:1.3; color:var(--sf-c1,#2b1a4a); }
.sf-list span{ white-space:nowrap; }
.sf-slogan{ font-size:16px; font-weight:600; line-height:1.2; color:var(--sf-c1,#2b1a4a); text-wrap:balance; }
.sf-flags{ display:grid; grid-template-columns:repeat(3,auto); gap:9px 13px; justify-content:center; }
.sf-flags img{ width:27px; height:20px; display:block; border-radius:3px; box-shadow:0 0 0 1px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.25); }
.sf-ico{ width:1.05em; height:1.05em; flex:none; color:var(--sf-c2,#3a3b44); vertical-align:-.14em; }
.sf-lbl .sf-ico{ margin:0 .12em; }
.sf-airlogo{ height:24px; width:auto; max-width:30px; object-fit:contain; flex:none; display:block; }
.sf-air1{ display:flex; align-items:center; justify-content:center; gap:4px; white-space:nowrap; min-width:0; max-width:100%; font-size:11px; font-weight:600; color:var(--sf-c1,#2b1a4a); line-height:1.1; letter-spacing:.1px; }
.sf-air1 b{ font-size:22px; font-weight:700; letter-spacing:.2px; color:var(--sf-c0,#14141c); font-variant-numeric:tabular-nums; }
.sf-air1 .sf-ico{ width:13px; height:13px; margin-left:-1px; }
.sf-air2{ font-size:12px; font-weight:600; color:var(--sf-c2,#3a3b44); letter-spacing:.2px; white-space:nowrap; }
.sf-ticker .sf-airlogo{ height:22px }
.sf-ticker .sf-air1 b{ font-size:21px }
.sf-lbl--long{ white-space:nowrap; }
.sf-sr{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* ---------- mobile: ONE slim plate that rolls through everything (about the height of the original row of boxes) ---------- */
.sf-ticker,.sf-dots{ display:none; }
.sf-ticker{ --sf-h:32px; width:100%; margin:0 auto; }
.sf-ticker .sf-face{ border-radius:8px; }
.sf-ticker .sf-face::before,.sf-ticker .sf-face::after{ width:5px; height:5px; margin-top:-2.5px; }
.sf-ticker .sf-face::before{ left:7px } .sf-ticker .sf-face::after{ right:7px }
.sf-ticker .sf-in{ flex-direction:row; flex-wrap:nowrap; gap:7px; padding:0 17px; white-space:nowrap; }
.sf-ticker .sf-num{ font-size:17px }
.sf-ticker .sf-lbl{ font-size:9.5px; letter-spacing:1.6px; }
.sf-ticker .sf-list{ font-size:11.5px; line-height:1.2; }
.sf-ticker .sf-slogan{ font-size:13px; line-height:1.1; }
.sf-ticker .sf-flags{ display:flex; gap:9px; }
.sf-ticker .sf-flags img{ width:20px; height:14px; border-radius:2px; }
.sf-ticker .sf-airlogo{ height:20px; max-width:26px; }
.sf-ticker .sf-air1{ gap:3px; font-size:10px; }
.sf-ticker .sf-air1 b{ font-size:16px; }
.sf-ticker .sf-air1 .sf-ico{ width:12px; height:12px; }
.sf-ticker .sf-air2{ font-size:10.5px; padding-left:8px; border-left:1px solid currentColor; opacity:.9; }
.sf-dots{ justify-content:center; gap:5px; }
.sf-dots i{ width:4px; height:4px; border-radius:50%; background:rgba(201,166,255,.35); transition:background .3s; }
.sf-dots i.on{ background:#c9a6ff; }
@media (max-width:600px){
  .sf-slot{ width:100%; }
  .sf-stats{ display:none; }
  #statBoxes > .sf-new, .sf-new{ position:relative; max-width:none; }
  .sf-ticker{ display:block; }
  .sf-dots{ display:flex; position:absolute; left:0; right:0; bottom:2px; margin:0; pointer-events:none; z-index:3; }
}
@media (prefers-reduced-motion:reduce){ .sf-cube{ transition:none; } }

/* AIR face: a little less side padding so logo + number + "Live stations" always fit on one line */
.sf-in:has(.sf-air1){ padding:0 15px; }
.sf-air1{ font-size:10.5px; gap:3px; }
.sf-air1 b{ font-size:21px; }

/* ---------- desktop plates at the live size (130 x 50): type scale ----------
   Everything here is scoped to .sf-stats, so the slim mobile ticker keeps its own sizes. */
.sf-stats .sf-in{ gap:2px; }
.sf-stats .sf-num{ font-size:21px; line-height:1.05; }                       /* same as the live number (.stat-box b) */
.sf-stats .sf-lbl{ font-size:9.5px; letter-spacing:.15em; }                  /* same as the live label (.stat-box span) */
.sf-stats .sf-lbl--sm{ font-size:8.5px; letter-spacing:.12em; }
.sf-stats .sf-lbl--long{ font-size:8.5px; letter-spacing:.1em; }             /* "Live (antenna) Stations" */
.sf-stats .sf-in:has(.sf-list),
.sf-stats .sf-in:has(.sf-slogan){ padding:0 16px; }
.sf-stats .sf-list{ font-size:10px; line-height:1.25; }
.sf-stats .sf-slogan{ font-size:11.5px; line-height:1.2; }
.sf-stats .sf-flags{ gap:5px 9px; }
.sf-stats .sf-flags img{ width:22px; height:16px; border-radius:2.5px; }
.sf-stats .sf-in:has(.sf-air1){ padding:0 6px; gap:1px; }
.sf-stats .sf-face:has(.sf-air1)::before,
.sf-stats .sf-face:has(.sf-air1)::after{ display:none; }                    /* no corner screws on the AIR face: it needs the full width */
.sf-stats .sf-air1{ font-size:8.5px; }
.sf-stats .sf-air1 b{ font-size:18px; }
.sf-stats .sf-airlogo{ height:19px; max-width:24px; }
.sf-stats .sf-air1 .sf-ico{ width:10px; height:10px; }
.sf-stats .sf-air2{ font-size:9px; }

/* ---------- phones: TWO plates side by side (replaces the single slim ticker when stats-flip.js builds .sf-duo) ----------
   Left plate = the short number faces, right plate = the wordier faces (AIR, language / genre lists, flags, slogans).
   48px tall, a little wider than the desktop plates (130 x 50), so every face that fits on desktop fits here. */
.sf-duo{ display:none; }
@media (max-width:600px){
  .sf-new:has(.sf-duo) .sf-ticker,
  .sf-new:has(.sf-duo) .sf-dots{ display:none; }
  .sf-duo{ --sf-h:48px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; width:100%; }
  .sf-duo .sf-in{ gap:2px; padding:0 14px; }
  .sf-duo .sf-num{ font-size:22px; line-height:1.05; }
  .sf-duo .sf-lbl{ font-size:9.5px; letter-spacing:.15em; }
  .sf-duo .sf-lbl--long{ font-size:9px; letter-spacing:.1em; }
  .sf-duo .sf-in:has(.sf-list),
  .sf-duo .sf-in:has(.sf-slogan){ padding:0 14px; }
  .sf-duo .sf-list{ font-size:11px; line-height:1.25; }
  .sf-duo .sf-slogan{ font-size:12.5px; line-height:1.2; }
  .sf-duo .sf-flags{ gap:5px 9px; }
  .sf-duo .sf-flags img{ width:22px; height:16px; border-radius:2.5px; }
  .sf-duo .sf-in:has(.sf-air1){ padding:0 6px; gap:1px; }
  .sf-duo .sf-face:has(.sf-air1)::before,
  .sf-duo .sf-face:has(.sf-air1)::after{ display:none; }
  .sf-duo .sf-air1{ font-size:9.5px; gap:3px; }
  .sf-duo .sf-air1 b{ font-size:19px; }
  .sf-duo .sf-airlogo{ height:20px; max-width:26px; }
  .sf-duo .sf-air1 .sf-ico{ width:11px; height:11px; }
  .sf-duo .sf-air2{ font-size:9.5px; }
}

/* The two 48px plates are taller than the old 32px ticker. Give that height back from the phone radio so the controls
   do not move down the screen: the speaker grille, the meter and the Seek/Mute buttons each give up a few px
   (about 20px in all). Buttons stay 60px or more. Only applies on phones, and only while Animation 2 is on. */
@media (max-width:600px){
  @supports (height:1svh){
    html[data-stats-anim="2"] .v-skin{
      --g:clamp(42px, calc(10svh - 8px), 88px);
      --m:clamp(73px, calc(13.5svh - 6px), 106px);
      --b:clamp(60px, calc(10.5svh - 6px), 74px);
    }
  }
}

/* ---------- the little antenna (📡) in "Live (antenna) Stations" and in the AIR line: bigger, brighter, a gentle pulse ----------
   Colour: change --sf-ico-c.  Pulse speed: --sf-ping (set it to 0s to stop it).  Stops by itself for visitors who ask for reduced motion. */
html{ --sf-ico-c:#d9c2ff; --sf-ping:2.8s; }
html[data-stats-anim] .sf-face .sf-ico{ color:var(--sf-ico-c); filter:drop-shadow(0 0 2px rgba(217,194,255,.55)); }
.sf-lbl .sf-ico{ width:1.55em; height:1.55em; margin:-.25em .08em -.25em; vertical-align:-.34em; }
.sf-stats .sf-air1 .sf-ico{ width:14px; height:14px; margin:0 -1px 0 -2px; }
.sf-duo .sf-air1 .sf-ico{ width:15px; height:15px; margin:0 -1px 0 -2px; }
@keyframes sfPing{ 0%,100%{ opacity:.3 } 40%{ opacity:1 } 70%{ opacity:.55 } }
.sf-ico .sf-w1{ animation:sfPing var(--sf-ping) ease-in-out infinite; }
.sf-ico .sf-w2{ animation:sfPing var(--sf-ping) ease-in-out .38s infinite; }
@media (prefers-reduced-motion:reduce){ .sf-ico .sf-w1,.sf-ico .sf-w2{ animation:none; } }


/* ================= theme: graphite-gloss / graphite-gloss-light (merged from stats-flip-graphite.css) ================= */
/* Wave Purple — stat plates, theme "graphite-gloss": polished graphite with a glass finish.
   Opaque (looks the same on any background). Sizes/type are untouched; this is colour + finish only.
   Use:  <html data-stats-theme="graphite-gloss">   (or "graphite-gloss-light" for the lighter shade)
   Load this file after stats-flip.css.  Try without editing:  ?theme=graphite-gloss  /  ?theme=graphite-gloss-light */

/* the colours (and gloss strength) that make the difference between the two shades: body top / middle / bottom, and the small label colour */
html[data-stats-theme="graphite-gloss"]      { --sf-g0:#4d5059; --sf-g1:#34363d; --sf-g2:#202228; --sf-lblc:#c9cddb; --sf-gloss:.30; }
html[data-stats-theme="graphite-gloss-light"]{ --sf-g0:#6f737f; --sf-g1:#565a65; --sf-g2:#41444d; --sf-lblc:#f0f2f8; --sf-gloss:.20; }

html[data-stats-theme^="graphite-gloss"]{ --sf-c0:#ffffff; --sf-c1:#eef0f6; --sf-c2:#c9cddb; }

html[data-stats-theme^="graphite-gloss"] :is(.sf-face,.sf-legacy-plate){
  border:1px solid #0b0c10;
  background:
    /* glass: soft diagonal glare */
    linear-gradient(112deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0) 34%,rgba(255,255,255,.11) 40%,rgba(255,255,255,.04) 50%,rgba(255,255,255,0) 56%,rgba(255,255,255,0) 100%),
    /* glass: top-half gloss with a crisp lower edge */
    linear-gradient(180deg,rgba(255,255,255,var(--sf-gloss)) 0%,rgba(255,255,255,calc(var(--sf-gloss) * .37)) 47%,rgba(255,255,255,0) 50%),
    /* graphite grain: fine brushed lines + faint cross-grain */
    repeating-linear-gradient(90deg,rgba(255,255,255,.050) 0 1px,rgba(0,0,0,.14) 1px 2px),
    repeating-linear-gradient(0deg,rgba(255,255,255,.022) 0 1px,rgba(0,0,0,0) 1px 3px),
    /* graphite body */
    linear-gradient(180deg,var(--sf-g0) 0%,var(--sf-g1) 48%,var(--sf-g2) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 0 0 1px rgba(255,255,255,.06),
    inset 0 -2px 4px rgba(0,0,0,.55),
    0 2px 6px rgba(0,0,0,.55);
}
html[data-stats-theme^="graphite-gloss"] :is(.sf-face,.sf-legacy-plate)::before,
html[data-stats-theme^="graphite-gloss"] :is(.sf-face,.sf-legacy-plate)::after{
  background:radial-gradient(circle at 35% 30%,#f2f4f8,#8e929e 55%,#3d4047);
  box-shadow:0 0 0 1px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.12);
}
html[data-stats-theme^="graphite-gloss"] :is(.sf-in,.sf-legacy-plate){ text-shadow:0 1px 2px rgba(0,0,0,.6); }
html[data-stats-theme^="graphite-gloss"] .sf-flags img{ box-shadow:0 0 0 1px rgba(255,255,255,.45), 0 2px 4px rgba(0,0,0,.55); }

/* lettering stated outright, so it holds even if an older stats-flip.css is cached */
html[data-stats-theme^="graphite-gloss"] :is(.sf-num,.sf-list span,.sf-slogan,.sf-air1,.sf-air1 b){ color:#ffffff; }
html[data-stats-theme^="graphite-gloss"] :is(.sf-lbl,.sf-air2){ color:var(--sf-lblc); }
