:root {
  --bg: #0b0a0c;
  --panel: #16130f;
  --gold: #e6c37a;
  --gold-dark: #9a7432;
  --red: #a8281d;
  --text: #f4ecdc;
  --muted: rgba(244, 236, 220, 0.6);
  color-scheme: dark;
  /* the 9:16 frame: the SAME box on the "generating" view and on the reel page (desktop), so the
     job -> reel view transition never jumps */
  --frame-h: min(calc(100dvh - 24px), calc((100vw - 150px) * 16 / 9));
  --frame-bg: radial-gradient(ellipse at 50% 40%, #17110a 0%, #080605 75%);
}
* { box-sizing: border-box; }
/* `display` set on sections below must not defeat the hidden attribute. */
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 45%, #17110a 0%, #080605 70%) fixed;
  color: var(--text);
  font: 500 18px/1.45 "Barlow Semi Condensed", system-ui, sans-serif;
}
/* Fire background: embers + smoke drawn on canvas; the radial gradient above stays as the fallback. */
#fire { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
/* The vignette: dark edges and corners so the eye goes to the centre. Static CSS over the fire canvas (and
   over the plain background without it), the same on the landing, the friends grid and around the reel.
   --vignette is the strength: 0 = none, 1 = black corners. The ellipse follows the screen's shape. */
:root { --vignette: 1; }
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--vignette);
  background: radial-gradient(ellipse 56% 62% at 50% 46%, rgba(0,0,0,0) 12%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0.94) 62%, #000 78%);
}

/* One centered column. */
.app { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 0 20px; display: flex; flex-direction: column; }
.content { flex: 1; display: flex; flex-direction: column; }

/* Top bar: the title centred, name + Log out on the right. */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 16px 0 4px; width: 100%; }
.topbar .brand { grid-column: 2; font: 700 22px Cinzel, serif; color: var(--gold); letter-spacing: 2px; text-align: center; }
#user { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); min-width: 0; }
#user .name { color: var(--text); font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#user .logout { font-size: 13px; white-space: nowrap; }
@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr; gap: 4px; }
  .topbar .brand, #user { grid-column: 1; justify-self: center; }
}

/* Under the search: the recap's language (click to change) and "update list". */
.under-search { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin: -8px 2px 16px; font-size: 15px; color: var(--muted); }
.lang-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#lang-slot-login { font-size: 15px; color: var(--muted); }
.lang-switch { position: relative; }
.link-btn { background: none; border: 0; padding: 2px 0; font: inherit; font-size: 14px; color: var(--gold); text-decoration: underline; cursor: pointer; }
.link-btn:disabled { opacity: .6; cursor: wait; }
.lang-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 2px 0; font: 600 15px "Barlow Semi Condensed", system-ui, sans-serif; color: var(--text); cursor: pointer; }
.lang-btn i { font-style: normal; color: var(--muted); }
.lang-btn u { color: var(--gold); }
.lang-menu {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; margin: 0; padding: 6px; list-style: none; min-width: 200px; text-align: left;
  background: rgba(22, 19, 15, 0.97); border: 1px solid rgba(230, 195, 122, 0.35); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.lang-menu[hidden] { display: none; }
.lang-menu li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 15px;
}
.lang-menu li:hover { background: rgba(230, 195, 122, 0.12); }
.lang-menu li[aria-selected="true"] { color: var(--gold); font-weight: 600; }
.lang-menu .check { width: 16px; height: 16px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

a { color: var(--gold); }
.lead { font-size: 22px; max-width: 460px; margin: 0; }
.hint { color: var(--muted); font-size: 15px; }
section { margin-top: 28px; }
button, select, input, .steam-btn {
  font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid rgba(230, 195, 122, 0.3); border-radius: 6px; padding: 9px 14px;
}
button { cursor: pointer; }
button:hover, .card:hover { border-color: var(--gold); }
.steam-btn {
  position: relative; overflow: hidden;
  display: inline-block; text-decoration: none; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(180deg, #b8342a, #7a1a12); border-color: #d9564b; padding: 12px 22px;
  box-shadow: 0 6px 18px rgba(120, 20, 12, 0.35);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
/* hover: lift, glow and a light sweep, so it clearly reads as a button */
.steam-btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 230, 190, 0.35), transparent);
  transform: skewX(-20deg); transition: left .5s ease;
}
.steam-btn:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.12); box-shadow: 0 10px 28px rgba(200, 50, 30, 0.55), 0 0 0 1px rgba(255, 190, 150, 0.5); }
.steam-btn:hover::after { left: 120%; }
.steam-btn:active { transform: translateY(0) scale(0.98); }

/* Hero (landing): title, tagline, button and hint, centred both ways. */
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 56px 0; }
.title {
  font: 700 48px Cinzel, serif; letter-spacing: 4px; margin: 0; color: var(--gold);
  /* static relief: a gold gradient face, a dark bevel edge and a soft drop, like a metal plate */
  background: linear-gradient(180deg, #fff1c4 0%, #e6c37a 45%, #a67b34 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #3a2508) drop-shadow(0 10px 22px rgba(0, 0, 0, 0.7));
}
/* a soft dark halo behind the hero so it is the focus */
.hero { position: relative; }
.hero::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: min(760px, 120vw); height: 420px; transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 70%); z-index: -1; pointer-events: none;
}

/* Pick: search, "Just me", then a single-column friend list and the FAQ. */
#pick { padding-bottom: 24px; }
#pick #search { width: 100%; }
#friends-note { margin: 12px 0 0; }
/* Friends as a card grid: avatar + name only (the stats are the surprise inside the reel). */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; padding: 18px 12px 14px; width: 100%; border-radius: 14px;
  /* glass card with a gradient border: gold top-left fading into ember red */
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, rgba(48, 32, 22, 0.62), rgba(14, 10, 10, 0.72)) padding-box,
    linear-gradient(140deg, rgba(230, 195, 122, 0.75), rgba(230, 195, 122, 0.08) 45%, rgba(168, 40, 29, 0.6)) border-box;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  transition: transform .18s ease, box-shadow .18s ease;
  cursor: pointer; font: inherit; color: var(--text);
  /* cheap glass: no backdrop-filter; off-screen cards skip rendering */
  content-visibility: auto; contain-intrinsic-size: 150px 150px;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.55), 0 0 24px rgba(230, 160, 80, 0.25);
  background:
    linear-gradient(160deg, rgba(62, 40, 24, 0.7), rgba(18, 12, 10, 0.78)) padding-box,
    linear-gradient(140deg, #e6c37a, rgba(230, 195, 122, 0.2) 45%, #c0301a) border-box;
}
.card img { width: 76px; height: 76px; border-radius: 50%; border: 2px solid rgba(230, 195, 122, 0.55); box-shadow: 0 4px 14px rgba(0,0,0,0.5); }
.card .name { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .live { position: absolute; top: 8px; right: 10px; }
.card .meta { color: var(--muted); font-size: 14px; }
.card.solo { display: block; width: 100%; margin-bottom: 14px; padding: 12px 16px; text-align: center; }
.card.solo .meta { margin-left: 10px; }
.live { color: #6fd38a; font-style: normal; font-size: 12px; }

/* FAQ */
.faq { margin-top: 26px; }
.faq { max-width: 640px; margin-left: auto; margin-right: auto; width: 100%; }
.faq-title { font: 700 20px Cinzel, serif; color: var(--gold); letter-spacing: 2px; margin: 0 0 10px; text-align: center; }
.faq details { background: var(--panel); border: 1px solid rgba(230, 195, 122, 0.2); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--text); outline: none; }
.faq summary:hover { color: var(--gold); }
.faq details p { color: var(--muted); font-size: 15px; margin: 8px 0 2px; line-height: 1.5; }

/* The reel frame's waiting state: the intro slide wiggles on the canvas and a spinner sits where the
   play button will go (the frame is never a separate black loader screen). */
#loading {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: row; align-items: flex-start; justify-content: center;
  gap: 10px; text-align: left; padding: calc(var(--frame-h) * 0.872) 24px 0; pointer-events: none;
}
body.mobile #loading { padding-top: 78dvh; }
#loading .spinner { width: 36px; height: 36px; margin: 0; border-width: 3px; }
#loading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 36px; max-width: 80%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 6px #000; }
.progress { width: 66%; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }

.spinner { margin: 0; }
.reel-inner p { margin: 0; color: var(--muted); font-size: 15px; max-width: 90%; }
.progress { width: 66%; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); transition: width 0.3s; }

.spinner {
  width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 50%;
  border: 4px solid rgba(230, 195, 122, 0.2); border-top-color: var(--gold); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Sticky footer: the Valve disclaimer at the very bottom of the viewport on every view. */
.disclaimer { text-align: center; color: var(--muted); font-size: 12px; padding: 10px 16px 14px; margin: 0; }
.disclaimer p { margin: 0; }

/* reel page */
/* The viewer is a fixed layer over the home, which stays in place (and keeps its scroll) underneath. */
#viewer { display: none; position: fixed; inset: 0; z-index: 20; flex-direction: column; align-items: center; justify-content: center; }
.reel-page { overflow: hidden; }
.reel-page #viewer { display: flex; }
.app, body > .disclaimer { transition: opacity .38s ease, visibility 0s; }
.reel-page > .app, .reel-page > footer.disclaimer { opacity: 0; visibility: hidden; transition: opacity .38s ease, visibility 0s .38s; }
.reel-page.closing > .app, .reel-page.closing > footer.disclaimer { opacity: 1; visibility: visible; transition: opacity .38s ease; }
.reel-page #stage { animation: frame-in .45s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes frame-in { from { opacity: 0; transform: scale(.94); } }
#shell { position: relative; z-index: 1; }
.reel-page:not(.reel-ready) #controls, .reel-page:not(.reel-ready) #side-actions { visibility: hidden; }
.act-update:disabled { opacity: .5; cursor: wait; }
#stage { position: relative; background: var(--frame-bg); overflow: hidden; }
/* rounded like Instagram stories on desktop (phones are full-screen, square; fullscreen and the exported image / video stay square) */
.reel-page:not(.mobile) #stage { height: var(--frame-h); aspect-ratio: 9 / 16; border-radius: 16px; }
#stage:fullscreen, body.mobile #stage { border-radius: 0; box-shadow: none; }
#stage:fullscreen { width: 100vw !important; height: 100vh !important; display: flex; align-items: center; justify-content: center; }
#reel { width: 100%; height: 100%; display: block; object-fit: contain; }
#progress { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; gap: 4px; z-index: 3; pointer-events: none; }
#progress span { flex: 1; height: 3px; background: rgba(255, 255, 255, 0.25); border-radius: 2px; overflow: hidden; }
#progress i { display: block; height: 100%; width: 0; background: #fff; }
.tap { position: absolute; background: transparent; border: 0; padding: 0; border-radius: 0; -webkit-tap-highlight-color: transparent; }
.tap:hover { border: 0; }
#tap-top { top: 0; left: 0; right: 0; height: 18%; z-index: 2; }
#tap-prev { left: 0; top: 18%; bottom: 0; width: 28%; }
#tap-next { right: 0; top: 18%; bottom: 0; width: 28%; }
#tap-mid { left: 28%; right: 28%; top: 18%; bottom: 0; }
#loading.failed .spinner { display: none; }
#loading.failed { align-items: center; padding-top: 0; }
#loading.failed { flex-direction: column; gap: 14px; }
#loading .donate-btn { pointer-events: auto; padding: 10px 22px; border-radius: 999px; background: var(--gold); color: #1a1205; font-weight: 700; font-size: 14px; text-decoration: none; }
#loading.failed p { white-space: pre-line; text-align: center; line-height: 1.3; }
#loading.failed p { color: var(--gold); font-size: 16px; }

/* icon buttons */
.icon {
  width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.12); color: #fff;
  -webkit-tap-highlight-color: transparent; backdrop-filter: blur(4px);
}
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon:hover { border-color: var(--gold); color: var(--gold); }
/* desktop: a vertical rail to the right of the frame (the frame itself stays centred) */
#controls { position: absolute; left: calc(100% + 18px); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 12px; align-items: center; }
#controls select { font-size: 14px; padding: 8px 10px; border-radius: 22px; height: 44px; }
.reel-page:not(.mobile) .icon { background: rgba(14, 10, 10, 0.62); border-color: rgba(230, 195, 122, 0.3); }
.speed-code { font: 700 14px "Barlow Semi Condensed", sans-serif; letter-spacing: .5px; }
.act-speed.on { color: var(--gold); border-color: var(--gold); }
/* the held last card: the replay buttons pulse instead of an overlay covering the card */
body.ended .act-replay { color: var(--gold); border-color: var(--gold); animation: pulse 1.4s ease-in-out infinite; }

/* top-right inside the frame, like Instagram stories: sound, then the X */
#top-actions { position: absolute; top: calc(22px + env(safe-area-inset-top)); right: 12px; z-index: 7; display: flex; align-items: center; gap: 8px; }
#top-actions .icon { width: 40px; height: 40px; background: rgba(0, 0, 0, 0.4); border-color: transparent; }
#top-actions .icon svg { width: 22px; height: 22px; }
#volume { display: flex; align-items: center; gap: 6px; }
#vol-slider { width: 0; opacity: 0; transition: width .2s, opacity .2s; accent-color: var(--gold); }
#volume:hover #vol-slider, #volume:focus-within #vol-slider { width: 90px; opacity: 1; }
#side-actions { display: none; }

#speed-badge { position: absolute; top: calc(28px + env(safe-area-inset-top)); left: 16px; z-index: 6; padding: 4px 10px; border-radius: 12px; background: rgba(0,0,0,0.55); color: var(--gold); font: 700 18px "Barlow Semi Condensed", sans-serif; pointer-events: none; }
#speed-badge[hidden], #flash[hidden], #toast[hidden], #big-play[hidden], #volume[hidden] { display: none; }
#flash { position: absolute; inset: 0; margin: auto; width: 110px; height: 110px; border-radius: 50%; background: rgba(0,0,0,0.5); color: #fff; display: grid; place-items: center; pointer-events: none; opacity: 0; z-index: 4; }
#flash.show { animation: flash .7s ease-out; }
@keyframes flash { 0% { opacity: 1; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.25); } }
#toast {
  position: absolute; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 8;
  max-width: 86%; padding: 10px 16px; border-radius: 22px; background: rgba(0,0,0,0.75); color: #fff; text-align: center;
  font: 600 15px "Barlow Semi Condensed", sans-serif; pointer-events: none;
}

#big-play {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(circle, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.7) 70%); border: 0; border-radius: 0;
  color: #fff; cursor: pointer; font: 700 20px "Barlow Semi Condensed", sans-serif; letter-spacing: 1px;
}
#big-play svg { width: 110px; height: 110px; padding: 22px 18px 22px 26px; border-radius: 50%; background: rgba(0,0,0,0.45); border: 2px solid var(--gold); color: var(--gold); box-shadow: 0 0 40px rgba(230,195,122,0.35); transition: transform .15s; }
#big-play:hover svg { transform: scale(1.08); }
#big-play:hover { border: 0; }
#big-play:disabled { cursor: wait; }
#big-play:disabled svg { opacity: .35; transform: none; animation: pulse 1.2s ease-in-out infinite; }
#big-play span { text-shadow: 0 2px 8px #000; font-size: 22px; }

/* phone: full-screen reel, only volume + download + share */
body.mobile #stage { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; }
body.mobile #controls, body.mobile .disclaimer { display: none; }
#viewer .disclaimer { position: fixed; left: 0; right: 0; bottom: 6px; z-index: 1; padding: 4px 16px; text-shadow: 0 1px 6px #000; }
/* phone actions: a slim row along the bottom (Instagram-story style) over the bottom margin, never over the
   slide's text: a soft dark gradient, evenly spaced small icons, safe-area aware. The container lets taps
   through to the tap zones; only the buttons catch them. X + sound stay top-right. */
body.mobile #side-actions {
  display: flex; flex-direction: row; justify-content: space-evenly; align-items: center; gap: 0;
  position: absolute; z-index: 6; left: 0; right: 0; bottom: 0;
  padding: 22px 10px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.5) 55%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}
body.mobile #side-actions .icon { pointer-events: auto; width: 40px; height: 40px; background: rgba(0, 0, 0, 0.35); border-color: rgba(230, 195, 122, 0.25); }
body.mobile #side-actions .icon svg { width: 22px; height: 22px; }
body.mobile #side-actions .icon[hidden] { display: none; }
body.mobile #top-actions .icon { width: 40px; height: 40px; }
body.mobile #top-actions .icon svg { width: 22px; height: 22px; }
body.mobile #vol-slider { display: none; }
body.recording .tap { pointer-events: none; }
body.recording .act-download { animation: pulse 1.2s ease-in-out infinite; color: var(--gold); border-color: var(--gold); }
@keyframes pulse { 50% { box-shadow: 0 0 14px rgba(230,195,122,0.7); } }

/* no text selection / callout on long press */
#stage, #stage * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
body.holding #progress, body.holding #side-actions, body.holding #top-actions, body.holding #speed-badge { opacity: 0; transition: opacity .15s; }
#debug { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 9; margin: 0; padding: 8px; background: rgba(0,0,0,0.8); color: #9f9; font: 11px/1.4 ui-monospace, monospace; white-space: pre-wrap; pointer-events: none; }
.lang-code { font: 700 15px "Barlow Semi Condensed", sans-serif; letter-spacing: 1px; }
body.mobile .lang-code { font-size: 17px; }

/* ---- v2 extras: private-profile card, cloud render, feedback, kofi ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

#warning-card {
  position: absolute; inset: 0; z-index: 9; display: grid; place-items: center;
  padding: 18px; overflow: auto;
  background: rgba(6, 4, 8, 0.78); backdrop-filter: blur(6px);
}
#warning-card[hidden] { display: none; }
#warning-card .wc-inner {
  width: min(620px, 100%); padding: 22px 22px 18px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(30, 22, 20, 0.98), rgba(14, 10, 12, 0.98));
  border: 1px solid rgba(230, 195, 122, 0.55); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
#warning-card h2, #render-panel h2, #feedback-dialog h2 {
  font: 700 22px/1.2 Cinzel, serif; color: var(--gold); letter-spacing: 1px; margin: 0 0 12px;
}
#warning-card p { margin: 0 0 12px; font-size: 16px; line-height: 1.45; color: var(--text); }
#warning-card .wc-note { color: var(--muted); font-size: 14px; }
#warning-card .wc-est { margin: 0 0 10px; }
.wc-chip {
  display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
  letter-spacing: .04em; color: #1c1412; background: var(--gold);
}
.wc-status { min-height: 20px; margin: 4px 0 10px; font-size: 14px; color: var(--muted); }
.wc-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.wc-actions button, .wc-actions a {
  font: 700 15px "Barlow Semi Condensed", sans-serif; letter-spacing: .03em;
  padding: 10px 16px; border-radius: 10px; border: 1px solid rgba(230, 195, 122, 0.45);
  background: #1d1719; color: var(--text); text-decoration: none; cursor: pointer;
}
.wc-actions button:hover, .wc-actions a:hover { border-color: var(--gold); color: var(--gold); }
.wc-actions .wc-primary { background: linear-gradient(180deg, #e6c37a, #c8a24f); color: #1c1412; border-color: #e6c37a; }
.wc-actions button:disabled { opacity: .6; cursor: wait; }
body.warning-open .tap { pointer-events: none; }
body.warning-open #big-play { display: none; }

#render-panel {
  position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 9; width: min(560px, calc(100% - 24px)); padding: 16px 18px;
  border-radius: 14px; background: rgba(12, 9, 12, 0.94); border: 1px solid rgba(160, 190, 235, 0.5);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); text-align: left;
}
#render-panel[hidden] { display: none; }
#render-panel h2 { font-size: 18px; color: #cfe0ff; margin-bottom: 8px; }
#render-panel p { margin: 0 0 10px; font-size: 14px; color: var(--muted); line-height: 1.4; }
#rp-bar { height: 8px; border-radius: 6px; background: rgba(255,255,255,0.12); overflow: hidden; margin: 8px 0; }
#rp-bar[hidden] { display: none; }
#rp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7fb2ff, #cfe0ff); transition: width .4s; }
#render-panel .wc-actions .wc-primary { background: linear-gradient(180deg, #a9c7ff, #7fb2ff); border-color: #a9c7ff; color: #0e1524; }

#feedback-dialog {
  border: 1px solid rgba(230, 195, 122, 0.5); border-radius: 16px; padding: 0;
  background: linear-gradient(180deg, #1e1614, #100b0d); color: var(--text);
  width: min(560px, calc(100vw - 24px));
}
#feedback-dialog::backdrop { background: rgba(0, 0, 0, 0.66); backdrop-filter: blur(4px); }
#feedback-dialog form { padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 10px; }
#feedback-dialog .fb-row { display: grid; gap: 5px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#feedback-dialog select, #feedback-dialog textarea {
  font: 500 16px/1.4 "Barlow Semi Condensed", system-ui, sans-serif; color: var(--text);
  background: #17131b; border: 1px solid #3a2f38; border-radius: 8px; padding: 9px 10px; width: 100%;
}
#feedback-dialog textarea { resize: vertical; min-height: 90px; }
#feedback-dialog #fb-status { margin: 0; }
.kofi-link { color: var(--gold); }
#warning-card .wc-fix {
  margin: 0 0 12px; padding: 10px 12px; font-size: 15px; color: #f2e3c6;
  border-left: 3px solid var(--gold); background: rgba(230, 195, 122, 0.08); border-radius: 0 8px 8px 0;
}
/* keep the art visible behind the play overlay */
/* the play button sits BELOW the intro's avatars / names (~72% of the frame), never over them */
#big-play { justify-content: flex-start; padding-top: calc(var(--frame-h) * 0.73); background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.5) 100%); }
body.mobile #big-play { padding-top: 71dvh; }
#big-play svg { width: 84px; height: 84px; padding: 17px 14px 17px 20px; }
/* the reel viewer's intro has its avatars low in the frame: there the play button is a pill under them */
body.reel-page #big-play { flex-direction: row; justify-content: center; align-items: flex-start; gap: 12px; padding-top: calc(var(--frame-h) * 0.884); }
body.reel-page.mobile #big-play { padding-top: 80dvh; }
body.reel-page #big-play svg { width: 48px; height: 48px; padding: 10px 8px 10px 11px; }
body.reel-page #big-play span { line-height: 48px; font-size: 20px; }
#progress span { background: rgba(255, 255, 255, 0.34); }

/* ---- friends round 3: me card, show-all, staggered load + skeletons, glass search + FAQ ---- */
#pick #search {
  padding: 13px 16px 13px 44px; border-radius: 12px; font-size: 18px;
  background: rgba(20, 14, 12, 0.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e6c37a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 15px center / 18px;
  border: 1px solid rgba(230, 195, 122, 0.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  margin-bottom: 18px; transition: border-color .15s, box-shadow .15s;
}
#pick #search:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(230, 195, 122, 0.15); }
.card.me {
  background:
    linear-gradient(160deg, rgba(90, 62, 22, 0.7), rgba(20, 13, 10, 0.8)) padding-box,
    linear-gradient(140deg, #f3d48d, rgba(230, 195, 122, 0.35) 50%, #e6c37a) border-box;
}
.card.me img { border-color: var(--gold); }
.card .tag { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin-top: -6px; }
.card.dim { opacity: .62; }
.card.dim:hover { opacity: 1; }
.show-all {
  display: block; margin: 18px auto 0; padding: 10px 24px; border-radius: 999px; color: var(--gold); font-weight: 600;
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, rgba(48, 32, 22, 0.62), rgba(14, 10, 10, 0.72)) padding-box,
    linear-gradient(140deg, rgba(230, 195, 122, 0.75), rgba(230, 195, 122, 0.08) 45%, rgba(168, 40, 29, 0.6)) border-box;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35); transition: transform .18s ease, box-shadow .18s ease;
}
.show-all:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5), 0 0 24px rgba(230, 160, 80, 0.3);
  background:
    linear-gradient(160deg, rgba(62, 40, 24, 0.7), rgba(18, 12, 10, 0.78)) padding-box,
    linear-gradient(140deg, #e6c37a, rgba(230, 195, 122, 0.2) 45%, #c0301a) border-box; }
.card.pop { animation: card-in .42s cubic-bezier(.2, .9, .3, 1.25) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }
.card.skeleton { pointer-events: none; min-height: 150px; }
.card.skeleton i { width: 76px; height: 76px; border-radius: 50%; background: rgba(255,255,255,0.07); }
.card.skeleton b { width: 60%; height: 14px; border-radius: 7px; background: rgba(255,255,255,0.07); }
.card.skeleton::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(100deg, transparent 30%, rgba(230, 195, 122, 0.10) 50%, transparent 70%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .card.pop, .card.skeleton::after { animation: none; } }
/* FAQ: the same gradient border, hover lift and warm glow as the friend cards */
.faq details {
  border: 1px solid transparent; border-radius: 12px; padding: 12px 16px;
  background:
    linear-gradient(160deg, rgba(48, 32, 22, 0.62), rgba(14, 10, 10, 0.72)) padding-box,
    linear-gradient(140deg, rgba(230, 195, 122, 0.75), rgba(230, 195, 122, 0.08) 45%, rgba(168, 40, 29, 0.6)) border-box;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  transition: transform .18s ease, box-shadow .18s ease;
}
.faq details:hover, .faq details[open] {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5), 0 0 24px rgba(230, 160, 80, 0.25);
  background:
    linear-gradient(160deg, rgba(62, 40, 24, 0.7), rgba(18, 12, 10, 0.78)) padding-box,
    linear-gradient(140deg, #e6c37a, rgba(230, 195, 122, 0.2) 45%, #c0301a) border-box;
}
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-size: 22px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
/* the Dota settings path, on its own line, like breadcrumb chips */
.faq .path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 6px; }
.faq .path span {
  font-weight: 700; font-size: 14px; color: #1c1412; background: linear-gradient(180deg, #f0d391, #c9a14f);
  padding: 4px 10px; border-radius: 6px;
}
.faq .path i { color: var(--gold); font-style: normal; font-weight: 700; }

@media (prefers-reduced-motion: reduce) { .reel-page #stage { animation: none; } }

/* no focus rectangle over the reel (the tap zones are focusable buttons) */
.tap, .tap:focus, .tap:focus-visible, #stage:focus, #stage:focus-visible { outline: none; }
/* desktop: the frame is almost the whole viewport height; the viewer's disclaimer goes bottom-right */
@media (min-width: 761px) {
  #viewer .disclaimer { left: auto; right: 12px; bottom: 8px; max-width: 250px; text-align: right; font-size: 11px; line-height: 1.35; padding: 0; opacity: .7; }
}
@media (max-width: 760px) { :root { --frame-h: min(calc(100dvh - 24px), calc((100vw - 32px) * 16 / 9)); } }


/* leaving the reel (back): the frame shrinks a little and fades, the rail goes, then the friends grid */
#stage, #controls { transition: transform .4s cubic-bezier(.4, 0, .2, 1), opacity .35s ease; }
body.closing #stage { transform: scale(.9); opacity: 0; }
body.closing #controls { opacity: 0; transform: translateY(-50%) translateX(-18px); pointer-events: none; }

/* nicknames: pencil (hover on desktop, always faint on touch), inline input, Steam name under it */
.card .pencil { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--gold); opacity: 0; transition: opacity .15s, background .15s; cursor: pointer; }
.card .pencil svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card:hover .pencil, .card:focus-within .pencil { opacity: .85; }
.card .pencil:hover { background: rgba(230, 195, 122, 0.18); opacity: 1; }
@media (hover: none) { .card .pencil { opacity: .6; } }
.card .ago { font-size: 12px; color: var(--muted); opacity: .8; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -6px; }
.card .sub { font-size: 12px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -6px; }
.card .nick-input { width: 100%; font: 700 18px/1.2 "Barlow Semi Condensed", sans-serif; text-align: center; color: var(--text); background: rgba(0,0,0,.4); border: 1px solid var(--gold); border-radius: 8px; padding: 4px 6px; }
.card .nick-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(230, 195, 122, 0.2); }
.card.skeleton { content-visibility: visible; }


/* "ready" recaps: a gold tag under the avatar and a menu (update) */
.card .face { position: relative; display: flex; }
.card .badge { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #1c1412; background: linear-gradient(180deg, #f0d391, #c9a14f); box-shadow: 0 2px 8px rgba(0,0,0,.6); white-space: nowrap; }
.card .more { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--gold); opacity: .55; cursor: pointer; }
.card .more svg { width: 17px; height: 17px; fill: currentColor; }
.card:hover .more, .card .more:focus-visible { opacity: 1; }
.card .more:hover { background: rgba(230, 195, 122, 0.18); }
.tip, .card-menu, .home-toast { position: fixed; z-index: 15; background: rgba(22, 19, 15, 0.97); border: 1px solid rgba(230, 195, 122, 0.45); border-radius: 10px; box-shadow: 0 12px 34px rgba(0,0,0,.65); }
.tip { max-width: 260px; padding: 7px 11px; font-size: 14px; line-height: 1.35; text-align: center; white-space: pre-line; pointer-events: none; }
.tip::first-line { font-weight: 700; }
.card-menu { padding: 5px; }
.card-menu button { background: none; border: 0; border-radius: 7px; padding: 8px 12px; font-size: 15px; white-space: nowrap; }
.card-menu button:hover, .card-menu button:focus-visible { background: rgba(230, 195, 122, 0.14); outline: none; }
.home-toast { left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 18px; font-size: 15px; text-align: center; width: max-content; max-width: 90vw; }

.faq-suggest { display: block; margin: 14px 0 6px; text-align: center; color: var(--gold); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.faq-suggest:hover { color: var(--text); }
#report-menu { z-index: 40; }
#report-menu button { display: block; width: 100%; text-align: left; }
