/* =====================================================================
   Episodes of the path (web/episode): the brief, the words, the scenes,
   your turn, the arcade and the duel. Owned by the episode pass.

   The screen is the lesson's (.dr-screen: the sky, the close button, the
   bar), holding one .ep-page: a column with the top bar, a scrolling body
   and the dock with the one orange button. On a phone the column is the
   window; on a desktop it is a centred column of 720px, and the story lays
   its stage beside the chat instead of over it.

   The look follows the prototypes in design/content/: the stage as a dark
   glass card with the place in neon letters, the chat in glass bubbles with
   each speaker's dot, Linguino's whispers in italics, the pause greying the
   stage, and the arcade's HUD with the score and the combo flame.
   ===================================================================== */

.dr-screen.ep-screen { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.ep-page {
  --ep-w: min(720px, 100%);
  flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%;
  animation: ep-in 0.25s ease-out both;
}
@keyframes ep-in { from { opacity: 0; transform: translateY(10px); } }
.ep-page > .dr-top, .ep-screen .dr-top.ep-top { width: var(--ep-w); margin: 0 auto; padding: 14px var(--au-gutter) 8px; }
.ep-top-fill { flex: 1; }
.ep-book { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; font: 700 14px/1 var(--display); color: var(--ink);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0); box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge); }
.ep-book .i { width: 16px; height: 16px; color: var(--au-violet); }

.ep-col {
  flex: 1; min-height: 0; overflow-y: auto; width: var(--ep-w); margin: 0 auto;
  padding: 8px var(--au-gutter) 24px; display: flex; flex-direction: column; gap: 14px;
}
.ep-dock {
  flex: none; width: var(--ep-w); margin: 0 auto; padding: 12px var(--au-gutter) max(16px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
}
.ep-dock.column { flex-direction: column; align-items: stretch; }
.ep-dock .ep-go { flex: 1; justify-content: center; }
.ep-dock-hint { display: none; }
.ep-h1 { margin: 0; font: 700 30px/1.08 var(--display); letter-spacing: -0.02em; }
.ep-h2 { margin: 6px 0 0; font: 700 18px/1.2 var(--display); }
.center { text-align: center; align-self: center; }
.ep-sub { color: var(--muted); font-size: 15px; }
.ep-meta { color: var(--muted); font-size: 13px; font-weight: 700; }
.ep-lat { color: var(--muted); font-size: 13px; font-style: italic; }

/* ---------- the brief ---------- */

.ep-mission.au-hero { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: var(--au-r-hero);
  background-image: radial-gradient(160px 160px at 0 0, color-mix(in srgb, var(--hue) 40%, transparent), transparent 72%), var(--au-glass); }
.ep-mission-art { flex: none; width: 84px; height: 84px; display: grid; place-items: center; border-radius: 24px; font-size: 52px;
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0); box-shadow: 0 0 34px -6px var(--hue), inset 0 1px 0 var(--au-highlight); }
.ep-mission-art .pic { width: 56px; height: 56px; }
.ep-mission-t { display: grid; gap: 4px; min-width: 0; }
.ep-brief-text { margin: 0; font-size: 16px; line-height: 1.55; }
.ep-brief-text b { color: var(--au-gold); }
.ep-cast { flex: none; display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.ep-cast-i small { line-height: 1.35; }
.ep-cast-i { flex: none; display: grid; justify-items: center; gap: 2px; min-width: 76px; text-align: center; }
.ep-cast-i b { font-size: 13px; }
.ep-cast-i small { font-size: 11px; color: var(--muted); }
.ep-cast-i .ep-avatar { width: 52px; height: 52px; }
.ep-goal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ep-goal-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--au-r-tile); font-weight: 700;
  background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow); }
.ep-goal-pic { width: 34px; height: 34px; display: grid; place-items: center; font-size: 26px; }
.ep-goal-pic .pic { width: 30px; height: 30px; }
.ep-goal-list.result li > .i { margin-left: auto; width: 20px; height: 20px; }
.ep-goal-list.result li.won > .i { color: var(--au-teal); }
.ep-goal-list.result li.missed { opacity: 0.6; }
.ep-goal-list.result li.missed > .i { color: var(--bad); }
.ep-hint { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 14px; }
.ep-hint .pic { width: 22px; height: 22px; }

/* ---------- the words for tonight ---------- */

.ep-card.au-hero { position: relative; display: grid; justify-items: center; gap: 8px; padding: 22px 18px 18px; border-radius: var(--au-r-hero); text-align: center; }
.ep-card-n { position: absolute; left: 18px; top: 16px; color: var(--muted); font: 700 14px/1 var(--display); }
.ep-card > .ep-say { position: absolute; right: 14px; top: 12px; }
.ep-card-pic { font-size: 96px; line-height: 1; margin-top: 12px; filter: drop-shadow(0 12px 22px rgb(0 0 0 / 0.35)); }
.ep-card-pic .pic { width: 120px; height: 120px; }
.ep-card-w { border: 0; background: none; color: var(--ink); font: 800 32px/1.1 var(--display); letter-spacing: -0.02em; cursor: pointer; padding: 0; }
.ep-card-tr { color: var(--muted); font-size: 18px; font-weight: 600; }
.ep-card-use { width: 100%; text-align: left; padding: 12px 14px; border-radius: var(--au-r-tile); background: rgb(var(--violet-rgb) / 0.12); }
.ep-card-use .au-eyebrow { color: var(--au-violet); display: inline-flex; gap: 6px; align-items: center; }
.ep-card-use .pic { width: 14px; height: 14px; }
.ep-card-use p { margin: 6px 0 0; }
.ep-card-ex { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; padding: 10px 12px; border: 0; border-radius: var(--au-r-tile); cursor: pointer; color: var(--ink);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0); }
.ep-card-ex > span:last-child { display: grid; gap: 3px; }
.ep-card-ex small { color: var(--muted); }
.ep-dots { display: flex; justify-content: center; gap: 6px; }
.ep-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line-hi); transition: width 0.2s, background 0.2s; }
.ep-dots i.on { width: 22px; background: var(--au-teal); }
.ep-dots i.done { background: color-mix(in srgb, var(--au-teal) 45%, transparent); }

.ep-say { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 14px; cursor: pointer; color: var(--au-teal);
  background: color-mix(in srgb, var(--au-teal) 16%, transparent); }
.ep-say .i { width: 20px; height: 20px; }
.ep-say.small { width: 30px; height: 30px; border-radius: 10px; }
.ep-say.small .i { width: 16px; height: 16px; }
.ep-say.big { width: 56px; height: 56px; border-radius: 18px; }
.ep-say.big .i { width: 26px; height: 26px; }
.ep-say.slow { color: var(--au-violet); background: rgb(var(--violet-rgb) / 0.16); }

/* ---------- the listening check and pictures to tap ---------- */

.ep-hear-big { align-self: center; width: 110px; height: 110px; border-radius: 34px; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, var(--au-teal), var(--au-violet)); box-shadow: 0 18px 40px -14px var(--au-teal); }
.ep-hear-big .i { width: 46px; height: 46px; }
.ep-hear-big:active { transform: scale(0.96); }
.ep-pics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ep-pics.small { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.ep-pic { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 120px; padding: 12px 8px; border: 0; border-radius: var(--au-r-tile); cursor: pointer; color: var(--ink); font-size: 64px;
  background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow); transition: transform 0.12s, box-shadow 0.2s; }
.ep-pics.small .ep-pic { min-height: 96px; font-size: 44px; }
.ep-pic .pic { width: 70px; height: 70px; }
.ep-pics.small .ep-pic .pic { width: 48px; height: 48px; }
.ep-pic small { font-size: 13px; font-weight: 700; color: var(--muted); }
.ep-pic:active:not(:disabled) { transform: scale(0.97); }
.ep-pic.right { box-shadow: inset 0 0 0 2px var(--au-teal), 0 0 24px -6px var(--au-teal); }
.ep-pic.wrong { box-shadow: inset 0 0 0 2px var(--bad); opacity: 0.7; animation: ep-shake 0.35s; }
.ep-verdict { margin: 0; text-align: center; font-weight: 700; }
.ep-verdict.ok { color: var(--au-teal); } .ep-verdict.bad { color: var(--bad); }
@keyframes ep-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---------- the story: goals, stage and chat ---------- */

.ep-goals { width: var(--ep-w); margin: 0 auto; padding: 0 var(--au-gutter) 8px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.ep-goal { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 6px; border-radius: 14px; font-size: 13px; font-weight: 700;
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0); box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge); }
.ep-goal-i { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; font-size: 18px; background: rgb(var(--fg) / 0.06); }
.ep-goal-i .pic { width: 20px; height: 20px; }
.ep-goal-i .i { width: 16px; height: 16px; }
.ep-goal.won { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 70%, transparent); }
.ep-goal.won .ep-goal-i { background: var(--au-teal); color: var(--au-on-teal, #04201b); }
.ep-goal.missed { opacity: 0.55; }
.ep-goal.missed .ep-goal-i { background: color-mix(in srgb, var(--bad) 25%, transparent); color: var(--bad); }

.ep-story-body { flex: 1; min-height: 0; width: var(--ep-w); margin: 0 auto; display: flex; flex-direction: column; gap: 10px; padding: 0 var(--au-gutter); }
.ep-stage {
  position: relative; flex: none; height: 168px; border-radius: 26px; overflow: hidden; padding: 14px 16px;
  background:
    radial-gradient(120% 90% at 70% 110%, color-mix(in srgb, var(--hue, var(--au-violet)) 38%, transparent), transparent 60%),
    linear-gradient(180deg, #2a1b4a, #1a1438 60%, #120f2a);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12), 0 18px 40px -20px rgb(0 0 0 / 0.7);
  transition: filter 0.4s, height 0.3s ease;
}
:root[data-theme="light"] .ep-stage { background: radial-gradient(120% 90% at 70% 110%, color-mix(in srgb, var(--hue, var(--au-violet)) 30%, transparent), transparent 60%), linear-gradient(180deg, #3a2a68, #251c50); }
.ep-stage.paused { filter: grayscale(1) brightness(0.8); }
.ep-stage-place { position: absolute; left: 18px; top: 12px; font: 800 26px/1 var(--display); letter-spacing: -0.01em; color: #ffa04d;
  text-shadow: 0 0 12px rgb(255 140 50 / 0.8), 0 0 28px rgb(255 120 40 / 0.45); }
.ep-stage-pause { position: absolute; right: 14px; top: 12px; padding: 4px 12px; border-radius: 10px; transform: rotate(6deg); background: rgb(255 255 255 / 0.85); color: #222; font: 800 16px/1.2 var(--display); letter-spacing: 0.12em; text-transform: uppercase; }
.ep-stage-cast { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; align-items: flex-end; gap: 22px; }
.ep-actor { display: grid; justify-items: center; gap: 2px; transition: transform 0.25s, filter 0.25s; filter: saturate(0.85) brightness(0.85); }
.ep-actor small { padding: 1px 8px; border-radius: 8px; font-size: 11px; font-weight: 700; color: #fff; background: rgb(0 0 0 / 0.45); }
.ep-actor.talking { transform: translateY(-6px) scale(1.06); filter: none; }
.ep-actor-pic { font-size: 54px; line-height: 1; }
img.ep-actor-pic { width: 62px; height: 62px; }
img.ep-actor-pic.art { width: 72px; height: 72px; }
.ep-props { position: absolute; right: 14px; top: 50px; display: flex; gap: 4px; font-size: 22px; opacity: 0.95; }
.ep-props .pic { width: 26px; height: 26px; }
.ep-stage-time { position: absolute; left: 16px; top: 46px; padding: 4px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; color: #fff; background: rgb(0 0 0 / 0.45); }
.ep-stage.role { height: 140px; }

.ep-log { flex: 1; min-height: 0; overflow-y: auto; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22px); mask-image: linear-gradient(to bottom, transparent, #000 22px); display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 16px; scroll-behavior: smooth; }
.ep-sep { align-self: center; margin: 6px 0 2px; padding: 5px 14px; border-radius: 99px; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--au-teal);
  background: color-mix(in srgb, var(--au-teal) 14%, transparent); }
.ep-line { display: flex; gap: 10px; align-items: flex-start; animation: ep-pop 0.28s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes ep-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.ep-line.mine { flex-direction: row-reverse; }
.ep-avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; font-size: 26px;
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0); box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge); }
.ep-avatar .pic { width: 30px; height: 30px; }
/* Linguino's own portraits bring their own round backdrop: they fill the disc. */
.ep-avatar .pic.art { width: 100%; height: 100%; }
.ep-avatar.pg { overflow: visible; }
.ep-avatar.you { color: var(--au-green); }
.ep-avatar.you .i { width: 22px; height: 22px; }
.ep-bubble { position: relative; flex: 0 1 auto; max-width: min(560px, 100% - 52px); min-width: 0; display: grid; gap: 4px; padding: 10px 44px 12px 14px; border-radius: 18px; border-top-left-radius: 6px; cursor: pointer;
  background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow); }
.ep-line.mine .ep-bubble { border-top-left-radius: 18px; border-top-right-radius: 6px; background-image: linear-gradient(color-mix(in srgb, var(--au-green) 14%, transparent) 0 0), var(--au-glass); }
.ep-who { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.ep-who small { color: var(--muted); font-weight: 600; }
.ep-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--au-violet); box-shadow: 0 0 8px var(--au-violet); }
.ep-dot.w-L { background: var(--au-teal); box-shadow: 0 0 8px var(--au-teal); }
.ep-dot.w-Y { background: var(--au-green); box-shadow: 0 0 8px var(--au-green); }
.ep-line[data-who="B"] .ep-dot, .ep-line[data-who="P"] .ep-dot { background: #ffa04d; box-shadow: 0 0 8px #ffa04d; }
.ep-line[data-who="G"] .ep-dot, .ep-line[data-who="C"] .ep-dot { background: var(--au-gold); box-shadow: 0 0 8px var(--au-gold); }
.ep-emote { margin-left: 4px; display: inline-flex; }
.ep-emote .pic { width: 16px; height: 16px; }
.ep-text { font-size: 17px; line-height: 1.4; font-weight: 600; }
.ep-mark { background: color-mix(in srgb, var(--au-teal) 22%, transparent); color: inherit; border-radius: 6px; padding: 0 3px; box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--au-teal) 70%, transparent); }
.ep-tr { color: var(--muted); font-size: 14px; font-weight: 600; animation: ep-in 0.2s ease-out both; }
.ep-bubble > .ep-say { position: absolute; right: 8px; top: 8px; }
.ep-line.whisper .ep-bubble { cursor: default; padding-right: 14px; background-image: linear-gradient(color-mix(in srgb, var(--au-teal) 10%, transparent) 0 0), var(--au-glass); }
.ep-line.whisper .ep-text { font-style: italic; color: color-mix(in srgb, var(--ink) 86%, var(--au-teal)); }
.ep-won { align-self: center; display: inline-flex; gap: 6px; align-items: center; padding: 6px 14px; border-radius: 99px; font-size: 13px; font-weight: 800; color: var(--au-on-teal, #04201b); background: var(--au-teal); animation: ep-pop 0.4s cubic-bezier(.3, 1.6, .5, 1) both; }
.ep-won .i { width: 16px; height: 16px; }

/* interactive cards in the chat */
.ep-q, .ep-card-note {
  display: grid; gap: 10px; padding: 16px; border-radius: 22px; animation: ep-pop 0.3s cubic-bezier(.3, 1.4, .5, 1) both;
  background-color: var(--au-glass-base);
  background-image: radial-gradient(240px 140px at 100% 0, color-mix(in srgb, var(--au-teal) 18%, transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
}
.ep-q.done { opacity: 0.8; }
.ep-q-t { font: 700 19px/1.25 var(--display); }
.ep-opts { display: grid; gap: 8px; }
.ep-opt {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 0; border-radius: 16px; cursor: pointer; text-align: left; color: var(--ink); font-size: 16px; font-weight: 700;
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0); box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi);
  transition: transform 0.1s, box-shadow 0.2s;
}
.ep-opt kbd { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; font: 700 13px/1 var(--display); color: var(--muted); background: rgb(var(--fg) / 0.08); }
.ep-opt .pic { width: 28px; height: 28px; }
.ep-opt:active:not(:disabled) { transform: scale(0.98); }
.ep-opt.good, .ep-opt.right { box-shadow: inset 0 0 0 2px var(--au-teal), 0 0 22px -8px var(--au-teal); }
.ep-opt.meh { box-shadow: inset 0 0 0 2px var(--au-gold); }
.ep-opt.bad, .ep-opt.wrong { box-shadow: inset 0 0 0 2px var(--bad); opacity: 0.6; animation: ep-shake 0.35s; }
.ep-opt.on { box-shadow: inset 0 0 0 2px var(--au-violet); }
.ep-opt:disabled { cursor: default; }
.ep-fb { display: grid; gap: 3px; padding: 10px 12px; border-radius: 14px; font-size: 14px; }
.ep-fb b { display: inline-flex; align-items: center; gap: 6px; }
.ep-fb b .i { width: 16px; height: 16px; }
.ep-fb.good { background: color-mix(in srgb, var(--au-teal) 14%, transparent); } .ep-fb.good b { color: var(--au-teal); }
.ep-fb.meh { background: color-mix(in srgb, var(--au-gold) 14%, transparent); } .ep-fb.meh b { color: var(--au-gold); }
.ep-fb.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); } .ep-fb.bad b { color: var(--bad); }

.ep-card-note.pause { background-image: radial-gradient(240px 140px at 100% 0, color-mix(in srgb, var(--bad) 22%, transparent), transparent 72%), var(--au-glass); }
.ep-pause-ey { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #ff7d9a; }
.ep-pause-ey .i { width: 14px; height: 14px; }
.ep-pause-t { font: 700 21px/1.2 var(--display); }
.ep-card-note p { margin: 0; line-height: 1.5; }
.ep-fix { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; border-radius: 14px; background: rgb(var(--fg) / 0.05); }
.ep-fix s { color: var(--bad); text-decoration-thickness: 2px; font-weight: 700; }
.ep-fix b { font-size: 16px; cursor: pointer; }
.ep-fix .i { width: 16px; height: 16px; color: var(--muted); }
.ep-foot-note { font-size: 14px; color: var(--muted); }
.ep-card-note.culture { grid-template-columns: auto 1fr; align-items: start; background-image: radial-gradient(240px 140px at 100% 0, color-mix(in srgb, var(--au-gold) 20%, transparent), transparent 72%), var(--au-glass); }
.ep-card-note.culture .au-eyebrow { color: var(--au-gold); }
.ep-card-note.culture > div > b { display: block; font: 700 18px/1.25 var(--display); margin: 2px 0 6px; }
.ep-note-pic { font-size: 40px; }
.ep-note-pic .pic { width: 44px; height: 44px; }

.ep-tiles-line { min-height: 54px; display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; border-radius: 16px; background: rgb(var(--fg) / 0.04); box-shadow: inset 0 0 0 1.5px var(--line-hi); }
.ep-tiles-line.big { min-height: 120px; align-content: flex-start; }
.ep-tiles-line.wrong { box-shadow: inset 0 0 0 2px var(--bad); animation: ep-shake 0.35s; }
.ep-tiles-line.right { box-shadow: inset 0 0 0 2px var(--au-teal); }
.ep-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ep-tile { min-height: 44px; padding: 0 14px; border: 0; border-radius: 14px; cursor: pointer; color: var(--ink); font: 700 17px/1 var(--font);
  background: linear-gradient(180deg, color-mix(in srgb, var(--au-violet) 26%, var(--au-glass-base)), color-mix(in srgb, var(--au-violet) 14%, var(--au-glass-base)));
  box-shadow: inset 0 1px 0 var(--au-highlight), 0 3px 0 rgb(0 0 0 / 0.3); transition: transform 0.08s; }
.ep-tile:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 var(--au-highlight), 0 1px 0 rgb(0 0 0 / 0.3); }
.ep-tile.used { visibility: hidden; }
.ep-tile.in { animation: ep-pop 0.2s ease-out both; }
.ep-check-btn { justify-self: center; min-width: 160px; justify-content: center; }
.ep-built { margin: 0; display: flex; gap: 8px; align-items: center; font-weight: 700; color: var(--au-teal); }
.ep-built .i { width: 18px; height: 18px; }

.ep-hear-row { display: flex; align-items: center; gap: 10px; }
.ep-wave { flex: 1; height: 26px; border-radius: 8px; background: repeating-linear-gradient(90deg, var(--au-teal) 0 4px, transparent 4px 9px); opacity: 0.5;
  -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ep-heard { flex: 1; display: grid; gap: 2px; font-weight: 700; }
.ep-heard small { color: var(--muted); font-weight: 600; }

.ep-typing { display: flex; gap: 8px; align-items: center; }
.ep-input { flex: 1; min-width: 0; min-height: 50px; font-size: 16px; }
.ep-mic, .ep-send { flex: none; width: 50px; height: 50px; padding: 0; display: grid; place-items: center; border-radius: 16px; }
.ep-mic { border: 0; cursor: pointer; color: var(--au-teal); background: color-mix(in srgb, var(--au-teal) 16%, transparent); }
.ep-mic.on { color: #fff; background: var(--bad); animation: ep-pulse 1s infinite; }
@keyframes ep-pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--bad) 25%, transparent); } }
.ep-mic .i, .ep-send .i { width: 22px; height: 22px; }
.ep-almost { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); }
.ep-almost b { color: var(--ink); }

/* your turn */
.ep-dock.role { flex-direction: column; align-items: stretch; gap: 10px; }
.ep-role-help { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ep-role-hint { flex: 1 1 100%; display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); }
.ep-role-hint .i { width: 16px; height: 16px; color: var(--au-gold); }
.ep-chip { cursor: pointer; border: 0; }

/* the end */
.ep-end .ep-col { align-items: center; text-align: center; justify-content: center; }
.ep-stars { transform: scale(1.8); margin: 10px 0 6px; }
.ep-stats { width: 100%; }
.ep-next { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px 16px; border-radius: var(--au-r-tile); width: 100%;
  background: rgb(var(--violet-rgb) / 0.12); }
.ep-next .pic { width: 34px; height: 34px; flex: none; }
.ep-next b { color: var(--au-gold); }

/* ---------- the arcade ---------- */

.ep-ar-title .ep-col { align-items: center; text-align: center; justify-content: center; position: relative; }
.ep-float { position: absolute; inset: 0; pointer-events: none; }
.ep-float span { position: absolute; font-size: 44px; animation: ep-float 4s ease-in-out infinite; animation-delay: calc(var(--i) * -0.7s); }
.ep-float .pic { width: 52px; height: 52px; filter: drop-shadow(0 8px 14px rgb(0 0 0 / 0.35)); }
.ep-float span:nth-child(1) { left: 6%; top: 8%; } .ep-float span:nth-child(2) { right: 8%; top: 4%; }
.ep-float span:nth-child(3) { left: 12%; top: 34%; } .ep-float span:nth-child(4) { right: 6%; top: 30%; }
.ep-float span:nth-child(5) { left: 2%; top: 58%; } .ep-float span:nth-child(6) { right: 2%; top: 56%; }
@keyframes ep-float { 50% { transform: translateY(-10px) rotate(-6deg); } }
.ep-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 520px; }
.ep-chips .au-chip { gap: 6px; }
.ep-chips .pic { width: 18px; height: 18px; }
.ep-dock .btn.violet .pic { width: 22px; height: 22px; }

.ar-hud { gap: 12px; }
.ar-hud-t { flex: 1; min-width: 0; display: grid; gap: 6px; }
.ar-hud-t small { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-score { display: grid; justify-items: end; gap: 4px; }
.ar-score b { font: 800 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.ar-combo { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; font: 700 13px/1 var(--display); color: var(--muted); background: rgb(var(--fg) / 0.08); }
.ar-combo i { font-style: normal; padding: 2px 5px; border-radius: 6px; background: rgb(var(--fg) / 0.1); }
.ar-combo .i { width: 14px; height: 14px; }
.ar-combo.hot { color: #3b1d00; background: linear-gradient(180deg, #ffd166, #ff9f1c); box-shadow: 0 0 18px -2px #ffb347; }
.ar-stage { justify-content: flex-start; }
.ar-timer { height: 8px; border-radius: 99px; background: var(--line-hi); overflow: hidden; flex: none; }
.ar-timer span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--au-teal), var(--au-violet)); transition: width 0.1s linear; }
.ar-timer.low span { background: linear-gradient(90deg, #ff9f1c, var(--bad)); }
.ar-ask { font: 700 22px/1.2 var(--display); text-align: center; }
.ar-cue { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: 22px; background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow); }
.ar-cue b { font: 700 22px/1.25 var(--display); }
.ar-flag { flex: none; padding: 6px 8px; border-radius: 10px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--au-gold); background: color-mix(in srgb, var(--au-gold) 16%, transparent); }
.ar-hint { display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 14px 6px 6px; border-radius: 99px; align-self: center; font-size: 14px; background: rgb(var(--violet-rgb) / 0.16); }
.ar-hint b { color: var(--au-gold); }
.ar-odd { display: grid; gap: 10px; }
.ar-odd.two { grid-template-columns: repeat(2, 1fr); }
.ar-odd .ep-opt { min-height: 58px; }
.ar-why { margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
.ar-match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ar-match-col { display: grid; gap: 10px; }
.ar-match-o { justify-content: center; min-height: 64px; font-size: 16px; }
.ar-match-o .pic { width: 40px; height: 40px; }
.ar-match-o.done { opacity: 0.3; box-shadow: inset 0 0 0 2px var(--au-teal); }
.ar-match-o.bad { box-shadow: inset 0 0 0 2px var(--bad); animation: ep-shake 0.35s; }
.ar-cloze { margin: 0; padding: 18px; border-radius: 22px; font: 600 22px/1.45 var(--font); text-align: center; background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow); }
.ar-gap { display: inline-block; min-width: 70px; padding: 0 8px; border-radius: 10px; color: var(--au-teal); background: color-mix(in srgb, var(--au-teal) 14%, transparent); }
.ar-gap.right { color: var(--au-on-teal, #04201b); background: var(--au-teal); }
.ar-gap.wrong { color: #fff; background: var(--bad); }
.ar-cloze-tr { margin: -4px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.ar-credit { text-align: center; color: var(--muted); font-size: 11px; opacity: 0.7; }
.ar-mic { align-self: center; display: grid; justify-items: center; gap: 8px; width: 150px; height: 150px; align-content: center; border: 0; border-radius: 50%; cursor: pointer; color: #fff; font-weight: 700;
  background: radial-gradient(circle at 50% 35%, #8b74ff, #5b44d8); box-shadow: 0 18px 44px -14px #6b56f0; }
.ar-mic .i { width: 44px; height: 44px; }
.ar-mic.on { animation: ep-pulse 1s infinite; background: radial-gradient(circle at 50% 35%, #ff7d9a, #e23d62); }
.ar-model { align-self: center; display: inline-flex; gap: 8px; align-items: center; padding: 10px 16px; border: 0; border-radius: 14px; cursor: pointer; font-weight: 700; color: var(--ink); background: color-mix(in srgb, var(--au-teal) 16%, transparent); }
.ar-model .i { width: 18px; height: 18px; color: var(--au-teal); }
.ar-boss { display: flex; gap: 14px; align-items: center; }
.ar-boss-face { flex: none; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 30px; font-size: 64px;
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0); box-shadow: 0 0 30px -8px var(--hue), inset 0 1px 0 var(--au-highlight); }
.ar-boss-face .pic { width: 70px; height: 70px; }
.ar-boss-face.shake { animation: ep-shake 0.35s 2; }
.ar-boss-say { flex: 1; min-width: 0; display: grid; gap: 4px; padding: 14px 16px; border-radius: 22px; border-top-left-radius: 6px; background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow); }
.ar-boss-say .au-eyebrow { color: var(--au-gold); }
.ar-boss-line { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: var(--ink); font: 700 22px/1.2 var(--display); }
.ar-boss-tr { color: var(--muted); font-size: 13px; }
.ar-patience { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; color: var(--muted); }
.ar-patience .au-progress { flex: 1; height: 10px; }
.ar-patience .au-progress > span { display: block; height: 100%; width: calc(var(--v) * 100%); border-radius: inherit; background: linear-gradient(90deg, var(--au-teal), var(--au-violet)); transition: width 0.4s; }
.ar-odd.one { grid-template-columns: 1fr; }

.ar-fb { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 20px; animation: ep-pop 0.25s ease-out both; }
.ar-fb > div { display: grid; gap: 3px; min-width: 0; }
.ar-fb b { display: inline-flex; gap: 6px; align-items: center; font: 700 17px/1.2 var(--display); }
.ar-fb b .i { width: 18px; height: 18px; }
.ar-fb span { font-weight: 700; }
.ar-fb small { color: var(--muted); }
.ar-fb.ok { justify-content: center; background: color-mix(in srgb, var(--au-teal) 16%, transparent); } .ar-fb.ok b { color: var(--au-teal); }
.ar-fb.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); } .ar-fb.bad b { color: var(--bad); }
.ar-fb .ep-go { flex: none; min-width: 130px; }
.btn.big.ep-go.bad { color: #fff; background: var(--bad); box-shadow: 0 4px 0 color-mix(in srgb, var(--bad) 60%, #000); }
.ar-final { font-size: 64px; }

.ep-intro { margin: auto 0; display: grid; justify-items: center; gap: 10px; padding: 26px 20px; border: 0; border-radius: var(--au-r-hero); cursor: pointer; color: var(--ink); text-align: center;
  background-color: var(--au-glass-base); background-image: radial-gradient(260px 200px at 50% 0, color-mix(in srgb, var(--hue) 36%, transparent), transparent 72%), var(--au-glass); box-shadow: var(--au-shadow);
  animation: ep-zoom 0.35s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes ep-zoom { from { opacity: 0; transform: scale(0.85); } }
.ep-intro-pic { font-size: 72px; } .ep-intro-pic .pic { width: 84px; height: 84px; }
.ep-intro .ep-h1 { font-size: 32px; }
.ep-tip { display: grid; justify-items: center; gap: 10px; margin: auto 0; }
.ep-tip .ep-card-note { width: 100%; }

/* ---------- the duel ---------- */

.ep-duel { display: grid; grid-template-rows: 1fr auto 1fr; height: 100%; }
.duel-half { display: flex; flex-direction: column; gap: 10px; padding: 14px var(--au-gutter); transition: background 0.3s, opacity 0.3s; position: relative; }
.duel-half.p1 { transform: rotate(180deg); background: linear-gradient(180deg, rgb(var(--violet-rgb) / 0.14), transparent); }
.duel-half.p0 { background: linear-gradient(0deg, rgb(255 154 77 / 0.12), transparent); }
.duel-half.locked { opacity: 0.45; }
.duel-half.won { background: color-mix(in srgb, var(--au-teal) 20%, transparent); }
.duel-head { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.duel-half.p0 .au-dot { --hue: #ff9a4d; } .duel-half.p1 .au-dot { --hue: var(--au-violet); }
.duel-score { margin-left: auto; font: 800 30px/1 var(--display); }
.duel-prompt { flex: 1; display: grid; justify-items: center; align-content: center; gap: 6px; }
.duel-pic { font-size: 70px; } img.duel-pic { width: 84px; height: 84px; }
.duel-tr { font: 700 26px/1.2 var(--display); text-align: center; }
.duel-prompt small { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.duel-flash { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) rotate(-4deg); font: 800 32px/1 var(--display); color: var(--bad); pointer-events: none; }
.duel-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.duel-opts .ep-opt { justify-content: center; text-align: center; min-height: 56px; }
.duel-mid { display: flex; align-items: center; gap: 10px; padding: 6px var(--au-gutter); background: rgb(0 0 0 / 0.25); }
.duel-mid .dr-bar { flex: 1; }
.duel-mid span { font: 700 13px/1 var(--display); color: var(--muted); }
.duel-mid span:last-child { transform: rotate(180deg); }

/* On a phone, while a question waits, the stage folds to a strip so the line
   that asked it stays in view above the answers. */
@media (max-width: 1023px) {
  .ep-story-body.ask .ep-stage { height: 92px; }
  .ep-story-body.ask .ep-stage-time, .ep-story-body.ask .ep-props { display: none; }
  .ep-story-body.ask .ep-stage-place { top: 50%; transform: translateY(-50%); font-size: 22px; }
  .ep-story-body.ask .ep-stage-cast { left: auto; right: 12px; bottom: 6px; gap: 10px; transform: scale(0.72); transform-origin: bottom right; }
  .ep-story-body.ask .ep-actor small { display: none; }
}

/* The words for tonight: on a tall phone the card sits in the middle of the
   screen, with a bigger picture, instead of hanging from the top. */
.ep-cards .ep-card { margin-top: auto; }
.ep-cards .ep-dots { margin-bottom: auto; }
@media (max-width: 1023px) and (min-height: 760px) {
  .ep-cards .ep-card.au-hero { gap: 12px; padding: 28px 20px 22px; }
  .ep-cards .ep-card-pic .pic { width: 150px; height: 150px; }
  .ep-cards .ep-card-w { font-size: 36px; }
}

/* ---------- a desktop ---------- */

@media (min-width: 1024px) {
  .ep-page { --ep-w: min(760px, 100% - 48px); }
  .ep-page > .dr-top, .ep-screen .dr-top.ep-top { padding: 22px 0 12px; }
  .ep-col, .ep-dock, .ep-goals { padding-left: 0; padding-right: 0; }
  .ep-dock { padding-bottom: 28px; }
  .ep-dock .ep-go { flex: none; min-width: 300px; margin-left: auto; }
  .ep-dock.column .ep-go, .ep-end .ep-dock .ep-go { margin: 0 auto; }
  .ep-dock-hint { display: block; flex: 1; color: var(--muted); font-size: 14px; }
  .ep-h1 { font-size: 38px; }

  /* The story: the stage on the left, held still; the chat beside it. */
  .ep-story { --ep-w: min(1180px, 100% - 64px); }
  .ep-story .ep-goals { justify-content: flex-start; }
  .ep-story-body { flex-direction: row; align-items: stretch; gap: 28px; padding: 0; }
  .ep-stage { width: 400px; height: auto; max-height: 520px; align-self: flex-start; aspect-ratio: 4 / 5; }
  .ep-stage-place { font-size: 34px; left: 22px; top: 20px; }
  .ep-stage-time { left: 22px; top: 64px; }
  .ep-props { top: 64px; right: 20px; }
  .ep-stage-cast { bottom: 52px; gap: 34px; }
  .ep-actor .pg-wrap, .ep-actor .penguin { transform: scale(1.4); transform-origin: bottom center; }
  .ep-actor-pic { font-size: 80px; } img.ep-actor-pic { width: 92px; height: 92px; }
  .ep-stage.role { height: auto; }
  .ep-log { padding-right: 8px; }
  .ep-text { font-size: 18px; }
  .ep-dock.role { width: min(760px, 100% - 64px); margin-left: auto; margin-right: max(32px, calc((100% - 1180px) / 2)); }
  .ep-story .ep-dock { width: min(752px, 100% - 492px); margin-left: auto; margin-right: max(32px, calc((100% - 1180px) / 2)); }

  .ep-pics { grid-template-columns: repeat(4, 1fr); }
  .ep-pic { min-height: 150px; }
  .ar-stage { justify-content: center; }
  .ar-odd { grid-template-columns: 1fr 1fr; }
  .ar-odd.one { grid-template-columns: 1fr; }
  .ar-cue b, .ar-ask { font-size: 26px; }
  .ep-duel { width: min(900px, 100%); margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .ep-page, .ep-line, .ep-q, .ep-card-note, .ep-won, .ep-intro, .ep-float span, .ep-mic.on, .ar-mic.on { animation: none !important; }
}

/* On a phone the goals share the row instead of running off its edge: the
   brief has said them in full, the bar only has to show which are won. */
@media (max-width: 599px) {
  .ep-goal { flex: 1 1 0; min-width: 0; padding-right: 8px; font-size: 12px; }
  .ep-goal > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
