:root {
  --bg: #140f0c;
  --panel: #1f1712;
  --panel-hi: #2b2019;
  --gold: #f5c542;
  --gold-dim: #b58824;
  --cream: #fff6e0;
  --cherry: #d9383a;
  --teal: #2dd4bf;
  --muted: #b8a792;
  --border: rgba(245, 197, 66, 0.28);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top, #2a1d15 0%, var(--bg) 65%);
  color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  user-select: none;
}

.app-shell {
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  background: linear-gradient(180deg, #1b130e 0%, #120d0a 100%);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.75);
}

/* 70s Vegas Game-Show Marquee Header */
.marquee-bar {
  padding: 10px 12px 8px;
  background: linear-gradient(90deg, #5e1416, #8f1d20, #5e1416);
  border-bottom: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 10;
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-title h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 2px 0 #2e090a;
}

.brand-title span {
  font-size: 10px;
  color: #fde6b8;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.top-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bucks-pill {
  background: #1a120d;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-weight: 800;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 999px;
}

.icon-btn {
  background: rgba(20, 15, 12, 0.75);
  border: 1px solid var(--border);
  color: var(--cream);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
  cursor: pointer;
}

/* Screens */
.screen {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px 16px;
  gap: 10px;
}

.screen.active {
  display: flex;
}

/* Showroom Stage */
.stage-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--gold-dim);
  background: #0d0907;
  aspect-ratio: 16 / 11;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.stage-card.powered img {
  transform: scale(1.04);
  filter: brightness(1.14) contrast(1.05);
}

.stage-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(20, 15, 12, 0.85);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}

.stage-controls {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.stage-btn {
  background: rgba(20, 15, 12, 0.88);
  border: 1.5px solid var(--gold);
  color: var(--cream);
  font-weight: 700;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.stage-btn.on {
  background: var(--gold);
  color: #1c1208;
}

/* Encore Velvet Curtains */
.curtain {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52%;
  background: repeating-linear-gradient(90deg, #6e1015 0px, #9e1b22 14px, #580b10 28px);
  z-index: 5;
  pointer-events: none;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.curtain.left { left: 0; transform: translateX(-105%); }
.curtain.right { right: 0; transform: translateX(105%); }
.stage-card.curtain-closed .curtain.left { transform: translateX(0); }
.stage-card.curtain-closed .curtain.right { transform: translateX(0); }

/* Vacuum Header & Roster Carousel */
.roster-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.roster-strip::-webkit-scrollbar { display: none; }

.roster-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1.5px solid var(--border);
  color: var(--cream);
  padding: 5px 9px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.roster-chip.selected {
  border-color: var(--gold);
  background: #332315;
  color: var(--gold);
}

.roster-chip.locked {
  opacity: 0.65;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* GT Spec Telemetry Card */
.info-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vac-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.vac-heading h2 {
  margin: 0;
  font-size: 18px;
  color: var(--gold);
}

.vac-inspired {
  font-size: 11px;
  color: var(--muted);
}

.tagline {
  font-size: 12px;
  font-style: italic;
  color: #fde68a;
  margin: 0;
}

.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}

.spec-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.spec-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

.spec-label strong {
  color: var(--cream);
}

.spec-bar {
  height: 6px;
  background: #110c09;
  border-radius: 999px;
  overflow: hidden;
}

.spec-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 999px;
}

.perk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.perk-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.14);
  border: 1px solid rgba(45, 212, 191, 0.4);
  color: #99f6e4;
}

/* Culture / Sales Lore & 3-Part Engineering Tour */
.lore-box {
  background: #17110d;
  border-left: 3px solid var(--gold);
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #efe2c8;
}

.part-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.part-tab {
  background: #16100c;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 4px;
  border-radius: 8px;
  cursor: pointer;
}

.part-tab.active {
  border-color: var(--gold);
  color: var(--gold);
  background: #2b1e13;
}

.part-fact {
  font-size: 12px;
  line-height: 1.38;
  color: var(--cream);
  background: #140e0b;
  padding: 7px 9px;
  border-radius: 8px;
}

/* Room Picker & CTA */
.room-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.room-list::-webkit-scrollbar { display: none; }

.room-card {
  flex: 0 0 154px;
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 8px 9px;
  cursor: pointer;
  text-align: left;
  color: var(--cream);
}

.room-card.selected {
  border-color: var(--gold);
  background: #302216;
}

.room-card strong {
  display: block;
  font-size: 12px;
  color: var(--gold);
}

.room-card span {
  font-size: 10px;
  color: var(--muted);
}

.cta-row {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.primary-btn {
  flex: 1;
  background: linear-gradient(180deg, #f7d054 0%, #d49b1d 100%);
  color: #1e1206;
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 197, 66, 0.35);
}

.secondary-btn {
  background: var(--panel-hi);
  color: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

/* Gameplay Screen */
#play-screen {
  padding: 0;
  overflow: hidden;
  position: relative;
}

.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: #17100c;
  border-bottom: 2px solid var(--gold-dim);
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
}

.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-stat small {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
}

.hud-stat span {
  font-size: 14px;
  color: var(--gold);
}

.canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  touch-action: none;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.power-bar {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.power-btn {
  pointer-events: auto;
  background: rgba(20, 14, 10, 0.9);
  border: 2px solid var(--gold);
  color: var(--cream);
  border-radius: 14px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}

.power-btn:disabled {
  opacity: 0.4;
}

/* Round Summary Modal */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 7, 5, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 30;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  background: var(--panel);
  border: 2px solid var(--gold);
  border-radius: 18px;
  padding: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-card h2 {
  margin: 0;
  color: var(--gold);
  font-size: 22px;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.modal-stat {
  background: #140e0a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
}

.modal-stat small {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.modal-stat strong {
  font-size: 16px;
  color: var(--gold);
}
