:root {
  --wheel-primary: #f21f4b;
  --wheel-accent: #fff24d;
  --wheel-bg: #09070d;
  --line: rgba(255, 255, 255, 0.16);
  --panel: rgba(15, 14, 22, 0.82);
  --text: #ffffff;
  --muted: #bbb8c8;
  --danger: #ff4567;
  --success: #61ffa1;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--text);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
.outline-link {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  color: #130912;
  background: linear-gradient(135deg, var(--wheel-accent), #ffb347);
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

button:hover,
.outline-link:hover {
  filter: brightness(1.06);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

input[type="color"] {
  padding: 4px;
}

textarea {
  padding: 12px;
  resize: vertical;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.toggle-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--wheel-accent);
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--wheel-accent);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-text {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.status-text[data-type="success"] {
  color: var(--success);
}

.status-text[data-type="error"] {
  color: #ff92a5;
}

.wheel-admin-page {
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(242, 31, 75, 0.28), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(65, 217, 255, 0.18), transparent 24%),
    linear-gradient(135deg, #09070d, #17101f 48%, #08060b);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1280px, 100%);
  margin: 0 auto 20px;
}

.admin-header h1,
.admin-card h2 {
  margin: 0;
}

.header-actions,
.control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.outline-link,
.neutral-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.admin-main {
  width: min(1280px, 100%);
  margin: 0 auto;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: var(--panel);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.login-card {
  max-width: 480px;
}

.login-form,
.settings-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.dashboard {
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  gap: 18px;
}

.settings-column {
  display: grid;
  align-self: start;
  gap: 18px;
}

.card-heading {
  margin-bottom: 14px;
}

.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.messages-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.count-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
  font-weight: 900;
}

.wheel-control-card {
  display: grid;
  gap: 16px;
}

.admin-preview {
  display: grid;
  grid-template-columns: minmax(360px, 0.72fr) minmax(220px, 0.28fr);
  gap: 18px;
  align-items: center;
}

#admin-wheel {
  width: min(100%, 640px);
  aspect-ratio: 1;
}

.admin-winner {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.08);
}

.admin-winner span {
  color: var(--wheel-accent);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-winner strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.6rem, 4vw, 3.8rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.winner-decision {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.winner-decision button {
  flex: 1 1 160px;
}

.wheel-display-page {
  width: 100vw;
  min-height: 100vh;
  overflow: hidden;
  background: transparent;
}

.wheel-stage {
  position: relative;
  display: grid;
  width: 100vw;
  min-height: 100vh;
  place-items: center;
  padding: clamp(18px, 3vw, 48px);
}

.wheel-stage.background-transparent {
  background: transparent;
}

.wheel-stage.background-dark {
  background:
    radial-gradient(circle at 18% 20%, rgba(242, 31, 75, 0.32), transparent 28%),
    radial-gradient(circle at 84% 16%, rgba(65, 217, 255, 0.2), transparent 24%),
    linear-gradient(135deg, #09070d, #17101f 48%, #08060b);
}

.wheel-stage.background-solid {
  background: var(--wheel-bg);
}

.wheel-stage.background-gradient {
  background:
    radial-gradient(circle at 16% 22%, color-mix(in srgb, var(--wheel-primary), transparent 58%), transparent 28%),
    radial-gradient(circle at 84% 16%, color-mix(in srgb, var(--wheel-accent), transparent 64%), transparent 24%),
    linear-gradient(135deg, var(--wheel-bg), #0d0b12);
}

.wheel-stage.theme-elegant-gold {
  --wheel-primary: #d7aa3f;
  --wheel-accent: #fff3bd;
  --wheel-bg: #080705;
}

.wheel-stage.theme-clean-minimal {
  --wheel-primary: #f21f4b;
  --wheel-accent: #111827;
  --wheel-bg: #f6f7fb;
}

.wheel-stage.theme-festival-pop {
  --wheel-primary: #ff3d7f;
  --wheel-accent: #23d18b;
  --wheel-bg: #171022;
}

.wheel-stage.theme-cyber-glass {
  --wheel-primary: #65f7ff;
  --wheel-accent: #a78bfa;
  --wheel-bg: #05080d;
}

.wheel-show {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(520px, 0.58fr);
  gap: clamp(18px, 3vw, 48px);
  align-items: center;
  width: min(1500px, 100%);
}

.wheel-only .wheel-show {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
}

.wheel-only .wheel-title {
  display: none;
}

.wheel-title {
  display: grid;
  gap: 18px;
}

.display-logo {
  width: min(260px, 68%);
  max-height: 110px;
  object-fit: contain;
  object-position: left center;
}

.wheel-title p {
  margin: 0 0 12px;
  color: var(--wheel-accent);
  font-size: clamp(1rem, 1.8vw, 1.55rem);
  font-weight: 900;
  text-transform: uppercase;
}

.wheel-title h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(3.4rem, 7vw, 8.5rem);
  font-weight: 900;
  line-height: 0.88;
  text-transform: uppercase;
}

.wheel-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
}

#wheel-canvas {
  width: min(84vh, 72vw);
  max-width: 860px;
  aspect-ratio: 1;
  filter: drop-shadow(0 26px 80px rgba(0, 0, 0, 0.42));
}

.wheel-only #wheel-canvas {
  width: min(88vh, 88vw);
  max-width: 980px;
}

.winner-pointer {
  position: absolute;
  top: max(-34px, calc(50% - min(88vh, 88vw) / 2 - 30px));
  z-index: 3;
  width: clamp(24px, 3vw, 44px);
  height: clamp(34px, 4vw, 58px);
  background: linear-gradient(180deg, #fff, var(--wheel-accent));
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

.winner-zoom {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 4;
  display: grid;
  width: min(360px, 42vw);
  min-height: 86px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  padding: 12px 18px 14px;
  background: rgba(10, 8, 16, 0.82);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(16px);
  transform: translate(-50%, -50%);
}

.winner-zoom > span {
  color: var(--wheel-accent);
  font-size: 0.66rem;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
}

.winner-zoom strong {
  --winner-font-size: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  max-height: 70px;
  margin-top: 6px;
  color: #fff;
  font-size: var(--winner-font-size);
  line-height: 1.02;
  text-align: center;
  text-transform: none;
  overflow-wrap: normal;
  word-break: normal;
  overflow: visible;
}

.winner-line {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-transform: none;
  overflow: visible;
  overflow-wrap: break-word;
  text-overflow: clip;
  white-space: normal;
}

.winner-zoom[data-length="medium"],
.winner-zoom[data-length="long"] {
  width: min(400px, 46vw);
}

.winner-zoom[data-length="medium"] strong,
.winner-zoom[data-length="long"] strong {
  line-height: 0.98;
}

.winner-pop {
  animation: winnerPop 900ms cubic-bezier(0.18, 0.95, 0.2, 1.18) both;
}

@keyframes winnerPop {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.34) translateY(36px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) translateY(0);
  }
}

.effect-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
}

.confetti-bit,
.sparkle-bit {
  position: absolute;
  top: -12vh;
  left: var(--x);
  width: 11px;
  height: 18px;
  border-radius: 3px;
  animation: confettiFall 4.4s var(--delay) ease-in forwards;
}

.sparkle-bit {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  box-shadow: 0 0 16px currentColor;
}

@keyframes confettiFall {
  to {
    transform: translate(var(--dx), 118vh) rotate(var(--rot));
    opacity: 0.8;
  }
}

.firework {
  position: absolute;
  width: 2px;
  height: 2px;
  animation: fireworkPop 1.2s ease-out both;
}

.firework i {
  position: absolute;
  left: 0;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  box-shadow: 0 0 14px currentColor;
}

@keyframes fireworkPop {
  0% {
    opacity: 0;
    transform: scale(0.1);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

.spotlight-effect {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 38%);
  animation: spotlightPulse 2.8s ease both;
}

@keyframes spotlightPulse {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.7);
  }
  35%,
  70% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@media (max-width: 920px) {
  .dashboard,
  .admin-preview,
  .two-fields,
  .wheel-show {
    grid-template-columns: 1fr;
  }

  .admin-header,
  .messages-heading {
    align-items: stretch;
    flex-direction: column;
  }

  #wheel-canvas {
    width: min(82vw, 70vh);
  }

  .wheel-title h1 {
    font-size: clamp(2.8rem, 14vw, 5.4rem);
  }
}
