:root {
  --roulette-orange: #ff7a3d;
  --roulette-yellow: #ffc857;
  --roulette-pink: #ef5da8;
  --roulette-cyan: #36c5d8;
}
.roulette-page {
  width: min(1400px, calc(100% - clamp(28px, 5vw, 92px)));
  margin: 0 auto;
  padding: 56px 0 96px;
}
.roulette-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 52px;
}
.roulette-hero h1 {
  margin-bottom: 16px;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
}
.roulette-hero > div:first-child > p:last-child {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 1.03rem;
}
.roulette-hero-badge {
  display: grid;
  place-items: center;
  width: 126px;
  height: 126px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 200, 87, 0.35);
  border-radius: 36px;
  color: #fff;
  background: linear-gradient(
    145deg,
    var(--roulette-orange),
    var(--roulette-pink)
  );
  box-shadow: 0 24px 60px rgba(239, 93, 168, 0.24);
  transform: rotate(8deg);
}
.roulette-hero-badge span {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-8deg);
}
.roulette-workspace {
  display: grid;
  grid-template-columns: minmax(380px, 1.15fr) minmax(340px, 0.85fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 4vw, 64px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(
      circle at 18% 25%,
      rgba(109, 124, 255, 0.14),
      transparent 34%
    ),
    var(--surface);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.18);
}
.wheel-panel {
  min-width: 0;
  text-align: center;
}
.wheel-wrap {
  position: relative;
  width: min(100%, 610px);
  margin: 0 auto;
  aspect-ratio: 1;
}
#roulette-wheel {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 24px 28px rgba(0, 0, 0, 0.3));
}
.wheel-pointer {
  position: absolute;
  z-index: 3;
  top: -5px;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 18px solid transparent;
  border-left: 18px solid transparent;
  border-top: 44px solid #fff;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.35));
  transform: translateX(-50%);
}
.spin-button {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 25%;
  aspect-ratio: 1;
  padding: 0;
  color: #fff;
  border: 8px solid var(--surface);
  border-radius: 50%;
  background: linear-gradient(145deg, #7c89ff, #5865f2);
  box-shadow: 0 10px 30px rgba(20, 24, 56, 0.5);
  font: inherit;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition:
    transform 0.18s ease,
    filter 0.18s ease;
}
.spin-button:hover {
  filter: brightness(1.12);
  transform: translate(-50%, -50%) scale(1.04);
}
.spin-button:disabled {
  cursor: wait;
  filter: grayscale(0.2);
}
.spin-button span {
  align-self: end;
  font-size: clamp(0.9rem, 2.4vw, 1.5rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
}
.spin-button small {
  align-self: start;
  margin-top: 5px;
  font-size: clamp(0.55rem, 1.4vw, 0.75rem);
  font-weight: 700;
  opacity: 0.78;
}
.wheel-hint {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.control-panel {
  min-width: 0;
}
.control-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.control-heading h2 {
  margin: 0;
}
.entry-count {
  padding: 5px 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}
.preset-panel {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(109, 124, 255, 0.26);
  border-radius: 12px;
  background: rgba(109, 124, 255, 0.08);
}
.preset-panel > label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-light);
  font-size: 0.76rem;
  font-weight: 800;
}
.preset-row {
  display: flex;
  gap: 8px;
}
.preset-row select {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: var(--page);
  font: inherit;
  font-size: 0.88rem;
}
.preset-row button {
  min-width: 64px;
  color: #fff;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.preset-row button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.preset-status {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}
.preset-status.error {
  color: #ff8390;
}
.entry-form {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.entry-form input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 15px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: var(--page);
  font: inherit;
}
.entry-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 124, 255, 0.16);
}
.entry-form button {
  width: 50px;
  flex: 0 0 auto;
  color: #fff;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  font-size: 1.5rem;
  cursor: pointer;
}
.entry-list {
  display: grid;
  gap: 8px;
  max-height: 338px;
  margin: 0;
  padding: 0 4px 0 0;
  overflow: auto;
  list-style: none;
}
.entry-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 7px 8px 7px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}
.entry-color {
  width: 10px;
  height: 28px;
  border-radius: 999px;
}
.entry-name {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.entry-remove {
  width: 34px;
  height: 34px;
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
}
.entry-remove:hover {
  color: #ff8390;
  background: rgba(255, 95, 109, 0.1);
}
.control-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}
.utility-button,
.sound-button {
  min-height: 42px;
  padding: 8px 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.utility-button:hover,
.sound-button:hover {
  color: var(--text);
  background: var(--surface-soft);
}
.utility-button.danger {
  color: #ff8390;
}
.sound-button {
  width: 42px;
  margin-left: auto;
  padding: 0;
  font-size: 1rem;
}
.sound-button[aria-pressed="false"] {
  text-decoration: line-through;
  opacity: 0.55;
}
.result-dialog {
  width: min(500px, calc(100% - 32px));
  padding: 46px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
  text-align: center;
}
.result-dialog::backdrop {
  background: rgba(4, 5, 15, 0.74);
  backdrop-filter: blur(8px);
}
.result-dialog h2 {
  margin: 8px 0 4px;
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 8vw, 3.2rem);
}
.result-dialog > p:not(.eyebrow) {
  color: var(--muted);
}
.result-spark {
  color: var(--roulette-yellow);
  font-size: 3.2rem;
  animation: spark 1.4s ease-in-out infinite;
}
.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  color: var(--muted);
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
}
.result-again {
  min-height: 48px;
  margin-top: 12px;
  padding: 10px 22px;
  color: #fff;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes spark {
  50% {
    transform: rotate(18deg) scale(1.14);
  }
}
@media (max-width: 920px) {
  .roulette-workspace {
    grid-template-columns: 1fr;
  }
  .wheel-wrap {
    max-width: 540px;
  }
  .control-panel {
    max-width: 620px;
    width: 100%;
    margin: 0 auto;
  }
}
@media (max-width: 620px) {
  .roulette-page {
    padding-top: 38px;
  }
  .roulette-hero {
    align-items: flex-start;
    margin-bottom: 34px;
  }
  .roulette-hero-badge {
    display: none;
  }
  .roulette-workspace {
    padding: 22px 14px 28px;
    border-radius: 18px;
  }
  .wheel-pointer {
    border-right-width: 12px;
    border-left-width: 12px;
    border-top-width: 31px;
  }
  .spin-button {
    border-width: 5px;
  }
  .result-dialog {
    padding: 42px 22px 30px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .result-spark {
    animation: none;
  }
}
