:root {
  --navy: #211b5e;
  --purple: #302979;
  --red: #ed3f59;
  --yellow: #f5c928;
  --blue: #69b8cf;
  --gold: #d4af37;
  --gold-deep: #b88d20;
  --white: #ffffff;
  --ink: #171344;
  --muted: #6e6a8a;
  --soft: #f7f6fb;
  --line: rgba(33, 27, 94, 0.12);
  --shadow: 0 22px 70px rgba(33, 27, 94, 0.16);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-en: "Montserrat", Arial, sans-serif;
  --font-ar: "Cairo", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: var(--font-en);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[dir="rtl"],
.admin-body {
  font-family: var(--font-ar);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

img {
  max-width: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

/* -------------------- Public experience -------------------- */

.public-body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 12%, rgba(237, 63, 89, 0.13), transparent 25%),
    radial-gradient(circle at 90% 8%, rgba(245, 201, 40, 0.12), transparent 24%),
    radial-gradient(circle at 92% 86%, rgba(105, 184, 207, 0.14), transparent 25%),
    linear-gradient(145deg, #171344 0%, #211b5e 52%, #302979 100%);
}

.public-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
              linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.brand-orb {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(1px);
  opacity: 0.82;
  animation: floatOrb 10s ease-in-out infinite;
}

.orb-red {
  width: 90px;
  height: 90px;
  left: 5vw;
  top: 18vh;
  background: var(--red);
}

.orb-yellow {
  width: 58px;
  height: 58px;
  right: 8vw;
  top: 15vh;
  background: var(--yellow);
  animation-delay: -2.2s;
}

.orb-blue {
  width: 74px;
  height: 74px;
  right: 5vw;
  bottom: 13vh;
  background: var(--blue);
  animation-delay: -4.1s;
}

.dot-grid {
  position: fixed;
  z-index: 0;
  width: 150px;
  height: 150px;
  left: 4vw;
  bottom: 8vh;
  opacity: 0.18;
  background-image: radial-gradient(var(--white) 1.5px, transparent 1.5px);
  background-size: 16px 16px;
  pointer-events: none;
}

.public-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 42px 22px 32px;
  display: grid;
  place-items: center;
}

.public-app {
  width: 100%;
  text-align: center;
}

.spin-header {
  width: min(100%, 760px);
  margin: 0 auto 22px;
  color: var(--white);
}

.spin-logo {
  width: min(190px, 44vw);
  margin: 0 auto 18px;
}

.brand-kicker,
.panel-kicker {
  margin: 0 0 7px;
  color: var(--yellow);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.spin-header h1 {
  margin: 0;
  color: var(--white);
  font-size: clamp(2.25rem, 7vw, 4.55rem);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: -0.055em;
}

.spin-subtitle {
  max-width: 660px;
  margin: 16px auto 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(0.95rem, 2.1vw, 1.12rem);
  line-height: 1.75;
}

.brand-card,
.panel-card,
.stat-card,
.registration-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.state-card {
  width: min(100%, 520px);
  padding: 38px 30px;
  border-radius: var(--radius-xl);
  text-align: center;
}

.state-logo,
.admin-login-logo {
  width: min(190px, 52vw);
  margin: 0 auto 24px;
}

.state-card h1 {
  margin: 15px 0 8px;
  color: var(--navy);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
}

.state-card p {
  margin: 0 auto 22px;
  line-height: 1.7;
}

.loader {
  width: 46px;
  height: 46px;
  margin: 6px auto 0;
  border: 4px solid rgba(33, 27, 94, 0.13);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spinLoader 0.9s linear infinite;
}

.state-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--red);
  font-weight: 900;
  font-size: 1.4rem;
}

.registration-card {
  width: min(100%, 560px);
  margin: 30px auto 0;
  padding: clamp(25px, 5vw, 38px);
  border-radius: var(--radius-xl);
  text-align: left;
}

.registration-heading {
  margin-bottom: 25px;
  text-align: center;
}

.step-badge {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--navy);
  background: rgba(245, 201, 40, 0.28);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.registration-heading h2 {
  margin: 13px 0 8px;
  color: var(--navy);
  font-size: clamp(1.45rem, 4.5vw, 2rem);
  line-height: 1.2;
}

.registration-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.registration-form,
.stack-form {
  display: grid;
  gap: 16px;
}

.registration-form label,
.stack-form label,
.compact-form label {
  display: grid;
  gap: 7px;
}

.registration-form label > span,
.stack-form label > span,
.compact-form label > span {
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(33, 27, 94, 0.14);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input,
select {
  min-height: 50px;
  padding: 0 15px;
}

textarea {
  min-height: 108px;
  padding: 13px 15px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(48, 41, 121, 0.1);
}

input.input-error {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(237, 63, 89, 0.1);
}

.field-error,
.form-message {
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.4;
}

.form-message {
  margin: 0;
  padding: 10px 12px;
  border-radius: 11px;
  text-align: center;
  background: rgba(237, 63, 89, 0.09);
}

.registration-button {
  width: 100% !important;
  margin-top: 4px;
}

.privacy-note {
  margin: -1px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
  text-align: center;
  line-height: 1.55;
}

.wheel-view {
  padding-top: 2px;
}

.participant-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(92vw, 430px);
  margin-top: 3px;
  padding: 9px 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 12px 30px rgba(7, 4, 31, 0.14);
  backdrop-filter: blur(12px);
  font-size: 0.88rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wheel-stage {
  position: relative;
  width: min(500px, 88vw);
  aspect-ratio: 1;
  margin: 24px auto 18px;
  filter: drop-shadow(0 28px 45px rgba(7, 4, 31, 0.4));
}

.wheel-stage::before {
  content: "";
  position: absolute;
  inset: -11px;
  z-index: -1;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--white), rgba(255, 255, 255, 0.58));
  box-shadow: inset 0 0 0 2px rgba(33, 27, 94, 0.12), 0 18px 40px rgba(7, 4, 31, 0.25);
}

.wheel {
  position: absolute;
  inset: 0;
  border: 5px solid var(--white);
  border-radius: 50%;
  overflow: hidden;
  transform: rotate(0deg);
  transition: transform 5.2s cubic-bezier(0.12, 0.74, 0.14, 1);
  will-change: transform;
}

.wheel.no-transition {
  transition: none !important;
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.22), transparent 28%),
    radial-gradient(circle, transparent 60%, rgba(33, 27, 94, 0.08) 100%);
}

.wheel-labels {
  position: absolute;
  inset: 0;
}

.wheel-label {
  position: absolute;
  z-index: 2;
  width: 31%;
  transform: translate(-50%, -50%);
  color: var(--white);
  font-size: clamp(0.6rem, 2.1vw, 0.92rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-align: center;
  text-shadow: 0 2px 5px rgba(15, 11, 55, 0.42);
  overflow-wrap: anywhere;
}

.wheel-label.is-light {
  color: var(--navy);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.25);
}

.wheel-label.is-vip {
  width: 22%;
  color: var(--navy);
  font-size: clamp(0.52rem, 1.65vw, 0.76rem);
  text-shadow: none;
}

.wheel-label.is-small-slice {
  width: 20%;
  font-size: clamp(0.5rem, 1.55vw, 0.7rem);
}

.wheel-label.is-large-slice {
  width: 34%;
  font-size: clamp(0.72rem, 2.35vw, 1rem);
}

.pointer {
  position: absolute;
  z-index: 9;
  top: -13px;
  left: 50%;
  width: 54px;
  height: 66px;
  transform: translateX(-50%);
  filter: drop-shadow(0 7px 7px rgba(7, 4, 31, 0.32));
}

.pointer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 44px;
  height: 44px;
  border: 5px solid var(--white);
  border-radius: 50%;
  background: var(--red);
  transform: translateX(-50%);
}

.pointer span {
  position: absolute;
  left: 50%;
  top: 34px;
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 27px solid var(--red);
  transform: translateX(-50%);
}

.wheel-center {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 50%;
  width: 25%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-content: center;
  gap: 2px;
  border: 6px solid var(--white);
  border-radius: 50%;
  color: var(--white);
  background: var(--navy);
  box-shadow: 0 10px 30px rgba(7, 4, 31, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.center-top {
  font-size: clamp(0.7rem, 2vw, 1rem);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.center-bottom {
  color: var(--yellow);
  font-size: clamp(0.38rem, 1vw, 0.56rem);
  font-weight: 800;
  letter-spacing: 0.06em;
}

.spin-button,
.primary-btn,
.secondary-btn,
.danger-btn,
.danger-ghost-btn,
.table-btn {
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.spin-button {
  width: min(340px, 88vw);
  min-height: 58px;
  padding: 0 24px;
  color: var(--white);
  background: var(--red);
  box-shadow: 0 15px 34px rgba(237, 63, 89, 0.3);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
}

.spin-button:hover:not(:disabled),
.primary-btn:hover:not(:disabled),
.secondary-btn:hover:not(:disabled),
.danger-btn:hover:not(:disabled),
.danger-ghost-btn:hover:not(:disabled),
.table-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.spin-button:disabled,
.primary-btn:disabled,
.secondary-btn:disabled,
.danger-btn:disabled,
.danger-ghost-btn:disabled,
.table-btn:disabled {
  opacity: 0.62;
}

.spin-status {
  min-height: 24px;
  margin: 12px auto 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 600;
}

.result-card {
  width: min(100%, 540px);
  margin: 22px auto 0;
  padding: 25px 24px 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.result-prefix {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.result-card h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.75rem, 6vw, 2.7rem);
  line-height: 1.1;
}

.result-note {
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.result-seal {
  display: inline-flex;
  margin-top: 15px;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--navy);
  background: rgba(105, 184, 207, 0.2);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.spin-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px auto 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.72rem;
}

.confetti {
  position: fixed;
  z-index: 50;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -18px;
  width: 9px;
  height: 15px;
  border-radius: 2px;
  animation: confettiFall 3s ease-in forwards;
}

/* -------------------- Admin -------------------- */

.admin-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 0 0, rgba(105, 184, 207, 0.14), transparent 22%),
    radial-gradient(circle at 100% 0, rgba(237, 63, 89, 0.11), transparent 22%),
    var(--soft);
}

.admin-shell {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 30px 22px 50px;
}

.login-card,
.setup-card {
  width: min(100%, 500px);
  margin: max(7vh, 45px) auto 0;
  padding: 36px;
  border-radius: var(--radius-xl);
  text-align: center;
}

.login-card h1,
.setup-card h1 {
  margin: 4px 0 8px;
  color: var(--navy);
  font-size: 2rem;
}

.login-card .stack-form {
  margin-top: 25px;
  text-align: right;
}

.dashboard {
  display: grid;
  gap: 20px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 25px 27px;
  border-radius: var(--radius-xl);
  color: var(--white);
  background: linear-gradient(135deg, var(--navy), var(--purple));
  box-shadow: 0 18px 50px rgba(33, 27, 94, 0.2);
}

.admin-title-block {
  display: flex;
  align-items: center;
  gap: 19px;
}

.admin-header-logo {
  width: 150px;
  flex: 0 0 auto;
}

.admin-header h1 {
  margin: 0;
  font-family: var(--font-en);
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.1;
}

.admin-header .muted {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.68);
}

.header-actions,
.results-actions,
.row-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.danger-ghost-btn {
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.primary-btn {
  color: var(--white);
  background: var(--red);
  box-shadow: 0 10px 24px rgba(237, 63, 89, 0.2);
}

.secondary-btn {
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line);
}

.admin-header .secondary-btn {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.96);
}

.danger-ghost-btn {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
}

.danger-btn {
  color: var(--white);
  background: var(--red);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-color: var(--line);
  border-radius: var(--radius-lg);
}

.stat-card::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  left: -25px;
  bottom: -27px;
  border-radius: 50%;
  background: rgba(105, 184, 207, 0.16);
}

.stat-card:nth-child(2)::after {
  background: rgba(237, 63, 89, 0.14);
}

.stat-card:nth-child(3)::after {
  background: rgba(245, 201, 40, 0.18);
}

.stat-card span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 7px;
  color: var(--navy);
  font-family: var(--font-en);
  font-size: 2.25rem;
  line-height: 1;
}

.panel-card {
  padding: 24px;
  border-color: var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 44px rgba(33, 27, 94, 0.09);
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2,
.results-heading h2,
.settings-details summary strong {
  margin: 0;
  color: var(--navy);
  font-size: 1.35rem;
}

.panel-heading p,
.results-heading p {
  margin: 6px 0 0;
  line-height: 1.65;
}

.compact-heading,
.results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.result-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.breakdown-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--white);
}

.breakdown-dot,
.prize-color-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(33, 27, 94, 0.05);
}

.breakdown-card strong {
  display: block;
  color: var(--navy);
  font-size: 0.82rem;
}

.breakdown-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
}

.breakdown-card b {
  color: var(--navy);
  font-family: var(--font-en);
  font-size: 1.45rem;
}

.search-input {
  width: min(285px, 100%);
}

.filter-select {
  width: 150px;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  background: var(--white);
}

th,
td {
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: rgba(33, 27, 94, 0.035);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

td {
  color: var(--ink);
  font-size: 0.81rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(105, 184, 207, 0.045);
}

.status-pill,
.result-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.used {
  color: var(--navy);
  background: rgba(105, 184, 207, 0.22);
}

.status-pill.unused {
  color: var(--navy);
  background: rgba(245, 201, 40, 0.24);
}

.result-pill {
  color: var(--navy);
  background: rgba(33, 27, 94, 0.055);
}

.result-pill i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.table-btn {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.7rem;
}

.table-btn.reset {
  color: var(--navy);
  background: rgba(105, 184, 207, 0.19);
}

.table-btn.delete {
  color: var(--red);
  background: rgba(237, 63, 89, 0.09);
}

.empty-state {
  padding: 35px 20px;
  color: var(--muted);
  text-align: center;
  background: var(--white);
}

.settings-details {
  padding: 0;
  overflow: hidden;
}

.settings-details > summary {
  min-height: 78px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
}

.settings-details > summary::-webkit-details-marker {
  display: none;
}

.summary-arrow {
  color: var(--navy);
  font-size: 1.5rem;
  transition: transform 0.2s ease;
}

.settings-details[open] .summary-arrow {
  transform: rotate(180deg);
}

.settings-content {
  padding: 0 24px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  border-top: 1px solid var(--line);
}

.settings-content > article {
  padding-top: 23px;
}

.security-card {
  grid-column: 1 / -1;
  padding-top: 20px !important;
  border-top: 1px solid var(--line);
}

.compact-form,
.inline-form {
  display: grid;
  gap: 13px;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.simple-prize-rows {
  display: grid;
  gap: 10px;
  margin-bottom: 15px;
}

.simple-prize-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 105px 64px;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.simple-prize-row .prize-name {
  color: var(--navy);
  font-family: var(--font-en);
  font-size: 0.82rem;
  font-weight: 800;
}

.simple-prize-row label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
}

.simple-prize-row label span {
  color: var(--muted);
  font-size: 0.67rem;
}

.simple-prize-row input {
  min-height: 40px;
  padding: 0 9px;
  text-align: center;
}

.prize-percent {
  color: var(--purple);
  font-family: var(--font-en);
  font-size: 0.9rem;
  text-align: left;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 25px;
  min-width: min(350px, calc(100vw - 32px));
  padding: 13px 18px;
  border-radius: 999px;
  transform: translateX(-50%);
  color: var(--white);
  background: var(--navy);
  box-shadow: 0 18px 45px rgba(33, 27, 94, 0.28);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.toast.error {
  background: var(--red);
}

.modal-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(23, 19, 68, 0.62);
  backdrop-filter: blur(6px);
}

.confirm-modal {
  width: min(100%, 450px);
  padding: 27px;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
}

.confirm-modal h2 {
  margin: 0 0 8px;
  color: var(--navy);
}

.confirm-modal p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

.modal-actions {
  justify-content: flex-start;
}

/* -------------------- Motion -------------------- */

@keyframes spinLoader {
  to { transform: rotate(360deg); }
}

@keyframes floatOrb {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -16px, 0); }
}

@keyframes confettiFall {
  0% { transform: translate3d(0, -10px, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(var(--drift), 105vh, 0) rotate(760deg); opacity: 0; }
}

/* -------------------- Responsive -------------------- */

@media (max-width: 1050px) {
  .result-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-header {
    align-items: flex-start;
  }

  .header-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 760px) {
  .public-shell {
    padding: 26px 14px 24px;
  }

  .brand-orb,
  .dot-grid {
    opacity: 0.42;
    transform: scale(0.76);
  }

  .spin-header {
    margin-bottom: 15px;
  }

  .spin-logo {
    width: 145px;
    margin-bottom: 13px;
  }

  .registration-card {
    margin-top: 21px;
    border-radius: 24px;
  }

  .wheel-stage {
    width: min(430px, 89vw);
  }

  .wheel-label {
    font-size: clamp(0.56rem, 2.4vw, 0.8rem);
  }

  .admin-shell {
    padding: 16px 12px 35px;
  }

  .admin-header {
    padding: 21px;
    flex-direction: column;
  }

  .admin-title-block {
    align-items: flex-start;
  }

  .admin-header-logo {
    width: 120px;
  }

  .header-actions,
  .results-actions {
    width: 100%;
  }

  .header-actions > *,
  .results-actions > * {
    flex: 1 1 auto;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .compact-heading,
  .results-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-input,
  .filter-select {
    width: 100%;
  }

  .settings-content {
    grid-template-columns: 1fr;
  }

  .security-card {
    grid-column: auto;
  }

  .two-cols,
  .inline-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .spin-header h1 {
    font-size: clamp(2.05rem, 12vw, 3.15rem);
  }

  .spin-subtitle {
    max-width: 340px;
    font-size: 0.86rem;
  }

  .wheel-stage {
    width: min(385px, 88vw);
    margin-top: 20px;
  }

  .pointer {
    top: -12px;
    transform: translateX(-50%) scale(0.88);
  }

  .wheel-center {
    border-width: 4px;
  }

  .spin-button {
    min-height: 54px;
  }

  .result-card {
    padding: 22px 18px;
  }

  .spin-footer {
    max-width: 330px;
  }

  .panel-card {
    padding: 18px;
  }

  .result-breakdown {
    grid-template-columns: 1fr;
  }

  .simple-prize-row {
    grid-template-columns: auto minmax(0, 1fr) 78px;
  }

  .simple-prize-row .prize-percent {
    grid-column: 2 / -1;
    text-align: right;
  }

  .admin-title-block {
    flex-direction: column;
  }

  .admin-header-logo {
    width: 132px;
  }

  .settings-details > summary {
    padding: 18px;
  }

  .settings-content {
    padding: 0 18px 18px;
  }

  .login-card,
  .setup-card {
    padding: 26px 20px;
  }
}

@media (max-width: 410px) {
  .public-shell {
    padding-inline: 10px;
  }

  .registration-card {
    padding: 22px 17px;
  }

  .wheel-label {
    width: 28%;
    font-size: 0.55rem;
  }

  .wheel-label.is-small-slice,
  .wheel-label.is-vip {
    width: 18%;
    font-size: 0.46rem;
  }

  .center-bottom {
    display: none;
  }

  .spin-footer {
    font-size: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* Dynamic wheel controls */
.wheel-controls-card {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
}

.wheel-controls-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.prize-controls-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.prize-control-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 1.3fr) 110px minmax(180px, .9fr) auto auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  transition: opacity .2s ease, border-color .2s ease, background .2s ease;
}

.prize-control-row.is-inactive {
  opacity: .64;
  background: #f8f8fb;
}

.prize-control-row label > span:first-child,
.prize-save-bar span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 700;
}

.prize-main-field input,
.prize-percent-field input,
.prize-color-hex {
  min-height: 42px;
}

.percent-input-wrap,
.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.percent-input-wrap input {
  width: 76px;
  text-align: center;
}

.percent-input-wrap b {
  color: var(--purple);
  font-family: var(--font-en);
}

.prize-color {
  width: 46px;
  height: 42px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
}

.prize-color-hex {
  width: 112px;
  direction: ltr;
  text-align: center;
  font-family: var(--font-en);
  text-transform: uppercase;
}

.prize-order-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.mini-icon-btn {
  width: 32px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--navy);
  background: var(--white);
  font-weight: 900;
}

.mini-icon-btn:hover:not(:disabled) {
  border-color: var(--purple);
}

.active-switch {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.active-switch > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 40px;
  height: 22px;
  margin: 0 !important;
  border-radius: 999px;
  background: #c9c8d5;
  transition: background .2s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 7px rgba(33,27,94,.22);
  transition: transform .2s ease;
}

.active-switch input:checked + .switch-track {
  background: var(--purple);
}

.active-switch input:checked + .switch-track::after {
  transform: translateX(-18px);
}

.switch-label {
  margin: 0 !important;
  min-width: 46px;
  color: var(--navy) !important;
}

.prize-delete-btn {
  min-height: 42px;
}

.prize-save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(33, 27, 94, .045);
}

.prize-save-bar > div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 10px;
}

.prize-save-bar strong {
  font-family: var(--font-en);
  font-size: 1.2rem;
}

.prize-save-bar strong.is-valid { color: #27885f; }
.prize-save-bar strong.is-invalid { color: var(--red); }
.prize-save-bar small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.breakdown-card.is-muted {
  opacity: .7;
}

@media (max-width: 1120px) {
  .prize-control-row {
    grid-template-columns: auto minmax(180px, 1fr) 100px minmax(170px, 1fr);
  }
  .active-switch,
  .prize-delete-btn {
    align-self: center;
  }
}

@media (max-width: 760px) {
  .wheel-controls-heading,
  .prize-save-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .prize-control-row {
    grid-template-columns: auto minmax(0, 1fr) 92px;
    align-items: end;
  }
  .prize-color-field {
    grid-column: 2 / -1;
  }
  .active-switch {
    grid-column: 2;
  }
  .prize-delete-btn {
    grid-column: 3;
  }
  .prize-save-bar .primary-btn {
    width: 100%;
  }
}

@media (max-width: 470px) {
  .prize-control-row {
    grid-template-columns: 1fr 1fr;
  }
  .prize-order-actions {
    grid-column: 1 / -1;
    width: 72px;
  }
  .prize-main-field,
  .prize-color-field {
    grid-column: 1 / -1;
  }
  .prize-percent-field { grid-column: 1; }
  .active-switch { grid-column: 2; }
  .prize-delete-btn { grid-column: 1 / -1; }
  .color-input-wrap { flex-wrap: wrap; }
}
