/* ACN Co. booth spin — locked palette */
:root {
  --porcelain: #F4F5F5;
  --dusty-teal: #3E6060;
  --blue-mist: #8DACB7;
  --stone: #CEBFB2;
  --ink: #0B0B0B;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--porcelain);
  color: var(--ink);
  font-family: "Lato", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  display: flex;
  flex-direction: column;
  padding:
    calc(12px + var(--safe-top))
    calc(16px + var(--safe-right))
    calc(8px + var(--safe-bottom))
    calc(16px + var(--safe-left));
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  min-height: 56px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 8px;
  /* long-press target */
}

.logo-wrap img {
  height: 44px;
  width: auto;
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  appearance: none;
  border: 2px solid var(--dusty-teal);
  background: var(--porcelain);
  color: var(--dusty-teal);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
}

.btn-icon[aria-pressed="true"] {
  background: var(--dusty-teal);
  color: var(--porcelain);
}

/* Main stage */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 0;
  position: relative;
}

.wheel-wrap {
  position: relative;
  width: min(72vmin, 560px);
  height: min(72vmin, 560px);
  flex-shrink: 0;
}

#wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  box-shadow:
    0 0 0 6px var(--dusty-teal),
    0 12px 32px rgba(11, 11, 11, 0.18);
}

.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 36px solid var(--dusty-teal);
  z-index: 3;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.25));
}

.pointer::after {
  content: "";
  position: absolute;
  top: -36px;
  left: -8px;
  width: 16px;
  height: 16px;
  background: var(--stone);
  border: 3px solid var(--dusty-teal);
  border-radius: 50%;
}

.hub {
  position: absolute;
  inset: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: var(--porcelain);
  border: 4px solid var(--dusty-teal);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 2;
  pointer-events: none;
}

.btn-spin {
  appearance: none;
  border: none;
  background: var(--dusty-teal);
  color: var(--porcelain);
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 4.5vw, 32px);
  letter-spacing: 0.04em;
  padding: 18px 64px;
  border-radius: 999px;
  cursor: pointer;
  min-width: min(80vw, 320px);
  min-height: 72px;
  box-shadow: 0 6px 0 #2a4444, 0 10px 24px rgba(11,11,11,0.2);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-spin:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #2a4444, 0 4px 12px rgba(11,11,11,0.2);
}

.btn-spin:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.legal-line {
  font-family: "Lato", sans-serif;
  font-size: clamp(11px, 1.6vw, 14px);
  line-height: 1.35;
  color: var(--ink);
  text-align: center;
  max-width: 920px;
  padding: 0 8px;
  flex-shrink: 0;
}

/* Result overlay — scrim fades; panel stays fully opaque Porcelain (never inherits parent opacity) */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
  pointer-events: none;
  visibility: hidden;
}

.overlay.is-open {
  pointer-events: auto;
  visibility: visible;
}

.overlay-scrim {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 11, 0.60); /* ~60% Ink */
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 0;
}

.overlay.is-open .overlay-scrim {
  opacity: 1;
}

/* Confetti: above scrim, behind panel — never over result text */
#confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.card {
  background: #F4F5F5; /* Porcelain, fully opaque — not rgba */
  background-color: #F4F5F5;
  border-radius: 24px;
  padding: 32px 36px 28px;
  max-width: min(680px, 92vw);
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  border-top: 8px solid var(--dusty-teal);
  position: relative;
  z-index: 2;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.overlay.is-open .card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.card.is-prize {
  border-top-color: var(--blue-mist);
}

.card-kicker {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dusty-teal);
  opacity: 1;
  margin-bottom: 12px;
  position: relative;
}

.card-body {
  font-family: "Lato", sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 3.2vw, 26px);
  line-height: 1.35;
  color: #0B0B0B; /* Ink full opacity */
  opacity: 1;
  position: relative;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

/* Compliment is the hero — larger than prize body / thanks line */
.card.is-compliment .card-body {
  font-size: clamp(22px, 4.2vw, 34px);
  line-height: 1.3;
}

.card-thanks {
  margin-top: 14px;
  font-family: "Lato", sans-serif;
  font-weight: 600;
  font-size: clamp(13px, 1.8vw, 16px);
  line-height: 1.3;
  color: var(--dusty-teal);
  opacity: 1;
  position: relative;
}

.card-thanks[hidden] {
  display: none;
}

.card-tap {
  margin-top: 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--dusty-teal);
  opacity: 1;
  position: relative;
}

/* Settings */
.settings {
  position: fixed;
  inset: 0;
  background: rgba(11,11,11,0.65);
  z-index: 50;
  display: none;
  align-items: stretch;
  justify-content: center;
  padding: 16px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.settings.is-open { display: flex; }

.settings-panel {
  background: var(--porcelain);
  border-radius: 16px;
  width: min(720px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 20px;
  margin: auto;
}

.settings-panel h2 {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--dusty-teal);
  margin-bottom: 4px;
}

.settings-panel .hint {
  font-size: 13px;
  color: var(--ink);
  opacity: 0.75;
  margin-bottom: 16px;
}

.settings-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.btn {
  appearance: none;
  border: 2px solid var(--dusty-teal);
  background: var(--dusty-teal);
  color: var(--porcelain);
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.btn.secondary {
  background: transparent;
  color: var(--dusty-teal);
}

.btn.danger {
  background: transparent;
  border-color: #8a3a3a;
  color: #8a3a3a;
}

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-row {
  display: grid;
  grid-template-columns: 1fr 110px 70px 70px 40px;
  gap: 8px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--stone);
  border-radius: 10px;
  padding: 10px;
}

.entry-row input, .entry-row select {
  font-family: "Lato", sans-serif;
  font-size: 14px;
  padding: 8px;
  border: 1px solid var(--blue-mist);
  border-radius: 6px;
  background: var(--porcelain);
  color: var(--ink);
  width: 100%;
}

.entry-row .del {
  appearance: none;
  border: none;
  background: transparent;
  color: #8a3a3a;
  font-size: 20px;
  cursor: pointer;
  height: 36px;
}

.legal-locked {
  margin-top: 16px;
  padding: 12px;
  background: rgba(141,172,183,0.2);
  border-left: 3px solid var(--dusty-teal);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
}

.legal-locked strong {
  font-family: "Poppins", sans-serif;
  display: block;
  margin-bottom: 4px;
}

@media (orientation: landscape) and (max-height: 700px) {
  .logo-wrap img { height: 36px; }
  .btn-spin {
    padding: 12px 48px;
    min-height: 56px;
    font-size: 20px;
  }
  .wheel-wrap {
    width: min(58vmin, 420px);
    height: min(58vmin, 420px);
  }
  .legal-line { font-size: 11px; }
}

@media (max-width: 600px) {
  .entry-row {
    grid-template-columns: 1fr 1fr;
  }
  .entry-row .del { grid-column: 2; justify-self: end; }
}

.subhead {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--dusty-teal);
  margin: 16px 0 6px;
}
.field-label {
  display: block;
  font-size: 13px;
  margin-bottom: 12px;
}
.field-label input {
  display: block;
  width: 100%;
  margin-top: 4px;
  font-family: "Lato", sans-serif;
  font-size: 14px;
  padding: 8px;
  border: 1px solid var(--blue-mist);
  border-radius: 6px;
  background: #fff;
}
.prize-row, .comp-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  grid-template-columns: none;
}
.prize-name { font-weight: 700; font-size: 14px; }
.muted { font-size: 12px; opacity: 0.7; }
.warn {
  color: #8a3a3a;
  font-size: 12px;
  font-weight: 700;
}
.ok { color: var(--dusty-teal); font-weight: 700; font-size: 12px; }
.has-warn { border-color: #8a3a3a; }
.fit-report {
  background: #fff;
  border: 1px solid var(--stone);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  margin-bottom: 8px;
}

.prize-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
}
.prize-row .del { justify-self: end; }
.comp-row {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
  align-items: center;
}


/* Staff PIN gate */
.pin-gate {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 11, 0.65);
  z-index: 55;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.pin-gate.is-open { display: flex; }
.pin-panel {
  background: #F4F5F5;
  border-radius: 16px;
  width: min(420px, 100%);
  padding: 24px 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  border-top: 8px solid var(--dusty-teal);
}
.pin-panel h2 {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--dusty-teal);
  margin-bottom: 6px;
}
.pin-panel .hint {
  font-size: 13px;
  margin-bottom: 14px;
  opacity: 0.8;
}
.pin-panel .field-label input {
  letter-spacing: 0.2em;
  font-size: 20px;
  text-align: center;
}
.is-hidden { display: none !important; }

.legal-locked-line {
  margin-top: 6px;
}
