:root {
  color-scheme: dark;
  --bg: #141819;
  --surface: #1d2224;
  --text: #f4f6f5;
  --muted: #a8b3b5;
  --line: #394344;
  --mint: #79e2bd;
  --rose: #f697ae;
  --gold: #edcf87;
}
html {
  scrollbar-gutter: stable;
}
.wheel-shell:has(.is-empty) .wheel-center {
  display: none;
}
.source-item span:last-child {
  min-width: 0;
}
* {
  box-sizing: border-box;
  letter-spacing: 0;
  scrollbar-width: thin;
  scrollbar-color: #687b76 var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
button:focus-visible,
a:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 36px;
  line-height: 1.2;
}
h2 {
  font-size: 24px;
  line-height: 1.3;
}
img {
  display: block;
  max-width: 100%;
}
.random-app {
  max-width: 1440px;
  margin: auto;
  padding: 0 32px 32px;
  background: var(--bg);
  min-height: 100dvh;
}
.topbar {
  height: 66px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.home-link {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
}
.home-link img {
  width: 22px;
  filter: invert(1);
}
.toolbar {
  display: flex;
  gap: 8px;
}
.icon-button {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
}
.icon-button img {
  width: 22px;
  height: 22px;
  filter: invert(1);
  opacity: 0.8;
}
.icon-button:hover {
  background: var(--surface);
  border-color: var(--line);
}
.icon-button[aria-pressed="false"] img {
  opacity: 0.35;
}
.icon-button[aria-pressed="false"] {
  border-color: var(--line);
}
.random-header {
  padding: 24px 0 20px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 44px;
  align-items: start;
}
.wheel-panel {
  grid-row: 1/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 12px 16px 0;
}
.input-panel,
.results-panel {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: 32px;
}
.input-panel {
  padding-bottom: 24px;
}
.results-panel {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.wheel-shell {
  overflow: clip;
  overflow-clip-margin: 14px;
  width: min(100%, 560px);
  aspect-ratio: 1;
  position: relative;
  isolation: isolate;
  margin: 0 0 28px;
}
.wheel-shell::before {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px solid #7e704c;
  border-radius: 50%;
  pointer-events: none;
}
.wheel-shell::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px dotted #a59366;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.7;
}
.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  transform-origin: center;
  background: var(--surface);
  box-shadow: 0 12px 28px #0005;
}
.is-spinning .wheel {
  will-change: transform;
}
.wheel canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.empty-wheel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20%;
  background: var(--surface);
  color: var(--muted);
  border: 3px solid var(--gold);
  border-radius: 50%;
}
.wheel:not(.is-empty) .empty-wheel {
  display: none;
}
.wheel-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18%;
  aspect-ratio: 1;
  background: #151919;
  border: 3px solid var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 12px #0006;
  overflow: hidden;
  z-index: 3;
}
.wheel-center img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 34px;
  height: 44px;
  background: var(--rose);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform: translateX(-50%);
  transform-origin: 50% 0;
  z-index: 4;
}
.pointer.tick {
  animation: tick 0.09s ease-out;
}
@keyframes tick {
  50% {
    transform: translateX(-50%) rotate(-16deg);
  }
}
.wheel-actions {
  width: min(100%, 490px);
  display: grid;
  gap: 14px;
  text-align: center;
}
.mode-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  margin: 0;
  background: var(--surface);
  gap: 4px;
  min-width: 0;
}
.mode-switch label {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  position: relative;
}
.mode-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.mode-switch span {
  display: block;
  padding: 10px 5px;
  border-radius: 5px;
  font-size: 15px;
  line-height: 1.3;
  color: var(--muted);
}
.mode-switch input:checked + span {
  background: var(--mint);
  color: #14251e;
}
.mode-switch input:focus-visible + span {
  outline: 2px solid white;
  outline-offset: 1px;
}
.mode-switch:disabled {
  opacity: 0.5;
}
.spin-button {
  min-height: 52px;
  background: var(--mint);
  color: #10221a;
  border: 0;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.spin-button img {
  width: 20px;
}
.spin-button:hover:not(:disabled) {
  background: #a0edcf;
}
.spin-button:active:not(:disabled) {
  transform: translateY(1px);
}
.winner-display {
  font-size: 24px;
  font-weight: 700;
  color: var(--mint);
  overflow-wrap: anywhere;
  padding: 12px 0;
  border-block: 1px solid var(--line);
}
.winner-display small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.winner-display.is-eliminated {
  color: var(--rose);
}
.counter {
  font-size: 14px;
  color: var(--muted);
}
.error-message {
  font-size: 14px;
  color: var(--gold);
  overflow-wrap: anywhere;
}
.error-message:empty {
  display: none;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
textarea {
  display: block;
  width: 100%;
  height: 248px;
  resize: vertical;
  min-height: 180px;
  max-height: 500px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
}
.meta-row {
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0 14px;
}
.elimination-details summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  padding: 8px 0;
}
.source-list {
  max-height: 240px;
  overflow: auto;
}
.source-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.source-item.picked {
  color: var(--muted);
}
.source-item.picked span:last-child {
  text-decoration: line-through;
}
.rank {
  width: 24px;
  flex-shrink: 0;
  text-align: center;
  color: var(--gold);
}
.empty-results {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px 12px;
  color: var(--muted);
  font-size: 15px;
}
.empty-results img {
  width: 40px;
  filter: invert(1);
  opacity: 0.35;
}
.results-list {
  padding-left: 28px;
  margin: 0;
  max-height: 320px;
  overflow: auto;
}
.results-list li {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.results-list li::marker {
  color: var(--gold);
  font-size: 13px;
}
.results-list span {
  font-weight: 700;
}
.results-list small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.results-list li.new-result {
  animation: arrive 0.35s ease-out;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.mobile-tabs {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
}
.confetti i {
  position: absolute;
  top: 35%;
  left: 50%;
  width: 6px;
  height: 12px;
  background: var(--color);
  animation: confetti 1.5s ease-out forwards;
}
@keyframes confetti {
  from {
    transform: translate(0, 0) rotate(0);
    opacity: 1;
  }
  to {
    transform: translate(var(--x), var(--y)) rotate(var(--turn));
    opacity: 0;
  }
}
.no-effects *,
.no-effects *::before,
.no-effects *::after {
  animation: none !important;
  transition: none !important;
}
.random-app:fullscreen {
  overflow: auto;
  max-width: none;
}
.random-app:fullscreen .workspace {
  display: block;
}
.random-app:fullscreen .input-panel,
.random-app:fullscreen .results-panel,
.random-app:fullscreen .mobile-tabs {
  display: none;
}
.random-app:fullscreen .wheel-shell {
  width: min(52dvh, 640px);
}
.random-app:fullscreen .random-header {
  text-align: center;
  padding: 12px;
}
.random-app:fullscreen .wheel-panel {
  padding-top: 12px;
}
@media (max-width: 1000px) {
  .random-app {
    padding-inline: 24px;
  }
  .workspace {
    column-gap: 24px;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }
  .input-panel,
  .results-panel {
    padding-left: 20px;
  }
  .wheel-panel {
    padding-inline: 8px;
  }
  h1 {
    font-size: 32px;
  }
  h2 {
    font-size: 22px;
  }
}
@media (max-width: 700px) {
  .random-app {
    padding: 0 18px 24px;
  }
  .topbar {
    height: 58px;
  }
  .toolbar {
    gap: 0;
  }
  .home-link {
    font-size: 14px;
    gap: 6px;
  }
  .random-header {
    padding: 20px 0 18px;
  }
  h1 {
    font-size: 28px;
  }
  .mobile-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
  }
  .mobile-tabs button {
    flex: 1;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--muted);
    font-size: 13px;
    min-height: 44px;
    padding: 8px 3px;
  }
  .mobile-tabs button[aria-pressed="true"] {
    border-bottom-color: var(--mint);
    color: var(--mint);
  }
  #resultCount {
    font-size: 11px;
  }
  .workspace {
    display: block;
  }
  .wheel-panel {
    padding: 8px 8px 0;
  }
  .wheel-shell {
    width: min(100%, 420px);
    margin-bottom: 24px;
  }
  .input-panel,
  .results-panel {
    border: 0;
    padding: 0;
  }
  .workspace[data-view="wheel"] .input-panel,
  .workspace[data-view="wheel"] .results-panel,
  .workspace[data-view="input"] .wheel-panel,
  .workspace[data-view="input"] .results-panel,
  .workspace[data-view="results"] .wheel-panel,
  .workspace[data-view="results"] .input-panel {
    display: none;
  }
  .winner-display {
    font-size: 22px;
  }
  .pointer {
    width: 28px;
    height: 36px;
  }
  .wheel-center {
    border-width: 2px;
  }
  .results-list {
    max-height: none;
  }
  textarea {
    height: 310px;
  }
  .random-app:fullscreen .wheel-panel {
    display: flex;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
