/* Roll Rush — every selector is prefixed rr- */
.rr { display: flex; flex-direction: column; width: 100%; color: #dfe9ff; }
.rr-stage { position: relative; width: 100%; height: min(82vh, 760px); min-height: 420px; overflow: hidden; background: #04060f;
  border-radius: 14px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.rr-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; cursor: grab; touch-action: none; }
.rr-stage.rr-drag canvas { cursor: grabbing; }
.rr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.rr-hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px; pointer-events: none; }
.rr-hud > * { pointer-events: auto; position: relative; z-index: 3; }
.rr-hud > .rr-tool { z-index: 6; }
.rr-sp { flex: 1 1 auto; pointer-events: none; }
.rr-stat { display: flex; flex-direction: column; min-width: 54px; padding: 3px 10px 4px; border-radius: 10px; background: rgba(8, 13, 30, 0.72); border: 1px solid #1c2b4a; line-height: 1.1; pointer-events: none; }
.rr-k { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #8aa3c4; }
.rr-stat b { font-size: 19px; font-variant-numeric: tabular-nums; color: #fff; }
.rr-stat.rr-bump b { animation: rr-bump 0.3s ease-out; }
.rr-stat.rr-low b { color: #ff6b81; }
.rr-mult { min-width: 40px; text-align: center; padding: 6px 8px; border-radius: 10px; font-weight: 800; font-size: 17px; color: #8aa3c4; background: rgba(8, 13, 30, 0.72); border: 1px solid #1c2b4a; pointer-events: none; }
.rr-mult.rr-hot { color: #1a1204; background: linear-gradient(135deg, #ffd166, #ff8a5c); border-color: #ffd166; box-shadow: 0 0 14px rgba(255, 209, 102, 0.5); }
.rr-mult.rr-pop { animation: rr-bump 0.35s ease-out; }
.rr-sparks { display: flex; gap: 4px; padding: 0 2px; pointer-events: none; }
.rr-sparks i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #5a6f96; background: transparent; }
.rr-sparks i.on { background: #ffd166; border-color: #ffd166; box-shadow: 0 0 8px #ffd166; }
.rr-sparks.rr-armed i { background: #ff6b81; border-color: #ff6b81; box-shadow: 0 0 9px #ff6b81; animation: rr-blink 0.5s steps(2) infinite; }
.rr-tool { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 11px; border: 1px solid #1c2b4a; background: rgba(11, 19, 40, 0.8); color: #dfe9ff; cursor: pointer; padding: 0; }
.rr-tool svg { width: 21px; height: 21px; }
.rr-tool:hover:not(:disabled) { border-color: #55d6ff; color: #fff; }
.rr-tool:disabled { opacity: 0.4; cursor: default; }
.rr-tool:focus-visible, .rr-btn:focus-visible, .rr-chip:focus-visible, .rr-lane:focus-visible, .rr-prize:focus-visible { outline: 2px solid #55d6ff; outline-offset: 2px; }
#rr-pause .pl { display: none; }
#rr-pause.rr-on .pl { display: block; }
#rr-pause.rr-on .pz { display: none; }
#rr-sound .off { display: none; }
#rr-sound[aria-pressed="true"] .on { display: none; }
#rr-sound[aria-pressed="true"] .off { display: block; }

.rr-players { position: absolute; left: 8px; right: 8px; top: 58px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; pointer-events: none; z-index: 2; }
.rr-pl { display: flex; align-items: baseline; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; background: rgba(8, 13, 30, 0.78); border: 1px solid #1c2b4a; color: #8aa3c4; }
.rr-pl b { color: #dfe9ff; font-variant-numeric: tabular-nums; }
.rr-pl.rr-now { border-color: #ffd166; color: #ffd166; box-shadow: 0 0 10px rgba(255, 209, 102, 0.35); }
.rr-pl.rr-now b { color: #fff; }

.rr-side { position: absolute; top: 64px; width: 168px; box-sizing: border-box; padding: 12px 12px 10px; border-radius: 14px; background: rgba(8, 13, 30, 0.66); border: 1px solid #1c2b4a; font-size: 13px; color: #8aa3c4; pointer-events: none; display: none; z-index: 1; }
.rr-wide .rr-side { display: block; }
.rr-side h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #8aa3c4; font-weight: 700; }
.rr-side ul { list-style: none; margin: 0; padding: 0; }
.rr-side li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.rr-side li b { color: #dfe9ff; font-variant-numeric: tabular-nums; }
.rr-side li.rr-cur { color: #ffd166; }
.rr-side li.rr-cur b { color: #ffd166; }
.rr-side .rr-goal { margin-top: 8px; padding-top: 8px; border-top: 1px solid #1c2b4a; }
.rr-side .rr-goal span.on { color: #ffd166; }
.rr-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

.rr-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; background: radial-gradient(ellipse at center, rgba(4, 6, 15, 0.5), rgba(4, 6, 15, 0.84)); z-index: 5; overflow: auto; }
.rr-overlay[hidden] { display: none; }
.rr-panel { width: min(100%, 392px); max-height: 100%; overflow: auto; padding: 18px 18px 16px; border-radius: 18px; background: rgba(8, 13, 30, 0.92); border: 1px solid #1c2b4a; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(85, 214, 255, 0.06); text-align: center; }
.rr-panel h2 { margin: 0 0 4px; font-size: 28px; letter-spacing: 0.01em; color: #fff; }
.rr-panel h2 span { color: #ffd166; }
.rr-sub { margin: 0 0 12px; color: #8aa3c4; font-size: 14px; }
.rr-modes, .rr-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 0 10px; }
.rr-chip { min-height: 40px; padding: 8px 12px; border-radius: 11px; border: 1px solid #1c2b4a; background: #0b1328; color: #dfe9ff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.rr-chip:hover { border-color: #55d6ff; }
.rr-chip[aria-checked="true"], .rr-chip[aria-pressed="true"] { border-color: #55d6ff; background: rgba(85, 214, 255, 0.14); color: #fff; box-shadow: 0 0 12px rgba(85, 214, 255, 0.22); }
.rr-desc { min-height: 38px; margin: 0 0 10px; font-size: 13.5px; color: #8aa3c4; }
.rr-lanes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 10px; }
.rr-lane { min-height: 54px; padding: 6px 4px; border-radius: 11px; border: 1px solid #1c2b4a; background: #0b1328; color: #dfe9ff; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; line-height: 1.25; }
.rr-lane small { display: block; margin-top: 2px; color: #ffd166; font-size: 13px; letter-spacing: 2px; }
.rr-lane small i { color: #34425f; font-style: normal; }
.rr-lane[aria-checked="true"] { border-color: #55d6ff; background: rgba(85, 214, 255, 0.14); }
.rr-lane:disabled { opacity: 0.45; cursor: default; }
.rr-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid #1c2b4a; background: #0b1328; color: #dfe9ff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.rr-btn:hover { border-color: #55d6ff; }
.rr-primary { width: 100%; min-height: 54px; margin: 2px 0 10px; font-size: 20px; color: #1a1204; border: 0; background: linear-gradient(135deg, #ffd166, #ff8a5c); box-shadow: 0 6px 22px rgba(255, 170, 90, 0.35); }
.rr-primary:hover { filter: brightness(1.07); }
.rr-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.rr-row .rr-btn { flex: 1 1 0; min-width: 96px; font-size: 13.5px; padding: 8px 8px; }
.rr-foot { margin: 10px 0 0; font-size: 13px; color: #8aa3c4; }
.rr-foot b { color: #ffd166; }
.rr-big { font-size: 46px; font-weight: 800; line-height: 1.05; color: #fff; font-variant-numeric: tabular-nums; }
.rr-newbest { display: inline-block; margin: 6px 0 2px; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; color: #1a1204; background: linear-gradient(90deg, #ffd166, #fff2b8, #ffd166); background-size: 200% 100%; animation: rr-shine 1.6s linear infinite; }
.rr-starsrow { font-size: 34px; letter-spacing: 6px; color: #ffd166; text-shadow: 0 0 16px rgba(255, 209, 102, 0.5); }
.rr-starsrow i { font-style: normal; color: #26334f; text-shadow: none; }
.rr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.rr-grid div { padding: 7px 4px; border-radius: 10px; background: #0b1328; border: 1px solid #1c2b4a; font-size: 11.5px; color: #8aa3c4; }
.rr-grid b { display: block; font-size: 17px; color: #fff; font-variant-numeric: tabular-nums; }
.rr-tix { margin: 4px 0 12px; font-size: 15px; color: #ffd166; font-weight: 700; }
.rr-table { width: 100%; border-collapse: collapse; margin: 10px 0 12px; font-size: 14px; }
.rr-table th { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: #8aa3c4; font-weight: 600; padding: 4px; }
.rr-table td { padding: 6px 4px; border-top: 1px solid #1c2b4a; font-variant-numeric: tabular-nums; }
.rr-table td:first-child, .rr-table th:first-child { text-align: left; }
.rr-table tr.rr-win td { color: #ffd166; font-weight: 700; }
.rr-how { text-align: left; margin: 8px 0 12px; padding: 0; list-style: none; font-size: 14px; color: #c5d3ee; }
.rr-how li { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.rr-how li b { color: #ffd166; flex: 0 0 auto; min-width: 74px; }
.rr-shelf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 12px; }
.rr-prize { position: relative; padding: 6px 2px 5px; border-radius: 11px; border: 1px solid #1c2b4a; background: #0b1328; color: #dfe9ff; font: inherit; font-size: 11px; cursor: pointer; line-height: 1.2; min-height: 78px; }
.rr-prize canvas { position: static; width: 40px; height: 40px; display: block; margin: 0 auto 3px; cursor: inherit; }
.rr-prize small { display: block; color: #ffd166; font-size: 11px; }
.rr-prize.rr-own small { color: #7be0a4; }
.rr-prize.rr-use { border-color: #ffd166; box-shadow: 0 0 12px rgba(255, 209, 102, 0.3); }
.rr-prize.rr-far { opacity: 0.6; }
.rr-toast { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px; background: rgba(8, 13, 30, 0.92); border: 1px solid #ffd166; color: #ffd166; font-weight: 700; font-size: 15px; white-space: nowrap; pointer-events: none; z-index: 4; animation: rr-toast 0.25s ease-out; }
.rr-toast[hidden] { display: none; }
.rr-help { margin-top: 10px; }
.rr-help .hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .rr-help .hint-kb { display: none; } .rr-help .hint-touch { display: inline; } }

@media (max-width: 600px) {
  .rr-stage { height: auto; aspect-ratio: 5 / 8; max-height: 80vh; min-height: 380px; border-radius: 10px; }
  .rr-hud { gap: 5px; padding: 6px; }
  .rr-stat { min-width: 46px; padding: 3px 7px 4px; }
  .rr-stat b { font-size: 17px; }
  .rr-players { top: 54px; }
  .rr-pl { font-size: 12px; padding: 2px 8px; }
  .rr-panel { padding: 14px 12px 12px; }
  .rr-panel h2 { font-size: 24px; }
  .rr-chip { padding: 8px 9px; font-size: 13px; }
}
.rr-short .rr-panel { padding: 10px 14px; }
.rr-short .rr-panel h2 { font-size: 20px; margin: 0; }
.rr-short .rr-sub, .rr-short .rr-desc { display: none; }
.rr-short .rr-primary { min-height: 44px; font-size: 17px; margin-bottom: 6px; }
.rr-short .rr-big { font-size: 30px; }
.rr-short .rr-grid { margin: 6px 0; }
.rr-short .rr-modes, .rr-short .rr-chips, .rr-short .rr-lanes { margin-bottom: 6px; }
.rr-short .rr-lane { min-height: 40px; }

.stage.is-immersive .stage-body > .rr { min-height: 0; }
.stage.is-immersive .rr-stage { flex: 1 1 auto; height: auto; aspect-ratio: auto; max-height: none; min-height: 0; border-radius: 0; }
.stage.is-immersive .rr-help { display: none; }

@keyframes rr-bump { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes rr-blink { 50% { opacity: 0.35; } }
@keyframes rr-shine { to { background-position: -200% 0; } }
@keyframes rr-toast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) {
  .rr-stat.rr-bump b, .rr-mult.rr-pop, .rr-newbest, .rr-toast, .rr-sparks.rr-armed i { animation: none; }
}
