/* ===== CSS Variables ===== */
:root {
  --neon-pink: #ff2d95;
  --neon-blue: #00d4ff;
  --neon-purple: #b829ff;
  --dark-bg: #0a0a0f;
  --dark-card: #111118;
  --smoke: rgba(255, 255, 255, 0.035);
  
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--dark-bg);
  background-image:
    radial-gradient(circle at top, rgba(184, 41, 255, 0.1), transparent 35%),
    radial-gradient(circle at bottom right, rgba(0, 212, 255, 0.08), transparent 30%),
    linear-gradient(180deg, #09090d 0%, #0a0a0f 45%, #07070a 100%);
  color: #fff;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    radial-gradient(circle at 20% 20%, var(--smoke) 0, transparent 45%),
    radial-gradient(circle at 75% 30%, rgba(255, 45, 149, 0.04) 0, transparent 30%),
    radial-gradient(circle at 55% 80%, rgba(0, 212, 255, 0.035) 0, transparent 28%);
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.6) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: soft-light;
  z-index: 1;
}

/* ===== Background Effects ===== */
.bg-effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.05;
}

.bg-glow-pink {
  background: var(--neon-pink);
  top: 25%;
  left: 25%;
}

.bg-glow-blue {
  background: var(--neon-blue);
  bottom: 25%;
  right: 25%;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.03;
  background-image: 
    linear-gradient(rgba(255, 45, 149, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 45, 149, 0.3) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ===== Layout ===== */
.container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ===== Glass Card ===== */
.glass-card {
  background:
    linear-gradient(180deg, rgba(18, 18, 27, 0.88), rgba(9, 9, 14, 0.92)),
    rgba(17, 17, 24, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.05), transparent 35%),
    linear-gradient(180deg, transparent, rgba(255, 45, 149, 0.04));
  pointer-events: none;
}

@media (min-width: 640px) {
  .glass-card {
    padding: 3rem;
  }
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
}

@media (min-width: 640px) {
  h1 {
    font-size: 3rem;
  }
}

h2 {
  font-size: 1.75rem;
}

@media (min-width: 640px) {
  h2 {
    font-size: 2rem;
  }
}

/* ===== Neon Text ===== */
.neon-text-pink {
  color: var(--neon-pink);
  text-shadow: 
    0 0 10px rgba(255, 45, 149, 0.5),
    0 0 20px rgba(255, 45, 149, 0.3),
    0 0 30px rgba(255, 45, 149, 0.2);
}

.neon-text-blue {
  color: var(--neon-blue);
  text-shadow: 
    0 0 10px rgba(0, 212, 255, 0.5),
    0 0 20px rgba(0, 212, 255, 0.3),
    0 0 30px rgba(0, 212, 255, 0.2);
}

/* ===== Utilities ===== */
.text-center {
  text-align: center;
}

.text-white {
  color: #fff;
}

.text-white\/70 {
  color: rgba(255, 255, 255, 0.7);
}

.text-white\/60 {
  color: rgba(255, 255, 255, 0.6);
}

.text-white\/50 {
  color: rgba(255, 255, 255, 0.5);
}

.text-white\/40 {
  color: rgba(255, 255, 255, 0.4);
}

.text-white\/30 {
  color: rgba(255, 255, 255, 0.3);
}

.text-white\/20 {
  color: rgba(255, 255, 255, 0.2);
}

.text-white\/10 {
  color: rgba(255, 255, 255, 0.1);
}

.text-xl { font-size: 1.25rem; }
.text-lg { font-size: 1.125rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.tracking-wider { letter-spacing: 0.12em; }

.block { display: block; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }

.fixed { position: fixed; }
.inset-0 { inset: 0; }

.rounded-full { border-radius: 9999px; }

.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-20 { width: 5rem; }
.h-20 { height: 5rem; }
.max-w-lg { max-width: 32rem; }

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-6 {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.pt-2 {
  padding-top: 0.5rem;
}

.border-y {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* ===== Icons ===== */
.icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.icon-wrapper {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.icon-sparkles {
  width: 2rem;
  height: 2rem;
  color: white;
}

.icon-arrow {
  width: 1.25rem;
  height: 1.25rem;
}

/* ===== Buttons ===== */
.neon-button-pink,
.neon-button-blue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.25s ease, filter 0.25s ease, opacity 0.25s ease;
  color: white;
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
}

.neon-button-pink {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  box-shadow: 0 0 20px rgba(255, 45, 149, 0.4);
}

.neon-button-pink:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(255, 45, 149, 0.6),
              0 0 60px rgba(255, 45, 149, 0.3);
  filter: saturate(1.08);
}

.neon-button-blue {
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.neon-button-blue:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.6),
              0 0 60px rgba(0, 212, 255, 0.3);
  filter: saturate(1.08);
}

.neon-button-pink:active,
.neon-button-blue:active {
  transform: translateY(1px) scale(0.99);
}

.neon-button-pink:disabled,
.neon-button-blue:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.w-full {
  width: 100%;
}

/* ===== Inputs ===== */
.input-dark {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color: white;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  min-height: 56px;
}

.input-dark:focus {
  outline: none;
  border-color: var(--neon-pink);
  box-shadow: 0 0 15px rgba(255, 45, 149, 0.3);
}

.input-dark::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* ===== Textarea ===== */
textarea.input-dark {
  resize: none;
  min-height: 120px;
}

/* ===== Hint Boxes ===== */
.hint-box {
  border-left: 2px solid;
  padding-left: 1rem;
}

.hint-pink {
  border-color: rgba(255, 45, 149, 0.3);
}

.hint-blue {
  border-color: rgba(0, 212, 255, 0.3);
}

/* ===== Error Text ===== */
.error-text {
  color: var(--neon-pink);
  font-size: 0.875rem;
  text-align: center;
  margin-top: 0.5rem;
}

.dramatic-copy {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.72rem;
}

.dramatic-question {
  width: 100%;
  padding: 2rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at top, rgba(255, 45, 149, 0.14), transparent 45%),
    rgba(255, 255, 255, 0.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 40px rgba(255, 45, 149, 0.08);
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1.15;
}

.system-note {
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.hidden {
  display: none !important;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.7s ease-out forwards;
}

@keyframes fadeScaleIn {
  from { opacity: 0; transform: scale(0.97) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.fade-scale-in {
  animation: fadeScaleIn 0.55s ease-out forwards;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 45, 149, 0.4); }
  50% { box-shadow: 0 0 40px rgba(255, 45, 149, 0.6); }
}

.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes glitchFlash {
  0%,
  100% { transform: translateX(0); filter: none; }
  20% { transform: translateX(-5px); filter: hue-rotate(8deg); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.glitch-flash {
  animation: glitchFlash 0.35s linear 1;
}

/* ===== Stage Indicator ===== */
.stage-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.stage-dot {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.stage-dot.active {
  background: var(--neon-pink);
  color: white;
}

.stage-dot.completed {
  background: #22c55e;
  color: white;
}

.stage-dot.pending {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
}

.stage-line {
  width: 2.5rem;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.stage-line.completed {
  background: #22c55e;
}

/* ===== Cipher Display ===== */
.cipher-display {
  display: inline-block;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 45, 149, 0.3);
  border-radius: 0.5rem;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  font-family: var(--font-heading);
}

/* ===== Equation Display ===== */
.equation-display {
  display: inline-block;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 0.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

/* ===== Letter Grid ===== */
.letter-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.375rem;
  max-width: 400px;
  margin: 0 auto;
}

.letter-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  color: rgba(255, 255, 255, 0.7);
}

.letter-cell:hover {
  background: rgba(255, 45, 149, 0.15);
  border-color: rgba(255, 45, 149, 0.4);
  transform: scale(1.05);
}

.letter-cell.selected {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  border-color: var(--neon-pink);
  box-shadow: 0 0 10px rgba(255, 45, 149, 0.5);
  color: white;
}

.letter-cell.found {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-color: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
  color: white;
}

.letter-cell.secret-found {
  background: linear-gradient(135deg, var(--neon-blue), #3b82f6);
  border-color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  color: white;
}

/* ===== Success/Error Messages ===== */
.success-message {
  padding: 1rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 0.5rem;
  color: #4ade80;
  text-align: center;
}

.secret-message {
  padding: 0.75rem;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 0.5rem;
  color: var(--neon-blue);
  text-align: center;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* ===== Question Display ===== */
.question-display {
  display: inline-block;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  font-size: 1.25rem;
  font-weight: 500;
}

.screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at center, rgba(255, 45, 149, 0.08), transparent 42%),
    rgba(5, 6, 10, 0.92);
  backdrop-filter: blur(16px);
}

.screen-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.8) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 4px 4px;
  mix-blend-mode: soft-light;
}

.screen-overlay-card {
  position: relative;
  width: min(100%, 560px);
  padding: 2rem 1.5rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 11, 17, 0.92);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4);
}

.screen-overlay-code {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.screen-overlay-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1.06;
  margin-top: 1rem;
}

.screen-overlay-copy {
  color: rgba(255, 255, 255, 0.62);
  margin-top: 0.8rem;
}

.screen-overlay.progress .screen-overlay-title {
  color: var(--neon-blue);
  text-shadow: 0 0 18px rgba(0, 212, 255, 0.28);
}

.screen-overlay.success .screen-overlay-title {
  color: #4ade80;
  text-shadow: 0 0 18px rgba(74, 222, 128, 0.22);
}

/* ===== Loading Screen ===== */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid rgba(255, 45, 149, 0.2);
  border-top-color: var(--neon-pink);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

/* ===== Invitation Preview ===== */
.invitation-preview {
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
}

.invitation-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.invitation-preview canvas {
  width: 100%;
  max-width: 420px;
  height: auto;
  display: block;
}

/* ===== Secret Link ===== */
.secret-link {
  opacity: 0.15;
  transition: opacity 0.3s ease;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto;
}

.secret-link:hover {
  opacity: 0.6;
}

/* ===== Reset Link ===== */
.reset-link {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.875rem;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto;
  transition: color 0.3s ease;
}

.reset-link:hover {
  color: rgba(255, 255, 255, 0.5);
}

/* ===== Event Details ===== */
.event-details {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.event-detail {
  text-align: center;
}

.event-detail-label {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.875rem;
}

.event-detail-value {
  color: white;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 45, 149, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 45, 149, 0.5);
}

/* ===== Selection Text ===== */
.selection-text {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.875rem;
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .container {
    padding: 1.2rem 0.9rem 1.8rem;
    justify-content: flex-start;
  }

  .glass-card {
    padding: 1.4rem 1rem;
    border-radius: 1rem;
  }

  .cipher-display,
  .equation-display {
    width: 100%;
    font-size: 2rem;
    padding: 1.15rem 1rem;
  }

  .equation-display {
    font-size: 1.45rem;
  }

  .letter-grid {
    gap: 0.28rem;
  }

  .letter-cell {
    font-size: 0.8rem;
  }

  .dramatic-question {
    padding: 1.45rem 1rem;
  }
}
.qr-block{
  margin-top:40px;
  margin-bottom:28px;
  text-align:center;
}

.invite-qr{
  width:22vw;
  max-width:130px;
  min-width:90px;
  height:auto;
  border-radius:8px;
  box-shadow:0 0 18px rgba(255,255,255,.08);
}

.qr-text{
  margin-top:10px;
  font-size:12px;
  opacity:.75;
  letter-spacing:.08em;
}
