/* Straf rad + Handicap rad (winsbits.nl/timtopspin/strafrad, /handicaprad), in the Timtopspin look:
   near-black page, tennis-ball lime (plus a darker olive lime), and the wheel on a gravel court.
   Wheel and result on the left, the pick-your-own list on the right (stacks on phones). */

.rad-page {
  --rad-surface: #191919;
  --rad-line: #2b2b2b;
  --rad-muted: #a3a39e;
  --clay: #d9683a;
  --clay-dark: #b9532a;
  --court-lines: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='white' stroke-width='3' vector-effect='non-scaling-stroke' opacity='.85'%3E%3Crect x='5' y='5' width='90' height='90' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M17 5V95M83 5V95M17 27H83M17 73H83M50 27V73' vector-effect='non-scaling-stroke'/%3E%3C/g%3E%3Cpath d='M0 50H100' stroke='white' stroke-width='6' stroke-dasharray='2 1.2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center/100% 100% no-repeat;
  background: radial-gradient(70% 40% at 50% 0%, rgba(220,245,80,.08), transparent 70%), var(--tts-bg);
}
.rad-page [hidden] { display: none !important; }
.rad { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); padding-block: 18px 48px; }

.rad-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.rad-page h1 { font: 700 clamp(44px, 8vw, 76px)/.92 var(--f-tts-head); text-transform: uppercase; letter-spacing: -.01em; margin: 0; }
.rad-page h1 { white-space: nowrap; }
.rad-page h1 span { color: var(--tts-lime); }
.hball { display: inline-block; width: .42em; height: .42em; margin-left: .16em; border-radius: 50%; vertical-align: .1em;
  background: radial-gradient(circle at 34% 28%, #F6FF9A, #DDF23A 50%, #9fb51f); box-shadow: 0 0 24px rgba(220,245,80,.45); animation: rad-bounce 1.6s ease-in-out infinite; }
@keyframes rad-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.3em); } }
.tag { color: var(--rad-muted); margin: 10px 0 0; font-size: 15.5px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; }

.rbtn { font: 600 14px/1 var(--f-tts-body); border: 1px solid var(--rad-line); background: var(--rad-surface); color: var(--tts-ink);
  height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer; transition: border-color .2s, background .2s; }
.rbtn:hover { border-color: var(--tts-lime); }
.rbtn-lime { background: linear-gradient(180deg, var(--tts-lime), var(--tts-lime-2)); color: #111; border-color: transparent; }
.rad-page :is(.rbtn, .spin, .hub, input, .rad-other):focus-visible { outline: 3px solid var(--tts-lime); outline-offset: 2px; }

.main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .main { grid-template-columns: minmax(0, 1fr); } }

/* stage: the wheel on a gravel court */
.stage { position: relative; border-radius: 22px; overflow: hidden; padding: 30px 16px 24px; display: flex; flex-direction: column; align-items: center; gap: 18px; min-width: 0;
  background: var(--court-lines), radial-gradient(120% 90% at 50% 40%, var(--clay), var(--clay-dark)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.stage:fullscreen { border-radius: 0; justify-content: center; }
.wheelbox { position: relative; width: min(100%, 560px); aspect-ratio: 1; max-width: 100%; }
.stage:fullscreen .wheelbox { width: min(78vh, 90vw); }
canvas#wheel { width: 100%; height: 100%; display: block; filter: drop-shadow(0 16px 26px rgba(60,20,0,.45)); }
canvas#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.pointer { position: absolute; right: -14px; top: 50%; width: 56px; height: 46px; margin-top: -23px; z-index: 2; transform-origin: 88% 50%;
  clip-path: polygon(100% 0, 100% 100%, 0 50%); background: #121212; filter: drop-shadow(0 4px 4px rgba(0,0,0,.4)); }
.pointer.tick { animation: rad-tick .12s ease-out; }
@keyframes rad-tick { 40% { transform: rotate(-14deg); } }
.hub { position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; z-index: 2; cursor: pointer;
  border: 5px solid #fff; background: radial-gradient(circle at 34% 28%, #F6FF9A, #DDF23A 50%, #9fb51f 100%);
  font: 700 clamp(13px, 2.8vw, 22px)/1 var(--f-tts-head); color: #111; text-transform: uppercase; box-shadow: 0 6px 14px rgba(0,0,0,.35); }
.hub:disabled { cursor: default; }

/* result: only appears after a spin */
.result { width: min(100%, 560px); background: #121212; color: var(--tts-ink); border-radius: 14px; padding: 12px 16px; border: 2px solid var(--tts-lime);
  box-shadow: 0 10px 24px rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 3px; }
.result .lbl { font: 600 11px/1 var(--f-tts-head); letter-spacing: .14em; text-transform: uppercase; color: var(--rad-muted); }
.result .res { font: 700 clamp(22px, 4.2vw, 34px)/1.05 var(--f-tts-head); text-transform: uppercase; color: var(--tts-lime); text-wrap: balance; }
.result .note { font-size: 14px; color: #d6d6d1; margin: 0; }
.result.flash { animation: rad-flash .6s ease-out; }
@keyframes rad-flash { 0% { transform: scale(.96); } 50% { transform: scale(1.03); } 100% { transform: none; } }

.spin { font: 700 20px/1 var(--f-tts-head); letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 17px 42px; cursor: pointer;
  background: linear-gradient(180deg, var(--tts-lime), var(--tts-lime-2)); color: #111; border: 0; box-shadow: 0 6px 0 #121212, 0 12px 28px rgba(0,0,0,.3);
  transition: transform .15s, box-shadow .15s; }
.spin:hover { transform: translateY(-1px); }
.spin:active { transform: translateY(4px); box-shadow: 0 2px 0 #121212; }
.spin:disabled { opacity: .6; cursor: default; transform: none; }

/* the list on the right */
.rad-page aside { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel { background: var(--rad-surface); border: 1px solid var(--rad-line); border-radius: var(--tts-radius); padding: 18px; }
.panel h2 { font: 700 21px/1.1 var(--f-tts-head); text-transform: uppercase; margin: 0 0 8px; }
.panel p { margin: 0 0 12px; color: var(--rad-muted); font-size: 14px; }
.panel .lead { color: #d6d6d1; font-size: 14.5px; line-height: 1.55; }
.panel .lead b { color: var(--tts-lime); font-weight: 600; }
.panel .count { font: 600 12px/1 var(--f-tts-head); letter-spacing: .1em; text-transform: uppercase; color: var(--tts-lime); margin-bottom: 10px; }
.panel .saved { font-size: 12.5px; margin: 8px 0 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tight { margin: 0 0 14px; }
.msg { font-size: 13px; color: var(--rad-muted); margin-top: 8px; min-height: 1em; }
#groups { max-height: 520px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.cgroup { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.cgroup legend { font: 600 12px/1 var(--f-tts-head); letter-spacing: .12em; text-transform: uppercase; color: var(--rad-muted); padding: 0 0 8px; }
.crow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--rad-line); }
.crow:last-child { border-bottom: 0; }
.crow input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--tts-lime); cursor: pointer; }
.crow label { flex: 1; min-width: 0; cursor: pointer; font-size: 15px; }
.crow input:not(:checked) ~ label { color: var(--rad-muted); }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(255,255,255,.3); }
.dot.off { box-shadow: 0 0 0 1px #3a3a3a; }
.joker { font: 700 11px/1 var(--f-tts-head); letter-spacing: .08em; text-transform: uppercase; background: #fff; color: var(--clay-dark); padding: 4px 7px; border-radius: 5px; }
.del { border: 0; background: none; color: var(--rad-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.del:hover { color: var(--tts-ink); }
.addrow { display: flex; gap: 8px; margin-top: 8px; }
.addrow input { flex: 1; min-width: 0; font: 15px/1.2 var(--f-tts-body); border: 1px solid var(--rad-line); border-radius: 999px; padding: 0 16px; height: 40px; background: #111; color: var(--tts-ink); }
ul.hist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
ul.hist li { display: flex; gap: 10px; }
ul.hist time { color: var(--tts-lime); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.empty { color: var(--rad-muted); font-size: 14px; }
.toWheel { display: none; }

/* link to the other wheel */
.rad-page .rad-other { display: flex; align-items: center; gap: 14px; padding: 12px 18px 12px 12px; border-radius: 999px; background: var(--rad-surface); border: 1px solid var(--rad-line); text-decoration: none; transition: border-color .2s; }
.rad-other:hover { border-color: var(--tts-lime); }
.rad-other > span:not(.tts-rad-wheel) { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.rad-other small { font-size: 12.5px; color: var(--rad-muted); }
.rad-other b { font: 700 18px/1 var(--f-tts-head); text-transform: uppercase; color: var(--tts-lime); }
.rad-other > i { font-style: normal; color: var(--tts-lime); font-size: 18px; }

.rad-page .tts-foot { margin-top: 8px; }

@media (max-width: 640px) {
  .rad { padding-block: 10px 36px; gap: 16px; }
  .rad-page h1 { font-size: min(11vw, 52px); }
  .stage { padding: 20px 8px 18px; border-radius: 16px; gap: 14px; }
  .pointer { width: 40px; height: 34px; margin-top: -17px; right: -8px; }
  .spin { width: 100%; padding: 17px 20px; }
  #groups { max-height: none; overflow: visible; }
  .toWheel { display: inline-flex; align-items: center; }
  .rbtn { padding: 0 13px; }
}
@media (prefers-reduced-motion: reduce) { .pointer.tick, .result.flash, .hball { animation: none; } }

/* list controls: the three buttons share one row, the add-your-own field sits above the list */
.panel .row.tight { flex-wrap: nowrap; gap: 6px; }
.panel .row.tight .rbtn { flex: 1 1 0; min-width: 0; padding: 0 8px; font-size: 13px; white-space: nowrap; }
.panel .addrow { margin: 0; }
.panel .msg { margin: 6px 0 10px; }
