/* Songdle - built to be read from a couch, on a 1080p stream.

   Everything the player looks at lives inside --col, a narrow centre column.
   That is deliberate: clips get cut into 9:16 shorts, and a wide row of
   controls loses its ends the moment the frame is cropped. Keep new controls
   inside the column, keep side furniture (the rail) outside it. */

:root{
  --bg:#0a0c0f;
  --panel:#14181d;
  --panel-2:#1b2028;
  --line:#2a313b;
  --txt:#f2f5f8;
  --dim:#8d99a8;
  --faint:#5c6673;
  --accent:#1ed760;
  --accent-dk:#12a247;
  --bad:#ef4b5b;
  --warn:#f0a938;
  --tint:20,24,30;

  --col:min(520px,94vw);     /* the 9:16 safe column, see note above */
  --rail:248px;
  --mono:"JetBrains Mono",Consolas,"Cascadia Mono",ui-monospace,monospace;
}

*{box-sizing:border-box;margin:0;padding:0}

body{
  background:var(--bg);
  background-image:
    radial-gradient(1100px 620px at 50% -12%, rgba(var(--tint),.6), transparent 68%),
    radial-gradient(900px 500px at 50% 112%, rgba(var(--tint),.28), transparent 70%);
  color:var(--txt);
  font-family:"Segoe UI Variable Display","Segoe UI",Inter,system-ui,sans-serif;
  min-height:100vh;
  transition:background-image .6s ease;
  -webkit-font-smoothing:antialiased;
}

.hidden{display:none !important}

::selection{background:rgba(30,215,96,.3)}

/* ------------------------------------------------------------- buttons */
.btn{
  font:inherit;font-weight:700;letter-spacing:.04em;
  border:2px solid var(--line);
  background:var(--panel-2);
  color:var(--txt);
  border-radius:12px;
  padding:13px 24px;
  cursor:pointer;
  transition:transform .08s ease,background .15s ease,border-color .15s ease;
}
.btn:hover{background:#232a33;border-color:#3c4653}
.btn:active{transform:translateY(1px)}
.btn.primary{
  background:linear-gradient(180deg,#25e96c,var(--accent));
  border-color:var(--accent);color:#04120a;
  box-shadow:0 6px 18px rgba(30,215,96,.22);
}
.btn.primary:hover{background:linear-gradient(180deg,#3bf57e,#25e96c)}
.btn.ghost{background:transparent}
.btn.small{padding:9px 14px;font-size:13px}
.btn.big{padding:17px 42px;font-size:19px}
.btn:disabled{opacity:.4;cursor:default;box-shadow:none}
.btn .k{font-weight:400;color:var(--dim);font-size:12px;margin-left:6px}
.btn.primary .k{color:rgba(4,18,10,.6)}

/* --------------------------------------------------------------- setup */
.screen{min-height:100vh;display:flex;flex-direction:column}

#setup{align-items:center;justify-content:flex-start;gap:11px;padding:26px 24px 22px}
.logo{
  font-size:clamp(40px,7vw,70px);font-weight:900;letter-spacing:.16em;
  background:linear-gradient(180deg,#fff 20%,#7fe3a4);
  -webkit-background-clip:text;background-clip:text;color:transparent;
  line-height:1.05;
}
.tag{color:var(--dim);font-size:16px;text-align:center}

/* the reason this site is public at all: say who made it, and where to watch */
.credit{display:flex;align-items:center;justify-content:center;gap:10px;
        flex-wrap:wrap;font-size:13.5px;color:var(--dim);text-align:center}
.kick{font-weight:800;font-size:12.5px;letter-spacing:.03em;color:#07110a;
      background:#53fc18;padding:5px 12px;border-radius:999px;text-decoration:none;
      box-shadow:0 4px 14px rgba(83,252,24,.25)}
.kick:hover{filter:brightness(1.08)}

.setup-box{display:flex;gap:10px;width:min(640px,94vw);margin-top:6px}
.setup-box input{
  flex:1;font:inherit;font-size:16px;
  padding:15px 18px;border-radius:12px;
  border:2px solid var(--line);background:var(--panel);color:var(--txt);
}
.setup-box input:focus{outline:none;border-color:var(--accent)}

.sub-head{
  font-size:11px;letter-spacing:.2em;color:var(--faint);font-weight:800;
  text-align:center;margin-bottom:10px;
}

/* featured cards -------------------------------------------------------
   Each card carries its own hue so sixteen lists stay tellable apart at a
   glance. The hue comes from playlists.json, not from here. */
.featured{width:min(880px,96vw);display:flex;flex-direction:column;gap:12px;
          margin-top:6px}
.feat-group{display:flex;flex-direction:column;gap:7px}
.feat-row{display:flex;flex-wrap:wrap;gap:10px;justify-content:center}

.card{
  --h:142;
  width:204px;
  position:relative;text-align:left;font:inherit;cursor:pointer;
  border-radius:13px;padding:8px 12px;min-height:58px;
  display:flex;align-items:center;gap:12px;
  color:var(--txt);
  border:1px solid hsl(var(--h) 40% 26%);
  background:
    linear-gradient(135deg, hsl(var(--h) 46% 16%), hsl(var(--h) 30% 10%));
  transition:transform .1s ease,border-color .15s ease,box-shadow .2s ease;
  overflow:hidden;
}
.card:hover{
  transform:translateY(-2px);
  border-color:hsl(var(--h) 70% 52%);
  box-shadow:0 10px 28px hsl(var(--h) 60% 8% / .9);
}
.card:active{transform:translateY(0)}
.card::after{                       /* colour wash so the hue reads at a glance */
  content:"";position:absolute;inset:auto -30% -60% auto;width:150px;height:150px;
  background:radial-gradient(circle, hsl(var(--h) 80% 50% / .22), transparent 70%);
  pointer-events:none;
}
.card img,.card .c-art{
  width:44px;height:44px;border-radius:8px;object-fit:cover;flex:none;
  background:hsl(var(--h) 34% 17%);
}
/* stand-in until the server has pulled that list's artwork */
.card .c-art{display:grid;place-items:center;font-weight:900;font-size:21px;
             color:hsl(var(--h) 52% 62%)}
.card .c-txt{min-width:0;display:flex;flex-direction:column;gap:2px}
.card .c-label{font-weight:800;font-size:15px;line-height:1.2;
               overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card .c-sub{font-size:11.5px;color:hsl(var(--h) 45% 72%);letter-spacing:.04em}

.recent-wrap{width:min(880px,96vw);margin-top:4px}

.msg{color:var(--warn);font-size:15px;text-align:center}
.msg:empty{display:none}
.msg.err{color:var(--bad)}
.hint{color:#5a636f;font-size:12.5px;max-width:560px;text-align:center;
      line-height:1.55;margin-top:12px}

/* ---------------------------------------------------------------- game */
.bar{
  border-bottom:1px solid var(--line);
  background:rgba(8,10,13,.72);backdrop-filter:blur(10px);
  padding:12px 20px;
}
.bar-in{                         /* header rides the same column as the stage */
  width:var(--col);margin:0 auto;
  display:flex;justify-content:space-between;align-items:center;gap:14px;
}
.bar-left{display:flex;align-items:center;gap:11px;min-width:0}
.pl-cover{width:42px;height:42px;border-radius:7px;object-fit:cover;
          background:var(--panel-2);flex:none}
.pl-name{font-size:16px;font-weight:700;max-width:230px;
         overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pl-meta{font-size:11.5px;color:var(--dim)}

.bar-right{display:flex;align-items:center;gap:16px}
.stat{text-align:center;line-height:1.05}
.stat span{font-size:21px;font-weight:800;display:block}
.stat small{font-size:9px;letter-spacing:.14em;color:var(--dim)}

.stage{
  flex:1;display:flex;flex-direction:column;align-items:center;
  justify-content:center;     /* keeps the game in the middle of a 9:16 crop */
  gap:16px;padding:26px 24px 44px;
}

/* hint tiers ------------------------------------------------------------
   Hue runs green to red as the clip gets longer and the points drop, so the
   cost of asking for more audio is visible without reading the numbers. */
.tiers{display:flex;gap:7px;justify-content:center;width:var(--col)}
.tier{
  --h:142;
  flex:1;padding:8px 2px;border-radius:9px;text-align:center;
  /* every pill carries its own hue even before it is reached, otherwise the
     row reads as five grey boxes and the colour says nothing */
  border:2px solid hsl(var(--h) 30% 26%);
  background:hsl(var(--h) 28% 10%);
  font-weight:800;font-size:15px;color:hsl(var(--h) 34% 64%);
  transition:all .18s ease;
}
.tier small{display:block;font-size:8.5px;letter-spacing:.1em;font-weight:700;
            color:hsl(var(--h) 26% 46%);margin-top:1px}
.tier.done{
  border-color:hsl(var(--h) 30% 22%);background:hsl(var(--h) 34% 9%);
  color:hsl(var(--h) 24% 44%);
}
.tier.done small{color:hsl(var(--h) 20% 34%)}
.tier.now{
  border-color:hsl(var(--h) 72% 48%);
  background:hsl(var(--h) 60% 13%);
  color:hsl(var(--h) 85% 78%);
  box-shadow:0 0 0 4px hsl(var(--h) 72% 48% / .14);
}
.tier.now small{color:hsl(var(--h) 55% 60%)}

/* scrubber: one segment per tier, so the bar and the pills agree */
.scrub{
  width:var(--col);height:13px;border-radius:999px;
  background:var(--panel-2);position:relative;
  border:1px solid var(--line);padding:2px;
}
.scrub-segs{display:flex;gap:3px;height:100%;border-radius:999px;overflow:hidden}
.seg{--h:142;min-width:6px;border-radius:2px;
     background:hsl(var(--h) 30% 19%);
     transition:background .2s ease}
.seg:first-child{border-radius:999px 2px 2px 999px}
.seg:last-child{border-radius:2px 999px 999px 2px}
.seg.on{background:linear-gradient(180deg,
        hsl(var(--h) 72% 52%), hsl(var(--h) 66% 38%))}
.scrub-head{position:absolute;top:-4px;left:0;width:3px;height:19px;
            background:#fff;border-radius:2px;opacity:0;
            box-shadow:0 0 10px #fff;transform:translateX(-1px)}
.scrub.live .scrub-head{opacity:1}

/* play button */
.play{
  width:118px;height:118px;border-radius:50%;
  border:none;cursor:pointer;display:grid;place-items:center;
  background:linear-gradient(180deg,#2bec74,var(--accent));
  color:#04120a;margin-top:6px;
  box-shadow:0 10px 30px rgba(30,215,96,.28),0 0 0 0 rgba(30,215,96,.35);
  transition:transform .1s ease,box-shadow .2s ease,filter .2s ease;
}
.play:hover{filter:brightness(1.08);
            box-shadow:0 12px 34px rgba(30,215,96,.34),0 0 0 12px rgba(30,215,96,.08)}
.play:active{transform:scale(.96)}
.play svg{width:52px;height:52px;fill:currentColor;margin-left:4px}
.play .ico-stop{display:none;margin-left:0}
.play.playing .ico-play{display:none}
.play.playing .ico-stop{display:block}
.play.playing{animation:pulse 1.4s ease-in-out infinite}
@keyframes pulse{
  0%,100%{box-shadow:0 10px 30px rgba(30,215,96,.28),0 0 0 0 rgba(30,215,96,.3)}
  50%    {box-shadow:0 10px 30px rgba(30,215,96,.28),0 0 0 14px rgba(30,215,96,0)}
}
.play.loading{opacity:.55;pointer-events:none;animation:none}
.play-label{font-family:var(--mono);font-size:20px;font-weight:700;
            letter-spacing:.04em;color:var(--accent);margin-top:2px}

/* guess box + autocomplete */
.guessbox{position:relative;width:var(--col)}
#guess{
  width:100%;font:inherit;font-size:19px;padding:16px 20px;
  border-radius:13px;border:2px solid var(--line);
  background:var(--panel);color:var(--txt);
}
#guess::placeholder{color:#57616d}
#guess:focus{outline:none;border-color:var(--accent);
             box-shadow:0 0 0 4px rgba(30,215,96,.1)}
.ac{
  position:absolute;left:0;right:0;top:calc(100% + 8px);z-index:30;
  list-style:none;background:#10141a;border:2px solid var(--line);
  border-radius:13px;overflow:hidden;max-height:380px;overflow-y:auto;
  box-shadow:0 18px 50px rgba(0,0,0,.7);
}
.ac li{padding:8px 14px;cursor:pointer;border-bottom:1px solid #1c222a;
       display:flex;align-items:center;gap:12px}
.ac li:last-child{border-bottom:none}
.ac li b{display:block;font-size:16px}
.ac li em{font-style:normal;font-size:12.5px;color:var(--dim)}
.ac li.ac-wait{color:var(--faint);font-style:italic;font-size:13.5px;
               justify-content:center;cursor:default;padding:14px}
/* every row gets the same square first, the picture sits on top of it */
.ac-art{width:40px;height:40px;border-radius:6px;flex:none;overflow:hidden;
        background:#1f252e}
.ac-art img{width:100%;height:100%;object-fit:cover;display:block}
.ac-txt{min-width:0}
.ac-txt b,.ac-txt em{display:block;overflow:hidden;text-overflow:ellipsis;
                     white-space:nowrap}
.ac li.ac-wait:hover{background:none}
.ac li.on{background:#0f2418}
.ac li.on b{color:var(--accent)}

.actions{display:flex;gap:12px;width:var(--col)}
.actions .btn{flex:1}

/* guess history */
.history{list-style:none;width:var(--col);display:flex;
         flex-direction:column;gap:7px}
.history li{
  display:flex;align-items:center;gap:10px;
  padding:10px 15px;border-radius:9px;font-size:15px;
  background:var(--panel);border-left:4px solid var(--line);
}
.history li.wrong{border-left-color:var(--bad);color:#d8a5ab}
.history li.skip{border-left-color:#4a5462;color:var(--dim);font-style:italic}
.history li span.at{margin-left:auto;font-size:11.5px;color:var(--dim);
                    font-family:var(--mono)}

.keys{display:flex;gap:16px;color:var(--faint);font-size:12px;flex-wrap:wrap;
      justify-content:center;width:var(--col)}
.foot{width:var(--col);text-align:center;font-size:12px;color:#4e5864;
      margin-top:2px}
.foot a,.rev-credit a{color:#53fc18;text-decoration:none;font-weight:700}
.foot a:hover,.rev-credit a:hover{text-decoration:underline}
.keys b{color:var(--dim);font-weight:700}
.keys.one{margin-top:6px}

/* ----------------------------------------------------------------- rail
   Pinned to the right edge, never inside --col, so a 9:16 crop of the centre
   never catches it. Hidden outright when the window is too narrow to hold
   both, otherwise it would push the game off centre. */
.rail{
  position:fixed;top:78px;right:0;width:var(--rail);
  max-height:calc(100vh - 100px);
  display:flex;flex-direction:column;gap:8px;
  padding:14px 12px 14px 14px;
  background:rgba(13,16,20,.82);backdrop-filter:blur(10px);
  border:1px solid var(--line);border-right:none;
  border-radius:14px 0 0 14px;
  transition:transform .22s ease;
  z-index:40;
}
.rail.away{transform:translateX(calc(100% - 26px))}
.rail.away .rail-head,.rail.away .rail-list,.rail.away .rail-empty{opacity:0}
.rail-head{font-size:10px;letter-spacing:.2em;color:var(--faint);
           font-weight:800;padding-left:2px;transition:opacity .15s ease}
.rail-toggle{
  position:absolute;left:-1px;top:12px;width:24px;height:30px;
  border:1px solid var(--line);border-right:none;border-radius:8px 0 0 8px;
  background:#11151a;color:var(--dim);cursor:pointer;
  font-size:15px;line-height:1;transform:translateX(-100%);
}
.rail-toggle:hover{color:var(--txt);border-color:var(--accent)}
.rail.away .rail-toggle{transform:translateX(-100%) rotate(180deg)}
.rail-list{list-style:none;display:flex;flex-direction:column;gap:6px;
           overflow-y:auto;transition:opacity .15s ease}
.rail-list li{
  display:flex;align-items:center;gap:9px;padding:7px 8px;border-radius:9px;
  cursor:pointer;border:1px solid transparent;
}
.rail-list li:hover{background:#181d24;border-color:#2e3641}
.rail-list li.on{background:#0f2418;border-color:rgba(30,215,96,.4)}
.rail-list img,.rail-list .r-art{width:36px;height:36px;border-radius:6px;
               object-fit:cover;background:var(--panel-2);flex:none}
.rail-list .r-art{display:grid;place-items:center;font-weight:800;font-size:14px;
                  color:var(--dim)}
.rail-list .r-txt{min-width:0;line-height:1.25}
.rail-list .r-name{font-size:13px;font-weight:600;
                   overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rail-list .r-sub{font-size:10.5px;color:var(--faint)}
.rail-empty{font-size:11.5px;color:var(--faint);line-height:1.5;padding:2px}

@media (max-width:1180px){ .rail,.board{display:none} }

/* ----------------------------------------------------------- leaderboard
   The mirror of the rail, on the left edge. */
.board{
  position:fixed;top:78px;left:0;width:var(--rail);
  max-height:calc(100vh - 100px);
  display:flex;flex-direction:column;gap:7px;
  padding:14px 14px 12px 12px;
  background:rgba(13,16,20,.82);backdrop-filter:blur(10px);
  border:1px solid var(--line);border-left:none;
  border-radius:0 14px 14px 0;
  z-index:40;
}
.board-head{font-size:10px;letter-spacing:.2em;color:var(--faint);font-weight:800}
.board-list{font-size:13.5px;font-weight:800;margin-top:-3px;
            overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.board-rows{list-style:none;display:flex;flex-direction:column;gap:2px;overflow-y:auto}
.board-rows li{display:flex;align-items:center;gap:8px;padding:6px 8px;
               border-radius:8px;font-size:13px}
.board-rows li.me{background:#0f2418;box-shadow:inset 0 0 0 1px rgba(30,215,96,.45)}
.b-rank{width:18px;text-align:center;font-family:var(--mono);font-weight:800;
        font-size:12px;color:var(--faint)}
.p1 .b-rank{color:#f5c542}
.p2 .b-rank{color:#c9d2dd}
.p3 .b-rank{color:#d68a4c}
.b-name{flex:1;min-width:0;font-weight:600;
        overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.b-score{font-family:var(--mono);font-weight:700;color:var(--accent)}
.board-empty{font-size:11.5px;color:var(--faint);line-height:1.5;padding:2px}
.board-me{border-top:1px solid var(--line);padding-top:8px;margin-top:2px;
          display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12px}
.b-you{color:var(--faint);font-weight:700}
.b-mename{font-weight:700;max-width:128px;
          overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.b-edit{font:inherit;font-size:12px;line-height:1;cursor:pointer;
        background:transparent;color:var(--dim);
        border:1px solid var(--line);border-radius:6px;padding:3px 6px}
.b-edit:hover{color:var(--txt);border-color:var(--accent)}
.b-mebest{width:100%;font-size:11px;color:var(--faint)}

/* ----------------------------------------------------------- name prompt */
.namer{position:fixed;inset:0;z-index:75;display:grid;place-items:center;
       background:rgba(6,8,10,.72);backdrop-filter:blur(6px);animation:fade .16s ease}
.namer-card{width:min(380px,90vw);padding:24px 22px 18px;border-radius:18px;
            background:var(--panel);border:1px solid var(--line);
            display:flex;flex-direction:column;gap:10px;text-align:center;
            box-shadow:0 30px 80px rgba(0,0,0,.7)}
.namer-title{font-size:20px;font-weight:800;color:var(--accent)}
.namer-sub{font-size:13px;color:var(--dim)}
#nameIn{font:inherit;font-size:18px;padding:12px 14px;border-radius:11px;
        border:2px solid var(--line);background:#0f1318;color:var(--txt);
        text-align:center}
#nameIn:focus{outline:none;border-color:var(--accent)}
.namer-err{min-height:16px;font-size:12.5px;color:var(--bad)}
.namer-actions{display:flex;gap:10px;justify-content:center}

/* -------------------------------------------------------------- reveal */
.reveal{
  position:fixed;inset:0;z-index:60;display:grid;place-items:center;
  background:rgba(6,8,10,.88);backdrop-filter:blur(10px);
  animation:fade .18s ease;
}
@keyframes fade{from{opacity:0}to{opacity:1}}
.reveal-card{
  width:min(480px,92vw);padding:32px 30px;text-align:center;
  background:linear-gradient(180deg,rgba(var(--tint),.92),var(--panel));
  border:2px solid var(--line);border-radius:20px;
  display:flex;flex-direction:column;align-items:center;gap:12px;
  box-shadow:0 30px 90px rgba(0,0,0,.75);
}
.verdict{font-size:14px;font-weight:800;letter-spacing:.22em}
.verdict.good{color:var(--accent)}
.verdict.bad{color:var(--bad)}
.rev-cover{width:190px;height:190px;border-radius:13px;object-fit:cover;
           background:var(--panel-2);box-shadow:0 14px 40px rgba(0,0,0,.6)}
.rev-title{font-size:27px;font-weight:800;line-height:1.15}
.rev-artist{font-size:16px;color:var(--dim)}
.rev-points{font-size:14px;color:var(--accent);font-weight:700;min-height:18px}
.rev-credit{font-size:12px;color:var(--dim);margin-top:4px}
.rev-run{font-size:14.5px;font-weight:800;color:var(--txt);min-height:18px;
         letter-spacing:.02em}

/* ------------------------------------------------------------- loader
   Shown whenever a list is being fetched. The bar must always be moving:
   a still bar reads as a frozen game, which is exactly the complaint this
   screen answers. The fill creeps toward a cap it never reaches and the
   shimmer keeps going even when the creep is slow. */
.loader{
  position:fixed;inset:0;z-index:70;display:grid;place-items:center;
  background:rgba(6,8,10,.84);backdrop-filter:blur(8px);
  animation:fade .16s ease;
}
.ld-card{
  --h:142;
  width:min(400px,90vw);padding:28px 26px 22px;text-align:center;
  background:linear-gradient(180deg,hsl(var(--h) 34% 13%),var(--panel));
  border:1px solid hsl(var(--h) 36% 24%);border-radius:20px;
  display:flex;flex-direction:column;align-items:center;gap:10px;
  box-shadow:0 30px 80px rgba(0,0,0,.7);
}
.ld-art img,.ld-art .ld-tile{
  width:92px;height:92px;border-radius:12px;object-fit:cover;display:block;
  background:hsl(var(--h) 34% 18%);box-shadow:0 10px 30px rgba(0,0,0,.5);
}
.ld-art .ld-tile{display:grid;place-items:center;font-weight:900;font-size:36px;
                 color:hsl(var(--h) 52% 62%)}
.ld-art:empty{display:none}
.ld-name{font-size:20px;font-weight:800;line-height:1.2;max-width:100%;
         overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ld-name:empty{display:none}
.ld-step{font-size:14px;color:var(--dim);letter-spacing:.02em}
.ld-bar{
  width:100%;height:10px;border-radius:999px;margin-top:4px;
  background:#0e1216;border:1px solid var(--line);overflow:hidden;
}
.ld-fill{
  position:relative;height:100%;width:0;border-radius:999px;overflow:hidden;
  /* always green: a red list (NKVT) gave a red bar, and red here means failed */
  background:linear-gradient(90deg,var(--accent-dk),var(--accent));
}
.ld-fill::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.4),transparent);
  transform:translateX(-100%);animation:shimmer 1.1s linear infinite;
}
@keyframes shimmer{to{transform:translateX(100%)}}
.loader.done .ld-fill{transition:width .22s ease-out}
.loader.fail .ld-fill{background:var(--bad)}
.loader.fail .ld-fill::after{animation:none;opacity:0}
.loader.fail .ld-step{color:#ffb9c0}
.ld-note{font-size:12.5px;color:var(--warn);min-height:17px}
.ld-actions{display:flex;gap:10px;margin-top:4px}

/* the play button says it is working too, so a slow next song is not a
   dead button */
.play.loading::after{
  content:"";position:absolute;inset:-7px;border-radius:50%;
  border:3px solid rgba(30,215,96,.15);border-top-color:var(--accent);
  animation:spin .8s linear infinite;
}
.play{position:relative}
@keyframes spin{to{transform:rotate(360deg)}}

/* ------------------------------------------------------ language switch */
.lang-sw{position:fixed;top:12px;right:14px;z-index:55;display:flex;gap:2px;
         padding:3px;border-radius:999px;background:rgba(13,16,20,.88);
         border:1px solid var(--line);backdrop-filter:blur(8px)}
.lang-sw button{font:inherit;font-size:12px;font-weight:800;letter-spacing:.08em;
                color:var(--dim);background:transparent;border:none;cursor:pointer;
                border-radius:999px;padding:6px 11px;min-width:40px}
.lang-sw button:hover{color:var(--txt)}
.lang-sw button.on{background:var(--accent);color:#04120a}
/* on a phone the top right belongs to the header, so the switch goes down */
@media (max-width:700px){ .lang-sw{top:auto;bottom:12px} }

/* --------------------------------------------------------------- toast */
.toast{
  position:fixed;left:50%;bottom:30px;transform:translateX(-50%);
  background:var(--panel-2);border:2px solid var(--line);
  padding:11px 20px;border-radius:999px;font-size:14.5px;z-index:80;
}
.toast.err{border-color:var(--bad);color:#ffb9c0}
