:root {
  --bg-1: #0b1020;
  --bg-2: #131a31;
  --card: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --muted: #b8c2d8;
  --accent: #60a5fa;
  --accent-2: #a78bfa;
  --success: #22c55e;
  --gold: #facc15;
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  min-height: 100%;
}

.page-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(96,165,250,.18), transparent 35%),
    radial-gradient(circle at top right, rgba(167,139,250,.14), transparent 30%),
    radial-gradient(circle at bottom center, rgba(250,204,21,.10), transparent 22%);
  pointer-events: none;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr .9fr;
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: #c4b5fd;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.02;
}

.hero-text {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.stat-card {
  min-width: 180px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
}

.money-card {
  background: linear-gradient(180deg, rgba(250,204,21,.16), rgba(250,204,21,.08));
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 6px;
}

.stat-card strong { font-size: 1.4rem; }

.hero-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.hero-badge {
  align-self: flex-start;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #08111f;
  font-weight: 700;
  letter-spacing: .08em;
}

.hero-note {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--card);
}

.hero-note h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.hero-note p {
  margin: 0;
  color: #dbeafe;
}

.legend {
  display: flex;
  gap: 18px;
  margin: 20px 4px 24px;
  color: var(--muted);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot.locked { background: #64748b; }
.dot.open { background: var(--success); }
.dot.ready { background: var(--gold); }

.door-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
}

.door {
  position: relative;
  overflow: hidden;
  min-height: 295px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04)),
    radial-gradient(circle at top left, rgba(255,255,255,.10), transparent 35%);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.door::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.08));
  pointer-events: none;
}

.door-top, .door-bottom {
  position: relative;
  z-index: 1;
}

.door-number {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin: 0 0 10px;
}

.door-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: .85rem;
  background: rgba(255,255,255,.08);
  color: var(--muted);
}

.door-status.open {
  color: #dcfce7;
  background: rgba(34,197,94,.16);
}

.door-status.scheduled {
  color: #fef3c7;
  background: rgba(250,204,21,.14);
}

.door-doorframe {
  position: relative;
  margin-top: 14px;
  height: 88px;
  perspective: 1000px;
}

.door-panel {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(96,165,250,.28), rgba(167,139,250,.28));
  border: 1px solid rgba(255,255,255,.18);
  transform-origin: left center;
  transition: transform .9s ease, opacity .9s ease;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

.door-panel::before {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: #fde68a;
}

.door.opened .door-panel {
  transform: rotateY(-110deg);
  opacity: .35;
}

.door-info {
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.45;
  margin: 10px 0 0;
}

.door-meta {
  margin-top: 14px;
  color: #fde68a;
  font-size: .95rem;
}

.door-code-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.door input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(10,15,30,.65);
  color: var(--text);
  outline: none;
}

.door button {
  border: none;
  border-radius: 14px;
  padding: 11px 14px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #08111f;
}

.door button:hover { opacity: .92; }

.door button:disabled,
.door input:disabled {
  opacity: .7;
  cursor: default;
}

.error {
  min-height: 18px;
  margin-top: 8px;
  font-size: .85rem;
  color: #fda4af;
}

.locked-note {
  margin-top: 12px;
  color: #fef3c7;
  font-size: .86rem;
  min-height: 18px;
}

.door-open-btn {
  width: 100%;
  margin-top: 14px;
  background: linear-gradient(90deg, #22c55e, #86efac) !important;
  color: #052e16 !important;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 99;
}

.modal.show { display: block; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3,7,18,.7);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 6vh auto;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.modal-image-wrap {
  position: relative;
  background: #020617;
}

.slider-stage {
  width: 100%;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020617;
}

.slider-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
}

.slider-prev { left: 12px; }
.slider-next { right: 12px; }

.slider-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  border: none;
  cursor: pointer;
  padding: 0;
}

.slider-dot.active {
  background: #fff;
}

.finale-overlay {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  font-size: 2.2rem;
  text-shadow: 0 10px 20px rgba(0,0,0,.5);
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.18));
}

.finale-overlay.show {
  display: flex;
}

.finale-center {
  font-size: 3rem;
  animation: float-finale 1.6s ease-in-out infinite alternate;
}

@keyframes float-finale {
  from { transform: translateY(-4px) scale(1); }
  to { transform: translateY(6px) scale(1.08); }
}

.modal-content { padding: 22px; }

.modal-door {
  margin: 0 0 8px;
  color: #c4b5fd;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .85rem;
}

.modal-content h2 {
  margin: 0 0 14px;
  font-size: 1.8rem;
}

.modal-content p {
  margin: 8px 0;
  color: #dbeafe;
  line-height: 1.5;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 5;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
  background: rgba(15,23,42,.75);
  color: #fff;
}

.confetti-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 120;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 18px;
  top: -30px;
  opacity: .9;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(110vh) rotate(720deg); }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .modal-card { margin: 3vh 14px; }
  .slider-stage { height: 260px; }
  .finale-overlay { font-size: 1.5rem; }
  .finale-center { font-size: 2rem; }
}