.cw-roll-stage, .cw-roll-controls {
  --roll-cyan: #97faff;
  --roll-purple: #bd76ff;
  --roll-text: #d2d8f5;
  --roll-edge: #5955a0;
  --roll-panel: #151d3e;
  --roll-deep: #0b1028;
}
.cw-roll-stage {
  display: grid;
  position: relative;
  isolation: isolate;
  grid-template: "story deck" auto "categories categories" auto / minmax(0, .9fr) minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--roll-edge);
  border-radius: 19px;
  background: radial-gradient(ellipse at 74% 40%, #3c2a7769, transparent 64%),
    linear-gradient(125deg, #0a152a 5%, #151b3d 44%, #2b1647 81%, #162043);
  box-shadow: inset 0 1px #ffffff16, 0 20px 50px #03041042;
  margin-top: 13px;
}
.cw-roll-story { grid-area: story; z-index: 2; min-width: 0; padding: 23px 0 20px clamp(16px, 2.5vw, 40px); }
.cw-roll-stage .cw-boardbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 11px;
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--roll-edge);
  border-radius: 8px;
  background: #0d1530;
}
.cw-roll-stage .cw-boardbar h2 { color: var(--roll-cyan); font: 600 15px/1.1 Chakra, var(--font); white-space: nowrap; }
.cw-roll-stage #price-updates { display: inline-flex; gap: 6px; max-width: none; color: var(--roll-text); font: 400 10px/1.45 var(--mono); white-space: nowrap; }
.cw-roll-stage .cw-source-summary { color: var(--roll-text); font: 400 10px/1.4 var(--mono); align-items: center; gap: 5px; margin: 0; padding-left: 8px; border-left: 1px solid var(--roll-edge); }
.cw-roll-stage .cw-source-summary time { color: #eef0ff; font: inherit; max-width: none; white-space: nowrap; }
.cw-roll-stage .cw-boardbar::before, .cw-roll-stage .cw-boardbar::after { content: none; }
.cw-roll-stage[data-roll-visible] .cw-boardbar:where(:has(> .cw-updates.is-active))::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 0;
  height: 2px;
  opacity: 0;
  background: linear-gradient(90deg, transparent 24%, #74e4ffa0 45%, #d0fbff 52%, transparent 78%);
  animation: cw-roll-signal 3.8s linear infinite;
  pointer-events: none;
}
.cw-roll-stage[data-roll-effect]:not([data-roll-effect="games"], [data-roll-effect="rotation"]) .cw-boardbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  width: auto;
  height: 2px;
  background: linear-gradient(90deg, transparent 16%, var(--roll-purple) 34%, var(--roll-cyan) 57%, transparent 87%);
  box-shadow: 0 0 14px var(--roll-purple);
  animation: cw-roll-signal 1.1s ease-out both;
  pointer-events: none;
}
.cw-roll-meter { display: inline-flex; align-items: end; gap: 2px; height: 13px; color: var(--roll-cyan); }
.cw-roll-meter i { width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: bottom; transform: scaleY(.38); opacity: .26; }
.cw-roll-meter i:nth-child(2) { --lamp-delay: .07s; }
.cw-roll-meter i:nth-child(3) { --lamp-delay: .14s; }
.cw-roll-meter i:nth-child(4) { --lamp-delay: .21s; }
.cw-roll-meter i:nth-child(5) { --lamp-delay: .28s; }
.cw-roll-meter i:nth-child(6) { --lamp-delay: .35s; }
.cw-roll-stage[data-roll-visible] :where(.cw-boardbar:has(> .cw-updates.is-active)) .cw-roll-meter i {
  animation: cw-roll-meter-live 1.35s var(--lamp-delay, 0s) ease-in-out infinite;
}
.cw-roll-stage[data-roll-effect]:not([data-roll-effect="games"], [data-roll-effect="rotation"]) .cw-roll-meter i { animation: cw-roll-meter .62s var(--lamp-delay, 0s) ease-out both; }
@keyframes cw-roll-signal { from { transform: translateX(-108%); opacity: .8; } to { transform: translateX(108%); opacity: 0; } }
@keyframes cw-roll-meter-live { 0%, 100% { transform: scaleY(.38); opacity: .34; } 46% { transform: scaleY(.86); opacity: .83; } }
@keyframes cw-roll-meter { 0%, 100% { transform: scaleY(.38); opacity: .26; } 46% { transform: scaleY(1); opacity: 1; box-shadow: 0 0 9px currentColor; } }

.cw-roll-stage .cw-intro { margin: 13px 0; padding: 0; min-height: 0; border: 0; background: none; overflow: visible; }
.cw-roll-stage .cw-intro::before, .cw-roll-stage .cw-intro::after { content: none; }
.cw-roll-stage .cw-intro h1 {
  max-width: 100%;
  color: #f9f6ff;
  font: 400 clamp(34px, 4vw, 68px)/.99 Georgia, serif;
  letter-spacing: -.066em;
  text-wrap: balance;
  text-shadow: none;
}
.cw-roll-stage .cw-intro h1 em { color: var(--roll-cyan); text-shadow: 0 0 26px #57c9f782; }
.cw-roll-stage .cw-intro p { margin: 10px 0 0; color: var(--roll-text); font: 400 clamp(13px, 1.13vw, 16px)/1.55 var(--font); text-shadow: none; }
.cw-roll-actions { display: flex; align-items: start; flex-wrap: wrap; gap: 7px; }
.cw-roll-actions button, .cw-roll-dispatch summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 41px;
  padding: 6px 11px;
  border: 1px solid var(--roll-edge);
  border-radius: 8px;
  background: #121b38;
  color: var(--roll-text);
  font: 500 12px/1.35 var(--font);
  cursor: pointer;
}
.cw-roll-actions button[hidden] { display: none; }
.cw-roll-actions [data-roll-play] { color: var(--roll-cyan); border-color: #83cbe7; background: linear-gradient(128deg, #295169, var(--roll-deep)); box-shadow: 0 0 13px #bd76ff3a; }
.cw-roll-actions [data-roll-play]:disabled { opacity: .55; box-shadow: none; cursor: default; }
.cw-roll-actions :is(button:not(:disabled), summary):hover { border-color: var(--roll-cyan); }
.cw-roll-dispatch { position: relative; max-width: 100%; }
.cw-roll-dispatch summary::before { content: "↗"; color: var(--roll-cyan); }
.cw-roll-dispatch p {
  position: absolute;
  z-index: 3;
  width: min(320px, 64vw);
  margin: 6px 0 0;
  padding: 11px 12px;
  border: 1px solid var(--roll-edge);
  border-radius: 8px;
  background: var(--roll-deep);
  color: var(--roll-text);
  font: 400 13px/1.6 var(--font);
  box-shadow: 0 8px 28px #000a;
}

.cw-roll-deck {
  --roll-height: clamp(105px, 12vw, 170px);
  grid-area: deck;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  justify-self: center;
  width: min(535px, calc(100% - 33px));
  margin: 15px 0 14px;
  padding: 9px 10px 10px;
  border: 1px solid #9b80f7;
  border-radius: 17px;
  background: linear-gradient(115deg, #1a3551, #281b55 58%, #362053);
  box-shadow: inset 0 0 0 2px #11162f, inset 0 0 0 3px #b09eff52, 0 9px 30px #04061681, 0 0 32px #8654ff43;
}
.cw-roll-deck > header { display: flex; align-items: center; justify-content: space-between; gap: 3px 8px; flex-wrap: wrap; padding: 3px 4px 5px; }
.cw-roll-deck h2 { margin: 0; color: #ecf6ff; font: 600 clamp(15px, 1.23vw, 20px)/1.17 var(--font); }
.cw-roll-label { margin: 0; color: var(--roll-cyan); font: 500 10px/1.34 var(--font); padding: 3px 6px; border: 1px solid #7363ae; border-radius: 5px; background: #141633; }
.cw-roll-deck[data-roll-mode="sample"] .cw-roll-label { color: #e7d5ff; }
.cw-roll-sheen {
  position: absolute;
  z-index: -1;
  inset: -10% auto -10% -35%;
  width: 40%;
  background: linear-gradient(105deg, transparent 8%, #54ccff25 38%, #dfb2ff89 47%, #a4e9ff51 52%, transparent 74%);
  transform: translateX(-70%) skewX(-10deg);
  pointer-events: none;
}
.cw-roll-lamps { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 7px; }
.cw-roll-lamps i { width: 5px; height: 5px; border-radius: 50%; background: #aff9ff; box-shadow: 0 0 7px 2px #82eeff70; }
.cw-roll-lamps i:nth-child(even) { background: #e9b9ff; box-shadow: 0 0 7px 2px #bc8aff86; }
.cw-roll-lamps i:nth-child(3n + 2) { --lamp-delay: .24s; }
.cw-roll-lamps i:nth-child(3n) { --lamp-delay: .48s; }
.cw-roll-cards { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 0; padding: 0; }
.cw-roll-card { min-width: 0; overflow: hidden; border: 1px solid #7b70b9; border-radius: 8px; background: linear-gradient(120deg, #1b2447, #14152e); }
.cw-roll-card:nth-child(2) { --roll-delay: .24s; }
.cw-roll-card:nth-child(3) { --roll-delay: .48s; }
.cw-roll-glass { position: relative; overflow: hidden; height: var(--roll-height); background: #090e25; }
.cw-roll-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-bottom: 1px solid #797bd187;
  background: linear-gradient(#0c14298c, transparent 19% 81%, #101332be),
    linear-gradient(121deg, transparent 61%, #93eeff30 73%, #d8aefe21 74% 82%, transparent 88%);
  pointer-events: none;
}
.cw-roll-track { display: grid; grid-auto-rows: var(--roll-height); }
.cw-roll-track img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.cw-roll-card[data-roll-key=""] img { width: 56%; margin-inline: auto; opacity: .35; }
.cw-roll-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.5em;
  margin: 6px 7px 4px;
  color: #f1ebff;
  font: 600 12px/1.25 var(--font);
  overflow-wrap: anywhere;
}
.cw-roll-card[data-roll-key=""] .cw-roll-name { color: #c3bfd8; }
.cw-roll-link { display: block; height: 100%; }
.cw-roll-link .cw-roll-glass::before {
  content: "↗";
  position: absolute;
  z-index: 1;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #8ee6f6ad;
  border-radius: 5px;
  background: #101a38e8;
  color: var(--roll-cyan);
  font: 600 12px/1 var(--font);
}
.cw-roll-card:has(.cw-roll-link:is(:hover, :focus-visible)) { border-color: var(--roll-cyan); }
.cw-roll-stage .cw-roll-link:focus-visible { outline-offset: -2px; }
.cw-roll-link:is(:hover, :focus-visible) .cw-roll-track { animation: none !important; }
.cw-roll-meta { display: flex; justify-content: space-between; gap: 2px 5px; flex-wrap: wrap; align-items: baseline; padding: 0 7px 6px; }
.cw-roll-meta b { color: var(--roll-cyan); font: 600 13px/1.15 var(--font); }
.cw-roll-meta time { color: var(--roll-text); font: 500 10px/1.3 var(--font); white-space: nowrap; }
.cw-roll-stage[data-roll-visible] .cw-roll-sheen { animation: cw-roll-sheen 5.1s linear infinite; }
.cw-roll-stage[data-roll-visible] .cw-roll-lamps i { animation: cw-roll-lamps 2.8s var(--lamp-delay, 0s) ease-in-out infinite; }
.cw-roll-stage[data-roll-visible] .cw-roll-card:not([data-roll-key=""]) .cw-roll-track { animation: cw-roll-idle 5.5s var(--roll-delay, 0s) ease-in-out infinite; }
.cw-roll-stage[data-roll-visible][data-roll-effect] .cw-roll-card:not([data-roll-key=""]) .cw-roll-track,
.cw-roll-stage[data-roll-visible] .cw-roll-card[data-roll-new] .cw-roll-track { animation: cw-roll-turn .94s var(--roll-delay, 0s) cubic-bezier(.22,.89,.31,1) both; }
.cw-roll-stage[data-roll-visible] .cw-roll-card[data-roll-new] .cw-roll-glass::after { animation: cw-roll-arrival 1.35s var(--roll-delay, 0s) ease-out both; }
@keyframes cw-roll-sheen { from { transform: translateX(-45%) skewX(-10deg); } to { transform: translateX(357%) skewX(-10deg); } }
@keyframes cw-roll-lamps { 0%, 65%, 100% { opacity: .54; transform: scale(.86); } 29% { opacity: 1; transform: scale(1.22); } }
@keyframes cw-roll-idle { 0%, 75% { transform: translateY(0); filter: none; } 82% { filter: blur(1.5px); } 90%, 100% { transform: translateY(-75%); filter: none; } }
@keyframes cw-roll-turn { 0% { transform: translateY(0); filter: none; } 34% { transform: translateY(-36%); filter: blur(1.7px); } 86%, 100% { transform: translateY(-75%); filter: none; } 94% { transform: translateY(-74.2%); } }
@keyframes cw-roll-arrival { 24% { box-shadow: inset 0 0 24px 5px #a387fa80; } 66% { box-shadow: inset 0 0 24px 6px #9deaff9b; } }

.cw-roll-categories {
  --roll-index: 0;
  grid-area: categories;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  position: relative;
  isolation: isolate;
  margin: 0 9px 9px;
  padding: 5px;
  border: 1px solid var(--roll-edge);
  border-radius: 13px;
  background: var(--roll-deep);
}
.cw-roll-categories:has([data-roll-media="film"][aria-current]) { --roll-index: 1; }
.cw-roll-categories:has([data-roll-media="game"][aria-current]) { --roll-index: 2; }
.cw-roll-categories:has([data-roll-media="music"][aria-current]) { --roll-index: 3; }
.cw-roll-marker {
  position: absolute;
  z-index: -1;
  inset: 5px auto 5px 5px;
  width: calc((100% - 10px) / 4);
  border: 1px solid #99c6e5;
  border-radius: 8px;
  background: linear-gradient(135deg, #224366, #42316a 70%, #29234f);
  box-shadow: inset 0 1px #ffffff24, 0 0 14px #bd76ff68;
  transform: translateX(calc(var(--roll-index) * 100%));
  transition: transform .39s cubic-bezier(.21, 1.5, .45, 1);
  pointer-events: none;
}
.cw-roll-categories:not(:has([aria-current])) .cw-roll-marker { opacity: 0; }
.cw-roll-categories a { display: flex; justify-content: center; align-items: center; gap: 7px; min-height: 46px; min-width: 0; color: var(--roll-text); font: 600 14px/1.2 var(--font); }
.cw-roll-categories a + a { border-left: 1px dashed #8574bc6b; }
.cw-roll-categories a[aria-current], .cw-roll-categories a:hover { color: var(--roll-cyan); }
.cw-roll-categories a:hover { background: #8f78df24; }
.cw-roll-categories svg { width: 19px; height: 19px; flex: 0 0 auto; color: var(--roll-cyan); }
.cw-roll-stage[data-roll-effect="category"] .cw-roll-categories a[aria-current] svg { animation: cw-roll-icon .46s cubic-bezier(.21, 1.5, .45, 1) both; }
@keyframes cw-roll-icon { 0% { transform: scale(.76); } 52% { transform: translateY(-3px) scale(1.15); } 100% { transform: none; } }
.cw-roll-stage :focus-visible, .cw-roll-controls :focus-visible { outline: 2px solid var(--roll-cyan); outline-offset: 2px; }

.cw-roll-controls {
  display: grid;
  grid-template: "tabs shops" auto "filters filters" auto / minmax(220px, .8fr) minmax(0, 1.2fr);
  background: var(--roll-deep);
  border: 1px solid var(--roll-edge);
  border-radius: 14px;
  margin: 10px 0 13px;
}
.cw-roll-controls .cw-tabs { grid-area: tabs; border: 0; margin: 0; gap: 8px; min-width: 0; padding-inline: 12px; border-radius: 13px 0 0; background: var(--roll-panel); }
.cw-roll-controls .cw-tabs > a { padding: 9px 0; min-height: 44px; }
.cw-roll-controls .cw-tabs > a[aria-current] { color: var(--roll-cyan); text-shadow: none; }
.cw-roll-controls .cw-tabs > a[aria-current]::after { background: var(--roll-cyan); }
.cw-roll-controls .cw-tabs-note { display: none; }
.cw-roll-controls .cw-selection {
  grid-area: shops;
  flex-wrap: wrap;
  min-height: 53px;
  min-width: 0;
  margin: 0;
  padding: 6px 12px;
  gap: 6px 10px;
  border: 0;
  border-left: 1px solid var(--roll-edge);
  border-radius: 0 13px 0 0;
  background: var(--roll-deep);
  box-shadow: none;
}
.cw-roll-controls .cw-selection > label { gap: 6px; }
.cw-roll-controls .cw-selection label > span { color: var(--roll-text); }
.cw-roll-controls .cw-selection select, .cw-roll-controls .cw-selection > button { min-height: 40px; padding: 5px 9px; border: 1px solid var(--roll-edge); border-radius: 7px; background: var(--roll-panel); box-shadow: none; font: 500 13px/1.4 var(--font); }
.cw-roll-controls .cw-selection > button { color: var(--roll-cyan); }
.cw-roll-controls .cw-selection > button:hover { border-color: var(--roll-cyan); }
.cw-roll-controls #result-count { color: var(--roll-text); }
.cw-roll-controls #product-filter { grid-area: filters; margin: 0; border-top: 1px solid var(--roll-edge); }
.cw-roll-controls .cw-facet-details { border: 0; border-radius: 0 0 13px 13px; margin: 0; background: var(--roll-panel); }
.cw-roll-controls .cw-facet-trigger { min-height: 44px; padding: 8px 12px; }

@media (max-width: 1180px) {
  .cw-roll-controls .cw-tabs > a { font-size: 12px; }
}
@media (max-width: 790px) {
  .cw-roll-controls { grid-template: "tabs" auto "shops" auto "filters" auto / minmax(0, 1fr); }
  .cw-roll-controls .cw-tabs { border-radius: 13px 13px 0 0; }
  .cw-roll-controls .cw-selection { border-left: 0; border-top: 1px solid var(--roll-edge); border-radius: 0; }
}
@media (max-width: 740px) {
  .cw-roll-stage { grid-template: "story" auto "deck" auto "categories" auto / minmax(0, 1fr); }
  .cw-roll-story { padding: 15px 12px 10px; }
  .cw-roll-deck { --roll-height: clamp(101px, 26vw, 150px); width: min(535px, calc(100% - 22px)); margin: 4px 0 12px; }
}
@media (max-width: 520px) {
  .cw-roll-stage .cw-boardbar { gap: 3px 7px; padding: 5px 6px; }
  .cw-roll-stage .cw-boardbar h2 { font-size: 12px; }
  .cw-roll-stage #price-updates, .cw-roll-stage .cw-source-summary { font-size: 9px; }
  .cw-roll-stage .cw-source-summary { padding-left: 0; border-left: 0; }
  .cw-roll-meter { display: none; }
  .cw-roll-stage .cw-intro h1 { font-size: clamp(30px, 8.15vw, 44px); text-wrap: wrap; }
  .cw-roll-actions button, .cw-roll-dispatch summary { min-height: 44px; font-size: 11px; padding-inline: 7px; }
  .cw-roll-actions #pause-board { min-height: 44px; }
  .cw-roll-deck { border-radius: 12px; padding: 5px 7px 7px; }
  .cw-roll-cards { gap: 5px; }
  .cw-roll-name { font-size: 11px; margin-inline: 4px; }
  .cw-roll-meta { padding-inline: 4px; }
  .cw-roll-meta b { font-size: 12px; }
  .cw-roll-categories { margin-inline: 6px; padding: 4px; }
  .cw-roll-categories a { min-height: 44px; gap: 4px; font-size: 12px; }
  .cw-roll-categories svg { width: 15px; height: 15px; }
  .cw-roll-marker { inset: 4px auto 4px 4px; width: calc((100% - 8px) / 4); }
  .cw-roll-controls .cw-selection { gap: 5px 7px; padding: 6px 8px; }
  .cw-roll-controls .cw-selection > label { display: grid; }
  .cw-roll-controls .cw-selection label > span { display: block; }
  .cw-roll-controls .cw-selection > button, .cw-roll-controls #result-count { align-self: end; }
}
@media (max-width: 350px) {
  .cw-roll-categories a { flex-direction: column; gap: 2px; }
}
html:is(.cw-motion-paused, :has(dialog[open])) .cw-roll-stage *,
html:is(.cw-motion-paused, :has(dialog[open])) .cw-roll-stage *::before,
html:is(.cw-motion-paused, :has(dialog[open])) .cw-roll-stage *::after {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .cw-roll-stage *, .cw-roll-stage *::before, .cw-roll-stage *::after { animation: none !important; transition: none !important; }
}
