:root {
  --bg: #07090f;
  --surface: rgba(62, 230, 255, 0.05);
  --surface-strong: rgba(176, 107, 255, 0.08);
  --cyan: #3ee6ff;
  --violet: #b06bff;
  --text: #e8ecf4;
  --dim: #93a0b8;
  --error: #ff7d95;
  --display: 'Rajdhani', 'Space Grotesk', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 50% -8%, rgba(62, 230, 255, 0.07), transparent 55%),
    radial-gradient(ellipse at 8% 30%, rgba(176, 107, 255, 0.05), transparent 50%);
  color: var(--text);
  font-family: var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--cyan); text-decoration: none; }
a:hover, a:focus-visible { color: #8ff2ff; text-shadow: 0 0 12px rgba(62, 230, 255, 0.5); }

h2 { font-family: var(--display); font-weight: 500; letter-spacing: 2px; text-transform: uppercase; font-size: clamp(20px, 2.6vw, 28px); margin: 0 0 10px; }

#splash { position: fixed; inset: 0; z-index: 50; }
.splash-doors { position: absolute; inset: 0; display: flex; }
.splash-door {
  width: 50%;
  height: 100%;
  background: #05070c;
  display: flex;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  transition: transform 1.15s cubic-bezier(0.85, 0, 0.15, 1);
}
.door-left { justify-content: flex-end; }
.door-right { justify-content: flex-start; }
.splash-logo {
  width: min(240px, 42vw);
  height: auto;
  flex: none;
  animation: heartbeat 1.9s ease-in-out infinite, heartglow 1.9s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 32%, 52%, 100% { transform: scale(1); }
  12% { transform: scale(1.045); }
  42% { transform: scale(1.085); }
}
@keyframes heartglow {
  0%, 32%, 52%, 100% { filter: drop-shadow(0 0 18px rgba(62, 230, 255, 0.28)) drop-shadow(0 0 46px rgba(176, 107, 255, 0.18)); }
  12% { filter: drop-shadow(0 0 26px rgba(62, 230, 255, 0.42)) drop-shadow(0 0 64px rgba(176, 107, 255, 0.3)); }
  42% { filter: drop-shadow(0 0 34px rgba(62, 230, 255, 0.52)) drop-shadow(0 0 84px rgba(176, 107, 255, 0.4)); }
}
.logo-l { margin-right: calc(min(240px, 42vw) / -2); }
.logo-r { margin-left: calc(min(240px, 42vw) / -2); }
#splash.open .door-left { transform: translateX(-101%); }
#splash.open .door-right { transform: translateX(101%); }
.splash-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding-bottom: 12vh;
  transition: opacity 0.3s;
  pointer-events: none;
}
.splash-ui > * { pointer-events: auto; }
#splash.open .splash-ui { opacity: 0; pointer-events: none; }
.splash-enter {
  background: none;
  border: 0;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: var(--cyan);
  cursor: pointer;
  padding: 10px;
}
.breathe { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { opacity: 0.5; text-shadow: none; }
  50% { opacity: 1; text-shadow: 0 0 20px rgba(62, 230, 255, 0.85); }
}
.splash-login {
  background: none;
  border: 0;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--dim);
  cursor: pointer;
  padding: 8px;
}
.splash-login:hover, .splash-login:focus-visible { color: var(--cyan); text-shadow: 0 0 12px rgba(62, 230, 255, 0.5); }
.splash-insta { display: inline-flex; color: var(--dim); }
.splash-insta:hover, .splash-insta:focus-visible { color: var(--cyan); }

#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
  background: var(--bg);
  z-index: 20;
}
.side-item {
  background: none;
  border: 0;
  color: var(--dim);
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.side-item:hover, .side-item:focus-visible { color: var(--cyan); filter: drop-shadow(0 0 8px rgba(62, 230, 255, 0.5)); }
.side-item.active { color: var(--cyan); filter: drop-shadow(0 0 10px rgba(62, 230, 255, 0.6)); }
.side-logo svg { width: 30px; height: 30px; }
.side-user {
  margin-top: auto;
  width: auto;
  padding: 0 4px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--violet);
}
.side-user:hover, .side-user:focus-visible { color: #d3aaff; filter: drop-shadow(0 0 8px rgba(176, 107, 255, 0.5)); }

#view, .site-footer { margin-left: 64px; }
#view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px clamp(10px, 3vw, 40px) 30px;
  min-width: 0;
  flex: 1;
}
#view > section { width: 100%; max-width: 1248px; }
#view-home { display: flex; flex-direction: column; gap: 22px; }
.home-head { text-align: center; }
.home-head h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: 3px;
  text-transform: lowercase;
  margin: 0 0 6px;
}
.home-head em { color: var(--cyan); font-style: normal; }

.login-card {
  width: min(420px, 100%);
  margin: 24px auto;
  padding: 26px 22px;
  background: linear-gradient(160deg, #131a28, #0a0d15);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.login-card form { width: 100%; }
.login-logo { filter: drop-shadow(0 0 18px rgba(62, 230, 255, 0.35)); }
.otp-boxes { display: flex; gap: 10px; justify-content: center; }
.otp-box {
  width: 44px;
  height: 52px;
  text-align: center;
  background: var(--surface);
  border: 0;
  border-radius: 8px;
  color: var(--text);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
}
.otp-box:focus { outline: none; background: var(--surface-strong); box-shadow: 0 0 16px rgba(62, 230, 255, 0.25); }

.chart-chip {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 3;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--violet);
  padding: 3px 12px;
  background: rgba(10, 13, 21, 0.72);
  border-radius: 20px;
  text-shadow: 0 1px 4px #000;
}

@media (max-width: 720px) {
  #sidebar {
    top: auto;
    bottom: 0;
    width: 100%;
    height: 58px;
    flex-direction: row;
    justify-content: center;
    padding: 0 12px;
  }
  .side-user { margin-top: 0; margin-left: auto; }
  #view, .site-footer { margin-left: 0; }
  body { padding-bottom: 58px; }
  .journal { left: 14px; }
  .hud-hint { left: 14px; }
}

#view-game { display: flex; flex-direction: column; align-items: center; }

.game-wrap {
  position: relative;
  width: 100%;
  max-width: 1248px;
  border-radius: 14px;
  overflow: hidden;
  background: #05070c;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(62, 230, 255, 0.08);
}

#game {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  touch-action: none;
}

.hud-hint, .hud-quest {
  position: absolute;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--dim);
  text-shadow: 0 1px 4px #000;
  pointer-events: none;
}
.hud-hint { left: 78px; bottom: 12px; }
.hud-hint.hot { color: var(--cyan); text-shadow: 0 0 10px rgba(62, 230, 255, 0.6); }
.hud-quest { right: 14px; top: 12px; color: var(--violet); }

.dpad { position: absolute; right: 14px; bottom: 12px; display: none; grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(2, 46px); gap: 6px; }
.dpad-btn {
  background: rgba(62, 230, 255, 0.06);
  border: 0;
  border-radius: 10px;
  color: var(--cyan);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  touch-action: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dpad-btn:active { color: #8ff2ff; text-shadow: 0 0 10px rgba(62, 230, 255, 0.8); }
.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-act { grid-column: 2; grid-row: 2; color: var(--violet); }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { display: none; }
@media (pointer: coarse) {
  .dpad { display: grid; grid-template-columns: repeat(4, 46px); grid-template-rows: 46px; }
  .dpad-btn { grid-row: 1; }
  .dpad-left { grid-column: 1; }
  .dpad-up { grid-column: 2; }
  .dpad-down { display: inline-flex; grid-column: 2; grid-row: 1; margin-top: 52px; }
  .dpad-right { grid-column: 3; }
  .dpad-act { grid-column: 4; }
  .hud-hint { display: none; }
}

.dialog {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 14px 18px;
  background: linear-gradient(160deg, rgba(19, 26, 40, 0.96), rgba(10, 13, 21, 0.96));
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(176, 107, 255, 0.1);
}
.dialog-name {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--violet);
}
.dialog-text { margin: 0 0 10px; color: var(--text); font-size: 15px; line-height: 1.5; }
.dialog-choices { display: flex; flex-wrap: wrap; gap: 4px 24px; }

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 12, 0.82);
  padding: 16px;
}
.overlay-card {
  width: min(440px, 94%);
  max-height: 94%;
  overflow-y: auto;
  padding: 22px;
  background: linear-gradient(160deg, #131a28, #0a0d15);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), 0 0 30px rgba(62, 230, 255, 0.12);
}
.overlay-card h2 { text-align: center; }
.overlay-card .panel-sub { margin-bottom: 16px; }

.creation-v1 { width: min(480px, 96%); }
.creation-v1 form { align-items: center; gap: 16px; }
.creation-v1 h2 { margin-bottom: 0; }
#ghost-preview { image-rendering: pixelated; }
#c-name {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(176, 107, 255, 0.4);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  width: 200px;
  padding: 6px 0;
  outline: none;
}
#c-name::placeholder { color: rgba(232, 236, 244, 0.25); }
#c-name:focus { border-bottom-color: rgba(176, 107, 255, 0.9); }
#color-wheel { display: block; }
.wheel-seg { cursor: pointer; }
.wheel-seg:hover { filter: drop-shadow(0 0 6px rgba(62, 230, 255, 0.8)); }
.wheel-seg.sel { filter: drop-shadow(0 0 8px rgba(176, 107, 255, 0.9)); }
.wheel-center { cursor: pointer; fill: rgba(62, 230, 255, 0.06); }
.wheel-center:hover { filter: drop-shadow(0 0 8px rgba(62, 230, 255, 0.8)); }


#view > section#view-game {
  position: fixed;
  inset: 0;
  z-index: 15;
  max-width: none;
  padding: 0;
  background: var(--bg);
}
#view > section#view-game .game-wrap {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  box-shadow: none;
}
#view > section#view-game #game {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#welcome {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 12, 0.9);
  padding: 16px;
}
.welcome-card {
  width: min(460px, 94%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.welcome-card p { margin: 0; color: var(--text); line-height: 1.6; }

.home-legal { text-align: center; margin: 0; }

.panel.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  max-width: none;
  margin: 0;
  border-radius: 0;
  background: rgba(4, 6, 12, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.panel.modal > * { width: 100%; max-width: 680px; }

.journal {
  position: absolute;
  left: 78px;
  bottom: 48px;
  z-index: 4;
  max-width: min(520px, 68%);
  pointer-events: none;
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--text);
  text-shadow: 0 1px 4px #000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
}
.journal p { margin: 0; }
.journal p.old { opacity: 0.45; }
.journal em { color: var(--cyan); }

.panel {
  width: 100%;
  max-width: 1248px;
  margin-top: 18px;
  padding: 20px;
  background: linear-gradient(160deg, #131a28, #0a0d15);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
.panel h2 { text-align: center; margin-bottom: 6px; }
.panel-sub { text-align: center; color: var(--dim); margin: 0 0 18px; font-size: 14px; }
.panel-close { display: block; margin: 0 auto 6px; }

.reading-body { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.reading-sec h3 {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--violet);
  margin: 0 0 4px;
}
.reading-sec p { margin: 0 0 4px; color: var(--text); font-size: 15px; line-height: 1.55; }
.reading-sec p.dim { color: var(--dim); }

.story-text { max-width: 640px; margin: 0 auto 16px; }
.story-text p { margin: 0 0 12px; font-size: 16px; line-height: 1.65; color: var(--text); }
.story-choices { display: flex; flex-direction: column; gap: 6px; max-width: 640px; margin: 0 auto; }

.choice-btn {
  background: none;
  border: 0;
  text-align: left;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--cyan);
  padding: 8px 4px;
  cursor: pointer;
}
.choice-btn:hover, .choice-btn:focus-visible { color: #8ff2ff; text-shadow: 0 0 14px rgba(62, 230, 255, 0.55); }
.choice-btn.match { color: var(--violet); }
.choice-btn.match:hover, .choice-btn.match:focus-visible { color: #d3aaff; text-shadow: 0 0 14px rgba(176, 107, 255, 0.6); }
.choice-btn.done { color: var(--dim); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(14px, 2vw, 22px);
}

.service-card { perspective: 1200px; cursor: pointer; outline: none; }
.service-card:focus-visible .card-inner { box-shadow: 0 0 0 2px rgba(62, 230, 255, 0.55), 0 0 30px rgba(62, 230, 255, 0.22); }

.card-inner {
  position: relative;
  min-height: 264px;
  transition: transform 0.65s cubic-bezier(0.35, 0.1, 0.2, 1);
  transform-style: preserve-3d;
  border-radius: 14px;
}
.service-card.flipped .card-inner { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 24px 18px;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 50% -12%, rgba(62, 230, 255, 0.10), transparent 55%),
    linear-gradient(155deg, #161d2c 0%, #0d1220 55%, #0a0d15 100%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.service-card:nth-child(even) .card-face {
  background:
    radial-gradient(ellipse at 50% -12%, rgba(176, 107, 255, 0.11), transparent 55%),
    linear-gradient(155deg, #161d2c 0%, #0d1220 55%, #0a0d15 100%);
}
.service-card:hover .card-front { box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 36px rgba(62, 230, 255, 0.22); }
.service-card:nth-child(even):hover .card-front { box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 36px rgba(176, 107, 255, 0.22); }
.card-back { transform: rotateY(180deg); }
.service-card:not(.flipped) .card-back { visibility: hidden; }
.service-card.flipped .card-front { visibility: hidden; }

.card-icon { width: 52px; height: 52px; color: var(--cyan); filter: drop-shadow(0 0 10px rgba(62, 230, 255, 0.35)); }
.service-card:nth-child(even) .card-icon { color: var(--violet); filter: drop-shadow(0 0 10px rgba(176, 107, 255, 0.35)); }
.card-title { font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; margin: 0; }
.card-tag { margin: 0; color: var(--dim); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.card-price { margin: 4px 0 0; font-family: var(--display); font-size: 24px; font-weight: 600; color: var(--cyan); text-shadow: 0 0 16px rgba(62, 230, 255, 0.4); }
.service-card:nth-child(even) .card-price { color: var(--violet); text-shadow: 0 0 16px rgba(176, 107, 255, 0.4); }
.card-offer { margin: 0; font-size: 12px; color: var(--dim); }
.card-badge { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--bg); background: var(--cyan); padding: 2px 10px; border-radius: 20px; }
.card-hint { margin: 6px 0 0; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); opacity: 0.7; }

.card-back .card-title { color: var(--cyan); }
.card-back p, .card-back li { margin: 0; color: var(--dim); font-size: 13.5px; }
.card-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.card-slot { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--violet); }

.book-btn {
  background: none;
  border: 0;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 10px 4px;
  cursor: pointer;
}
.book-btn:hover, .book-btn:focus-visible { color: #8ff2ff; text-shadow: 0 0 14px rgba(62, 230, 255, 0.55); }
.book-btn:disabled { color: var(--dim); cursor: wait; text-shadow: none; }

.booking {
  width: 100%;
  max-width: 680px;
  margin: 18px auto 0;
  padding: 22px;
  background: linear-gradient(160deg, #131a28, #0a0d15);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.booking h2 { text-align: center; }

form { display: flex; flex-direction: column; gap: 18px; }
.form-actions { display: flex; gap: 32px; justify-content: center; }

.form-summary {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--cyan);
  text-align: center;
  padding: 14px 10px;
  background: var(--surface);
  border-radius: 10px;
}

#fields { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); }
.field-note { margin: 0; font-size: 13px; color: var(--dim); }

.field input[type="text"], .field input[type="number"], .field input[type="date"], .field input[type="time"], .field textarea, .field select, #booking-summary {
  background: var(--surface);
  border: 0;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
  width: 100%;
  color-scheme: dark;
}
.field input:focus, .field textarea:focus, .field select:focus, #booking-summary:focus {
  outline: none;
  background: var(--surface-strong);
  box-shadow: 0 0 18px rgba(62, 230, 255, 0.14);
}

.question-group { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface); border-radius: 10px; border: 0; margin: 0; }
.question-group .q-title { font-family: var(--display); font-weight: 600; letter-spacing: 1px; color: var(--cyan); font-size: 15px; }
.question-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.consent { display: flex; gap: 10px; align-items: flex-start; color: var(--dim); font-size: 14px; cursor: pointer; }
.consent input { margin-top: 4px; accent-color: var(--cyan); }

.form-error { margin: 0; color: var(--error); }

.booking-done { display: flex; flex-direction: column; gap: 14px; }
.booking-done p { margin: 0; color: var(--dim); }
.done-actions { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: center;
  align-items: center;
  padding: 26px 20px 30px;
  color: var(--dim);
  font-size: 13px;
}
.site-footer svg { width: 22px; height: 22px; }
.site-footer a[aria-label="Instagram"] { display: inline-flex; color: var(--dim); }
.site-footer a[aria-label="Instagram"]:hover, .site-footer a[aria-label="Instagram"]:focus-visible { color: var(--cyan); }

@media (max-width: 560px) {
  .question-pair { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .dialog { left: 8px; right: 8px; bottom: 8px; }
}
