:root {
  --bg-color: #080c14;
  --card-bg: rgba(16, 24, 40, 0.85);
  --border-cyan: rgba(56, 189, 248, 0.3);
  --accent-cyan: #38bdf8;
  --accent-gold: #fbbf24;
  --accent-pink: #f472b6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius: 20px;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-x: hidden;
  position: relative;
}

.matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #080c14 80%);
  z-index: -1;
}

.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 20px;
}

.stealth-badge {
  display: inline-block;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.header h1 {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 2.2rem;
  letter-spacing: 1px;
  color: #fff;
}

.header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Progress Bar */
.progress-bar-wrap {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin-bottom: 30px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--accent-cyan) 0%, var(--accent-gold) 100%);
  transition: width 0.4s ease;
}

/* Card Nav Header for Back Button */
.card-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.btn-back {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: var(--accent-cyan);
}

/* Enigma Card */
.enigma-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius);
  padding: 35px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  text-align: center;
  transition: all 0.4s ease;
}

.enigma-card.hidden {
  display: none !important;
}

.step-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.step-label.gold {
  color: var(--accent-gold);
}

.enigma-card h2 {
  font-family: 'Fredoka', cursive;
  font-size: 1.7rem;
  margin-bottom: 8px;
}

.enigma-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Logic & Anagram Boxes */
.logic-box, .anagram-box, .freq-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 25px;
  margin: 25px 0;
}

.symbols-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.sub-hint {
  font-size: 0.85rem;
  color: var(--accent-gold);
  font-style: italic;
}

/* Anagram Scrambled Badges (R-E-T-S-C-E) */
.scrambled-letters {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.scrambled-letters span {
  font-family: 'Space Mono', monospace;
  font-size: 1.8rem;
  font-weight: 700;
  background: rgba(243, 156, 18, 0.15);
  border: 1px solid var(--accent-gold);
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--accent-gold);
}

/* Inputs & Buttons */
.input-zone {
  display: flex;
  justify-content: center;
  gap: 12px;
}

input[type="number"], input[type="text"], input[type="date"], select, textarea {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-cyan);
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-cyan);
}

input[type="number"] {
  width: 130px;
  text-align: center;
}

.btn-check {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-check:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.5);
}

/* Frequency Audio Box */
.btn-sound {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 12px 20px;
  border-radius: 20px;
  cursor: pointer;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.freq-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.freq-opt {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Vault Lock & Combined Equation Styling */
.vault-lock {
  margin: 25px 0;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--accent-gold);
  padding: 20px;
  border-radius: 14px;
}

.vault-badge {
  font-family: 'Space Mono', monospace;
  color: var(--accent-gold);
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.vault-keys-display {
  font-family: 'Space Mono', monospace;
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 16px;
}

.equation-combination-box {
  background: rgba(243, 156, 18, 0.1);
  border: 1px dashed var(--accent-gold);
  border-radius: 10px;
  padding: 14px;
}

.eq-title {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.eq-formula {
  font-family: 'Fredoka', cursive, monospace;
  font-size: 1.3rem;
  color: #fff;
}

.result-highlight {
  color: var(--accent-gold);
  font-size: 1.6rem;
  text-shadow: 0 0 10px rgba(243, 156, 18, 0.6);
  padding: 0 6px;
}

.btn-vault-open {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  border: none;
  padding: 16px 32px;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  transition: all 0.3s;
}

.btn-vault-open:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.8);
}

/* INTERMEDIATE TEASER CARD */
.teaser-card {
  border-color: var(--accent-gold);
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.25);
}

.teaser-emoji {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.teaser-title {
  font-family: 'Fredoka', cursive;
  font-size: 2.2rem;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.teaser-desc {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.teaser-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn-teaser-option {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 16px 24px;
  border-radius: 30px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-teaser-option:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  transform: translateY(-2px);
}

.btn-teaser-option.highlight {
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
  border: none;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
}

.btn-teaser-option.highlight:hover {
  color: #fff;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 25px rgba(236, 72, 153, 0.6);
}

/* REVEAL CARD */
.reveal-card {
  border-color: var(--accent-pink);
  box-shadow: 0 0 40px rgba(244, 114, 182, 0.4);
  position: relative;
  overflow: hidden;
}

#confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.big-emoji {
  font-size: 4rem;
  margin-bottom: 10px;
}

.surprise-stamp {
  display: inline-block;
  border: 3px dashed var(--accent-pink);
  color: var(--accent-pink);
  font-family: 'Space Mono', monospace;
  padding: 4px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  transform: rotate(-3deg);
  margin-bottom: 15px;
}

.reveal-title {
  font-family: 'Fredoka', cursive;
  font-size: 2.2rem;
  margin-bottom: 15px;
}

.reveal-message-box {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 35px;
}

.primary-msg {
  font-size: 1.25rem;
  line-height: 1.5;
  margin-bottom: 10px;
}

.gold-text {
  color: var(--accent-gold);
  font-size: 1.6rem;
  display: block;
  margin-top: 6px;
}

.secondary-msg {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* INTERACTIVE SECTIONS */
.interactive-section {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 25px;
  margin-top: 30px;
  text-align: left;
}

.interactive-section h2 {
  font-family: 'Fredoka', cursive;
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.preno-form, .wish-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 25px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-primary, .btn-secondary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-secondary {
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

.btn-primary:hover, .btn-secondary:hover {
  transform: translateY(-2px);
}

/* Leaderboard & Wishes feed */
.leaderboard h3 {
  font-size: 1rem;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.guess-list, .wishes-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.guess-card, .wish-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.9rem;
}

.guess-card .name, .wish-card .author {
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 2px;
}

.wish-card .author {
  color: var(--accent-pink);
}

.empty-state {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
}

/* Error Message Custom Style */
.error-msg {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #fca5a5;
  padding: 10px 15px;
  border-radius: 8px;
  margin-top: 15px;
  font-size: 0.9rem;
  display: none;
  animation: shake 0.4s ease-in-out;
}

.error-msg.visible {
  display: block;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

/* Hint System */
.btn-extra-hint {
  background: rgba(56, 189, 248, 0.1);
  border: 1px dashed var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 8px 16px;
  border-radius: 20px;
  margin-top: 15px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.5s ease;
  opacity: 1;
}

.btn-extra-hint:hover {
  background: rgba(56, 189, 248, 0.2);
}

.hidden-hint {
  display: none !important;
}

.hint-msg {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fcd34d;
  padding: 10px 15px;
  border-radius: 8px;
  margin-top: 15px;
  font-size: 0.9rem;
  display: none;
  animation: fadeIn 0.4s ease-in-out;
}

.hint-msg.visible {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
