/* Loading, rolling and result surfaces share one accessible dialog. */
.discovery-roulette {
    --roulette-line: rgba(255,255,255,.1); --roulette-muted: #a9adb7;
    width: min(840px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
    margin: auto; padding: 0; overflow: auto; overscroll-behavior: contain;
    border: 1px solid #2b2d33; border-radius: 24px; background: #0b0c0f;
    color: #f4f5f8; box-shadow: 0 24px 100px #0009;
}
.discovery-roulette::backdrop { background: #030509dc; backdrop-filter: blur(8px); }
.roulette-heading { display: flex; align-items: center; gap: 16px; padding: 24px; border-bottom: 1px solid var(--roulette-line); }
.roulette-heading-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border: 1px solid #3a3c43; border-radius: 14px; background: #ffffff08; }
.roulette-heading-copy { flex: 1; min-width: 0; }
.roulette-heading-copy h2 { margin: 0; font-size: 22px; line-height: 1.3; letter-spacing: -.035em; }
.roulette-heading-tag { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 3px 9px; border: 1px solid #ffffff12; border-radius: 999px; background: #ffffff08; color: #c2c5cc; font-size: 10px; font-weight: 600; letter-spacing: 0; }
.roulette-filter-button { min-height: 38px; padding: 8px 14px; border: 1px solid var(--roulette-line); border-radius: 999px; background: transparent; color: #c5c9d2; font: inherit; font-size: 12px; cursor: pointer; }
.roulette-heading-copy p { margin: 4px 0 0; color: var(--roulette-muted); font-size: 14px; line-height: 1.5; }
.roulette-close { flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #ffffff08; color: #babdc6; font-size: 27px; cursor: pointer; }
.roulette-close:hover { background: #ffffff12; color: #fff; }
.roulette-body { padding: 28px; }
.roulette-motion { display: flex; align-items: center; gap: 24px; }
.roulette-motion-copy { min-width: 0; }
.roulette-motion-copy strong { display: block; font-size: 16px; line-height: 1.5; }
.roulette-motion-copy span { display: block; margin-top: 5px; color: var(--roulette-muted); font-size: 13px; line-height: 1.5; }
.roulette-spinner { display: none; width: 20px; height: 20px; border: 2px solid #333943; border-top-color: #a9d7ff; border-radius: 50%; animation: roulette-loading 1s linear infinite; }
.discovery-roulette[data-state=loading] .roulette-motion,
.discovery-roulette[data-state=error] .roulette-motion { min-height: 260px; justify-content: center; flex-direction: column; gap: 20px; text-align: center; }
.discovery-roulette[data-state=loading] .roulette-spinner { display: block; }
.discovery-roulette[data-has-preview=true] .roulette-motion { display: none; }
.discovery-roulette[data-state=selected] .roulette-motion { display: none; }
.roulette-card { position: relative; display: grid; grid-template-columns: minmax(0, 200px) minmax(0,1fr); align-items: center; gap: 26px; padding: 24px; border: 1px solid var(--roulette-line); border-radius: 20px; background: #0d0e12; overflow: hidden; isolation: isolate; }
.roulette-card-backdrop { position: absolute; inset: -20px -20px auto; width: calc(100% + 40px); height: 75%; object-fit: cover; opacity: .16; filter: blur(26px); z-index: -2; pointer-events: none; }
.roulette-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #0a0b0e10, #0a0b0efa 80%); z-index: -1; pointer-events: none; }
.roulette-card-backdrop:not([src]) { display: none; }
.roulette-stage { position: relative; min-width: 0; z-index: 1; }
.roulette-poster { overflow: hidden; aspect-ratio: 2/3; border-radius: 12px; background: #1b1f26; }
.roulette-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.roulette-score { position: absolute; bottom: 10px; left: 10px; padding: 5px 9px; border-radius: 8px; background: #090a0de6; color: #ffd267; font-size: 13px; font-weight: 700; }
.roulette-details { min-width: 0; position: relative; z-index: 1; }
.roulette-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.roulette-meta span { padding: 4px 10px; border: 1px solid #ffffff0b; border-radius: 999px; background: #ffffff0a; color: #c7cbd4; font-size: 12px; line-height: 1.3; font-weight: 600; }
.roulette-details h3 { margin: 12px 0 0; font-size: clamp(21px, 2.5vw, 28px); line-height: 1.2; letter-spacing: -.035em; overflow-wrap: anywhere; }
.roulette-native { margin: 8px 0 0; color: var(--roulette-muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.roulette-genres { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.roulette-genres:empty { display: none; }
.roulette-genres span { padding: 4px 9px; border: 1px solid #343740; border-radius: 6px; color: #c5c9d2; font-size: 12px; line-height: 1.4; }
.roulette-description { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin: 18px 0 0; color: var(--roulette-muted); font-size: 14px; line-height: 1.7; }
.roulette-status { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.discovery-roulette[data-state=error] .roulette-status { position: static; width: auto; height: auto; margin: 0; padding: 0 16px 8px; clip-path: none; white-space: normal; text-align: center; color: #e8b7c0; font-size: 14px; line-height: 1.6; }
.roulette-notice { margin: 16px 0 0; font-size: 12px; line-height: 1.6; color: var(--roulette-muted); }
.roulette-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 28px; border-top: 1px solid var(--roulette-line); }
.roulette-result-actions { display: flex; gap: 10px; }
.roulette-result-actions a[aria-disabled=true] { opacity: .45; pointer-events: none; cursor: default; }
.discovery-roulette:is([data-state=rolling], [data-state=loading]) :is(.roulette-heading-icon, .roulette-again) svg { animation: roulette-icon-spin .65s linear infinite; }
.roulette-again, .roulette-details-link, .roulette-watch-link { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 10px 18px; border: 1px solid #373b44; border-radius: 14px; background: #ffffff06; color: #edf0f6; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.roulette-again:hover:not(:disabled) { background: #ffffff10; }
.roulette-watch-link { border-color: #f5f7fa; background: #f5f7fa; color: #11151b; }
.roulette-watch-link:hover { background: #dcecff; }
.roulette-again:disabled { cursor: wait; opacity: .55; }
.discovery-roulette [hidden] { display: none !important; }
.discovery-roulette :is(a,button):focus-visible { outline: 2px solid #83c3ff; outline-offset: 3px; }
.discovery-roulette[data-state=selected] .roulette-card { animation: roulette-result .38s ease-out both; }
@keyframes roulette-loading { to { transform: rotate(360deg); } }
@keyframes roulette-icon-spin { to { transform: rotate(360deg); } }
@keyframes roulette-result { from { opacity: .6; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
    .roulette-heading { gap: 12px; padding: 18px; }
    .roulette-heading-icon { width: 38px; height: 38px; border-radius: 12px; }
    .roulette-heading-copy h2 { font-size: 18px; }
    .roulette-heading-tag { display: none; }
    .roulette-filter-button { padding-inline: 10px; min-height: 36px; }
    .roulette-heading-copy p { font-size: 12px; }
    .roulette-close { width: 36px; height: 40px; }
    .roulette-body { padding: 16px; }
    .roulette-card { grid-template-columns: minmax(0,1fr); gap: 20px; padding: 20px; }
    .roulette-stage { width: min(160px, 65%); margin: auto; }
    .roulette-details h3 { font-size: 22px; }
    .roulette-description { font-size: 13px; margin-top: 14px; }
    .roulette-genres { margin-top: 14px; }
    .roulette-actions { padding: 16px; gap: 8px; }
    .roulette-result-actions { gap: 6px; }
    .roulette-again, .roulette-details-link, .roulette-watch-link { padding-inline: 12px; font-size: 13px; }
    .roulette-motion { gap: 12px; }
    .roulette-motion-copy strong { font-size: 14px; }
    .roulette-motion-copy span { font-size: 12px; }
    .discovery-roulette[data-state=loading] .roulette-motion { min-height: 270px; }
}
@media (max-width: 380px) { .roulette-actions { flex-wrap: wrap; } .roulette-result-actions { width: 100%; } .roulette-result-actions a { flex: 1; } .roulette-heading-icon { display: none; } }
@media (prefers-reduced-motion: reduce) {
    .discovery-roulette .roulette-card, .discovery-roulette .roulette-spinner, .discovery-roulette .roulette-heading-icon svg, .discovery-roulette .roulette-again svg { animation: none !important; }
}
