/* =========================================================
   New Year's Eve Ballroom — Interactive Seating Preview
   Prototype styling. Dark, premium, gold-accented.
   ========================================================= */

:root {
  --bg:        #0a0c12;
  --panel:     rgba(18, 21, 30, 0.82);
  --panel-2:   rgba(26, 30, 42, 0.92);
  --stroke:    rgba(216, 191, 122, 0.28);
  --stroke-2:  rgba(255, 255, 255, 0.08);
  --gold:      #e6c77e;
  --gold-soft: #f3e3b8;
  --text:      #f4f1ea;
  --muted:     #9aa1b1;
  --shadow:    0 18px 50px rgba(0, 0, 0, 0.55);
  --radius:    16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#stage-root { position: fixed; inset: 0; }
#stage-root canvas { display: block; touch-action: none; }

/* ---------- Loading ---------- */
#loading {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% 35%, #14182300, #060709 70%), var(--bg);
  transition: opacity 0.6s ease;
}
#loading.hide { opacity: 0; pointer-events: none; }
.load-inner { text-align: center; }
.load-mark {
  font-family: "Playfair Display", serif;
  font-size: 26px; letter-spacing: 0.04em;
  color: var(--gold-soft); margin-bottom: 18px;
}
.load-bar {
  width: 180px; height: 3px; border-radius: 3px;
  background: rgba(255,255,255,0.1); overflow: hidden; margin: 0 auto;
}
.load-bar span {
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: slide 1.1s infinite ease-in-out;
}
@keyframes slide { 0% { transform: translateX(-120%);} 100% { transform: translateX(360%);} }
.load-text { margin-top: 14px; font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }

/* ---------- Top bar ---------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 22px 26px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6,7,10,0.7), rgba(6,7,10,0));
}
.title-block {
  /* frosted plate so the title stays readable over the bright ballroom */
  background: var(--panel);
  border: 1px solid var(--stroke-2);
  border-radius: 6.8px; /* -15% */
  padding: 14.4px 21.6px 15.6px; /* +20% roomier so the text is not cramped */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.title-block .eyebrow {
  margin: 0 0 4px; font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
}
.title-block h1 {
  margin: 0; font-family: "Playfair Display", serif; font-weight: 600;
  font-size: clamp(20px, 3.4vw, 32px); line-height: 1.05; letter-spacing: 0.01em;
}
.title-block .subtitle { margin: 5px 0 0; font-size: 13px; color: var(--muted); }
.proto-badge {
  pointer-events: auto;
  font-size: 11px; letter-spacing: 0.08em; color: var(--gold);
  border: 1px solid var(--stroke); border-radius: 999px;
  padding: 6px 12px; background: var(--panel); backdrop-filter: blur(8px);
  white-space: nowrap;
}

/* ---------- Legend ---------- */
#legend {
  position: fixed; left: 26px; bottom: 96px; z-index: 20;
  width: 248px; padding: 16px;
  background: var(--panel); border: 1px solid var(--stroke-2);
  border-radius: 4.8px; backdrop-filter: blur(12px); /* radius cut 70% (was 16px) */
  box-shadow: var(--shadow);
}
.legend-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 12px;
}
.legend-head button {
  font: inherit; font-size: 11px; letter-spacing: 0.04em; text-transform: none;
  color: var(--muted); background: none; border: 1px solid var(--stroke-2);
  border-radius: 999px; padding: 3px 9px; cursor: pointer; transition: 0.2s;
}
.legend-head button:hover { color: var(--text); border-color: var(--stroke); }
#tier-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tier-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: 0.18s;
}
.tier-row:hover { background: rgba(255,255,255,0.04); }
.tier-row.active { background: rgba(230,199,126,0.10); border-color: var(--stroke); }
.tier-row .sw { width: 13px; height: 13px; border-radius: 4px; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(255,255,255,0.15); }
.tier-row .tn { flex: 1; font-size: 13.5px; font-weight: 500; }
.tier-row .tp { font-size: 12px; color: var(--muted); }
.legend-hint { margin: 12px 2px 0; font-size: 11.5px; color: var(--muted); }

/* ---------- Info panel ---------- */
#info {
  position: fixed; top: 50%; right: 26px; transform: translateY(-50%);
  z-index: 25; width: 340px; max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--panel-2); border: 1px solid var(--stroke);
  border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  animation: pop 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes pop { from { opacity: 0; transform: translateY(-50%) scale(0.97);} to { opacity: 1; } }
#info-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--stroke-2); background: rgba(0,0,0,0.35);
  color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; transition: 0.2s;
}
#info-close:hover { background: rgba(0,0,0,0.6); }
.info-photo { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: #11141d; }
.info-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-caption {
  position: absolute; left: 12px; bottom: 10px;
  font-size: 11px; color: var(--gold-soft); letter-spacing: 0.04em;
  background: rgba(0,0,0,0.45); padding: 4px 9px; border-radius: 999px; backdrop-filter: blur(4px);
}
.info-body { padding: 18px; }
.info-head { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 16px; }
.info-swatch { width: 16px; height: 16px; border-radius: 5px; margin-top: 5px; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(255,255,255,0.15); }
.info-head h2 { margin: 0; font-family: "Playfair Display", serif; font-size: 22px; font-weight: 600; }
.info-tagline { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.info-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.meta-cell { background: rgba(255,255,255,0.035); border: 1px solid var(--stroke-2); border-radius: 11px; padding: 10px 12px; }
.meta-label { display: block; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.meta-value { font-size: 16px; font-weight: 600; color: var(--gold-soft); }
.info-section { margin-bottom: 15px; }
.info-section h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.info-section p { margin: 0; font-size: 13.5px; line-height: 1.55; color: #d9dae0; }
#info-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
#info-perks li { position: relative; padding-left: 22px; font-size: 13.5px; line-height: 1.45; color: #d9dae0; }
#info-perks li::before {
  content: "✦"; position: absolute; left: 0; top: 0; color: var(--gold); font-size: 12px;
}
.info-foot { margin: 4px 0 0; font-size: 11px; color: #6f7585; font-style: italic; }

/* ---------- Bottom controls ---------- */
#controls {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 20; display: flex; align-items: center; gap: 18px;
  padding: 10px 14px; background: var(--panel); border: 1px solid var(--stroke-2);
  border-radius: 999px; backdrop-filter: blur(12px); box-shadow: var(--shadow);
}
#controls .hint { margin: 0; font-size: 12px; color: var(--muted); }
#controls .hint strong { color: var(--text); font-weight: 600; }
.control-btns { display: flex; gap: 8px; }
.ctl {
  font: inherit; font-size: 12.5px; color: var(--text); white-space: nowrap;
  background: rgba(255,255,255,0.05); border: 1px solid var(--stroke-2);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: 0.2s;
}
.ctl:hover { border-color: var(--stroke); background: rgba(230,199,126,0.10); }
.ctl.active { color: var(--gold-soft); border-color: var(--stroke); background: rgba(230,199,126,0.12); }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); color: var(--text); font-size: 16px; }

/* ---------- Responsive / mobile ---------- */
@media (max-width: 820px) {
  /* Title becomes a flush nav bar pinned to the very top of the viewport (no floating card) */
  #topbar {
    padding: 0;
    background: var(--panel-2);
    border-bottom: 1px solid var(--stroke-2);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .proto-badge { display: none; }
  /* Fill the bar edge-to-edge and shed the card styling so it reads as a nav, not a plate */
  .title-block {
    flex: 1; text-align: center;
    background: none; border: none; border-radius: 0; box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    padding: 10px 14px 11px;
  }

  /* Seating tiers move to the bottom, just above the controls widget */
  #legend {
    left: 12px; right: 12px; top: auto; bottom: 66px; width: auto;
    padding: 12px;
  }
  #tier-list { grid-template-columns: 1fr 1fr; }
  .legend-hint { display: none; }
  /* Hide the tiers list while the detail sheet is open so it doesn't show through it */
  body.info-open #legend { display: none; }

  /* Info panel becomes a bottom sheet */
  #info {
    top: auto; bottom: 0; right: 0; left: 0; transform: none;
    width: auto; max-height: 72vh; border-radius: 18px 18px 0 0;
    animation: sheet 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  @keyframes sheet { from { transform: translateY(100%);} to { transform: translateY(0);} }
  .info-photo { aspect-ratio: 16 / 7; }

  /* Tier name on the left; From + Capacity compact on the right of the same row */
  .info-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
  .info-head { margin-bottom: 0; flex: 1 1 auto; min-width: 0; }
  .info-meta {
    margin-bottom: 0; flex: 0 0 auto;
    display: flex; flex-direction: column; gap: 4px; align-items: flex-end; text-align: right;
  }
  .meta-cell { background: none; border: none; padding: 0; display: flex; align-items: baseline; gap: 6px; }
  .meta-label { margin-bottom: 0; }
  .meta-value { font-size: 15px; }

  #controls { bottom: 12px; gap: 10px; padding: 8px 10px; }
  #controls .hint { display: none; }
  /* Hide the floating controls only while the bottom-sheet detail panel is open */
  #info:not([hidden]) ~ #controls { display: none; }
}

@media (max-width: 480px) {
  .title-block h1 { font-size: 19px; }
  .title-block .subtitle { font-size: 11.5px; }
}
