.rr-shell {
  --rr-text: var(--bs-body-color, #20232a);
  --rr-surface: color-mix(in srgb, var(--bs-body-bg, #ffffff) 92%, transparent);
  --rr-surface-solid: var(--bs-body-bg, #ffffff);
  --rr-muted-surface: color-mix(in srgb, var(--bs-secondary-bg, #f3f5f7) 84%, transparent);
  --rr-border: color-mix(in srgb, var(--bs-body-color, #20232a) 16%, transparent);
  --rr-muted: color-mix(in srgb, var(--bs-body-color, #20232a) 62%, transparent);
  --rr-shadow: 0 24px 70px rgba(24, 22, 48, 0.14);
  color: var(--bs-body-color, #20232a);
  background:
    radial-gradient(circle at 12% 18%, var(--site-accent-soft) 0, transparent 32%),
    radial-gradient(circle at 88% 84%, color-mix(in srgb, var(--site-accent-soft) 65%, transparent) 0, transparent 34%),
    linear-gradient(145deg, var(--bs-body-bg, #f7f8fb), var(--bs-tertiary-bg, #eef1f6));
}

.rr-shell,
.rr-shell * {
  box-sizing: border-box;
}

.rr-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.26;
  background-image:
    linear-gradient(var(--rr-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--rr-border) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
}

.rr-main {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 68px clamp(14px, 2.4vw, 38px) clamp(14px, 2.4vw, 30px);
}

.rr-toolbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 44px;
}

.rr-mode-switch {
  justify-self: start;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--rr-border);
  border-radius: 15px;
  background: var(--rr-surface);
  box-shadow: 0 8px 24px rgba(24, 22, 48, 0.07);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.rr-mode {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 11px;
  padding: 8px 13px;
  color: var(--rr-muted);
  background: transparent;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.rr-mode:hover {
  color: var(--site-accent);
  background: var(--site-accent-soft);
}

.rr-mode.is-active {
  color: var(--site-accent-contrast);
  background: var(--site-accent);
  box-shadow: 0 4px 12px var(--site-accent-ring);
}

.rr-session-summary {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--rr-muted);
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
}

.rr-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--site-accent);
  box-shadow: 0 0 0 5px var(--site-accent-soft);
}

.rr-toolbar-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
}

.rr-icon-button,
.rr-text-button,
.rr-outline-button,
.rr-quiet-button,
.rr-close-button,
.rr-primary-button {
  font: inherit;
}

.rr-icon-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  border: 1px solid var(--rr-border);
  border-radius: 12px;
  padding: 7px 11px;
  color: inherit;
  background: var(--rr-surface);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(24, 22, 48, 0.07);
}

.rr-icon-button:hover {
  border-color: var(--site-accent);
  color: var(--site-accent);
}

.rr-gear-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.rr-count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  border-radius: 999px;
  padding-inline: 5px;
  color: var(--site-accent-contrast);
  background: var(--site-accent);
  font-size: 0.7rem;
}

.rr-workspace {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(440px, 1.22fr) minmax(340px, 0.78fr);
  gap: clamp(14px, 1.8vw, 26px);
}

.rr-wheel-card,
.rr-result-card {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--rr-border);
  border-radius: clamp(20px, 2vw, 30px);
  background: var(--rr-surface);
  box-shadow: var(--rr-shadow);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.rr-wheel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  padding: clamp(18px, 2vw, 30px);
}

.rr-card-heading {
  align-self: stretch;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.rr-kicker {
  margin: 0 0 5px;
  color: var(--site-accent);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.rr-card-heading h1,
.rr-result-card h2,
.rr-drawer-heading h2,
.rr-dialog-heading h2,
.rr-section-heading h3,
.rr-upload-panel h3,
.rr-detected-panel h3,
.rr-player-editor-heading h3 {
  margin: 0;
  color: inherit;
  font-family: inherit;
}

.rr-card-heading h1 {
  font-size: clamp(1.12rem, 1.65vw, 1.55rem);
  font-weight: 760;
  letter-spacing: -0.025em;
}

.rr-odds {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.rr-odds span {
  color: var(--site-accent);
  font-size: clamp(1.2rem, 1.8vw, 1.65rem);
  font-weight: 800;
  line-height: 1;
}

.rr-odds small {
  color: var(--rr-muted);
  font-size: 0.67rem;
}

.rr-wheel-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  width: min(100%, 68dvh);
  aspect-ratio: 1;
  margin: 4px auto;
}

#rrWheel {
  display: block;
  width: 92%;
  height: 92%;
  border-radius: 50%;
  filter: drop-shadow(0 20px 28px rgba(23, 20, 45, 0.18));
  transform: rotate(var(--rr-wheel-rotation, 0deg));
  transition: transform 1.65s cubic-bezier(0.16, 0.84, 0.22, 1);
}

.rr-wheel-wrap.is-spinning #rrWheel {
  filter: drop-shadow(0 24px 34px rgba(23, 20, 45, 0.23));
}

.rr-wheel-pointer {
  position: absolute;
  z-index: 4;
  top: 0.5%;
  left: 50%;
  width: clamp(22px, 3.2vw, 38px);
  height: clamp(30px, 4.3vw, 51px);
  transform: translateX(-50%);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  background: var(--site-accent);
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.18));
}

.rr-wheel-center {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 24%;
  aspect-ratio: 1;
  border: clamp(5px, 0.7vw, 9px) solid color-mix(in srgb, var(--bs-body-bg, #ffffff) 84%, transparent);
  border-radius: 50%;
  color: var(--site-accent);
  background: var(--rr-surface-solid);
  box-shadow: 0 10px 30px rgba(23, 20, 45, 0.2);
}

.rr-wheel-center strong {
  font-size: clamp(1.6rem, 4.2vw, 3.5rem);
  font-weight: 850;
  line-height: 0.88;
}

.rr-wheel-center span {
  margin-top: 6px;
  color: var(--rr-muted);
  font-size: clamp(0.58rem, 0.9vw, 0.76rem);
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rr-probability-line {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--rr-muted);
  font-size: 0.76rem;
}

.rr-local-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.rr-local-note span {
  color: #2e8b57;
  font-size: 0.55rem;
}

.rr-result-card {
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 3vw, 42px);
}

.rr-result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.rr-result-topline .rr-kicker {
  margin: 0;
}

.rr-round-pill {
  border: 1px solid var(--rr-border);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--rr-muted);
  background: var(--rr-muted-surface);
  font-size: 0.68rem;
  font-weight: 750;
}

.rr-result-display {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 0;
}

.rr-result-symbol {
  display: grid;
  place-items: center;
  width: clamp(48px, 6.4vw, 72px);
  height: clamp(48px, 6.4vw, 72px);
  margin-bottom: clamp(14px, 2vh, 24px);
  border-radius: 22px;
  color: var(--site-accent);
  background: var(--site-accent-soft);
  font-size: clamp(1.25rem, 2.2vw, 1.8rem);
  transform: rotate(-5deg);
}

.rr-result-display.is-picked .rr-result-symbol {
  color: var(--site-accent-contrast);
  background: var(--site-accent);
  animation: rr-pop 0.45s ease both;
}

@keyframes rr-pop {
  0% { transform: rotate(-5deg) scale(0.65); opacity: 0; }
  70% { transform: rotate(2deg) scale(1.08); opacity: 1; }
  100% { transform: rotate(-5deg) scale(1); opacity: 1; }
}

.rr-result-card h2 {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 5vw, 4.75rem);
  font-weight: 850;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.rr-result-card h2.rr-long-name {
  font-size: clamp(1.55rem, 3.8vw, 3.25rem);
}

.rr-result-display > p {
  max-width: 36ch;
  margin: 14px auto 0;
  color: var(--rr-muted);
  font-size: clamp(0.86rem, 1.2vw, 1rem);
  line-height: 1.55;
}

.rr-role-reveal {
  min-width: min(300px, 100%);
  margin-top: 18px;
  border: 1px solid var(--site-accent);
  border-radius: 16px;
  padding: 12px 18px;
  background: var(--site-accent-soft);
}

.rr-role-reveal[hidden] {
  display: none;
}

.rr-role-label {
  display: block;
  color: var(--rr-muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rr-role-reveal strong {
  display: block;
  margin-top: 2px;
  color: var(--site-accent);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  overflow-wrap: anywhere;
}

.rr-role-translation {
  display: inline-block;
  margin: 5px 5px 0;
  color: var(--rr-muted);
  font-size: 0.78rem;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.rr-role-translation + .rr-role-translation::before {
  margin-right: 10px;
  color: var(--rr-border-strong);
  content: "•";
}

.rr-primary-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.rr-primary-button {
  min-height: 54px;
  border: 0;
  border-radius: 15px;
  padding: 12px 22px;
  color: var(--site-accent-contrast);
  background: var(--site-accent);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px var(--site-accent-ring);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.rr-primary-button:hover:not(:disabled) {
  background: var(--site-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px var(--site-accent-ring);
}

.rr-primary-button:active:not(:disabled) {
  transform: translateY(1px);
}

.rr-primary-button:disabled {
  color: var(--site-accent-contrast);
  background: var(--site-accent-muted);
  cursor: wait;
  box-shadow: none;
}

.rr-key-hint {
  align-self: center;
  color: var(--rr-muted);
  font-size: 0.69rem;
}

.rr-key-hint kbd {
  border: 1px solid var(--rr-border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 6px;
  color: inherit;
  background: var(--rr-muted-surface);
  font-size: 0.64rem;
}

.rr-secondary-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.rr-text-button,
.rr-quiet-button {
  border: 0;
  padding: 5px;
  color: var(--rr-muted);
  background: transparent;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.rr-text-button:hover:not(:disabled),
.rr-quiet-button:hover:not(:disabled) {
  color: var(--site-accent);
}

.rr-text-button:disabled,
.rr-quiet-button:disabled {
  opacity: 0.4;
  cursor: default;
}

.rr-progress-block {
  margin-top: clamp(16px, 2.8vh, 28px);
}

.rr-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--rr-muted);
  font-size: 0.7rem;
}

.rr-progress-copy strong {
  color: inherit;
}

.rr-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--rr-muted-surface);
}

.rr-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--site-accent);
  transition: width 0.35s ease;
}

.rr-privacy-copy {
  margin: 13px 0 0;
  color: var(--rr-muted);
  font-size: 0.66rem;
  line-height: 1.45;
  text-align: center;
}

.rr-scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 12, 22, 0.35);
  opacity: 1;
  transition: opacity 0.22s ease;
}

.rr-scrim[hidden] {
  display: none;
}

.rr-history-drawer {
  position: fixed;
  z-index: 45;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(420px, 92vw);
  border-left: 1px solid var(--rr-border);
  padding: 24px;
  background: var(--rr-surface-solid);
  box-shadow: -24px 0 64px rgba(10, 12, 22, 0.18);
  transform: translateX(104%);
  visibility: hidden;
  transition: transform 0.24s ease, visibility 0.24s;
}

.rr-history-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

.rr-drawer-heading,
.rr-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.rr-drawer-heading h2,
.rr-dialog-heading h2 {
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  font-weight: 820;
  letter-spacing: -0.035em;
}

.rr-close-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--rr-border);
  border-radius: 12px;
  padding: 0;
  color: inherit;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.rr-close-button:hover {
  border-color: var(--site-accent);
  color: var(--site-accent);
  background: var(--site-accent-soft);
}

.rr-history-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rr-border);
}

.rr-outline-button {
  border: 1px solid var(--site-accent);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--site-accent);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 750;
  cursor: pointer;
}

.rr-outline-button:hover,
.rr-outline-button[aria-pressed="true"] {
  color: var(--site-accent-contrast);
  background: var(--site-accent);
}

.rr-history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.rr-history-group {
  margin-bottom: 22px;
}

.rr-history-group-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  color: var(--rr-muted);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.rr-history-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border-bottom: 1px solid var(--rr-border);
}

.rr-history-number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  color: var(--site-accent);
  background: var(--site-accent-soft);
  font-size: 0.69rem;
  font-weight: 800;
}

.rr-history-name {
  min-width: 0;
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rr-history-meta {
  color: var(--rr-muted);
  font-size: 0.68rem;
  text-align: right;
}

.rr-history-role {
  display: block;
  max-width: 130px;
  overflow: hidden;
  color: var(--site-accent);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rr-history-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--rr-muted);
  text-align: center;
}

.rr-history-empty[hidden] {
  display: none;
}

.rr-history-empty > span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  color: var(--site-accent);
  background: var(--site-accent-soft);
  font-size: 1.5rem;
}

.rr-history-empty p {
  max-width: 27ch;
  margin: 14px 0 0;
  font-size: 0.84rem;
  line-height: 1.55;
}

.rr-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 12, 22, 0.48);
}

.rr-modal-backdrop[hidden] {
  display: none;
}

.rr-setup-dialog {
  display: flex;
  flex-direction: column;
  width: min(820px, 100%);
  max-height: min(860px, calc(100dvh - 36px));
  overflow: hidden;
  border: 1px solid var(--rr-border);
  border-radius: 26px;
  color: var(--bs-body-color, #20232a);
  background: var(--rr-surface-solid);
  box-shadow: 0 32px 90px rgba(10, 12, 22, 0.3);
}

.rr-dialog-heading {
  padding: 24px 26px 19px;
  border-bottom: 1px solid var(--rr-border);
}

.rr-dialog-heading p:not(.rr-kicker) {
  max-width: 62ch;
  margin: 7px 0 0;
  color: var(--rr-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.rr-dialog-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 26px;
}

.rr-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.rr-section-heading h3,
.rr-upload-panel h3,
.rr-detected-panel h3,
.rr-player-editor-heading h3 {
  font-size: 0.98rem;
  font-weight: 790;
}

.rr-section-heading p,
.rr-upload-panel p,
.rr-detected-panel p {
  margin: 4px 0 0;
  color: var(--rr-muted);
  font-size: 0.73rem;
  line-height: 1.5;
}

#rrRosterInput,
#rrColumnSelect {
  width: 100%;
  border: 1px solid var(--rr-border);
  border-radius: 13px;
  color: inherit;
  background: var(--rr-muted-surface);
  font: inherit;
}

#rrRosterInput {
  display: block;
  margin-top: 12px;
  padding: 12px 14px;
  resize: vertical;
  font-size: 0.84rem;
  line-height: 1.45;
}

#rrRosterInput {
  min-height: 138px;
  max-height: 270px;
}

#rrRosterInput:focus,
#rrColumnSelect:focus {
  border-color: var(--site-accent);
  outline: 3px solid var(--site-accent-ring);
}

.rr-or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--rr-muted);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.rr-or-divider::before,
.rr-or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rr-border);
}

.rr-upload-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px dashed var(--rr-border);
  border-radius: 16px;
  padding: 14px;
  background: var(--rr-muted-surface);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.rr-upload-panel.is-dragging {
  border-color: var(--site-accent);
  background: var(--site-accent-soft);
}

.rr-upload-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: var(--site-accent);
  background: var(--site-accent-soft);
  font-size: 1.2rem;
}

.rr-detected-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.7fr);
  align-items: end;
  gap: 10px 16px;
  margin-top: 14px;
  border: 1px solid var(--site-accent);
  border-radius: 16px;
  padding: 14px;
  background: var(--site-accent-soft);
}

.rr-detected-panel[hidden] {
  display: none;
}

.rr-detected-panel label {
  align-self: end;
  color: var(--rr-muted);
  font-size: 0.69rem;
  font-weight: 750;
}

#rrColumnSelect {
  grid-column: 2;
  padding: 8px 10px;
  font-size: 0.78rem;
}

#rrDetectedSummary {
  grid-column: 1 / -1;
  margin: 0;
}

.rr-player-editor {
  margin-top: 14px;
  border: 1px solid var(--rr-border);
  border-radius: 16px;
  padding: 14px;
  background: var(--rr-muted-surface);
}

.rr-player-editor[hidden] {
  display: none;
}

.rr-player-editor-heading,
.rr-player-editor-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.rr-player-editor-heading .rr-kicker {
  margin: 0 0 3px;
}

.rr-player-editor-heading h3 {
  font-size: 0.92rem;
  font-weight: 790;
}

.rr-player-editor-meta {
  margin-top: 9px;
  color: var(--rr-muted);
  font-size: 0.66rem;
}

.rr-player-editor-meta strong {
  color: var(--rr-text);
  font-size: 0.7rem;
}

.rr-player-list {
  max-height: min(280px, 38dvh);
  margin-top: 9px;
  overflow-y: auto;
  border: 1px solid var(--rr-border);
  border-radius: 13px;
  background: var(--rr-surface);
  scrollbar-color: var(--rr-border-strong) transparent;
}

.rr-player-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  min-height: 49px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--rr-border);
}

.rr-player-row:last-child {
  border-bottom: 0;
}

.rr-player-number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  color: var(--rr-muted);
  background: var(--rr-muted-surface);
  font-size: 0.65rem;
  font-weight: 800;
}

.rr-player-name-input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--rr-border);
  border-radius: 10px;
  padding: 6px 10px;
  color: inherit;
  background: var(--rr-muted-surface);
  font: inherit;
  font-size: 0.78rem;
}

.rr-player-name-input:focus {
  border-color: var(--site-accent);
  outline: 3px solid var(--site-accent-ring);
}

.rr-player-remove {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0;
  color: var(--rr-muted);
  background: transparent;
  font-size: 1.05rem;
  cursor: pointer;
}

.rr-player-remove:hover {
  border-color: rgba(180, 35, 35, 0.2);
  color: #a42525;
  background: rgba(180, 35, 35, 0.08);
}

.rr-role-editor {
  margin-top: 14px;
  border: 1px solid var(--rr-border);
  border-radius: 16px;
  background: var(--rr-muted-surface);
}

.rr-role-editor summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
}

.rr-role-editor summary::-webkit-details-marker {
  display: none;
}

.rr-role-editor summary strong,
.rr-role-editor summary small {
  display: block;
}

.rr-role-editor summary strong {
  font-size: 0.84rem;
}

.rr-role-editor summary small {
  margin-top: 2px;
  color: var(--rr-muted);
  font-size: 0.69rem;
}

.rr-role-editor[open] summary > span:last-child {
  transform: rotate(45deg);
}

.rr-role-editor-body {
  border-top: 1px solid var(--rr-border);
  padding: 14px 15px 15px;
}

.rr-role-catalog-heading,
.rr-role-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 10px;
}

.rr-role-catalog-heading {
  padding: 0 10px 7px;
  color: var(--rr-muted);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rr-role-catalog-heading span:last-child {
  text-align: center;
}

.rr-role-catalog {
  max-height: min(315px, 42dvh);
  overflow-y: auto;
  border: 1px solid var(--rr-border);
  border-radius: 13px;
  background: var(--rr-surface);
  scrollbar-color: var(--rr-border-strong) transparent;
}

.rr-role-row {
  min-height: 58px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--rr-border);
  transition: background-color 140ms ease;
}

.rr-role-row:last-child {
  border-bottom: 0;
}

.rr-role-row.is-active {
  background: var(--site-accent-soft);
}

.rr-role-row.rr-common-role-end {
  border-bottom: 2px solid var(--rr-border-strong);
}

.rr-role-enabled {
  width: 18px;
  height: 18px;
  margin: 0 auto;
  accent-color: var(--site-accent);
  cursor: pointer;
}

.rr-role-copy {
  min-width: 0;
  cursor: pointer;
}

.rr-role-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--rr-text);
  font-size: 0.77rem;
  font-weight: 800;
}

.rr-role-team {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 6px;
  background: var(--rr-muted-surface);
  color: var(--rr-muted);
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rr-team-mafia {
  background: rgba(180, 45, 45, 0.1);
  color: #9e2727;
}

.rr-team-independent {
  background: rgba(133, 77, 14, 0.12);
  color: #80500e;
}

body.quarto-dark .rr-team-mafia {
  background: rgba(255, 140, 140, 0.14);
  color: #ffabab;
}

body.quarto-dark .rr-team-independent {
  background: rgba(255, 200, 120, 0.14);
  color: #ffd08a;
}

.rr-role-translations {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin-top: 3px;
  color: var(--rr-muted);
  font-size: 0.66rem;
  line-height: 1.25;
}

.rr-role-count-input {
  width: 58px;
  min-height: 36px;
  border: 1px solid var(--rr-border);
  border-radius: 10px;
  padding: 5px 4px;
  color: inherit;
  background: var(--rr-muted-surface);
  font: inherit;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.rr-role-count-input:focus {
  border-color: var(--site-accent);
  outline: 3px solid var(--site-accent-ring);
}

.rr-role-count-input:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.rr-role-helper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 7px;
  color: var(--rr-muted);
  font-size: 0.69rem;
}

#rrRoleCount {
  text-align: right;
}

#rrRoleCount.is-mismatch {
  color: #b42318;
  font-weight: 750;
}

.rr-form-status {
  min-height: 1.35em;
  margin: 13px 0 0;
  color: var(--rr-muted);
  font-size: 0.76rem;
}

.rr-form-status.is-error {
  color: #b42318;
}

.rr-form-status.is-success {
  color: #1e6b3e;
}

.rr-library-note {
  margin: 4px 0 0;
  color: var(--rr-muted);
  font-size: 0.62rem;
}

.rr-library-note a {
  color: var(--site-accent);
}

.rr-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--rr-border);
  padding: 15px 26px;
}

.rr-dialog-actions > p {
  max-width: 44ch;
  margin: 0;
  color: var(--rr-muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.rr-dialog-actions > div {
  display: flex;
  gap: 9px;
}

.rr-use-button {
  min-height: 40px;
  border-radius: 11px;
  padding: 8px 18px;
  font-size: 0.82rem;
}

.rr-toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--rr-border);
  border-radius: 12px;
  padding: 10px 15px;
  color: var(--bs-body-color, #20232a);
  background: var(--rr-surface-solid);
  box-shadow: 0 12px 32px rgba(10, 12, 22, 0.2);
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.rr-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.rr-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.rr-shell button:focus-visible,
.rr-shell input:focus-visible,
.rr-shell textarea:focus-visible,
.rr-shell select:focus-visible,
.rr-shell summary:focus-visible,
.rr-shell a:focus-visible {
  outline: 3px solid var(--site-accent-ring);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .rr-main {
    gap: 9px;
    padding: 57px 10px 10px;
  }

  .rr-toolbar {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .rr-session-summary {
    display: none;
  }

  .rr-mode {
    padding: 7px 10px;
    font-size: 0.76rem;
  }

  .rr-icon-button {
    min-height: 38px;
    padding: 6px 9px;
  }

  .rr-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 9px;
  }

  .rr-wheel-card,
  .rr-result-card {
    border-radius: 19px;
  }

  .rr-wheel-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 13px 16px;
  }

  .rr-card-heading {
    grid-column: 1;
    align-self: start;
  }

  .rr-card-heading h1 {
    font-size: 1rem;
  }

  .rr-odds {
    position: absolute;
    top: 14px;
    right: 16px;
  }

  .rr-wheel-wrap {
    grid-column: 1 / -1;
    width: min(100%, 38dvh);
    margin: -20px auto -9px;
  }

  .rr-probability-line {
    display: none;
  }

  .rr-result-card {
    padding: 16px 20px;
  }

  .rr-result-display {
    padding: 5px 0;
  }

  .rr-result-symbol {
    width: 44px;
    height: 44px;
    margin-bottom: 9px;
    border-radius: 15px;
  }

  .rr-result-card h2 {
    font-size: clamp(1.8rem, 8vw, 3.2rem);
  }

  .rr-result-display > p {
    margin-top: 7px;
    font-size: 0.8rem;
  }

  .rr-role-reveal {
    margin-top: 9px;
    padding: 8px 14px;
  }

  .rr-primary-button {
    min-height: 46px;
  }

  .rr-key-hint,
  .rr-privacy-copy {
    display: none;
  }

  .rr-secondary-actions {
    margin-top: 8px;
  }

  .rr-progress-block {
    margin-top: 9px;
  }
}

@media (max-width: 620px) {
  .app-pill-page,
  .app-pill-sep {
    display: none;
  }

  .rr-main {
    padding-top: 54px;
  }

  .rr-mode span,
  .rr-icon-button .rr-button-label {
    display: none;
  }

  .rr-toolbar-actions {
    gap: 5px;
  }

  .rr-mode-switch {
    gap: 2px;
    padding: 3px;
  }

  .rr-mode {
    padding-inline: 8px;
    font-size: 0.7rem;
  }

  .rr-icon-button {
    justify-content: center;
    min-width: 38px;
    font-size: 0.72rem;
  }

  .rr-button-icon {
    font-size: 1rem;
    line-height: 1;
  }

  .rr-role-editor-body {
    padding-right: 10px;
    padding-left: 10px;
  }

  .rr-role-catalog-heading,
  .rr-role-row {
    grid-template-columns: 28px minmax(0, 1fr) 56px;
    gap: 7px;
  }

  .rr-role-catalog-heading {
    padding-right: 6px;
    padding-left: 6px;
  }

  .rr-role-row {
    padding-right: 6px;
    padding-left: 6px;
  }

  .rr-role-count-input {
    width: 52px;
  }

  .rr-role-helper {
    align-items: flex-start;
    flex-direction: column;
  }

  #rrRoleCount {
    text-align: left;
  }

  .rr-result-card.is-role-visible .rr-secondary-actions,
  .rr-result-card.is-role-visible .rr-progress-block {
    display: none;
  }

  .rr-result-card.is-role-visible .rr-result-display {
    padding-bottom: 8px;
  }

  .rr-result-card.is-role-visible .rr-primary-actions {
    margin-right: 58px;
  }

  .rr-secondary-actions {
    justify-content: flex-start;
    gap: 14px;
    padding-right: 58px;
  }

  .rr-progress-block {
    margin-right: 58px;
  }

  .rr-progress-copy {
    font-size: 0.64rem;
  }

  .rr-wheel-card {
    padding: 11px 13px;
  }

  .rr-card-heading h1 {
    font-size: 0.88rem;
  }

  .rr-wheel-wrap {
    width: min(100%, 34dvh);
  }

  .rr-result-card {
    padding: 13px 16px;
  }

  .rr-result-card h2 {
    font-size: clamp(1.65rem, 9vw, 2.75rem);
  }

  .rr-result-card h2.rr-long-name {
    font-size: clamp(1.35rem, 7.5vw, 2.1rem);
  }

  .rr-result-symbol {
    display: none;
  }

  .rr-dialog-heading,
  .rr-dialog-body,
  .rr-dialog-actions {
    padding-left: 17px;
    padding-right: 17px;
  }

  .rr-dialog-heading {
    padding-top: 18px;
  }

  .rr-dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .rr-dialog-actions > p {
    display: none;
  }

  .rr-dialog-actions > div,
  .rr-dialog-actions button {
    flex: 1;
  }

  .rr-upload-panel {
    grid-template-columns: auto 1fr;
  }

  .rr-upload-panel .rr-outline-button {
    grid-column: 1 / -1;
  }

  .rr-detected-panel {
    grid-template-columns: 1fr;
  }

  #rrColumnSelect {
    grid-column: 1;
  }
}

@media (max-height: 700px) and (min-width: 901px) {
  .rr-main {
    padding-top: 61px;
  }

  .rr-toolbar {
    min-height: 38px;
  }

  .rr-wheel-card,
  .rr-result-card {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .rr-result-symbol {
    width: 50px;
    height: 50px;
    margin-bottom: 12px;
  }

  .rr-result-display > p {
    margin-top: 8px;
  }

  .rr-progress-block {
    margin-top: 13px;
  }

  .rr-privacy-copy {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #rrWheel,
  .rr-history-drawer,
  .rr-toast,
  .rr-progress-track span,
  .rr-primary-button {
    transition-duration: 0.01ms !important;
  }

  .rr-result-display.is-picked .rr-result-symbol {
    animation: none;
  }
}
