/* Shoomble Roulette — selectors prefixed .rv2-* */

/* ---------- Intro screen ---------- */
.rv2-intro {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}
.rv2-intro-hero {
  text-align: center;
  padding: 1.5rem 0 1.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
}
.rv2-intro-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--fg-mute);
  margin-bottom: .65rem;
}
.rv2-intro-icon svg { width: 22px; height: 22px; }
.rv2-intro-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
  margin: 0 0 .6rem;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  justify-content: center;
}
.rv2-beta-badge {
  display: inline-block;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .15em;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: rgba(251, 191, 36, .15);
  color: var(--gold);
  border: 1px solid rgba(251, 191, 36, .45);
  text-transform: uppercase;
  box-shadow: 0 0 12px -3px rgba(251, 191, 36, .35);
}
.rv2-intro-sub {
  font-size: 1rem;
  color: var(--fg-mute);
  line-height: 1.55;
  margin: 0 auto;
  max-width: 540px;
}
.rv2-intro-sub strong { color: var(--fg); }
.rv2-intro-note {
  font-size: .8rem;
  color: var(--fg-faint);
  margin: .85rem auto 0;
  max-width: 480px;
  font-style: italic;
  line-height: 1.5;
}
.rv2-intro-note a { color: var(--fg-mute); text-decoration: underline; }
.rv2-intro-note a:hover { color: var(--fg); }

/* ---------- Filters ---------- */
.rv2-filters {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.rv2-filter-group {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin: 0;
}
.rv2-filter-group legend {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-mute);
  padding: 0 .25rem;
}
.rv2-filter-hint {
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg-faint);
  font-size: .72rem;
  margin-left: .25rem;
}
.rv2-filter-note {
  font-size: .8rem;
  color: var(--fg-faint);
  margin: .65rem 0 0;
  font-style: italic;
}
.rv2-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
}
.rv2-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: .88rem;
  color: var(--fg-mute);
  cursor: pointer;
  user-select: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.rv2-pill input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.rv2-pill:hover { color: var(--fg); border-color: var(--border-strong); }
.rv2-pill:has(input:checked) {
  background: rgba(251, 191, 36, .1);
  border-color: rgba(251, 191, 36, .3);
  color: var(--gold);
  box-shadow: 0 0 10px -3px rgba(251, 191, 36, .25);
}

/* ---------- Start row ---------- */
.rv2-start-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  margin: 2rem 0 1.5rem;
  text-align: center;
}
.rv2-pool-count {
  margin: 0;
  font-size: .95rem;
  color: var(--fg-mute);
}
.rv2-pool-count strong { color: var(--gold); font-weight: 800; }

.rv2-start-btn {
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  color: #1a1207;
  border: 0;
  padding: 1.05rem 2.5rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .01em;
  border-radius: 999px;
  min-width: 240px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  cursor: pointer;
  box-shadow:
    0 6px 18px -4px rgba(251, 191, 36, .45),
    inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .18s ease, box-shadow .25s ease, filter .25s ease;
  animation: rv2-cta-pulse 2.8s ease-in-out infinite;
}
.rv2-start-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 12px 28px -6px rgba(251, 191, 36, .7),
    inset 0 1px 0 rgba(255, 255, 255, .45);
  filter: brightness(1.05);
  animation: none;
}
.rv2-start-btn:active:not(:disabled) { transform: translateY(0); }
.rv2-start-btn:disabled {
  background: var(--bg-elev);
  color: var(--fg-faint);
  box-shadow: none;
  animation: none;
  cursor: not-allowed;
  filter: none;
}
.rv2-start-btn svg { width: 18px; height: 18px; }
@keyframes rv2-cta-pulse {
  0%, 100% { box-shadow: 0 6px 18px -4px rgba(251, 191, 36, .4),  inset 0 1px 0 rgba(255, 255, 255, .35); }
  50%      { box-shadow: 0 6px 28px -4px rgba(251, 191, 36, .7),  inset 0 1px 0 rgba(255, 255, 255, .35); }
}
@media (prefers-reduced-motion: reduce) { .rv2-start-btn { animation: none; } }

/* ---------- Help accordion ---------- */
.rv2-help {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .85rem 1.1rem;
}
.rv2-help summary {
  cursor: pointer;
  font-weight: 700;
  font-size: .92rem;
  color: var(--fg);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rv2-help summary::-webkit-details-marker { display: none; }
.rv2-help summary::after { content: '+'; font-size: 1.3rem; color: var(--fg-mute); }
.rv2-help[open] summary::after { content: '−'; }
.rv2-help ul {
  margin: .85rem 0 0;
  padding-left: 1.1rem;
  color: var(--fg-mute);
  font-size: .9rem;
  line-height: 1.6;
}
.rv2-help li { margin: .35rem 0; }
.rv2-help strong { color: var(--fg); }

/* ---------- Play overlay ---------- */
/* Body scroll lock — mobile uses position:fixed to prevent iOS Safari bounce */
body.rv2-playing {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

.rv2-play-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  /* Fallback first, dvh override second (modern browsers respect URL bar) */
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  background: #07090f;
  color: var(--fg);
  overscroll-behavior: contain;
  animation: rv2-overlay-in .26s cubic-bezier(.2, .9, .32, 1);
}
@keyframes rv2-overlay-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
.rv2-play-overlay[hidden] { display: none; }

.rv2-play-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: max(.6rem, env(safe-area-inset-top)) .85rem .6rem;
  flex-shrink: 0;
}
.rv2-exit,
.rv2-filters-btn {
  appearance: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .06);
  color: var(--fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .12s ease;
}
.rv2-exit:hover,
.rv2-filters-btn:hover {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .25);
}
.rv2-exit:active,
.rv2-filters-btn:active { transform: scale(.92); }
.rv2-filters-btn:hover { color: var(--gold); border-color: rgba(251, 191, 36, .5); }
.rv2-exit svg { width: 20px; height: 20px; }
.rv2-filters-btn svg { width: 18px; height: 18px; }

.rv2-play-header-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  justify-content: center;
  font-size: .82rem;
  color: var(--fg-mute);
}
.rv2-counter {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  padding: .3rem .75rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.rv2-bias {
  background: rgba(251, 191, 36, .12);
  border: 1px solid rgba(251, 191, 36, .35);
  color: var(--gold);
  border-radius: 999px;
  padding: .25rem .6rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.rv2-play-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .3rem .85rem;
  min-height: 0;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.rv2-card-slot {
  width: 100%;
  max-width: 480px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Card ---------- */
.rv2-card {
  width: 100%;
  height: 100%;
  background: var(--bg-elev);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .8);
  animation: rv2-card-in .28s cubic-bezier(.22, .9, .32, 1.18);
  will-change: transform, opacity;
}
@keyframes rv2-card-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.rv2-card.is-leaving-left  { animation: rv2-out-left  .28s ease forwards; }
.rv2-card.is-leaving-right { animation: rv2-out-right .28s ease forwards; }
.rv2-card.is-leaving-up    { animation: rv2-out-up    .28s ease forwards; }
@keyframes rv2-out-left  { to { opacity: 0; transform: translateX(-60%) rotate(-8deg); } }
@keyframes rv2-out-right { to { opacity: 0; transform: translateX(60%) rotate(8deg);  } }
@keyframes rv2-out-up    { to { opacity: 0; transform: translateY(-40%) scale(1.04); } }

.rv2-card-img {
  width: 100%;
  flex: 1;
  background: var(--bg-soft);
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.rv2-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rv2-card-badges {
  position: absolute;
  top: .65rem;
  left: .65rem;
  right: .65rem;
  display: flex;
  justify-content: space-between;
  gap: .35rem;
  pointer-events: none;
}
.rv2-card-badge {
  display: inline-flex;
  align-items: center;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: rgba(10, 12, 20, .75);
  color: var(--fg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .08);
}
.rv2-card-badge-nsfw { color: #ff4f81; border-color: rgba(255, 79, 129, .45); }

.rv2-card-body {
  padding: .85rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  flex-shrink: 0;
}
.rv2-card-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.015em;
  margin: 0;
  color: var(--fg);
}
.rv2-card-tagline {
  margin: 0;
  font-size: .9rem;
  line-height: 1.45;
  color: var(--fg-mute);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rv2-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.rv2-card-tag {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--fg-mute);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.rv2-stage-message {
  text-align: center;
  color: var(--fg-mute);
  padding: 2rem 1rem;
  max-width: 380px;
}
.rv2-stage-message h3 { color: var(--fg); margin: 0 0 .6rem; font-size: 1.15rem; }
.rv2-stage-message p  { margin: 0; line-height: 1.55; font-size: .92rem; }

/* ---------- Action bar ---------- */
.rv2-play-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1rem .85rem max(1rem, env(safe-area-inset-bottom));
  flex-shrink: 0;
}
.rv2-action {
  appearance: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.rv2-action svg { width: 26px; height: 26px; display: block; }
.rv2-action:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .25);
}
.rv2-action:active:not(:disabled) { transform: scale(.92); }
.rv2-action:disabled { opacity: .35; cursor: not-allowed; }

.rv2-action-like {
  background: var(--bg-elev);
  border-color: var(--border-strong);
  color: #ff4f81;
  width: 76px;
  height: 76px;
}
.rv2-action-like svg { width: 32px; height: 32px; }
.rv2-action-like:hover:not(:disabled) { border-color: #ff4f81; }
.rv2-action-chat:hover { color: var(--gold); border-color: rgba(251, 191, 36, .5); }

/* ---------- End overlay ---------- */
.rv2-end-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 9, 15, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 1rem;
  animation: rv2-overlay-in .25s ease;
}
.rv2-end-overlay[hidden] { display: none; }
.rv2-end-content {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  max-width: 560px;
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 1.5rem 1.5rem 1.75rem;
  position: relative;
}
.rv2-end-exit {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 36px;
  height: 36px;
}
.rv2-end-exit svg { width: 18px; height: 18px; }
.rv2-end-hero { text-align: center; margin-bottom: 1.5rem; }
.rv2-end-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 .55rem;
  color: var(--fg);
}
.rv2-end-sub {
  font-size: .9rem;
  color: var(--fg-mute);
  margin: 0;
  line-height: 1.5;
}
.rv2-end-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .85rem;
  margin: 0 0 1.5rem;
}
.rv2-end-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.rv2-end-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.rv2-end-card-img { aspect-ratio: 3 / 4; background: var(--bg); overflow: hidden; }
.rv2-end-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv2-end-card-body { padding: .55rem .65rem .7rem; }
.rv2-end-card-name {
  font-size: .88rem;
  font-weight: 800;
  color: var(--fg);
  margin: 0 0 .15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rv2-end-card-platform { font-size: .7rem; color: var(--fg-faint); margin: 0; }
.rv2-end-actions {
  display: flex;
  gap: .65rem;
  justify-content: center;
  flex-wrap: wrap;
}
.rv2-end-btn {
  appearance: none;
  border: 0;
  padding: .8rem 1.4rem;
  font-weight: 800;
  font-size: .95rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s ease, filter .15s ease;
}
.rv2-end-btn-primary {
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  color: #1a1207;
}
.rv2-end-btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.rv2-end-btn-ghost {
  background: transparent;
  color: var(--fg-mute);
  border: 1px solid var(--border-strong);
}
.rv2-end-btn-ghost:hover { color: var(--fg); border-color: var(--fg-mute); }

/* ---------- Age confirm dialog ---------- */
.rv2-age-confirm {
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 0;
  background: var(--bg-elev);
  color: var(--fg);
  max-width: 460px;
  width: calc(100% - 2rem);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .6);
}
.rv2-age-confirm::backdrop {
  background: rgba(8, 10, 18, .72);
  backdrop-filter: blur(4px);
}
.rv2-age-confirm-content { padding: 1.5rem 1.6rem 1.35rem; }
.rv2-age-confirm h2 {
  margin: 0 0 .85rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--fg);
}
.rv2-age-confirm p {
  margin: 0 0 .65rem;
  font-size: .92rem;
  line-height: 1.55;
  color: var(--fg-mute);
}
.rv2-age-confirm-meta {
  font-size: .82rem !important;
  color: var(--fg-faint) !important;
}
.rv2-age-confirm-meta a { color: var(--fg-mute); text-decoration: underline; }
.rv2-age-confirm-meta a:hover { color: var(--fg); }
.rv2-age-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.rv2-age-btn {
  appearance: none;
  cursor: pointer;
  font-weight: 700;
  border-radius: 999px;
  padding: .6rem 1.2rem;
  font-size: .9rem;
  transition: transform .12s ease, filter .15s ease, border-color .15s ease, color .15s ease;
}
.rv2-age-btn-primary {
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  color: #1a1207;
  border: 0;
  box-shadow: 0 4px 14px -4px rgba(251, 191, 36, .45);
}
.rv2-age-btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.rv2-age-btn-ghost {
  background: transparent;
  color: var(--fg-mute);
  border: 1px solid var(--border-strong);
}
.rv2-age-btn-ghost:hover { color: var(--fg); border-color: var(--fg-mute); }
@media (max-width: 460px) {
  .rv2-age-confirm-actions { justify-content: stretch; }
  .rv2-age-confirm-actions .rv2-age-btn { flex: 1; }
}

/* ---------- Desktop: overlay docked into content area ---------- */
@media (min-width: 641px) {
  body.rv2-playing {
    overflow: hidden;
    position: static;
    width: auto;
    height: auto;
  }
  .rv2-play-overlay {
    top: var(--topbar-h, 64px);
    left: var(--sidebar-w, 240px);
    right: 0;
    bottom: 0;
    height: auto;
    background: var(--bg);
    z-index: 10;
    animation: rv2-overlay-fade .18s ease;
  }
  html.sidebar-collapsed body .rv2-play-overlay,
  .layout.sidebar-collapsed ~ .rv2-play-overlay {
    left: var(--sidebar-w-collapsed, 64px);
  }
  @keyframes rv2-overlay-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  body.rv2-playing .rv2-intro { display: none; }
  .rv2-card-slot { max-width: 420px; }
  .rv2-action { width: 60px; height: 60px; }
  .rv2-action-like { width: 70px; height: 70px; }
}

/* Small phones */
@media (max-width: 380px) {
  .rv2-play-actions { gap: 1rem; padding-left: .65rem; padding-right: .65rem; }
  .rv2-action { width: 58px; height: 58px; }
  .rv2-action-like { width: 68px; height: 68px; }
  .rv2-card-body { padding: .7rem .95rem .95rem; }
  .rv2-card-name { font-size: 1.1rem; }
}
