:root {
  --ink: #102a43;
  --cream: #fffaf0;
  --purple: #6b46c1;
  --purple2: #805ad5;
  --cyan: #00b5d8;
  --gold: #f6ad55;
  --green: #38a169;
  --shadow: 0 18px 50px rgba(16,42,67,.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body {
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 20%, rgba(0,181,216,.18), transparent 25%),
    radial-gradient(circle at 88% 18%, rgba(246,173,85,.22), transparent 22%),
    radial-gradient(circle at 75% 85%, rgba(128,90,213,.18), transparent 26%),
    var(--cream);
  user-select: none;
  touch-action: manipulation;
}

button, input { font: inherit; }
button { cursor: pointer; border: 0; }

header {
  position: fixed;
  z-index: 20;
  top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 26px;
}
.museum-name {
  background: transparent; color: var(--ink); opacity: .72; font-weight: 800; font-size: clamp(14px, 1.25vw, 28px);
}
.status-dot {
  width: 16px; height: 16px; border-radius: 50%; background: #a0aec0; box-shadow: 0 0 0 5px rgba(160,174,192,.18);
}
.status-dot.ok { background: var(--green); box-shadow: 0 0 0 5px rgba(56,161,105,.18); }

.screen {
  position: absolute; inset: 0;
  display: none;
  padding: 90px 6vw 50px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}
.screen.active { display: flex; animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: scale(1); } }

.sparkles { font-size: clamp(34px, 5vw, 90px); color: var(--gold); letter-spacing: .45em; margin-left: .45em; }
.eyebrow { letter-spacing: .23em; font-weight: 900; font-size: clamp(16px, 1.5vw, 30px); opacity: .7; }
h1 {
  margin: .12em 0 .18em;
  font-size: clamp(64px, 9vw, 170px);
  line-height: .8;
  letter-spacing: -.055em;
  color: var(--purple);
  text-shadow: 0 6px 0 rgba(255,255,255,.8);
}
h2 {
  margin: .2em 0;
  font-size: clamp(44px, 5.3vw, 105px);
  line-height: .95;
  letter-spacing: -.04em;
}
.hero-sub, .question-help {
  font-size: clamp(22px, 2.1vw, 42px);
  max-width: 1100px;
  margin: .5em auto 1.1em;
  line-height: 1.3;
}
.giant {
  min-width: min(720px, 82vw);
  min-height: 120px;
  border-radius: 34px;
  padding: 28px 50px;
  font-size: clamp(30px, 3vw, 60px);
  font-weight: 950;
  box-shadow: var(--shadow);
}
.primary { background: linear-gradient(135deg, var(--purple), var(--purple2)); color: white; }
.primary:active { transform: scale(.98); }
.tiny { margin-top: 22px; opacity: .55; font-size: clamp(15px, 1.3vw, 26px); text-transform: uppercase; letter-spacing: .16em; }

.progress {
  width: min(1000px, 74vw);
  height: 13px;
  border-radius: 30px;
  background: rgba(16,42,67,.1);
  overflow: hidden;
  margin-bottom: 28px;
}
#progressBar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--purple2));
  transition: width .25s;
}
.choice-grid {
  width: min(1500px, 92vw);
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
  margin: 18px 0 26px;
}
.choice {
  min-height: 112px;
  padding: 18px;
  border-radius: 26px;
  background: rgba(255,255,255,.84);
  border: 4px solid rgba(107,70,193,.12);
  color: var(--ink);
  font-weight: 900;
  font-size: clamp(22px, 2vw, 40px);
  box-shadow: 0 10px 30px rgba(16,42,67,.09);
}
.choice .emoji { font-size: 1.35em; margin-right: .25em; }
.choice:active, .choice.selected { border-color: var(--purple2); background: #f3e8ff; transform: scale(.98); }

.free-entry {
  display: flex;
  width: min(1200px, 92vw);
  gap: 14px;
  align-items: stretch;
}
.free-entry input {
  flex: 1;
  min-height: 84px;
  border-radius: 24px;
  border: 4px solid rgba(16,42,67,.12);
  padding: 12px 24px;
  font-size: clamp(24px, 2vw, 38px);
  outline: none;
  user-select: text;
}
.free-entry input:focus { border-color: var(--cyan); }
.pill {
  min-height: 76px;
  padding: 12px 28px;
  border-radius: 24px;
  background: white;
  color: var(--ink);
  font-weight: 900;
  font-size: clamp(20px, 1.6vw, 32px);
  box-shadow: 0 8px 22px rgba(16,42,67,.12);
}
.round-button {
  aspect-ratio: 1; min-width: 84px; border-radius: 50%; background: var(--cyan); color: white;
  font-size: 38px;
}
.round-button.recording { animation: pulse 1s infinite; background: #e53e3e; }
@keyframes pulse { 50% { transform: scale(1.08); box-shadow: 0 0 0 14px rgba(229,62,62,.18);} }
.mic-status { min-height: 38px; margin-top: 10px; font-size: 20px; font-weight: 800; opacity: .72; }
.back-button {
  position: absolute; left: 34px; bottom: 30px; background: transparent; color: var(--ink);
  font-weight: 900; font-size: 24px;
}

.machine-orb {
  display: grid; place-items: center;
  width: clamp(150px, 16vw, 310px); aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--purple2));
  color: white; font-size: clamp(90px, 10vw, 190px);
  box-shadow: 0 0 0 22px rgba(128,90,213,.08), var(--shadow);
  animation: float 1.8s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-12px) rotate(4deg); } }
#building h2 { font-size: clamp(38px, 4.4vw, 85px); margin-top: .55em; }
#buildMessage { font-size: clamp(24px, 2vw, 40px); font-weight: 800; }
.build-bar { width: min(850px, 70vw); height: 26px; background: rgba(16,42,67,.1); border-radius: 30px; overflow: hidden; }
.build-bar div { height: 100%; width: 35%; background: linear-gradient(90deg, var(--cyan), var(--purple2)); border-radius: inherit; animation: loading 1.4s infinite ease-in-out; }
@keyframes loading { 0% { transform: translateX(-100%); } 100% { transform: translateX(385%); } }

.reveal-layout {
  width: min(1750px, 95vw);
  display: grid;
  grid-template-columns: minmax(380px, .9fr) minmax(500px, 1.1fr);
  gap: 42px;
  align-items: center;
  text-align: left;
}
.image-wrap {
  background: white; padding: 14px; border-radius: 42px; box-shadow: var(--shadow); overflow: hidden;
}
.image-wrap img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 30px; }
.creature-card { padding-right: 2vw; }
.creature-card h2 { color: var(--purple); }
.scientific { font-style: italic; font-size: clamp(20px,1.5vw,31px); opacity: .65; margin-bottom: 22px; }
#creatureDescription { font-size: clamp(22px,1.7vw,34px); line-height: 1.45; }
.fun-fact { font-size: clamp(20px,1.5vw,30px); font-weight: 800; padding: 20px 24px; border-radius: 22px; background: rgba(246,173,85,.2); }
.reveal-buttons { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }

.overlay {
  position: fixed; z-index: 100; inset: 0; background: rgba(16,42,67,.74);
  display: grid; place-items: center; padding: 30px;
}
.hidden { display: none !important; }
.admin-card {
  position: relative; width: min(800px, 92vw); max-height: 90vh; overflow: auto;
  background: white; border-radius: 30px; padding: 40px; box-shadow: var(--shadow); user-select: text;
}
.admin-card h2 { font-size: 48px; }
.close-button { position: absolute; right: 22px; top: 15px; background: transparent; font-size: 48px; }
#adminPin { width: 100%; padding: 18px; border: 2px solid #cbd5e0; border-radius: 15px; font-size: 28px; margin-bottom: 14px; }
.admin-error { color: #c53030; font-weight: 800; margin-top: 12px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
.metric { background: #f7fafc; padding: 22px; border-radius: 20px; text-align: center; }
.metric span { display: block; font-size: 54px; font-weight: 950; color: var(--purple); }
.metric small { font-size: 18px; }
.admin-row { display: flex; justify-content: space-between; padding: 14px 5px; border-bottom: 1px solid #edf2f7; font-size: 22px; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.admin-note { opacity: .62; }

@media (max-width: 900px), (orientation: portrait) {
  .choice-grid { grid-template-columns: repeat(2, 1fr); }
  .reveal-layout { grid-template-columns: 1fr; width: min(800px, 92vw); text-align: center; }
  .image-wrap { width: min(50vh, 80vw); margin: auto; }
  .creature-card { padding: 0; }
  .reveal-buttons { justify-content: center; }
}

.access-card { text-align:center; }
.access-copy { font-size:24px; }
#demoAccessCode { width:100%; padding:18px; border:3px solid #cbd5e0; border-radius:18px; font-size:30px; margin:12px 0 16px; text-align:center; }
