/* ============================================
   Raffle — mobile-first, premium, pixel retro
   ============================================ */

:root {
  --bg: rgba(18, 18, 20, 0.92);
  --bg-card: rgba(28, 28, 32, 0.95);
  --bg-card-solid: #1c1c20;
  --text: #f5f5f5;
  --text-muted: #a1a1aa;
  --accent: #c6f135;
  --accent-soft: rgba(198, 241, 53, 0.18);
  --available: #4ade80;
  --available-bg: rgba(74, 222, 128, 0.2);
  --unavailable: #f87171;
  --unavailable-bg: rgba(248, 113, 113, 0.2);
  --border: rgba(255, 255, 255, 0.1);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-sans: 'Space Grotesk', system-ui, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

/* ---- Background (black; set .pixel-bg img to display:block to show pixel image) ---- */
.pixel-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

.pixel-bg img {
  display: none;
  width: 24px;
  height: 18px;
  object-fit: cover;
  object-position: center;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  transform: scale(120);
}

.pixel-bg::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #000;
  pointer-events: none;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background: #000;
  min-height: 100vh;
  min-height: 100dvh;
}

.page {
  position: relative;
  z-index: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 32px;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

/* ---- Header / Logo ---- */
.header {
  padding: 28px 0 24px;
  text-align: center;
}

.logo {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
  text-shadow: 0 0 24px rgba(198, 241, 53, 0.35);
}

.brand {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---- Hero ---- */
.hero {
  margin-bottom: 24px;
  width: 100%;
}

.title {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--text);
}

.tagline {
  margin: 0 0 20px;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.product-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: visible;
  margin: 0 auto;
  max-width: 100%;
  /* Fade edges into black: sharp centre, soft blend at edges */
  mask-image: radial-gradient(
    ellipse 85% 80% at 50% 45%,
    black 35%,
    transparent 88%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 85% 80% at 50% 45%,
    black 35%,
    transparent 88%
  );
  mask-size: 100% 100%;
  -webkit-mask-size: 100% 100%;
  mask-position: center;
  -webkit-mask-position: center;
}

.product-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 30%;
}

/* ---- Stats ---- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto 28px;
}

.stat {
  text-align: center;
  padding: 14px 8px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.stat-value {
  display: block;
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Sold out ---- */
.sold-out {
  text-align: center;
  padding: 32px 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
  width: 100%;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.sold-out-title {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.sold-out-text {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

/* ---- Ticket section ---- */
.ticket-section {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.quantity-row {
  margin-bottom: 24px;
  width: 100%;
}

.quantity-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  backdrop-filter: blur(8px);
  margin: 0 auto;
}

.btn-stepper {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-stepper:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-stepper:active {
  background: rgba(255, 255, 255, 0.15);
}

#quantity {
  width: 56px;
  height: 48px;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 500;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  -moz-appearance: textfield;
}

#quantity::-webkit-outer-spin-button,
#quantity::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ---- Number selection ---- */
.number-selection {
  margin-bottom: 24px;
  width: 100%;
}

.number-selection-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.number-selection-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.btn-random {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f0f0f;
  background: var(--accent);
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-random:hover {
  background: #d4f84a;
  transform: scale(1.02);
}

.number-slots {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slot-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.slot-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.slot-input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  font-size: 1.125rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, background 0.15s ease;
  backdrop-filter: blur(8px);
}

.slot-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.slot-input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.slot-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card-solid);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.slot-input.available {
  border-color: var(--available);
  background: var(--available-bg);
}

.slot-input.unavailable {
  border-color: var(--unavailable);
  background: var(--unavailable-bg);
}

.slot-random {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  color: #0f0f0f;
  background: var(--accent);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.slot-random:hover {
  background: #d4f84a;
  transform: scale(1.05);
}

.slot-hint {
  font-size: 0.75rem;
  min-height: 1.25em;
}

.slot-hint.available {
  color: var(--available);
}

.slot-hint.unavailable {
  color: var(--unavailable);
}

.selection-hint {
  margin: 12px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.selection-hint.error {
  color: var(--unavailable);
}

/* ---- Summary ---- */
.summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
  width: 100%;
  max-width: 360px;
  margin: 0 auto 24px;
  text-align: left;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 0.9375rem;
  padding: 6px 0;
}

.summary-row span:first-child {
  color: var(--text-muted);
}

.summary-row span:last-child {
  font-weight: 500;
  color: var(--text);
}

.summary-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 1.0625rem;
}

.summary-total span:last-child {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(198, 241, 53, 0.3);
}

.summary-numbers {
  word-break: break-all;
  text-align: right;
}

/* ---- CTA ---- */
.cta {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 18px 24px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-sans);
  text-align: center;
  text-decoration: none;
  color: #0f0f0f;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 24px rgba(198, 241, 53, 0.25);
}

.cta:hover:not(.cta-disabled) {
  background: #d4f84a;
  box-shadow: 0 0 32px rgba(198, 241, 53, 0.4);
}

.cta:active:not(.cta-disabled) {
  transform: scale(0.98);
}

.cta-disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

/* ---- Footer ---- */
.footer {
  margin-top: auto;
  padding-top: 32px;
  text-align: center;
}

.footer p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- Question modal ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden {
  display: none !important;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.modal-intro {
  margin: 0 0 20px;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-question {
  margin: 0 0 20px;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.modal-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  text-align: left;
}

.modal-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.modal-option:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.modal-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.modal-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.modal-option label {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.modal-error {
  margin: 0 0 16px;
  font-size: 0.8125rem;
  color: var(--unavailable);
}

.modal-proceed {
  width: 100%;
  margin: 0;
}
