:root {
  color-scheme: dark;
  --gold: #ffd86a;
  --blue: #051c69;
  --red: #9e1010;
  --ink: #ffffff;
  --panel: rgba(3, 14, 54, 0.82);
  --line: rgba(255, 216, 106, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #031038 url("/assets/mobile-background.png") center top / cover no-repeat fixed;
  color: var(--ink);
}

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

.campaign-shell {
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: grid;
  place-items: start center;
}

.hero {
  width: min(100%, 460px);
  display: grid;
  justify-items: center;
  text-align: center;
}

.brand-mark {
  margin-top: 8px;
  font-size: clamp(34px, 11vw, 54px);
  font-weight: 950;
  line-height: 0.9;
  letter-spacing: 0;
  color: #fff;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.55);
}

.brand-mark span {
  color: #e51a45;
}

.brand-logo {
  display: block;
  width: min(42vw, 180px);
  height: auto;
  margin-top: 4px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.58));
}

.admin-brand-logo {
  width: 150px;
}

h1 {
  margin: 12px 0 6px;
  font-size: clamp(32px, 11vw, 52px);
  line-height: 0.94;
  letter-spacing: 0;
  color: var(--gold);
  text-shadow: 0 3px 0 #7a3100, 0 0 20px rgba(248, 198, 51, 0.48);
}

.subheadline {
  margin: 0 0 8px;
  max-width: 310px;
  font-size: 15px;
  line-height: 1.32;
  color: rgba(255, 255, 255, 0.9);
}

.wheel-stage {
  position: relative;
  width: min(94vw, 430px);
  aspect-ratio: 1;
  margin-top: 18px;
  display: grid;
  place-items: center;
}

.wheel {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  pointer-events: none;
}

.wheel {
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.45));
  transition: transform 4.8s cubic-bezier(0.12, 0.72, 0.08, 1);
}

.pointer {
  position: absolute;
  z-index: 2;
  top: -8%;
  left: 50%;
  width: 23%;
  height: auto;
  object-fit: contain;
  transform: translateX(-50%);
  transform-origin: top center;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.38));
}

.image-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.spin-button {
  width: min(78vw, 360px);
  margin-top: -8px;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.42));
}

.spin-button img {
  display: block;
  width: 100%;
  height: auto;
}

.spin-button:disabled {
  cursor: wait;
  opacity: 0.74;
}

.home-ticket-hero .wheel-stage {
  margin-bottom: 4px;
}

.status-message,
.ticket-message {
  min-height: 22px;
  margin: 10px 0 0;
  color: #ffeaa0;
  font-size: 14px;
  line-height: 1.35;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.72);
}

.ticket-panel {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(4, 30, 93, 0.82), rgba(47, 2, 18, 0.72));
  box-shadow: inset 0 0 30px rgba(255, 216, 106, 0.08), 0 14px 32px rgba(0, 0, 0, 0.28);
  text-align: left;
}

.ticket-panel-collapsed {
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.ticket-panel-primary {
  margin-top: -4px;
}

.ticket-toggle {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 216, 106, 0.52);
  border-radius: 999px;
  background: rgba(1, 11, 42, 0.58);
  color: #ffeaa0;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.72);
}

.ticket-toggle::after {
  content: " +";
}

.ticket-toggle[aria-expanded="true"]::after {
  content: " -";
}

.ticket-lookup {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(4, 30, 93, 0.86), rgba(47, 2, 18, 0.76));
  box-shadow: inset 0 0 30px rgba(255, 216, 106, 0.08), 0 14px 32px rgba(0, 0, 0, 0.28);
  text-align: left;
}

.ticket-kicker {
  margin: 0 0 4px;
  color: var(--gold);
  font-weight: 850;
  font-size: 17px;
}

.ticket-panel label {
  display: block;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.ticket-row {
  display: grid;
  gap: 9px;
}

.ticket-row input,
.ticket-row button,
.admin-card input,
.admin-card select,
.admin-card textarea,
.admin-card button {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 216, 106, 0.35);
}

.ticket-row input,
.admin-card input,
.admin-card select,
.admin-card textarea {
  min-height: 46px;
  padding: 0 13px;
  background: rgba(0, 9, 39, 0.8);
  color: white;
  outline: none;
}

.ticket-row button,
.admin-card button {
  min-height: 46px;
  padding: 0 12px;
  border: 0;
  background: linear-gradient(180deg, #ffe172, #c47d0a 58%, #8f2703);
  color: #120903;
  font-weight: 900;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 4, 23, 0.78);
  backdrop-filter: blur(5px);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(92vw, 390px);
  aspect-ratio: 1086 / 1448;
  animation: popIn 220ms ease-out both;
}

.modal-card > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.result-copy {
  position: absolute;
  left: 16%;
  right: 16%;
  top: 35%;
  height: 32%;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 3px 0 #5a1800, 0 0 18px rgba(255, 217, 82, 0.52);
}

.result-copy p {
  margin: 0;
  color: white;
  font-weight: 950;
  font-size: clamp(20px, 6.5vw, 31px);
}

.result-copy strong {
  margin-top: 4px;
  color: var(--gold);
  font-size: clamp(46px, 16vw, 74px);
  line-height: 0.95;
}

.result-copy span {
  margin-top: 8px;
  color: white;
  font-size: clamp(20px, 6vw, 31px);
  font-weight: 950;
  line-height: 1.08;
}

.ticket-code-line {
  margin-top: 10px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 216, 106, 0.5);
  border-radius: 999px;
  background: rgba(1, 11, 42, 0.66);
  color: #fff5bf;
  font-size: clamp(11px, 3.4vw, 15px);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.1;
  text-shadow: none;
}

.ticket-code-line b {
  color: var(--gold);
}

.claim-hit-area {
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 8.5%;
  height: 12%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.admin-page {
  background: #071034;
}

.admin-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-header h1 {
  margin: 0;
  font-size: clamp(27px, 5vw, 42px);
}

.admin-grid,
.stats-grid {
  display: grid;
  gap: 14px;
}

.admin-grid {
  grid-template-columns: minmax(0, 360px) 1fr;
  align-items: start;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.admin-card,
.stat-card {
  border: 1px solid rgba(255, 216, 106, 0.24);
  border-radius: 8px;
  background: rgba(3, 16, 56, 0.84);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
}

.admin-card {
  padding: 16px;
}

.admin-card-wide {
  grid-column: 1 / -1;
}

.admin-card h2,
.admin-card h3 {
  margin: 0 0 12px;
  color: var(--gold);
}

.admin-card form {
  display: grid;
  gap: 10px;
}

.admin-card textarea {
  min-height: 80px;
  padding-top: 12px;
}

.stat-card {
  padding: 14px;
}

.stat-card span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 28px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--gold);
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.row-actions button,
.row-actions select {
  width: auto;
  min-height: 34px;
  font-size: 12px;
}

.muted {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

@media (min-width: 720px) {
  .campaign-shell {
    align-items: center;
    background: radial-gradient(circle at 50% 42%, rgba(15, 78, 190, 0.32), transparent 45%);
  }

  .ticket-row {
    grid-template-columns: 1fr 155px;
  }
}

@media (max-width: 860px) {
  .admin-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
