/* style.css - Premium Wedding RSVP Escape Room Stylesheet */

/* Global Reset & Base variables */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Default variables (fallback) */
  --bg-gradient: linear-gradient(135deg, #090d16 0%, #111827 50%, #090d16 100%);
  --bg-dark: #090d16;
  --accent-color: #fbbf24;
  --accent-rgb: 251, 191, 36;
  --accent-gradient: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  --text-color: #f8fafc;
  --text-muted: #94a3b8;
  --card-bg: rgba(17, 24, 39, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --font-heading: 'Cinzel', serif;
  --font-body: 'Outfit', sans-serif;
  --glow-color: rgba(251, 191, 36, 0.3);
  --glow-color-1: rgba(99, 102, 241, 0.25);
  --glow-color-2: rgba(236, 72, 153, 0.25);
  --border-radius: 20px;
  --transition-speed: 0.6s;
}

/* Theme 1: Default Wedding Theme (Elegant & Clean) */
.theme-default {
  --bg-dark: #0f172a;
  --accent-color: #e2e8f0;
  --accent-rgb: 226, 232, 240;
  --accent-gradient: linear-gradient(135deg, #fef08a 0%, #e2e8f0 100%);
  --text-color: #f8fafc;
  --text-muted: #94a3b8;
  --card-bg: rgba(15, 23, 42, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --font-heading: 'Cinzel', serif;
  --font-body: 'Outfit', sans-serif;
  --glow-color: rgba(226, 232, 240, 0.2);
  --glow-color-1: rgba(59, 130, 246, 0.2);
  --glow-color-2: rgba(147, 51, 234, 0.2);

  /* Labyrinth Grid variables */
  --wall-fill: #111827;
  --wall-stroke: #fbbf24;
  /* gold borders */
  --wall-stroke-width: 2px;
  --wall-rx: 6px;
  --passage-fill: #f8fafc;
  /* elegant marble-white paths */
  --passage-stroke: #cbd5e1;
  --cell-text-color: #0f172a;
  /* dark text on marble-white path */
  --passage-in-path-fill: rgba(251, 191, 36, 0.25);
}

/* Theme 2: Disney Theme (Magical & Dreamy) */
.theme-disney {
  --bg-dark: #1e1b4b;
  --accent-color: #f472b6;
  --accent-rgb: 244, 114, 182;
  --accent-gradient: linear-gradient(135deg, #f472b6 0%, #fb7185 100%);
  --text-color: #fef9e7;
  /* softened warm white – more readable than pure yellow */
  --text-muted: #e2d9f3;
  /* lifted from #cbd5e1 for better contrast on dark purple */
  --card-bg: rgba(59, 7, 100, 0.55);
  --card-border: rgba(244, 114, 182, 0.3);
  --font-heading: 'Satisfy', cursive;
  --font-body: 'Outfit', sans-serif;
  --glow-color: rgba(244, 114, 182, 0.45);
  --glow-color-1: rgba(168, 85, 247, 0.35);
  --glow-color-2: rgba(244, 63, 94, 0.3);

  /* Labyrinth Grid variables */
  --wall-fill: #1e1b4b;
  --wall-stroke: #f472b6;
  --wall-stroke-width: 1.5px;
  --wall-rx: 5px;
  --passage-fill: rgba(168, 85, 247, 0.22);
  /* translucent magical violet */
  --passage-stroke: rgba(244, 114, 182, 0.45);
  /* glowing pink border */
  --cell-text-color: #fef08a;
  /* glowing yellow letters */
  --passage-in-path-fill: rgba(244, 114, 182, 0.35);
}

/* Theme 3: Flintstones Theme (Prehistoric & Earthy) */
.theme-flintstones {
  --bg-dark: #451a03;
  --accent-color: #f97316;
  --accent-rgb: 249, 115, 22;
  --accent-gradient: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
  --text-color: #ffedd5;
  --text-muted: #fcd9ab;
  /* lifted from #fdba74 – cleaner cream-orange contrast on dark brown */
  --card-bg: rgba(69, 26, 3, 0.75);
  --card-border: rgba(249, 115, 22, 0.3);
  --font-heading: 'Luckiest Guy', sans-serif;
  --font-body: 'Fredoka', sans-serif;
  /* Fredoka is the theme body font - clear & readable */
  --glow-color: rgba(249, 115, 22, 0.4);
  --glow-color-1: rgba(234, 88, 12, 0.3);
  --glow-color-2: rgba(120, 53, 15, 0.4);

  /* Labyrinth Grid variables */
  --wall-fill: #451a03;
  --wall-stroke: #ea580c;
  --wall-stroke-width: 1.5px;
  --wall-rx: 3px;
  --passage-fill: rgba(251, 146, 60, 0.2);
  /* warm clay-sand pathway */
  --passage-stroke: rgba(217, 119, 6, 0.45);
  /* prehistoric orange border */
  --cell-text-color: #ffedd5;
  /* bone white / warm cream letters */
  --passage-in-path-fill: rgba(249, 115, 22, 0.35);
}

/* Base Body Styling */
body {
  font-family: var(--font-body);
  color: var(--text-color);
  background: var(--bg-dark);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  padding: 20px;
  position: relative;
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease, font-family var(--transition-speed) ease;
}

body.theme-default {
  background-image: linear-gradient(135deg, rgba(15, 23, 42, 0.45) 0%, rgba(30, 27, 75, 0.45) 50%, rgba(15, 23, 42, 0.45) 100%), url('wedding_background.png');
}

body.theme-disney {
  background-image: linear-gradient(135deg, rgba(26, 15, 46, 0.35) 0%, rgba(59, 7, 100, 0.35) 50%, rgba(26, 15, 46, 0.35) 100%), url('disney_background.png');
}

body.theme-flintstones {
  background-image: linear-gradient(135deg, rgba(69, 26, 3, 0.35) 0%, rgba(124, 45, 18, 0.35) 50%, rgba(69, 26, 3, 0.35) 100%), url('flintstones_background.png');
}

/* Background floating particles */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
  transition: background var(--transition-speed) ease;
}

@keyframes float-slow {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(5%, 10%) scale(1.1);
  }

  100% {
    transform: translate(-5%, -5%) scale(0.9);
  }
}

/* Main Layout Wrapper */
.app-container {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: center;
  z-index: 10;
}

/* Brand Header */
.wedding-header {
  text-align: center;
}

.wedding-logo {
  font-family: var(--font-heading);
  font-size: 3rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(var(--accent-rgb), 0.2);
  margin-bottom: 5px;
  transition: all var(--transition-speed) ease;
}

.wedding-sublogo {
  font-family: var(--font-body);
  font-weight: 300;
  letter-spacing: 6px;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Glassmorphism Card Container */
.escape-card {
  width: 100%;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 35px;
  position: relative;
  overflow: hidden;
  transition: background var(--transition-speed) ease, border var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

/* Step Indicator navigation */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  user-select: none;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
  position: relative;
  flex: 1;
}

.step-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--card-border);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.4s ease;
  font-size: 0.95rem;
}

.step-title {
  font-size: 0.8rem;
  /* up from 0.75rem – more legible */
  text-transform: uppercase;
  letter-spacing: 1.5px;
  /* tightened slightly for readability */
  font-weight: 600;
  /* bolder so muted colour still reads */
  color: var(--text-muted);
  transition: all 0.4s ease;
  text-align: center;
}

.step-line {
  height: 2px;
  background: var(--card-border);
  flex-grow: 1;
  margin: 0 -10px;
  margin-bottom: 24px;
  /* offset alignment with circles */
  position: relative;
  z-index: 1;
  transition: background 0.4s ease;
}

.step.active .step-num {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--bg-dark);
  box-shadow: 0 0 15px var(--glow-color);
}

.step.active .step-title {
  color: var(--text-color);
  font-weight: 600;
}

.step.completed .step-num {
  background: rgba(var(--accent-rgb), 0.2);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.step.completed .step-title {
  color: var(--text-muted);
}

.step-line.filled {
  background: var(--accent-color);
  box-shadow: 0 0 5px var(--glow-color);
}

/* Screen Layout & Animation */
.screen {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.screen.active-screen {
  display: flex;
  flex-direction: column;
}

.screen.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.screen-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 1px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: all var(--transition-speed) ease;
}

.screen-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-color);
  /* elevated from text-muted – description copy must be readable */
  opacity: 0.8;
  margin-bottom: 25px;
}

/* Form and Inputs styling */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.text-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--text-color);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
}

.text-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-color);
  box-shadow: 0 0 15px var(--glow-color);
}

.error-text {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 4px;
}

.hidden {
  display: none !important;
}

/* Theme Hint Box */
.theme-hint-box {
  padding: 12px;
  border-radius: 10px;
  margin-top: 10px;
  text-align: center;
}

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

/* Button UI */
.btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 15px 35px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--bg-dark);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--glow-color);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--card-border);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-color);
}

.btn-block {
  width: 100%;
}

.screen-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 25px;
}

.split-actions {
  justify-content: space-between;
  gap: 15px;
}

/* SCREEN 2: Labyrinth Styles */
.svg-wrapper {
  width: 100%;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 12px;
  border: 1px solid var(--card-border);
  overflow: visible;
  padding: 10px;
  touch-action: none;
  /* Prevent Android from interpreting SVG drags as page scrolls */
}

.labyrinth-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  touch-action: none;
  /* Disable default dragging actions on mobile */
}

/* Labyrinth Map SVG elements */
.labyrinth-wall {
  fill: var(--wall-fill, #1e293b);
  stroke: var(--wall-stroke, #475569);
  stroke-width: var(--wall-stroke-width, 1.5px);
  rx: var(--wall-rx, 6px);
  transition: all 0.3s ease;
}

body.theme-default .labyrinth-wall {
  fill: url(#default-wall-pattern);
}

body.theme-disney .labyrinth-wall {
  fill: url(#disney-wall-pattern);
}

body.theme-flintstones .labyrinth-wall {
  fill: url(#flintstones-wall-pattern);
}

.labyrinth-passage {
  fill: var(--passage-fill, rgba(255, 255, 255, 0.05));
  stroke: var(--passage-stroke, rgba(255, 255, 255, 0.02));
  stroke-width: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.labyrinth-passage.in-path {
  fill: var(--passage-in-path-fill, rgba(251, 191, 36, 0.15));
  pointer-events: auto !important;
  /* Allow backtracking click */
}

.labyrinth-cell-text {
  fill: var(--cell-text-color, var(--text-color));
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  pointer-events: none;
  transition: opacity 0.3s ease, fill 0.3s ease;
}

/* Labyrinth Cell Text Font Theme Overrides */
.theme-default .labyrinth-cell-text {
  font-family: var(--font-heading);
  font-size: 17px;
}

.theme-disney .labyrinth-cell-text {
  font-family: var(--font-heading);
  font-size: 20px;
}

.theme-flintstones .labyrinth-cell-text {
  font-family: var(--font-heading);
  font-size: 15px;
}

/* Fog of War */
.fog-of-war {
  opacity: 0.25 !important;
  transition: all 0.3s ease;
}

.fog-of-war:not(.in-path) {
  pointer-events: none !important;
}

.fog-of-war-text {
  opacity: 0 !important;
  pointer-events: none !important;
}

.labyrinth-path-active {
  stroke: var(--accent-color);
  stroke-width: 6px;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px var(--accent-color));
  fill: none;
  pointer-events: none;
  transition: stroke-dashoffset 0.5s ease, stroke var(--transition-speed) ease;
}

/* Flash nodes/cells green or red based on puzzle results */
.labyrinth-passage.success-pulse {
  fill: rgba(16, 185, 129, 0.35) !important;
  stroke: #10b981 !important;
  animation: successFlash 1s infinite alternate;
}

.labyrinth-passage.error-pulse {
  fill: rgba(239, 68, 68, 0.35) !important;
  stroke: #ef4444 !important;
  animation: errorFlash 1s infinite alternate;
}

@keyframes successFlash {
  0% {
    filter: drop-shadow(0 0 2px #10b981);
  }

  100% {
    filter: drop-shadow(0 0 12px #10b981);
  }
}

@keyframes errorFlash {
  0% {
    filter: drop-shadow(0 0 2px #ef4444);
  }

  100% {
    filter: drop-shadow(0 0 12px #ef4444);
  }
}

/* Pulse animation for clickable adjacent passages */
.labyrinth-passage.clickable-next:not(.in-path) {
  stroke: var(--accent-color);
  stroke-opacity: 0.9;
  stroke-width: 2px;
  animation: cellPulse 1.8s infinite ease-in-out;
}

@keyframes cellPulse {
  0% {
    opacity: 0.8;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.8;
  }
}

.labyrinth-char-token {
  pointer-events: auto !important;
  transition: transform 0.2s cubic-bezier(0.1, 0.8, 0.3, 1);
}

.labyrinth-char-token.dragging {
  transition: none !important;
}

.labyrinth-char-token * {
  pointer-events: auto !important;
}

/* Labyrinth Panels */
.path-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  padding: 16px 20px;
  border-radius: 12px;
}

.spelled-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.spelled-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  color: var(--text-color);
  /* elevated from text-muted for clearer labelling */
  opacity: 0.85;
}

.spelled-word {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  letter-spacing: 3px;
  color: var(--text-color);
  text-shadow: 0 0 8px rgba(var(--accent-rgb), 0.3);
  transition: all var(--transition-speed) ease;
}

.labyrinth-feedback-msg {
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 20px;
  transition: color 0.3s ease;
}

.labyrinth-feedback-msg.success {
  color: #10b981;
}

.labyrinth-feedback-msg.error {
  color: #f87171;
}

/* SCREEN 3: Slider Calibration Styles */
.decrypt-display-box {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.blur-wrapper {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px 15px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90px;
}

.blur-item {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  transition: filter 0.1s ease, color 0.3s ease;
  will-change: filter;
  color: var(--text-color);
}

.sliders-dashboard {
  display: flex;
  flex-direction: column;
  gap: 25px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 15px;
  padding: 25px;
}

.slider-control {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slider-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  /* tightened for readability */
  font-weight: 600;
  color: var(--text-color);
  /* use primary colour for slider labels */
  opacity: 0.85;
  padding-bottom: 6px;
}

/* Custom HTML5 Sliders */
.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  outline: none;
  transition: background 0.3s ease;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: grab;
  box-shadow: 0 0 10px var(--glow-color);
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.1s ease, background var(--transition-speed) ease;
}

.range-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
}

.range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: grab;
  box-shadow: 0 0 10px var(--glow-color);
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.1s ease, background var(--transition-speed) ease;
}

.range-slider::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
}

/* Date Success Reveal Banner */
.date-success-banner {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 15px;
  padding: 25px;
  margin-top: 25px;
  text-align: center;
  animation: slideDownFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.success-icon {
  font-size: 2rem;
  animation: rotateGlow 3s infinite linear;
}

.date-success-banner h3 {
  font-family: var(--font-body);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #34d399;
}

.final-date-badge {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 15px rgba(52, 211, 153, 0.4);
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rotateGlow {
  0% {
    transform: rotate(0deg) scale(1);
    filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.5));
  }

  50% {
    transform: rotate(180deg) scale(1.1);
    filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.8));
  }

  100% {
    transform: rotate(360deg) scale(1);
    filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.5));
  }
}

/* SCREEN 4: RSVP Form layout */
.rsvp-form-layout {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.form-row {
  display: flex;
  gap: 20px;
}

.form-row .form-group {
  flex: 1;
}

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

.form-group label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-color);
  /* use primary text colour for labels – always readable */
  font-weight: 600;
  opacity: 0.85;
  /* slight softening so it doesn't fight the input text */
}

.form-control {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text-color);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}

.form-control:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-color);
  box-shadow: 0 0 12px var(--glow-color);
}

.form-control[readonly] {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  border-color: var(--card-border);
  cursor: not-allowed;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 45px;
  cursor: pointer;
}

/* Theme Override selections for fonts inside inputs */
.theme-default .form-control {
  font-family: 'Outfit', sans-serif;
}

/* Disney: use Outfit for inputs – Satisfy cursive is too hard to read when typing */
.theme-disney .form-control {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
}

.theme-flintstones .form-control {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
}

/* Custom Radio Cards */
.radio-card-group {
  display: flex;
  gap: 15px;
}

.radio-card {
  flex: 1;
  position: relative;
  cursor: pointer;
}

.radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-card-content {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.radio-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 4px;
}

.radio-subtitle {
  font-size: 0.8rem;
  /* up from 0.75rem – more legible at small sizes */
  color: var(--text-color);
  /* use text-color at reduced opacity instead of text-muted */
  opacity: 0.7;
}

.radio-card input[type="radio"]:checked+.radio-card-content {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: var(--accent-color);
  box-shadow: 0 0 15px var(--glow-color);
  transform: translateY(-2px);
}

.radio-card input[type="radio"]:checked+.radio-card-content .radio-title {
  color: var(--accent-color);
}

/* Success Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 100%;
  max-width: 500px;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay:not(.hidden) .modal-content {
  transform: scale(1);
}

.modal-checkmark-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid #10b981;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 5px;
}

.modal-checkmark {
  width: 25px;
  height: 15px;
  border-left: 3px solid #10b981;
  border-bottom: 3px solid #10b981;
  transform: rotate(-45deg) translate(3px, -2px);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: #10b981;
}

.modal-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-color);
  /* elevated from text-muted – modal body copy should always be clear */
  opacity: 0.85;
}

.modal-summary-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 18px;
  text-align: left;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-summary-item {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

.modal-summary-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.modal-summary-label {
  color: var(--text-muted);
  font-weight: 500;
}

.modal-summary-value {
  color: var(--text-color);
  font-weight: 600;
  max-width: 60%;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Footer elements */
.app-footer {
  text-align: center;
  display: flex;
  flex-direction: column;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-color);
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0 4px;
}

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

.designer-credit {
  opacity: 0.6;
}

/* Screen Readers Only accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding: 10px;
    height: 100dvh;
    overflow: hidden;
  }

  .app-container {
    height: 100%;
    justify-content: center;
    gap: 15px;
  }

  .wedding-header {
    margin-bottom: 0px;
  }

  .wedding-logo {
    font-size: 1.8rem;
  }

  .wedding-sublogo {
    font-size: 0.75rem;
  }

  .escape-card {
    padding: 15px 12px;
    gap: 15px;
    height: 100%;
    max-height: fit-content;
    /* limit height to fit screen */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* prevent card itself from scrolling */
  }

  .step-indicator {
    margin-bottom: 0px;
  }

  .step-title {
    display: none;
    /* Hide step texts on small mobile to avoid crowding */
  }

  .step-num {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .step-line {
    margin-bottom: 0px;
    /* Align with centers on mobile */
  }

  .screen {
    flex: 1;
    display: none;
    overflow-y: auto;
    /* enable internal scroll for long screens on very small devices */
    padding-right: 2px;
  }

  .screen.active-screen {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .screen-title {
    font-size: 1.25rem;
    margin-bottom: 5px;
  }

  .screen-desc {
    font-size: 0.8rem;
    margin-bottom: 10px;
    line-height: 1.4;
  }

  .form-row {
    flex-direction: column;
    gap: 10px;
  }

  .radio-card-group {
    flex-direction: column;
    gap: 8px;
  }

  .radio-card {
    padding: 8px;
  }

  .radio-title {
    font-size: 0.875rem;
  }

  .radio-subtitle {
    font-size: 0.75rem;
    /* up from 0.7rem on mobile */
  }

  .decrypt-display-box {
    flex-direction: row;
    /* Keep month, day, year horizontal so they don't stack vertically */
    gap: 8px;
    margin-bottom: 12px;
  }

  .blur-wrapper {
    min-height: 50px;
    padding: 8px 4px;
    flex: 1;
  }

  .blur-item {
    font-size: 0.85rem;
  }

  .sliders-dashboard {
    padding: 12px;
    gap: 12px;
  }

  .slider-control {
    gap: 5px;
    margin-top: 10px;
  }

  .svg-wrapper {
    padding: 4px;
  }

  .path-panel {
    padding: 8px 10px;
  }

  .spelled-word {
    font-size: 1.1rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.85rem;
  }
}

/* -------------------------------------------------------------
   THEME VISUAL OVERRIDES
   ------------------------------------------------------------- */

/* Default Theme Overrides */

/* Select: solid dark background so the OS-native dropdown list stays dark
   instead of falling back to white when the input bg is near-transparent. */
.theme-default select.form-control {
  background-color: #0f172a;
  /* matches --bg-dark for the default theme */
  color: #f8fafc;
  /* --text-color: near-white, fully readable */
  border-color: rgba(255, 255, 255, 0.15);
}

.theme-default select.form-control:focus {
  background-color: #1e293b;
  border-color: #e2e8f0;
}

.theme-default select.form-control option {
  background-color: #0f172a;
  color: #f8fafc;
}

/* Disney Theme Overrides */
.theme-disney {
  --wall-fill: #3b0764;
  --wall-stroke: #f472b6;
  /* glowing magenta borders */
  --wall-stroke-width: 2.5px;
  --wall-rx: 12px;
  --passage-fill: #11072c;
  /* dark starry path passages */
  --passage-stroke: rgba(244, 114, 182, 0.15);
  --cell-text-color: #fef08a;
  /* glowing gold letters */
  --passage-in-path-fill: rgba(244, 114, 182, 0.3);
}

.theme-disney .escape-card {
  border: 1px solid rgba(244, 114, 182, 0.4);
  background: rgba(26, 15, 46, 0.75);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(244, 114, 182, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.theme-disney .wedding-logo,
.theme-disney .screen-title {
  text-shadow: 0 0 15px rgba(244, 114, 182, 0.6), 0 0 30px rgba(168, 85, 247, 0.4);
}

.theme-disney .btn-primary {
  background: linear-gradient(135deg, #f472b6 0%, #a855f7 100%);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 15px rgba(244, 114, 182, 0.3);
}

.theme-disney .btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(244, 114, 182, 0.5);
  transform: translateY(-2px) scale(1.02);
}

/* Select dropdown: force a solid dark background so the browser's native
   option list renders with dark bg + light text – avoids the white-flash
   that occurs when rgba/transparent backgrounds fall back to OS defaults.
   Note: no background-image override here – the base rule's caret arrow
   already has no-repeat/positioning set and will render fine on dark bg. */
.theme-disney select.form-control {
  background-color: #1e0a3c;
  /* solid deep purple – no transparency */
  color: #e2d9f3;
  /* soft lavender-white – readable on dark purple */
  border-color: rgba(244, 114, 182, 0.4);
}

.theme-disney select.form-control:focus {
  background-color: #2a0f52;
  border-color: #f472b6;
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.35);
}

/* Style the individual <option> elements (supported in most browsers) */
.theme-disney select.form-control option {
  background-color: #1e0a3c;
  color: #e2d9f3;
}

.theme-disney .range-slider::-webkit-slider-thumb {
  background: linear-gradient(135deg, #f472b6 0%, #fb7185 100%);
  box-shadow: 0 0 15px rgba(244, 114, 182, 0.6);
}

/* Flintstones Theme Overrides */
.theme-flintstones {
  --wall-fill: #78350f;
  /* blocky stone-textured brown/grey walls */
  --wall-stroke: #451a03;
  --wall-stroke-width: 4px;
  --wall-rx: 0px;
  /* blocky, sharp corners */
  --passage-fill: #ffedd5;
  /* rough stone path */
  --passage-stroke: #d97706;
  --cell-text-color: #451a03;
  /* dark brown letters */
  --passage-in-path-fill: rgba(249, 115, 22, 0.35);
}

.theme-flintstones .form-control,
.theme-flintstones .text-input {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #7c2d12;
  color: #ffedd5;
}

.theme-flintstones .form-control:focus,
.theme-flintstones .text-input:focus {
  background: rgba(0, 0, 0, 0.4);
  border-color: #f97316;
}

.theme-flintstones input::placeholder,
.theme-flintstones select::placeholder,
.theme-flintstones textarea::placeholder {
  color: rgba(253, 186, 116, 0.55);
}

.theme-flintstones .btn-secondary {
  background: #7c2d12;
  color: #ffedd5;
  border: none;
  border-bottom: 4px solid #451a03;
  box-shadow: 0 4px 0 #451a03;
}

.theme-flintstones .btn-secondary:hover:not(:disabled) {
  background: #9a3412;
  box-shadow: 0 2px 0 #451a03;
  transform: translateY(2px);
}

.theme-flintstones .modal-content {
  background: rgba(43, 16, 3, 0.96);
  border: 5px solid #7c2d12;
  border-radius: 28px;
  box-shadow: 0 20px 0 rgba(0, 0, 0, 0.45);
}

.theme-disney .modal-content {
  background: rgba(30, 16, 56, 0.95);
  border: 1px solid rgba(244, 114, 182, 0.35);
  box-shadow: 0 25px 60px rgba(244, 114, 182, 0.15);
}

.theme-flintstones .escape-card {
  border: 5px solid #7c2d12;
  border-radius: 28px;
  background: rgba(43, 16, 3, 0.82);
  box-shadow: 0 20px 0 rgba(0, 0, 0, 0.45),
    0 25px 40px rgba(0, 0, 0, 0.5);
}

.theme-flintstones .wedding-logo,
.theme-flintstones .screen-title {
  text-transform: uppercase;
}

.theme-flintstones .btn {
  border-radius: 6px;
  /* Blockier prehistoric buttons */
  border-bottom: 4px solid #9a3412;
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.4);
}

.theme-flintstones .btn-primary {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffedd5;
  box-shadow: 0 4px 0 #9a3412;
}

.theme-flintstones .btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
  transform: translateY(1px);
  /* press effect */
  box-shadow: 0 2px 0 #9a3412;
}

.theme-flintstones .range-slider {
  height: 12px;
  background: #451a03;
  border-radius: 4px;
  border: 2px solid #7c2d12;
}

.theme-flintstones .range-slider::-webkit-slider-thumb {
  background: #f97316;
  border-radius: 4px;
  /* blocky thumb */
  width: 24px;
  height: 24px;
  border: 2px solid #7c2d12;
  box-shadow: none;
}

/* -------------------------------------------------------------
   THEME TRANSITION PARTICLE ANIMATIONS & EFFECTS
   ------------------------------------------------------------- */

/* Disney Sparkles */
.sparkle-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-family: 'Outfit', sans-serif;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px currentColor;
  animation: sparkle-float 1.5s forwards cubic-bezier(0.1, 0.8, 0.3, 1);
  will-change: transform, opacity;
}

@keyframes sparkle-float {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(0) rotate(0deg);
  }

  30% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--dx), var(--dy), 0) scale(1.5) rotate(var(--rot));
  }
}

/* Flintstones Rocks */
.rock-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  background: #7c2d12;
  border: 2px solid #431407;
  box-shadow: inset -2px -2px 0px rgba(0, 0, 0, 0.3);
  animation: rock-fly 0.8s forwards cubic-bezier(0.15, 0.85, 0.45, 1);
  will-change: transform, opacity;
}

@keyframes rock-fly {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--rot)) scale(0.3);
  }
}

/* Card Screen Shake */
.shake-effect {
  animation: card-shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}

@keyframes card-shake {

  10%,
  90% {
    transform: translate3d(-3px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(5px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-8px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(8px, 0, 0);
  }
}