@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700&family=Nunito+Sans:wght@400;600;700;800&display=swap');

:root {
  --indigo-950: #0a0620;
  --indigo-900: #150c38;
  --indigo-800: #201048;
  --indigo-700: #2c1660;
  --violet-500: #7c5cff;
  --amber-300: #ffd76a;
  --amber-400: #ffb84d;
  --amber-500: #ff9f1c;
  --amber-600: #d97e08;
  --gold-300: #ffe9a8;
  --gold-500: #ffb020;
  --mint-400: #6ee7b7;
  --coral-400: #ff8a80;
  --text-hi: #f6f4ff;
  --text-lo: rgba(246, 244, 255, 0.62);
  --text-faint: rgba(246, 244, 255, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.055);
  --glass-bg-hi: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.14);
  --card-radius: 24px;
}

* { box-sizing: border-box; }

html {
  background-color: #0a0620;
  background-image:
    radial-gradient(60% 40% at 50% 0%, rgba(124, 92, 255, 0.28), transparent 60%),
    radial-gradient(ellipse at top, var(--indigo-800), var(--indigo-950) 68%);
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  color: var(--text-hi);
  min-height: 100vh;
}

a { color: var(--amber-400); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--amber-300); }

h1, h2, .display {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
}

.stars {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, white, transparent),
    radial-gradient(1.5px 1.5px at 90px 120px, white, transparent),
    radial-gradient(1px 1px at 160px 60px, white, transparent),
    radial-gradient(1.5px 1.5px at 230px 200px, white, transparent),
    radial-gradient(1px 1px at 300px 90px, white, transparent),
    radial-gradient(1.5px 1.5px at 40px 250px, white, transparent),
    radial-gradient(1px 1px at 340px 300px, white, transparent),
    radial-gradient(1.5px 1.5px at 120px 340px, white, transparent);
  background-repeat: repeat;
  background-size: 380px 380px;
  opacity: 0.4;
}

/* ---- Background spaceship ---- */
.bg-ship {
  position: fixed;
  top: -30px;
  right: -70px;
  width: 280px;
  height: 280px;
  z-index: -1;
  opacity: 0.3;
  pointer-events: none;
  animation: shipDrift 9s ease-in-out infinite;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.3));
}

body.gate-page .bg-ship {
  top: auto;
  right: auto;
  bottom: -50px;
  left: -60px;
  width: 240px;
  height: 240px;
  opacity: 0.24;
  animation-name: shipDriftGate;
}

.bg-ship .flame-outer { transform-origin: 50% 8%; animation: flameFlicker 1.3s ease-in-out infinite alternate; }
.bg-ship .flame-inner { transform-origin: 50% 8%; animation: flameFlicker 1s ease-in-out infinite alternate-reverse; }

@keyframes shipDrift {
  0%, 100% { transform: translate(0, 0) rotate(18deg); }
  50% { transform: translate(-16px, 18px) rotate(21deg); }
}

@keyframes shipDriftGate {
  0%, 100% { transform: translate(0, 0) rotate(-25deg); }
  50% { transform: translate(14px, -16px) rotate(-22deg); }
}

@keyframes flameFlicker {
  0% { transform: scaleY(0.95); opacity: 0.88; }
  100% { transform: scaleY(1.05); opacity: 1; }
}

.page {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

body.gate-page .page {
  max-width: none;
  padding: 0;
}

/* ---- Header ---- */
.mission-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rocket-badge {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--amber-300), var(--amber-600));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 6px rgba(255, 159, 28, 0.14), 0 4px 14px rgba(217, 126, 8, 0.35);
}

.rocket-badge svg { width: 24px; height: 24px; }

.mission-header h1 { font-size: 22px; flex: 1; }

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px 7px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  box-shadow: 0 4px 12px rgba(255, 176, 32, 0.3);
  color: #3a2400;
  font-weight: 800;
  font-size: 12.5px;
  flex-shrink: 0;
  white-space: nowrap;
}

.stat-badge svg { width: 15px; height: 15px; }

.subline {
  color: var(--text-lo);
  font-size: 13.5px;
  margin: 10px 0 16px;
}

.subline strong { color: var(--amber-400); font-weight: 700; }

/* ---- Filter tabs ---- */
.tabs {
  position: relative;
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 999px;
}

.tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc((100% - 16px) / 3);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--amber-300), var(--amber-500));
  box-shadow: 0 3px 10px rgba(255, 159, 28, 0.35);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.tab {
  position: relative;
  z-index: 1;
  flex: 1;
  text-align: center;
  padding: 9px 0;
  border-radius: 999px;
  color: var(--text-lo);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  border: none;
  background: transparent;
  transition: color 0.25s ease;
}

.tab:hover {
  color: var(--text-hi);
}

.tab.active {
  color: #331c00;
}

.tab.active:hover {
  color: #331c00;
}

/* ---- Gift cards ---- */
.gift-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gift-card {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--card-radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 24px rgba(6, 3, 20, 0.28);
  overflow: visible;
}

.gift-card.reserved { opacity: 0.5; }

.gift-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--violet-500), var(--indigo-700));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.gift-card.reserved .gift-icon { background: linear-gradient(155deg, #4a4560, #2a2542); }
.gift-icon svg { width: 22px; height: 22px; color: var(--gold-300); }

.gift-info { flex: 1; min-width: 0; }

.gift-name { font-weight: 700; font-size: 15px; margin: 0; color: var(--text-hi); }
.gift-card.reserved .gift-name { text-decoration: line-through; color: var(--text-lo); }

.gift-price { font-size: 13px; color: var(--text-lo); margin: 3px 0 0; }

.gift-notes { font-size: 12px; color: var(--text-lo); font-style: italic; margin: 3px 0 0; }

.gift-link {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
}
.gift-link svg { width: 11px; height: 11px; }

.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-launch {
  font-family: inherit;
  font-weight: 800;
  font-size: 13px;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--amber-300), var(--amber-500) 60%, var(--amber-600));
  color: #2b1400;
  box-shadow: 0 6px 16px rgba(255, 159, 28, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.btn-launch:hover {
  box-shadow: 0 8px 20px rgba(255, 159, 28, 0.5), 0 0 0 7px rgba(255, 159, 28, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.btn-launch:active { transform: scale(0.97); }

.pill-reserved {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-lo);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-reserved svg { width: 12px; height: 12px; color: var(--mint-400); }

/* ---- Featured card rocket accent ---- */
.mini-rocket {
  position: absolute;
  top: -14px;
  right: 6px;
  width: 40px;
  height: 40px;
  animation: hoverFloat 2.6s ease-in-out infinite;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}
.mini-rocket .flame { transform-origin: 50% 0%; animation: flameFlicker 0.9s ease-in-out infinite alternate; }

@keyframes hoverFloat {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-7px) rotate(-3deg); }
}

.add-gift-btn {
  width: 100%;
  margin-top: 18px;
  padding: 13px 0;
  border-radius: 999px;
  border: 1.5px dashed var(--glass-border);
  background: transparent;
  color: var(--text-lo);
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  text-align: center;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.add-gift-btn:hover {
  color: var(--text-hi);
  border-color: var(--amber-500);
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 20px 10px 8px;
}
.empty-state .mascot { width: 108px; height: 108px; margin-bottom: 10px; animation: bob 3.2s ease-in-out infinite; }
.empty-state p { color: var(--text-lo); font-size: 14px; margin: 0; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 20, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.modal {
  background: var(--glass-bg-hi);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-radius: var(--card-radius);
  padding: 22px;
  width: 100%;
  max-width: 320px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 20px 40px rgba(6, 3, 20, 0.4);
}

.modal h2 { font-size: 18px; margin-bottom: 4px; }
.modal .modal-sub { color: var(--text-lo); font-size: 13px; margin-bottom: 16px; }

label {
  display: block;
  font-size: 12.5px;
  color: var(--text-lo);
  margin-bottom: 6px;
  font-weight: 700;
}

input[type="text"], input[type="url"], textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 13px;
  padding: 11px 13px;
  color: var(--text-hi);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 14px;
}

input::placeholder { color: rgba(246, 244, 255, 0.35); }

input:focus, textarea:focus {
  outline: none;
  border-color: var(--amber-500);
}

.modal-actions { display: flex; gap: 10px; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-lo);
  flex: 1;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  width: 100%;
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  border: none;
  border-radius: 999px;
  padding: 14px 0;
  cursor: pointer;
  background: linear-gradient(135deg, var(--amber-300), var(--amber-500) 60%, var(--amber-600));
  color: #2b1400;
  box-shadow: 0 8px 20px rgba(255, 159, 28, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.btn-primary:hover {
  box-shadow: 0 10px 26px rgba(255, 159, 28, 0.52), 0 0 0 8px rgba(255, 159, 28, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.modal-actions .btn-primary { width: auto; flex: 1; }

/* ---- Gate screen ---- */
.gate-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 22px;
}

.mascot { width: 128px; height: 128px; margin-bottom: 6px; animation: bob 3.2s ease-in-out infinite; }

.gate-card {
  width: 100%;
  max-width: 320px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-radius: 26px;
  padding: 28px 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 20px 40px rgba(6, 3, 20, 0.4);
}

.gate-card .rocket-badge { margin: 0 auto 16px; width: 60px; height: 60px; }
.gate-card .rocket-badge svg { width: 32px; height: 32px; }

.gate-card h1 { font-size: 23px; margin-bottom: 8px; }
.gate-card p { color: var(--text-lo); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }

.error-text { color: var(--coral-400); font-size: 13px; margin: -8px 0 14px; }

.gate-card .field { text-align: left; }

/* ---- Admin ---- */
.panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 24px rgba(6, 3, 20, 0.28);
  margin-bottom: 22px;
}
.panel h2 { font-size: 16px; margin-bottom: 14px; }

.section-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-lo);
  margin: 0 0 12px 4px;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.admin-row .info { flex: 1; min-width: 0; }
.admin-row .name { font-weight: 700; font-size: 14px; margin: 0; }
.admin-row .price { font-size: 12px; color: var(--text-lo); margin: 2px 0 0; }
.admin-row .notes { font-size: 12px; color: var(--text-lo); font-style: italic; margin: 2px 0 0; }

.reserved-by-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(110, 231, 183, 0.14);
  border: 1px solid rgba(110, 231, 183, 0.3);
  color: var(--mint-400);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}
.tag-available { color: var(--text-lo); font-size: 12px; white-space: nowrap; }

.row-actions { display: flex; gap: 10px; flex-shrink: 0; }
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-lo);
  display: flex;
  font-family: inherit;
}
.icon-btn.danger { color: var(--coral-400); }
.icon-btn svg { width: 17px; height: 17px; }

.back-link {
  display: block;
  text-align: center;
  margin-top: 22px;
  color: var(--text-lo);
  font-size: 13.5px;
  font-weight: 700;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--text-hi);
}

@media (max-width: 380px) {
  .gift-card { flex-wrap: wrap; }
}
