/* css/rival.css — Online Rival Mode */

/* ── Fullscreen overlay ───────────────────────────── */
#rival-root.rv-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 400;
  overflow-y: auto;
  overflow-x: hidden;
  background: #0f172a;
  -webkit-overflow-scrolling: touch;
}

.rv-back-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.15);
  color: #94a3b8; font-size: .8rem; font-weight: 600;
  padding: .35rem .75rem; border-radius: 8px;
  cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s;
}
.rv-back-btn:hover { background: rgba(255,255,255,.07); color: #e2e8f0; }

.rv-btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #00d4ff);
  color: #0f172a; border: none; border-radius: 12px;
  padding: .85rem 1.5rem; font-size: .95rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: opacity .15s, transform .12s;
}
.rv-btn-primary:hover { opacity: .88; transform: translateY(-1px); }
.rv-btn-primary:active { transform: translateY(0); }

.rv-btn-ghost {
  background: rgba(255,255,255,.06); color: #e2e8f0;
  border: 1px solid rgba(255,255,255,.15); border-radius: 12px;
  padding: .85rem 1.5rem; font-size: .95rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background .15s;
}
.rv-btn-ghost:hover { background: rgba(255,255,255,.1); }

/* ── Lobby ────────────────────────────────────────── */
.rv-lobby {
  display: flex; flex-direction: column;
  padding: 1.2rem 1rem 4rem;
  max-width: 480px; margin: 0 auto; width: 100%; min-height: 100%;
}
.rv-lb-topbar { display: flex; margin-bottom: 1.5rem; }
.rv-lb-hero { text-align: center; margin-bottom: 2rem; }
.rv-lb-icon { font-size: 3rem; line-height: 1; margin-bottom: .4rem; }
.rv-lb-title {
  font-size: 1.8rem; font-weight: 900; color: #e2e8f0;
  margin: 0 0 .3rem; letter-spacing: .05em;
}
.rv-lb-sub { font-size: .9rem; color: #94a3b8; margin: 0; }

.rv-login-wall { text-align: center; padding: 2rem 1rem; }
.rv-lw-icon { font-size: 2.5rem; margin-bottom: .8rem; }
.rv-lw-text { color: #94a3b8; margin-bottom: 1.5rem; }

.rv-lb-form { display: flex; flex-direction: column; gap: 1.2rem; }
.rv-form-label {
  font-size: .72rem; font-weight: 700; color: #0ea5e9;
  text-transform: uppercase; letter-spacing: .08em; margin: 0 0 .4rem;
  display: block;
}

.rv-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.rv-mode-card {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  padding: 1.1rem .8rem;
  background: rgba(255,255,255,.04);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 14px; cursor: pointer; color: inherit;
  transition: background .18s, border-color .18s, transform .15s;
}
.rv-mode-card span { font-size: 1.5rem; }
.rv-mode-card strong { font-size: .9rem; color: #e2e8f0; }
.rv-mode-card small { font-size: .72rem; color: #64748b; }
.rv-mode-card:hover {
  background: rgba(0,212,255,.08); border-color: rgba(0,212,255,.3);
  transform: translateY(-2px);
}
.rv-mode-card.active {
  background: rgba(0,212,255,.12); border-color: rgba(0,212,255,.45);
}
.rv-mode-card.active strong { color: #00d4ff; }

.rv-level-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.rv-lv-btn {
  padding: .4rem .8rem;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; color: #94a3b8;
  font-size: .82rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background .15s, border-color .15s, color .15s;
}
.rv-lv-btn:hover { background: rgba(0,212,255,.08); border-color: rgba(0,212,255,.3); color: #00d4ff; }
.rv-lv-btn.active { background: rgba(0,212,255,.15); border-color: rgba(0,212,255,.5); color: #00d4ff; }

.rv-match-info {
  display: flex; justify-content: center; gap: 1.2rem;
  font-size: .78rem; color: #64748b; flex-wrap: wrap;
}
.rv-find-btn { width: 100%; margin-top: .5rem; font-size: 1rem; padding: 1rem; }

/* ── Waiting ──────────────────────────────────────── */
.rv-waiting {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100%;
  padding: 2rem 1rem; gap: 1rem;
}
.rv-wait-anim {
  position: relative; width: 100px; height: 100px;
  display: flex; align-items: center; justify-content: center;
}
.rv-pulse-ring {
  position: absolute; border-radius: 50%;
  border: 2px solid rgba(0,212,255,.3);
  animation: rv-pulse-out 2s ease-out infinite;
}
.rv-pr-1 { width: 50px; height: 50px; animation-delay: 0s; }
.rv-pr-2 { width: 72px; height: 72px; animation-delay: .4s; }
.rv-pr-3 { width: 94px; height: 94px; animation-delay: .8s; }
@keyframes rv-pulse-out {
  0%   { opacity: .8; transform: scale(.8); }
  100% { opacity: 0; transform: scale(1.2); }
}
.rv-wait-icon {
  font-size: 2rem; position: relative; z-index: 1;
  animation: rv-float 2s ease-in-out infinite;
}
@keyframes rv-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.rv-wait-title { font-size: 1.4rem; font-weight: 700; color: #e2e8f0; margin: 0; }
.rv-wait-mode  { font-size: .85rem; color: #64748b; margin: 0; }
.rv-wait-dots  { display: flex; gap: .4rem; }
.rv-wait-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: #00d4ff; animation: rv-dot 1.2s ease-in-out infinite;
}
.rv-wait-dots span:nth-child(2) { animation-delay: .2s; }
.rv-wait-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes rv-dot {
  0%,80%,100% { opacity: .3; transform: scale(.8); }
  40%         { opacity: 1; transform: scale(1.2); }
}

.rv-wait-timer {
  margin-top: 12px; font-size: 13px; color: rgba(255,255,255,.45);
  font-variant-numeric: tabular-nums;
}

/* ── Waiting for opponent result ─────────────────── */
.rv-waiting-result {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1rem;
  min-height: 100%; padding: 3rem 1.5rem;
}
.rv-wr-icon { font-size: 3rem; animation: rv-spin 3s linear infinite; }
.rv-wr-title { font-size: 1.5rem; font-weight: 800; color: #e2e8f0; margin: 0; }
.rv-wr-sub   { font-size: .9rem; color: #64748b; margin: 0; }
.rv-wr-scores {
  display: flex; align-items: center; gap: 1.5rem;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px; padding: 1.2rem 2rem; margin: .5rem 0;
}
.rv-wr-side { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.rv-wr-av {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800;
}
.rv-wr-name  { font-size: .8rem; color: #94a3b8; }
.rv-wr-score { font-size: 1.8rem; font-weight: 900; color: #e2e8f0; }
.rv-wr-score.rv-wr-you { color: #00d4ff; }
.rv-wr-vs    { font-size: 1rem; font-weight: 800; color: #475569; }

/* ── Countdown ────────────────────────────────────── */
.rv-countdown {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100%; padding: 2rem 1rem; gap: 2rem;
}
.rv-cd-mode { font-size: .78rem; color: #64748b; text-transform: uppercase; letter-spacing: .06em; }
.rv-cd-players { display: flex; align-items: center; gap: 1.5rem; }
.rv-cd-player  { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.rv-cd-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 900;
}
.rv-av-you { background: linear-gradient(135deg, #0ea5e9, #00d4ff); color: #0f172a; }
.rv-av-opp { background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; }
.rv-cd-name {
  font-size: .82rem; color: #e2e8f0; font-weight: 600;
  max-width: 90px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rv-cd-badge { font-size: .62rem; color: #64748b; text-transform: uppercase; letter-spacing: .06em; }
.rv-cd-vsbox  { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.rv-cd-vs     { font-size: .9rem; font-weight: 900; color: #475569; letter-spacing: .1em; }
.rv-cd-num {
  font-size: 3.5rem; font-weight: 900; min-width: 60px; text-align: center;
  background: linear-gradient(135deg, #0ea5e9, #00d4ff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.rv-cd-num.rv-cd-pop { animation: rv-pop .4s ease; }
.rv-cd-num.rv-cd-go  { font-size: 2rem; }
@keyframes rv-pop {
  0%   { transform: scale(1.6); opacity: .5; }
  100% { transform: scale(1);   opacity: 1;  }
}

/* ── Arena ────────────────────────────────────────── */
.rv-arena { display: flex; flex-direction: column; min-height: 100%; }

.rv-scorebar {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .75rem;
  background: rgba(15,23,42,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: sticky; top: 0; z-index: 10;
}
.rv-sb-you, .rv-sb-opp {
  flex: 1; display: flex; flex-direction: column; gap: .05rem;
}
.rv-sb-you { align-items: flex-start; }
.rv-sb-opp { align-items: flex-end; }
.rv-sb-name {
  font-size: .64rem; color: #64748b; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px;
}
.rv-sb-score { font-size: 1.3rem; font-weight: 800; line-height: 1; }
.rv-sb-you .rv-sb-score { color: #00d4ff; }
.rv-sb-opp .rv-sb-score { color: #a855f7; }

.rv-sb-center {
  display: flex; flex-direction: column; align-items: center; gap: .15rem; flex-shrink: 0;
}
.rv-timer-wrap { position: relative; width: 44px; height: 44px; }
.rv-timer-svg  { width: 44px; height: 44px; transform: rotate(-90deg); }
.rv-tr-bg   { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 3; }
.rv-tr-fill {
  fill: none; stroke: #00d4ff; stroke-width: 3; stroke-linecap: round;
  transition: stroke-dashoffset .9s linear, stroke .3s;
}
.rv-tr-fill.rv-t-warn   { stroke: #f59e0b; }
.rv-tr-fill.rv-t-danger { stroke: #ef4444; }
.rv-timer-num {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 12px; font-weight: 700; color: #00d4ff; transition: color .3s;
}
.rv-timer-num.rv-t-warn   { color: #f59e0b; }
.rv-timer-num.rv-t-danger { color: #ef4444; animation: rv-blink .5s ease infinite alternate; }
@keyframes rv-blink { from { opacity: 1; } to { opacity: .35; } }
.rv-qcount { font-size: .62rem; color: #475569; }

.rv-progress-duel {
  height: 4px; background: rgba(255,255,255,.05); display: flex; overflow: hidden;
}
.rv-pd-you {
  height: 4px; background: linear-gradient(90deg, #0ea5e9, #00d4ff);
  transition: width .4s ease;
}
.rv-pd-opp {
  height: 4px; background: linear-gradient(90deg, #7c3aed, #a855f7);
  margin-left: auto; transition: width .4s ease;
}

.rv-question-zone {
  flex: 1; display: flex; flex-direction: column;
  padding: 1rem 1rem 2rem;
  max-width: 540px; margin: 0 auto; width: 100%;
  position: relative;
}

/* ── Question ─────────────────────────────────────── */
.rv-q { display: flex; flex-direction: column; gap: .7rem; }
.rv-q-meta {
  font-size: .7rem; color: #0ea5e9; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
}
.rv-q-prompt {
  font-size: 1.3rem; font-weight: 700; color: #e2e8f0;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px; padding: 1.1rem 1.2rem;
  line-height: 1.4; text-align: center;
}
.rv-q-cue    { font-size: .78rem; color: #64748b; margin: 0; }
.rv-q-choices { display: flex; flex-direction: column; gap: .48rem; }
.rv-choice {
  display: flex; align-items: center; gap: .7rem;
  width: 100%; padding: .78rem 1rem;
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 12px; cursor: pointer;
  text-align: left; color: #e2e8f0;
  font-size: .9rem; line-height: 1.35;
  transition: background .13s, border-color .13s, transform .1s;
}
.rv-choice:not(:disabled):hover {
  background: rgba(0,212,255,.08); border-color: rgba(0,212,255,.3);
  transform: translateX(3px);
}
.rv-choice:disabled { cursor: default; transform: none; }
.rv-ch-letter {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #94a3b8;
}
.rv-ch-text { flex: 1; }
.rv-ch-correct {
  background: rgba(74,222,128,.12) !important;
  border-color: rgba(74,222,128,.5) !important; color: #4ade80 !important;
}
.rv-ch-correct .rv-ch-letter {
  background: #4ade80 !important; border-color: #4ade80 !important; color: #0f172a !important;
}
.rv-ch-wrong {
  background: rgba(248,113,113,.1) !important;
  border-color: rgba(248,113,113,.45) !important;
  color: #f87171 !important; text-decoration: line-through;
}
.rv-ch-wrong .rv-ch-letter {
  background: #f87171 !important; border-color: #f87171 !important; color: #0f172a !important;
}

/* ── Connecting ── */
.rv-connecting {
  display: flex; align-items: center; justify-content: center;
  min-height: 100%; font-size: 1rem; color: #64748b;
}

/* ── Result ───────────────────────────────────────── */
.rv-result {
  display: flex; flex-direction: column; align-items: center;
  padding: 2rem 1.2rem 4rem; gap: 1.5rem;
  max-width: 480px; margin: 0 auto; width: 100%;
}
.rv-res-badge {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  animation: rv-pop .5s ease both;
}
.rv-res-icon { font-size: 3.5rem; line-height: 1; }
.rv-res-lbl  { font-size: 1.6rem; font-weight: 900; letter-spacing: .06em; }
.rv-win .rv-res-lbl  { color: #00d4ff; }
.rv-tie .rv-res-lbl  { color: #f59e0b; }
.rv-lose .rv-res-lbl { color: #94a3b8; }

.rv-res-duel {
  display: flex; align-items: center; gap: 1.2rem;
  width: 100%;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px; padding: 1.2rem 1rem;
}
.rv-rd-side {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: .4rem; position: relative;
}
.rv-rd-av {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 900;
}
.rv-rd-name  { font-size: .8rem; color: #94a3b8; font-weight: 600; text-align: center; }
.rv-rd-score { font-size: 1.8rem; font-weight: 800; color: #e2e8f0; line-height: 1; }
.rv-rd-score small { font-size: .62rem; color: #475569; font-weight: 400; }
.rv-rd-winner .rv-rd-score { color: #00d4ff; }
.rv-rd-crown { font-size: 1.2rem; }
.rv-rd-vs { font-size: .9rem; font-weight: 900; color: #334155; flex-shrink: 0; }

.rv-xp-pill {
  padding: .5rem 1.5rem; border-radius: 99px;
  font-size: .95rem; font-weight: 800;
}
.rv-win  .rv-xp-pill { background: rgba(0,212,255,.15);  color: #00d4ff; }
.rv-tie  .rv-xp-pill { background: rgba(245,158,11,.15); color: #f59e0b; }
.rv-lose .rv-xp-pill { background: rgba(255,255,255,.07); color: #94a3b8; }

.rv-res-btns { display: flex; gap: .8rem; width: 100%; }
.rv-res-btns .rv-btn-primary,
.rv-res-btns .rv-btn-ghost { flex: 1; }

/* ── Cinema Arena (fullscreen) ────────────────────── */
.rv-cinema-arena {
  position: fixed; inset: 0; z-index: 500;
  background: #000; overflow: hidden;
}
.rv-cv {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain; background: #000;
}
.rv-cv-overlay {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.55) 0%,
    transparent 20%,
    transparent 55%,
    rgba(0,0,0,.65) 78%,
    rgba(0,0,0,.88) 100%
  );
}

/* HUD wrapper (scorebar + progress bar) */
.rv-fs-hud { position: absolute; top: 0; left: 0; right: 0; z-index: 20; }
.rv-scorebar-fs {
  background: rgba(0,0,0,.45) !important;
  backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid rgba(255,255,255,.07) !important;
  position: static !important;
}
.rv-clip-ctr {
  font-size: .78rem; font-weight: 800; color: #00d4ff; letter-spacing: .04em;
}
.rv-speed-tag {
  font-size: .58rem; color: #f59e0b; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
}

/* Clip info overlay */
.rv-clip-info {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
}
.rv-clip-info.rv-ci-in { opacity: 1; pointer-events: auto; }

.rv-ci-badge {
  display: inline-block;
  padding: .38rem 1rem;
  background: rgba(0,212,255,.16);
  border: 1px solid rgba(0,212,255,.4);
  border-radius: 99px;
  font-size: .78rem; font-weight: 800; color: #00d4ff;
  letter-spacing: .05em; margin-bottom: .55rem;
}
.rv-ci-film {
  font-size: 1rem; font-weight: 700; color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.9); margin-bottom: .35rem;
}
.rv-ci-cue {
  font-size: .72rem; color: rgba(255,255,255,.45);
  text-shadow: 0 1px 6px rgba(0,0,0,.9);
}

/* Question panel – slides up from bottom */
.rv-cq-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  max-height: 72%;
  background: rgba(8,14,28,.93);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-top: 1px solid rgba(255,255,255,.09);
  border-radius: 22px 22px 0 0;
  padding: 1.1rem 1.1rem 2rem;
  z-index: 15;
  transform: translateY(100%);
  transition: transform .38s cubic-bezier(.16,1,.3,1);
  overflow-y: auto;
}
.rv-cq-panel.rv-cqp-in { transform: translateY(0); }

.rv-cq-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .75rem;
}
.rv-cq-clip-lbl {
  font-size: .64rem; font-weight: 800; color: #00d4ff;
  text-transform: uppercase; letter-spacing: .08em;
}
.rv-cq-q-lbl { font-size: .64rem; color: #475569; font-weight: 600; }

/* Speed timer bar */
.rv-cq-speed-wrap {
  display: flex; align-items: center; gap: .55rem; margin-bottom: .85rem;
}
.rv-cq-speed-bar {
  flex: 1; height: 7px;
  background: rgba(255,255,255,.07); border-radius: 99px; overflow: hidden;
}
.rv-cq-speed-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #00d4ff, #0ea5e9);
  transition: width .85s linear, background .25s;
}
.rv-cq-speed-fill.rv-t-warn   { background: linear-gradient(90deg, #f59e0b, #d97706); }
.rv-cq-speed-fill.rv-t-danger { background: linear-gradient(90deg, #ef4444, #dc2626); }
.rv-cq-speed-num {
  font-size: .85rem; font-weight: 800; color: #00d4ff;
  min-width: 16px; text-align: right; transition: color .25s;
}
.rv-cq-speed-num.rv-t-warn   { color: #f59e0b; }
.rv-cq-speed-num.rv-t-danger { color: #ef4444; animation: rv-blink .45s ease infinite alternate; }

.rv-cq-phrase {
  font-size: 1.05rem; font-weight: 700; color: #e2e8f0;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; padding: .85rem 1rem;
  margin-bottom: .55rem; line-height: 1.45; text-align: center;
}
.rv-cq-cue { font-size: .72rem; color: #64748b; margin: 0 0 .55rem; text-align: center; }

/* Speed bonus popup */
.rv-speed-bonus {
  position: absolute; top: 42%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem; font-weight: 900; color: #f59e0b;
  text-shadow: 0 2px 10px rgba(245,158,11,.5);
  animation: rv-bonus-pop 1s ease forwards;
  pointer-events: none; z-index: 30;
}
.rv-speed-bonus.rv-sb-great   { color: #00d4ff; text-shadow: 0 2px 12px rgba(0,212,255,.6); font-size: 1.9rem; }
.rv-speed-bonus.rv-sb-good    { color: #4ade80; text-shadow: 0 2px 12px rgba(74,222,128,.5); }
.rv-speed-bonus.rv-sb-penalty { color: #f87171; text-shadow: 0 2px 12px rgba(248,113,113,.5); font-size: 1.6rem; }
@keyframes rv-bonus-pop {
  0%   { opacity: 0; transform: translate(-50%,-20%) scale(.5); }
  25%  { opacity: 1; transform: translate(-50%,-65%) scale(1.2); }
  65%  { opacity: 1; transform: translate(-50%,-85%) scale(1);   }
  100% { opacity: 0; transform: translate(-50%,-105%) scale(.85); }
}

/* Video loading overlay */
.rv-cv-loader {
  position: absolute; inset: 0; z-index: 18;
  display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: .9rem;
  background: rgba(0,0,0,.82); backdrop-filter: blur(6px);
}
.rv-cv-loader.rv-cvl-show { display: flex; }

.rv-cvl-spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(0,212,255,.2);
  border-top-color: #00d4ff;
  animation: rv-spin .75s linear infinite;
}
@keyframes rv-spin { to { transform: rotate(360deg); } }

.rv-cvl-label {
  font-size: .82rem; font-weight: 700; color: rgba(255,255,255,.75);
  letter-spacing: .03em;
}
.rv-cvl-bar-wrap {
  width: 160px; height: 4px;
  background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden;
}
.rv-cvl-bar {
  height: 100%; background: linear-gradient(90deg,#0ea5e9,#00d4ff);
  border-radius: 99px; transition: width .25s ease;
}

/* Mid-playback buffering ring */
.rv-cv-buf {
  position: absolute; inset: 0; z-index: 17;
  display: none; align-items: center; justify-content: center;
  pointer-events: none;
}
.rv-cv-buf.rv-cvb-show { display: flex; }
.rv-cvb-ring {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: rgba(255,255,255,.75);
  animation: rv-spin .65s linear infinite;
}

/* Autoplay fallback button */
.rv-vid-play-btn {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%); z-index: 25;
  background: rgba(0,212,255,.18); border: 2px solid #00d4ff;
  color: #00d4ff; font-size: 1rem; font-weight: 700;
  padding: .9rem 2rem; border-radius: 99px;
  cursor: pointer; font-family: inherit;
  backdrop-filter: blur(8px); transition: background .15s;
}
.rv-vid-play-btn:hover { background: rgba(0,212,255,.32); }

/* Countdown cinema hint */
.rv-cd-hint {
  font-size: .74rem; color: #64748b;
  text-align: center; max-width: 300px; line-height: 1.55;
  padding: .6rem 1rem; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
}

/* ── Synesthesia mode ─────────────────────────────── */
.rv-syn-prompt {
  font-size: 1.8rem; font-weight: 800; letter-spacing: .04em;
  text-align: center; word-break: break-word;
  text-shadow: 0 0 20px rgba(255,255,255,.12);
  margin-bottom: .3rem;
}

/* ── Phantom flash ────────────────────────────────── */
.rv-phantom-flash {
  font-size: 2.6rem; font-weight: 900; letter-spacing: .06em;
  text-align: center; color: #fff;
  text-shadow: 0 0 40px #00d4ff, 0 0 12px #00d4ff88;
  padding: .6rem 0 .2rem;
  transition: opacity .4s ease, transform .4s ease;
}
.rv-phantom-flash.rv-ph-fade { opacity: 0; transform: scale(.9); }
.rv-ph-sub {
  font-size: .85rem; color: #64748b; text-align: center;
  margin-bottom: .5rem;
  transition: opacity .4s ease;
}
.rv-ph-sub.rv-ph-fade { opacity: 0; }
.rv-ph-bar-wrap {
  width: 100%; height: 3px; background: rgba(255,255,255,.08);
  border-radius: 4px; overflow: hidden; margin-bottom: 1.2rem;
}
.rv-ph-bar {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #4d96ff, #00d4ff);
  border-radius: 4px;
}
.rv-ph-hide { opacity: 0; pointer-events: none; }
.rv-letters-wrap:not(.rv-ph-hide) { opacity: 1; pointer-events: auto; }

/* ── Typing arena ─────────────────────────────────── */
.rv-q-typing { text-align: center; }
.rv-letters-wrap { margin: 1rem 0 .5rem; transition: opacity .3s; }
.rv-ls-row {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 5px; padding: .4rem 0;
}
.rv-ls {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 44px; border-radius: 8px;
  font-size: 1.1rem; font-weight: 800; color: #fff;
  border: 2px solid var(--lc, #4d96ff);
  background: transparent;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.rv-ls.rv-ls-empty { color: transparent; }
.rv-ls.rv-ls-cursor {
  border-color: var(--lc, #4d96ff);
  box-shadow: 0 0 10px var(--lc, #4d96ff);
  animation: rv-cursor-blink .7s step-end infinite;
}
@keyframes rv-cursor-blink {
  50% { box-shadow: none; border-color: rgba(255,255,255,.25); }
}
.rv-ls.rv-ls-done {
  background: var(--lc, #4d96ff);
  border-color: var(--lc, #4d96ff);
  color: #0f172a; font-weight: 900;
  box-shadow: 0 0 12px var(--lc, #4d96ff66);
  transform: scale(1.08);
}
.rv-ls.rv-ls-error {
  background: rgba(239,68,68,.25);
  border-color: #ef4444;
  animation: rv-shake .25s ease;
}
@keyframes rv-shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.rv-ls.rv-ls-space { width: 18px; border: none; background: transparent; }

/* Listen button */
.rv-listen-btn {
  background: rgba(255,255,255,.07); color: #94a3b8;
  border: 1px solid rgba(255,255,255,.12); border-radius: 20px;
  padding: .3rem .9rem; font-size: .78rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s;
  margin: .4rem 0 .2rem;
}
.rv-listen-btn:hover { background: rgba(255,255,255,.13); color: #e2e8f0; }

/* Typing status */
.rv-type-status {
  min-height: 1.4rem; font-size: .85rem; font-weight: 700;
  text-align: center; margin-top: .3rem; letter-spacing: .05em;
}
.rv-type-status.rv-ts-ok { color: #4ade80; }
.rv-type-status.rv-ts-wrong { color: #f87171; }

/* ── Virtual keyboard ─────────────────────────────── */
.rv-vkb {
  display: none; flex-direction: column; align-items: center;
  gap: 5px; padding: .5rem .5rem .8rem;
  background: rgba(255,255,255,.03);
  border-top: 1px solid rgba(255,255,255,.07);
}
.rv-vkb-row { display: flex; gap: 4px; }
.rv-vkb-key {
  width: 32px; height: 40px; border-radius: 7px;
  background: rgba(255,255,255,.09); color: #e2e8f0;
  border: 1px solid rgba(255,255,255,.12);
  font-size: .8rem; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: background .1s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.rv-vkb-key:active { background: rgba(0,212,255,.25); transform: scale(.92); }
.rv-vkb-bs { width: 50px; color: #94a3b8; }
