:root {
  --bg-sky: #dbe8f3;
  --bg-board: #4c7898;
  --board-line: rgba(8, 19, 52, 0.5);
  --card-border: rgba(255, 255, 255, 0.24);
  --text: #e5edf7;
  --muted: rgba(229, 237, 247, 0.7);
  --navy: #060a49;
  --navy-soft: #11165d;
  --face: #86adb8;
  --cover: #89b1bc;
  --scallop: #f3efe6;
  --accent-red: #bf3742;
  --chip: #2d3365;
  --chip-border: rgba(211, 220, 244, 0.24);
  --face-radius: 280px;
  --face-radius-px: 280px;
  --pivot-y: 52%;
  --pivot-y-px: 52%;
  --pivot-x: 50%;
  --pivot-x-px: 50%;
  --slope-inset-x: 10%;
  --spindle-length-px: 220px;
  --spindle-width-px: 6px;
  --slope-side-y-px: 45%;
  --slope-center-y-px: 52%;
  --wheel-rotation: 0deg;
  --wheel-offset-y: -64px;
  --cover-open-rotation: -152deg;
  --cover-motion-ms: 1300ms;
  --cover-motion-ease: ease-in-out;
  --cover-handle-angle: -12deg;
  --cover-handle-x-px: 90%;
  --cover-handle-y-px: 45%;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}

body {
  position: relative;
  overflow: hidden;
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: var(--bg-board);
}

.bg-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: none;
  z-index: 0;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: radial-gradient(
      rgba(9, 22, 54, 0.24) 0.45px,
      transparent 0.45px
    ),
    radial-gradient(rgba(255, 255, 255, 0.09) 0.45px, transparent 0.45px);
  background-size: 3px 3px, 5px 5px;
  background-position: 0 0, 2px 1px;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  width: min(1420px, 96vw);
  height: calc(100svh - 14px);
  margin: 7px auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(10px, 1.4vh, 18px);
}

.top-bar,
.board,
.control-panel {
  animation: riseIn 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.board {
  animation-delay: 50ms;
}

.control-panel {
  animation-delay: 95ms;
}

.top-bar {
  position: relative;
  z-index: 25;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(8px, 2vw, 28px);
  min-height: clamp(118px, 15.5vh, 172px);
  padding: clamp(10px, 1.4vw, 16px) clamp(12px, 2vw, 20px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.status-cluster {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.round-pill {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(12, 25, 58, 0.42);
  backdrop-filter: blur(3px);
}

.round-pill span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.round-pill strong {
  font-size: 1rem;
}

.phase-badge {
  margin: 0;
  justify-self: center;
  border-radius: 999px;
  padding: 5px 12px;
  border: 1px solid rgba(228, 235, 255, 0.3);
  background: rgba(10, 20, 52, 0.4);
  color: #eff3ff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.team-card {
  position: relative;
  width: clamp(136px, 18vw, 192px);
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: linear-gradient(
    145deg,
    rgba(12, 22, 58, 0.58),
    rgba(9, 17, 45, 0.76)
  );
  box-shadow: 0 10px 22px rgba(3, 8, 27, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  padding: 10px 14px;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease,
    opacity 220ms ease, filter 220ms ease;
}

.team-card::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 0 0 2px rgba(195, 229, 255, 0.38), 0 0 22px rgba(137, 206, 248, 0.28);
  transition: opacity 220ms ease;
}

.team-card:not(.active) {
  opacity: 0.72;
  filter: saturate(0.8);
}

.team-card.active {
  border-color: rgba(224, 240, 255, 0.92);
  background: linear-gradient(
    145deg,
    rgba(18, 35, 82, 0.78),
    rgba(12, 24, 62, 0.94)
  );
  box-shadow: 0 16px 30px rgba(2, 8, 30, 0.44),
    inset 0 0 0 1px rgba(168, 212, 235, 0.56);
  transform: translateY(-3px) scale(1.01);
  animation: teamCardActivePulse 1.85s ease-in-out infinite;
}

.team-card.active::after {
  opacity: 1;
}

.team-card.active .team-name {
  color: rgba(240, 246, 255, 0.95);
}

.team-card.active .team-score {
  text-shadow: 0 0 14px rgba(157, 213, 255, 0.34);
}

.team-left {
  justify-self: start;
  text-align: left;
}

.team-right {
  justify-self: end;
  text-align: right;
}

.team-name {
  margin: 0;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  appearance: none;
  font: inherit;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.88rem;
}

.team-left .team-name {
  text-align: left;
}

.team-right .team-name {
  text-align: right;
}

.team-name:focus {
  outline: 1px solid rgba(219, 232, 255, 0.4);
  outline-offset: 2px;
  border-radius: 5px;
}

.team-score {
  margin: 3px 0 0;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  line-height: 1;
  font-weight: 700;
  color: #fcfcff;
}

.board {
  min-height: 0;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
  z-index: 1;
}

.wheel-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  justify-items: center;
  gap: clamp(12px, 2.4vw, 34px);
  transform: translateY(var(--wheel-offset-y));
}

.side-indicator {
  display: none !important;
  width: clamp(98px, 11vw, 136px);
  aspect-ratio: 1;
  align-self: end;
  margin-bottom: clamp(16px, 3vw, 42px);
  pointer-events: none;
}

.orb-tag {
  border-radius: 50%;
  border: 2px solid rgba(220, 228, 248, 0.75);
  background: radial-gradient(circle at 34% 28%, #3c4279 0%, #2c315f 72%);
  color: rgba(235, 238, 246, 0.9);
  display: grid;
  place-items: center;
  font-size: clamp(1rem, 2vw, 1.2rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 10px 20px rgba(2, 8, 28, 0.3);
}

.wheel-shell {
  position: relative;
  width: min(86vw, 980px);
  margin: 0 auto;
  aspect-ratio: 1 / 1.05;
  overflow: visible;
}

.wheel-shell::before {
  content: "";
  position: absolute;
  left: var(--slope-inset-x);
  right: var(--slope-inset-x);
  top: 0;
  bottom: 0;
  background: #060a49;
  -webkit-clip-path: polygon(
    0 var(--slope-side-y-px),
    50% var(--slope-center-y-px),
    100% var(--slope-side-y-px),
    100% 100%,
    0 100%
  );
  clip-path: polygon(
    0 var(--slope-side-y-px),
    50% var(--slope-center-y-px),
    100% var(--slope-side-y-px),
    100% 100%,
    0 100%
  );
  border-radius: 0 0 18% 18%;
  box-shadow: inset 0 10px 0 rgba(255, 255, 255, 0.02),
    0 12px 18px rgba(0, 0, 0, 0.2);
  z-index: 3;
}

.wheel-shell::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -17%;
  height: 30%;
  background: var(--navy);
  -webkit-clip-path: polygon(0 0, 50% 32%, 100% 0, 100% 100%, 0 100%);
  clip-path: polygon(0 0, 50% 32%, 100% 0, 100% 100%, 0 100%);
  border-radius: 0 0 12% 12%;
  z-index: 2;
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.rotatable-spectrum {
  transform: none;
  will-change: auto;
  z-index: 1;
}

.cover-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  transform-origin: var(--pivot-x-px) var(--pivot-y-px);
  transition: transform var(--cover-motion-ms) var(--cover-motion-ease);
}

.cover-layer.closed {
  transform: rotate(0deg);
}

.cover-layer.open {
  transform: rotate(var(--cover-open-rotation));
}

.cover-panel {
  position: absolute;
  inset: 0;
  -webkit-clip-path: polygon(
    0 0,
    100% 0,
    calc(100% - var(--slope-inset-x)) var(--slope-side-y-px),
    var(--pivot-x-px) var(--pivot-y-px),
    var(--slope-inset-x) var(--slope-side-y-px)
  );
  clip-path: polygon(
    0 0,
    100% 0,
    calc(100% - var(--slope-inset-x)) var(--slope-side-y-px),
    var(--pivot-x-px) var(--pivot-y-px),
    var(--slope-inset-x) var(--slope-side-y-px)
  );
  background: var(--cover);
  mask-image: radial-gradient(
    circle at var(--pivot-x-px) var(--pivot-y-px),
    #000 0 calc(var(--face-radius-px) - 0.6px),
    transparent calc(var(--face-radius-px) + 0.8px)
  );
  -webkit-mask-image: radial-gradient(
    circle at var(--pivot-x-px) var(--pivot-y-px),
    #000 0 calc(var(--face-radius-px) - 0.6px),
    transparent calc(var(--face-radius-px) + 0.8px)
  );
}

.cover-handle-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  transform-origin: var(--pivot-x-px) var(--pivot-y-px);
  transition: transform var(--cover-motion-ms) var(--cover-motion-ease);
}

.cover-layer.closed + .cover-handle-overlay {
  transform: rotate(0deg);
}

.cover-layer.open + .cover-handle-overlay {
  transform: rotate(var(--cover-open-rotation));
}

.cover-handle-overlay::before {
  content: "";
  position: absolute;
  left: var(--cover-handle-x-px);
  top: var(--cover-handle-y-px);
  height: clamp(12px, 1.4vw, 16px);
  width: clamp(56px, 6.8vw, 82px);
  border-radius: 2px 999px 999px 2px;
  border: 0;
  background: var(--cover);
  box-shadow: none;
  transform: translate(-12px, -50%) rotate(var(--cover-handle-angle));
  transform-origin: 0 50%;
  z-index: 1;
}

.setup-rotate-cue {
  position: absolute;
  left: var(--pivot-x-px);
  top: var(--pivot-y-px);
  width: min(calc(var(--face-radius-px) * 2.08), 95%);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
  z-index: 14;
}

.setup-rotate-cue::before,
.setup-rotate-cue::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.setup-rotate-cue::before {
  border: 2px solid rgba(206, 238, 255, 0.42);
  box-shadow: inset 0 0 0 1px rgba(169, 223, 248, 0.18);
}

.setup-rotate-cue::after {
  inset: clamp(4px, 0.82vw, 7px);
  border: 3px dashed rgba(210, 242, 255, 0.76);
  border-bottom-color: rgba(210, 242, 255, 0.08);
  border-left-color: rgba(210, 242, 255, 0.34);
  border-right-color: rgba(210, 242, 255, 0.56);
  background: none;
  -webkit-clip-path: inset(0 0 34% 0);
  clip-path: inset(0 0 34% 0);
  filter: drop-shadow(0 0 16px rgba(144, 209, 240, 0.66));
}

.setup-rotate-hint {
  position: absolute;
  left: var(--pivot-x-px);
  top: max(
    8px,
    calc(var(--pivot-y-px) - var(--face-radius-px) - clamp(56px, 6.2vw, 74px))
  );
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(208, 237, 255, 0.42);
  border-radius: 999px;
  padding: 8px 14px 8px 10px;
  background: linear-gradient(
    130deg,
    rgba(8, 18, 52, 0.74),
    rgba(16, 36, 82, 0.54)
  );
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 20px rgba(4, 12, 34, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #ebf7ff;
  letter-spacing: 0.03em;
  font-size: clamp(0.76rem, 0.95vw, 0.92rem);
  line-height: 1.2;
  opacity: 0;
  transform: translate(-50%, 12px) scale(0.97);
  pointer-events: none;
  transition: opacity 260ms ease, transform 260ms ease;
  z-index: 20;
}

.setup-rotate-hint::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 10px;
  height: 10px;
  background: rgba(18, 40, 88, 0.76);
  border-right: 1px solid rgba(208, 237, 255, 0.36);
  border-bottom: 1px solid rgba(208, 237, 255, 0.36);
  transform: translateX(-50%) rotate(45deg);
}

.setup-rotate-arrow {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #dff5ff;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 10px rgba(177, 229, 255, 0.55);
}

.setup-rotate-label {
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}

.setup-rotate-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(213, 240, 255, 0.56);
  background: radial-gradient(
    circle at 30% 26%,
    rgba(226, 246, 255, 0.4),
    rgba(93, 156, 186, 0.16)
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 4px 10px rgba(9, 23, 55, 0.35);
  font-size: 0.98rem;
  color: #e5f8ff;
  transform-origin: 50% 50%;
}

.spin-wheel-btn {
  position: fixed;
  right: clamp(10px, 2.1vw, 30px);
  top: 57%;
  width: clamp(86px, 9.3vw, 118px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 208, 198, 0.7);
  border-radius: 50%;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  padding: 10px;
  background: radial-gradient(circle at 30% 26%, #ff9288 0%, #e5453c 42%, #a50f1a 100%);
  color: #fff4f2;
  box-shadow: 0 12px 24px rgba(79, 8, 19, 0.42), inset 0 2px 4px rgba(255, 235, 231, 0.34);
  cursor: pointer;
  z-index: 40;
  transform: translateY(-50%);
  transition: transform 160ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.spin-wheel-btn::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(255, 239, 235, 0.62);
  opacity: 0.66;
}

.spin-wheel-btn::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(255, 141, 131, 0.56);
  opacity: 0.3;
}

.spin-wheel-btn-icon {
  font-size: clamp(1.12rem, 1.9vw, 1.46rem);
  line-height: 1;
  font-weight: 700;
}

.spin-wheel-btn-label {
  font-size: clamp(0.6rem, 0.88vw, 0.74rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.spin-wheel-btn:hover:not(:disabled) {
  transform: translateY(calc(-50% - 2px)) scale(1.02);
  box-shadow: 0 16px 30px rgba(95, 10, 23, 0.5), inset 0 2px 4px rgba(255, 239, 236, 0.42);
}

.spin-wheel-btn:active:not(:disabled) {
  transform: translateY(-50%) scale(0.985);
}

.spin-wheel-btn:focus-visible {
  outline: 2px solid rgba(225, 246, 255, 0.95);
  outline-offset: 3px;
}

.spin-wheel-btn:disabled {
  opacity: 0.44;
  cursor: not-allowed;
  transform: translateY(-50%);
}

.spin-wheel-btn.is-ready {
  animation: spinWheelButtonReadyPulse 1.95s ease-in-out infinite;
}

.spin-wheel-btn.is-spinning {
  background: radial-gradient(circle at 30% 26%, #ffc7bf 0%, #ff6f60 40%, #bf1c2a 100%);
  box-shadow: 0 18px 32px rgba(92, 10, 24, 0.55), inset 0 1px 4px rgba(255, 232, 227, 0.54);
}

.spin-wheel-btn.is-spinning::after {
  animation: spinWheelButtonRingPulse 700ms ease-in-out infinite;
}

.spin-wheel-btn.is-spinning .spin-wheel-btn-icon {
  animation: spinWheelButtonIconSpin 620ms linear infinite;
}

.wheel-shell.auto-spinning .setup-rotate-cue::after {
  animation-duration: 1.1s;
}

.wheel-shell.auto-spinning .setup-rotate-cue,
.wheel-shell.auto-spinning .setup-rotate-hint {
  opacity: 0;
  animation: none;
}

.wheel-shell.auto-spinning .setup-rotate-cue::before,
.wheel-shell.auto-spinning .setup-rotate-cue::after,
.wheel-shell.auto-spinning .setup-rotate-arrow,
.wheel-shell.auto-spinning .setup-rotate-icon {
  animation: none;
}

.wheel-shell.setup-mode .setup-rotate-cue {
  opacity: 0.96;
  animation: setupRotateCuePulse 2.25s ease-in-out infinite;
}

.wheel-shell.setup-mode .setup-rotate-cue::before {
  animation: setupRotateCuePulseInner 2.25s ease-in-out infinite;
}

.wheel-shell.setup-mode .setup-rotate-cue::after {
  animation: setupRotateCueOrbit 1.85s linear infinite;
}

.wheel-shell.setup-mode .setup-rotate-hint {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  animation: setupRotateHintFloat 2.25s ease-in-out infinite;
}

.wheel-shell.setup-mode .setup-rotate-arrow {
  animation: setupRotateArrowPulse 1.25s ease-in-out infinite;
}

.wheel-shell.setup-mode .setup-rotate-icon {
  animation: setupRotateIcon 1.45s cubic-bezier(0.25, 0.78, 0.36, 1) infinite;
}

.shutter {
  display: none;
}

.pointer-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}

.pointer-layer.dragging {
  cursor: grabbing;
}

.pointer-layer.locked {
  cursor: default;
}

.spindle {
  position: absolute;
  left: var(--pivot-x-px);
  top: var(--pivot-y-px);
  width: var(--spindle-width-px);
  height: var(--spindle-length-px);
  transform: translate(-50%, -100%) rotate(0deg);
  transform-origin: 50% 100%;
  border-radius: 999px;
  background: #c43b4a;
  border: 0;
  box-shadow: 0 0 0 1px rgba(122, 22, 38, 0.22), 0 1px 2px rgba(122, 22, 38, 0.22);
}

.pivot {
  position: absolute;
  left: var(--pivot-x-px);
  top: var(--pivot-y-px);
  transform: translate(-50%, -50%);
  width: clamp(88px, 11.8vw, 142px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #bf3742;
  border: 0;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28), inset 0 2px 2px rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  color: #34080d;
  font-size: clamp(1.5rem, 3.2vw, 2.15rem);
  letter-spacing: 0.04em;
}

.score-popup {
  position: fixed;
  left: var(--score-popup-left-px, 50vw);
  top: var(--score-popup-top-px, 116px);
  transform: translate(-50%, 8px) scale(0.98);
  z-index: 30;
  font-size: clamp(1.3rem, 3.8vw, 2.2rem);
  font-weight: 700;
  color: #ffd978;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.42);
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 260ms ease, transform 260ms ease;
}

.score-popup.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.score-popup.hiding {
  opacity: 0;
  transform: translate(-50%, -36px) scale(0.96);
  transition: opacity 1100ms ease-out, transform 1100ms cubic-bezier(0.19, 1, 0.22, 1);
}

.spectrum-card {
  position: absolute;
  left: 50%;
  top: calc(70% - clamp(116px, 15vw, 182px));
  transform: translateX(-50%);
  width: clamp(310px, 45vw, 540px);
  height: clamp(84px, 11.2vw, 138px);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
  z-index: 8;
  pointer-events: none;
}

.spectrum-side {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(8px, 1.6vw, 12px);
  color: #0d1217;
  font-size: clamp(1.25rem, 2.8vw, 2.05rem);
  font-weight: 500;
}

.spectrum-left {
  background: #db6d52;
}

.spectrum-right {
  background: #97bdcb;
}

.spectrum-arrow {
  font-size: clamp(2.4rem, 4.8vw, 3.4rem);
  line-height: 0.8;
}

.new-tag {
  display: none;
}

.control-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  border-radius: 0;
  border: 0;
  background: #0a1638;
  box-shadow: none;
  padding: 10px 12px;
  margin: 0;
  z-index: 20;
}

.actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  position: relative;
}

#newGameBtn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  margin-top: auto;
  margin-bottom: auto;
}

.btn {
  border: 1px solid rgba(221, 231, 252, 0.2);
  border-radius: 11px;
  color: #f6f8ff;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #58bcc8 0%, #4ca9bb 60%, #3b95ab 100%);
  box-shadow: 0 9px 16px rgba(8, 27, 58, 0.27);
}

.btn-secondary {
  background: linear-gradient(135deg, #3f4c93 0%, #313c7b 100%);
  box-shadow: 0 9px 16px rgba(8, 27, 58, 0.25);
}

.btn.btn-reveal-live {
  border-color: rgba(255, 168, 168, 0.38);
  background: linear-gradient(135deg, #ff5a5f 0%, #ef2f3a 58%, #d31522 100%);
  box-shadow: 0 10px 18px rgba(110, 8, 19, 0.38);
}

.btn-ghost {
  color: #f2f6ff;
  background: rgba(84, 96, 158, 0.46);
  box-shadow: 0 9px 16px rgba(8, 27, 58, 0.18);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes teamCardActivePulse {
  0%,
  100% {
    box-shadow: 0 16px 30px rgba(2, 8, 30, 0.44),
      inset 0 0 0 1px rgba(168, 212, 235, 0.56);
  }
  50% {
    box-shadow: 0 20px 34px rgba(2, 8, 30, 0.52),
      inset 0 0 0 1px rgba(182, 226, 248, 0.7);
  }
}

@keyframes setupRotateCuePulse {
  0% {
    transform: translate(-50%, -50%) scale(0.985);
    opacity: 0.82;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.015);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.985);
    opacity: 0.82;
  }
}

@keyframes setupRotateCuePulseInner {
  0% {
    transform: scale(0.985);
    opacity: 0.62;
  }
  50% {
    transform: scale(1);
    opacity: 0.95;
  }
  100% {
    transform: scale(0.985);
    opacity: 0.62;
  }
}

@keyframes setupRotateCueOrbit {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes setupRotateIcon {
  0% {
    transform: rotate(0deg);
  }
  62% {
    transform: rotate(316deg) scale(1.06);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes setupRotateHintFloat {
  0%,
  100% {
    transform: translate(-50%, 0) scale(1);
  }
  50% {
    transform: translate(-50%, -2px) scale(1.01);
  }
}

@keyframes setupRotateArrowPulse {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.72;
  }
  50% {
    transform: translateX(3px);
    opacity: 1;
  }
}

@keyframes spinWheelButtonReadyPulse {
  0%,
  100% {
    transform: translateY(-50%) scale(1);
    box-shadow: 0 12px 24px rgba(79, 8, 19, 0.42),
      inset 0 2px 4px rgba(255, 235, 231, 0.34);
  }
  50% {
    transform: translateY(-50%) scale(1.03);
    box-shadow: 0 17px 32px rgba(102, 12, 27, 0.54),
      inset 0 2px 5px rgba(255, 234, 230, 0.46);
  }
}

@keyframes spinWheelButtonRingPulse {
  0%,
  100% {
    opacity: 0.22;
    transform: scale(1);
  }
  50% {
    opacity: 0.58;
    transform: scale(1.05);
  }
}

@keyframes spinWheelButtonIconSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1140px) {
  .app {
    width: min(98vw, 980px);
  }

  .wheel-shell {
    width: min(94vw, 820px);
  }
}

@media (min-width: 1500px) {
  :root {
    --wheel-offset-y: -34px;
  }

  .wheel-shell {
    width: min(76vw, 1040px);
  }
}

@media (max-width: 900px) {
  :root {
    --wheel-offset-y: -56px;
  }

  .app {
    height: calc(100svh - 8px);
    margin: 4px auto;
    gap: 8px;
  }

  .top-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 8px;
    min-height: clamp(124px, 19vh, 166px);
    padding: 10px;
  }

  .status-cluster {
    grid-column: 1 / -1;
    order: 3;
  }

  .team-left,
  .team-right {
    width: 100%;
  }

  .team-right {
    justify-self: end;
  }

  .wheel-shell {
    aspect-ratio: 1 / 1.08;
  }

  .spin-wheel-btn {
    right: clamp(8px, 2vw, 16px);
    top: 60%;
    width: clamp(78px, 15vw, 98px);
    gap: 3px;
    padding: 8px;
  }

  .setup-rotate-cue {
    width: min(calc(var(--face-radius-px) * 2.02), 96%);
  }

  .setup-rotate-hint {
    top: max(
      6px,
      calc(var(--pivot-y-px) - var(--face-radius-px) - clamp(50px, 7.2vw, 66px))
    );
    padding: 7px 10px;
    font-size: 0.72rem;
  }

  .new-tag {
    right: 18%;
  }

  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #newGameBtn {
    position: static;
    right: auto;
    top: auto;
    bottom: auto;
    margin-top: 0;
    margin-bottom: 0;
    grid-column: 2;
  }

  .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  :root {
    --wheel-offset-y: -54px;
  }

  body {
    overflow-y: auto;
  }

  .app {
    min-height: 100svh;
    height: auto;
    padding-bottom: 0;
  }

  .team-card {
    padding: 8px 10px;
    border-radius: 12px;
  }

  .team-name {
    font-size: 0.8rem;
  }

  .team-score {
    font-size: 1.45rem;
  }

  .wheel-shell {
    width: 100%;
  }

  .spin-wheel-btn {
    right: 6px;
    top: 62%;
    width: clamp(70px, 20vw, 88px);
    gap: 2px;
    padding: 6px;
  }

  .spin-wheel-btn-label {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
  }

  .wheel-shell {
    --slope-inset-x: 6%;
  }

  .wheel-shell::after {
    left: 17%;
    right: 17%;
    bottom: -13%;
    -webkit-clip-path: polygon(0 0, 50% 30%, 100% 0, 100% 100%, 0 100%);
    clip-path: polygon(0 0, 50% 30%, 100% 0, 100% 100%, 0 100%);
  }

  .spectrum-card {
    top: calc(70% - clamp(106px, 24vw, 150px));
    width: min(90vw, 420px);
    height: clamp(74px, 16vw, 112px);
  }

  .spectrum-side {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
  }

  .spectrum-arrow {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  .setup-rotate-hint {
    top: max(
      4px,
      calc(var(--pivot-y-px) - var(--face-radius-px) - clamp(42px, 8.5vw, 56px))
    );
    gap: 8px;
    padding: 6px 8px;
    font-size: 0.66rem;
  }

  .setup-rotate-arrow {
    width: 15px;
    height: 15px;
    font-size: 0.86rem;
  }

  .setup-rotate-icon {
    width: 19px;
    height: 19px;
    font-size: 0.88rem;
  }

  .new-tag {
    right: 11%;
    bottom: 2.2%;
    padding: 5px 13px;
  }

  .control-panel {
    padding: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-card.active,
  .wheel-shell.setup-mode .setup-rotate-cue,
  .wheel-shell.setup-mode .setup-rotate-cue::before,
  .wheel-shell.setup-mode .setup-rotate-cue::after,
  .wheel-shell.setup-mode .setup-rotate-hint,
  .wheel-shell.setup-mode .setup-rotate-arrow,
  .wheel-shell.setup-mode .setup-rotate-icon,
  .spin-wheel-btn.is-ready,
  .spin-wheel-btn.is-spinning::after,
  .spin-wheel-btn.is-spinning .spin-wheel-btn-icon {
    animation: none;
  }
}
