:root {
  --ink: #08111f;
  --paper: #f1f4ed;
  --cyan: #72d9d1;
  --lime: #cbe66b;
  --line: rgba(8, 17, 31, 0.14);
  --orange: #ff9e57;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Outfit", system-ui, sans-serif;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.topbar {
  height: 82px;
  padding: 0 clamp(24px, 6vw, 88px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(241, 244, 237, 0.92);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 10;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand b { color: #6c746f; }
.brand-mark {
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.brand-mark span {
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  position: relative;
}
.brand-mark span::after {
  content: "";
  width: 8px;
  height: 2px;
  background: var(--ink);
  position: absolute;
  left: 10px;
  top: 4px;
  transform: rotate(-28deg);
  transform-origin: left;
}
.status {
  font-family: "DM Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #55b58b;
  box-shadow: 0 0 0 4px rgba(85, 181, 139, 0.12);
}

.hero {
  min-height: 590px;
  display: grid;
  grid-template-columns: 52% 48%;
  align-items: center;
  padding: 56px clamp(24px, 7vw, 110px);
  overflow: hidden;
}
.hero-copy { max-width: 590px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  margin: 0 0 18px;
}
.eyebrow span { color: #798078; margin-right: 12px; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  font-size: clamp(72px, 9vw, 142px);
  line-height: 0.82;
  letter-spacing: -0.075em;
  margin-bottom: 34px;
  font-weight: 700;
}
.intro {
  max-width: 520px;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.45;
  color: #4d554f;
  margin-bottom: 34px;
}
.primary-button, .check-button, .unlock-button {
  border: 0;
  cursor: pointer;
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.primary-button {
  height: 58px;
  border-radius: 4px;
  background: var(--ink);
  color: white;
  padding: 0 20px 0 26px;
  display: inline-flex;
  align-items: center;
  gap: 34px;
  font-size: 16px;
}
.primary-button span {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
}
.primary-button:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(8,17,31,.18); }

.orbit-visual {
  width: min(38vw, 520px);
  aspect-ratio: 1;
  justify-self: end;
  position: relative;
  display: grid;
  place-items: center;
}
.orbit {
  position: absolute;
  border: 1px solid rgba(8,17,31,.22);
  border-radius: 50%;
}
.orbit-1 { inset: 2%; }
.orbit-2 { inset: 15%; border-style: dashed; animation: spin 24s linear infinite; }
.orbit-3 { inset: 29%; }
.core {
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--cyan);
  display: grid;
  place-items: center;
  font-family: "DM Mono", monospace;
  font-size: clamp(12px, 1.4vw, 18px);
  box-shadow: inset 0 0 0 13px rgba(255,255,255,.18);
  z-index: 2;
}
.point { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); }
.point-a { top: 12%; left: 50%; }
.point-b { bottom: 22%; left: 14%; background: var(--orange); }
.point-c { right: 7%; top: 49%; background: var(--lime); }
@keyframes spin { to { transform: rotate(360deg); } }

.mission {
  background: var(--ink);
  color: #edf2e9;
  padding: 76px clamp(24px, 6vw, 88px) 90px;
  min-height: 100vh;
}
.mission-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 30px;
}
.mission-header h2, .final-lock h2 {
  font-size: clamp(38px, 5vw, 64px);
  letter-spacing: -0.045em;
  margin: 0;
}
.mission-header .eyebrow span, .final-lock .eyebrow span { color: #929a94; }
.timer {
  border-left: 1px solid rgba(255,255,255,.16);
  padding-left: 24px;
  min-width: 150px;
  display: grid;
  gap: 4px;
}
.timer span { color: #98a29b; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.timer strong { font-family: "DM Mono", monospace; font-size: 30px; }
.progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  color: #9aa49d;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  margin-bottom: 30px;
}
.progress-track { height: 3px; background: rgba(255,255,255,.12); }
.progress-fill { height: 100%; width: 0; background: var(--lime); transition: width 450ms ease; }

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.room-map {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.room-tab {
  height: 58px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: #aab4ad;
  font: 600 12px "Outfit", sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.room-tab span {
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "DM Mono", monospace;
}
.room-tab.active { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.room-tab.solved { color: var(--lime); border-color: rgba(203,230,107,.45); }
.room-tab.solved span { background: var(--lime); color: var(--ink); }

.escape-room {
  min-height: 610px;
  display: grid;
  grid-template-columns: 230px 1fr;
  border: 1px solid rgba(255,255,255,.14);
  background: #0d1a29;
}
.room-console {
  border-right: 1px solid rgba(255,255,255,.12);
  padding: 28px 24px;
  background: rgba(255,255,255,.025);
}
.console-label { color: #87948c; font: 10px "DM Mono", monospace; letter-spacing: .16em; }
#roomNumber {
  display: block;
  font: 500 58px "DM Mono", monospace;
  color: var(--lime);
  margin: 12px 0 20px;
}
.room-console h3 { font-size: 25px; margin-bottom: 10px; }
.room-console > p:not(.console-label):not(.hint-text) { color: #9aa69f; line-height: 1.5; font-size: 14px; }
.hint-button {
  margin-top: 16px;
  width: 100%;
  height: 42px;
  border: 1px solid rgba(255,255,255,.18);
  background: transparent;
  color: #edf2e9;
  font: 600 13px "Outfit", sans-serif;
  cursor: pointer;
}
.hint-text { min-height: 50px; color: var(--orange); font-size: 13px; line-height: 1.45; }

.room-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 38px 38px;
}
.room-decoration { position:absolute; inset:0; pointer-events:none; }
.wall-line { position:absolute; width:160px; height:160px; border:1px solid rgba(114,217,209,.12); border-radius:50%; }
.line-a { left:-70px; top:-40px; } .line-b { right:-50px; bottom:-70px; }
.cable { position:absolute; height:1px; width:220px; background:rgba(255,255,255,.08); transform:rotate(28deg); }
.cable-a { left:8%; top:18%; } .cable-b { right:4%; bottom:12%; }

.room-stage .puzzle-card {
  display: none;
  width: min(430px, calc(100% - 40px));
  min-height: 500px;
  z-index: 2;
  box-shadow: 0 30px 70px rgba(0,0,0,.28);
}
.room-stage .puzzle-card.active { display: flex; animation: roomEnter 280ms ease-out; }
.vault-card { justify-content: flex-start; }
.vault-card h2 { font-size: 36px; margin: 28px 0 12px; }
.vault-card form { margin-top: auto; }
@keyframes roomEnter { from { opacity:0; transform:scale(.96) translateY(8px); } to { opacity:1; transform:none; } }

.puzzle-card {
  background: #edf1e8;
  color: var(--ink);
  border-radius: 3px;
  min-height: 490px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 220ms ease, opacity 220ms ease;
}
.puzzle-card:hover { transform: translateY(-4px); }
.puzzle-card.solved {
  background: #dceca2;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.module {
  width: 34px;
  height: 34px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.card-status { color: #747b76; }
.solved .card-status { color: #426c42; }
.card-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border: 1px solid currentColor;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 1px;
}
.solved .card-status::before { background: #426c42; }

.card-icon {
  height: 150px;
  margin: 12px 0 8px;
  border: 1px solid rgba(8,17,31,.09);
  border-radius: 2px;
  background: rgba(255,255,255,.42);
  position: relative;
  display: grid;
  place-items: center;
}
.radius-icon::before, .circumference-icon::before, .area-icon::before {
  content: "";
  width: 98px;
  height: 98px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  position: absolute;
}
.icon-center {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  z-index: 2;
}
.icon-line {
  width: 48px;
  height: 2px;
  background: var(--ink);
  position: absolute;
  left: calc(50% - 2px);
  transform: rotate(-25deg);
  transform-origin: left;
}
.icon-label {
  position: absolute;
  right: 34px;
  top: 42px;
  font-family: "DM Mono", monospace;
  font-size: 16px;
  font-style: italic;
}
.circumference-icon::after {
  content: "";
  position: absolute;
  width: 98px;
  height: 2px;
  background: var(--ink);
  transform: rotate(90deg);
}
.circumference-icon .icon-arc {
  position: absolute;
  width: 98px;
  height: 98px;
  border-radius: 50%;
  border: 5px solid var(--cyan);
  border-left-color: transparent;
  transform: rotate(-25deg);
}
.area-icon::before { background: rgba(114,217,209,.48); border-style: dashed; }
.area-icon .icon-grid {
  position: absolute;
  width: 98px;
  height: 98px;
  border-radius: 50%;
  background-image: linear-gradient(rgba(8,17,31,.13) 1px, transparent 1px), linear-gradient(90deg, rgba(8,17,31,.13) 1px, transparent 1px);
  background-size: 10px 10px;
  mask: radial-gradient(circle, #000 69%, transparent 70%);
}
.sector-icon::before {
  content: "";
  width: 112px;
  height: 112px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  position: absolute;
}
.sector-slice {
  width: 56px;
  height: 56px;
  background: var(--orange);
  position: absolute;
  top: 19px;
  left: calc(50% - 56px);
  clip-path: polygon(100% 100%, 100% 0, 0 0);
  border-radius: 56px 0 0 0;
}
.icon-angle {
  position: absolute;
  right: 30px;
  bottom: 22px;
  font-family: "DM Mono", monospace;
  font-size: 13px;
}
.puzzle-card h3 {
  font-size: 21px;
  margin: 12px 0 8px;
  letter-spacing: -0.02em;
}
.puzzle-card > p:not(.feedback) {
  color: #626963;
  line-height: 1.45;
  min-height: 66px;
  margin-bottom: 14px;
  font-size: 14px;
}
.answer-row {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 8px;
  align-items: end;
}
.answer-row label > span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 7px;
}
.input-wrap {
  height: 46px;
  border: 1px solid rgba(8,17,31,.25);
  display: flex;
  align-items: center;
  background: white;
}
.input-wrap input {
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 12px;
  font: 700 16px "DM Mono", monospace;
  color: var(--ink);
}
.input-wrap b {
  font: 500 12px "DM Mono", monospace;
  color: #777f79;
  padding-right: 10px;
}
.check-button {
  height: 46px;
  background: var(--ink);
  color: white;
  border-radius: 2px;
  font-size: 13px;
}
.check-button:hover { background: #244052; }
.feedback {
  height: 18px;
  margin: 7px 0 -2px;
  font-size: 12px;
  color: #a14141;
}
.feedback.correct { color: #426c42; }

.final-lock {
  margin-top: 16px;
  border: 1px solid rgba(255,255,255,.14);
  min-height: 240px;
  padding: 38px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
  background: rgba(255,255,255,.025);
  opacity: .55;
  transition: opacity 300ms ease, border-color 300ms ease;
}
.final-lock.active { opacity: 1; border-color: rgba(203,230,107,.5); }
.final-lock h2 { font-size: clamp(30px, 4vw, 48px); margin-bottom: 12px; }
.final-lock > div > p:last-child { color: #adb6af; max-width: 560px; line-height: 1.5; }
.code-form { display: grid; grid-template-columns: 1fr 150px; gap: 10px; }
.code-inputs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-inputs input {
  height: 64px;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.07);
  color: white;
  text-align: center;
  font: 700 28px "DM Mono", monospace;
  outline: 0;
}
.code-inputs input:focus { border-color: var(--lime); background: rgba(203,230,107,.08); }
.unlock-button {
  height: 64px;
  background: var(--lime);
  color: var(--ink);
  border-radius: 2px;
}
.code-feedback { grid-column: 1 / -1; height: 18px; margin: 4px 0 0; color: #ff9e57; font-size: 13px; }

.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(6,13,23,.82);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-card {
  width: min(480px, 100%);
  background: var(--paper);
  color: var(--ink);
  padding: 48px;
  text-align: center;
  border-radius: 4px;
}
.success-orbit {
  width: 120px;
  height: 120px;
  border: 1px dashed var(--ink);
  border-radius: 50%;
  margin: 0 auto 28px;
  display: grid;
  place-items: center;
  position: relative;
}
.success-orbit::before {
  content: "";
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--lime);
  position: absolute;
}
.success-orbit span { z-index: 1; font-size: 34px; }
.modal-card h2 { font-size: 48px; margin-bottom: 10px; letter-spacing: -.04em; }
.modal-card > p:not(.eyebrow) { color: #656e67; margin-bottom: 26px; }
.modal-card .primary-button { margin: auto; }

@media (max-width: 1100px) {
  .puzzle-grid { grid-template-columns: repeat(2, 1fr); }
  .puzzle-card { min-height: 480px; }
  .final-lock { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .topbar { height: 68px; }
  .status { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 620px; padding-top: 42px; }
  h1 { font-size: 76px; }
  .orbit-visual { width: 280px; justify-self: center; margin-top: 20px; }
  .mission { padding-top: 50px; }
  .mission-header { align-items: start; }
  .timer { min-width: 100px; }
  .timer strong { font-size: 22px; }
  .puzzle-grid { grid-template-columns: 1fr; }
  .puzzle-card { min-height: 470px; }
  .final-lock { padding: 24px 20px; }
  .code-form { grid-template-columns: 1fr; }
  .unlock-button { width: 100%; }
  .modal-card { padding: 38px 20px; }
  .modal-card h2 { font-size: 40px; }
}

/* 3D laboratory pages */
.lobby-page { min-height: 100vh; }
.lobby {
  min-height: calc(100vh - 82px);
  display: grid;
  grid-template-columns: 44% 56%;
  overflow: hidden;
}
.lobby-copy { padding: 70px clamp(24px, 6vw, 90px); display:flex; flex-direction:column; justify-content:center; }
.lobby-door {
  position: relative;
  display: grid;
  place-items: center;
  perspective: 900px;
  background: linear-gradient(145deg,#d9e0d4,#87958d);
  border-left: 1px solid rgba(8,17,31,.16);
}
.door-frame {
  width: 48%;
  height: 66%;
  padding: 28px;
  background: #4b5a55;
  box-shadow: 18px 28px 50px rgba(8,17,31,.28);
  transform: rotateY(-8deg);
  transform-origin:right;
  z-index:2;
}
.door {
  height:100%;
  position:relative;
  background:linear-gradient(90deg,#9dac9f,#687a72);
  border:2px solid #35453f;
  box-shadow:inset 12px 0 25px rgba(255,255,255,.12);
}
.door-window { position:absolute; width:38%; height:18%; left:31%; top:12%; border:8px solid #35453f; background:#73b7b1; box-shadow:inset 0 0 25px #d8f1ea; }
.door-panel { position:absolute; width:60%; height:38%; left:20%; bottom:12%; border:2px solid #53665f; box-shadow:inset 0 0 30px rgba(8,17,31,.18); }
.door-lock { position:absolute; width:28px; height:28px; right:10%; top:51%; border-radius:50%; background:#cbe66b; border:5px solid #35453f; }
.floor-grid { position:absolute; inset:65% -20% -20% -20%; transform:perspective(500px) rotateX(58deg); background-image:linear-gradient(rgba(8,17,31,.22) 1px,transparent 1px),linear-gradient(90deg,rgba(8,17,31,.22) 1px,transparent 1px); background-size:55px 55px; }

.room-page { background:#07111f; color:#edf2e9; }
.room-page .topbar { background:rgba(7,17,31,.92); border-bottom-color:rgba(255,255,255,.12); }
.room-page .brand { color:white; }
.room-page .brand-mark { border-color:white; }
.room-page .brand-mark span { border-color:white; }
.room-page .brand-mark span::after { background:white; }
.room-page .timer { border:0; text-align:right; color:#edf2e9; }
.room-shell, .vault-shell {
  min-height:calc(100vh - 82px);
  display:grid;
  grid-template-columns:260px 1fr;
}
.room-sidebar {
  padding:50px 28px;
  border-right:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.025);
  z-index:3;
}
.room-sidebar h1 { font-size:48px; line-height:.95; letter-spacing:-.05em; margin:20px 0 18px; }
.room-sidebar > p:not(.eyebrow) { color:#98a49d; line-height:1.55; }
.hint-box { margin-top:38px; border:1px solid rgba(203,230,107,.24); padding:16px; display:grid; gap:8px; }
.hint-box b { color:var(--lime); font-family:"DM Mono",monospace; font-size:10px; text-transform:uppercase; letter-spacing:.12em; }
.hint-box span { color:#c2cbc4; font-size:13px; line-height:1.45; }

.3d-room {
  position:relative;
  overflow:hidden;
  display:grid;
  place-items:center;
  perspective:900px;
  background:linear-gradient(#1b3040 0 68%,#0a121d 68%);
}
.room-ceiling { position:absolute; width:70%; height:38%; top:-26%; background:#263a47; transform:perspective(500px) rotateX(-58deg); transform-origin:bottom; border:1px solid rgba(255,255,255,.08); }
.room-floor { position:absolute; left:-20%; right:-20%; bottom:-22%; height:55%; transform:perspective(500px) rotateX(58deg); transform-origin:top; background-image:linear-gradient(rgba(114,217,209,.12) 1px,transparent 1px),linear-gradient(90deg,rgba(114,217,209,.12) 1px,transparent 1px); background-size:70px 70px; }
.wall { position:absolute; top:0; bottom:18%; width:38%; background:linear-gradient(135deg,rgba(45,69,83,.9),rgba(16,35,49,.95)); }
.left-wall { left:-19%; transform:skewY(8deg); border-right:1px solid rgba(114,217,209,.14); }
.right-wall { right:-19%; transform:skewY(-8deg); border-left:1px solid rgba(114,217,209,.14); }
.room-2 .3d-room { background:linear-gradient(135deg,#17313a,#08111f 65%); }
.room-3 .3d-room { background:linear-gradient(145deg,#382d25,#101723 70%); }
.room-4 .3d-room { background:linear-gradient(145deg,#23372f,#09131d 70%); }
.room-5 .3d-room { background:linear-gradient(145deg,#29243a,#0d1420 70%); }
.room-6 .3d-room { background:linear-gradient(145deg,#3a3022,#101722 70%); }

.3d-room .puzzle-card, .vault-room .puzzle-card {
  width:min(410px,calc(100% - 40px));
  min-height:500px;
  z-index:4;
  transform:translateZ(30px);
  box-shadow:18px 28px 50px rgba(0,0,0,.38);
}
.puzzle-card.solved { background:#dceca2; }
.puzzle-card.solved .card-status { color:#426c42; }
.next-door {
  display:none;
  margin-top:14px;
  height:44px;
  align-items:center;
  justify-content:center;
  background:var(--lime);
  color:var(--ink);
  text-decoration:none;
  font-weight:800;
}
.next-door.visible { display:flex; }
.puzzle-feedback { min-height:18px; color:#a14141; font-size:12px; margin:8px 0 0; }
.puzzle-feedback.correct { color:#426c42; }

.vault-room {
  position:relative;
  display:grid;
  place-items:center;
  overflow:hidden;
  background:radial-gradient(circle at 50% 50%,#35505a,#0a151e 68%);
  perspective:900px;
}
.vault-door {
  position:absolute;
  width:62%;
  height:72%;
  border:18px solid #53615d;
  border-radius:50% 50% 8px 8px;
  background:linear-gradient(135deg,#1a2a30,#77847e);
  box-shadow:20px 30px 60px rgba(0,0,0,.55);
  transform:rotateY(-4deg);
  opacity:.55;
}
.vault-wheel { position:absolute; width:150px; height:150px; border-radius:50%; border:12px solid #2e3a38; left:50%; top:50%; transform:translate(-50%,-50%); }
.vault-wheel span { position:absolute; inset:38px; border-radius:50%; background:var(--lime); }
.vault-room .puzzle-card { width:min(390px,calc(100% - 40px)); min-height:420px; background:#edf1e8; color:var(--ink); }
.vault-card form { display:grid; gap:10px; margin-top:auto; }
.vault-card .code-inputs input { color:var(--ink); background:white; border-color:rgba(8,17,31,.25); }

.success-overlay {
  position:fixed; inset:0; z-index:50; display:none; place-items:center;
  background:rgba(4,10,18,.88); backdrop-filter:blur(12px);
}
.success-overlay.visible { display:grid; }
.success-card { width:min(440px,calc(100% - 40px)); background:var(--paper); color:var(--ink); text-align:center; padding:42px; }
.success-card h2 { font-size:48px; margin:10px 0; }
.again-button { border:0; background:var(--ink); color:white; height:54px; padding:0 28px; font-weight:800; cursor:pointer; }

@media (max-width:900px) {
  .lobby { grid-template-columns:1fr; }
  .lobby-door { min-height:420px; }
  .room-shell, .vault-shell { grid-template-columns:1fr; }
  .room-sidebar { min-height:auto; padding:24px; border-right:0; border-bottom:1px solid rgba(255,255,255,.12); }
  .room-sidebar h1 { font-size:38px; }
  .hint-box { display:none; }
  .3d-room,.vault-room { min-height:620px; }
  .vault-door { width:85%; height:65%; }
}

.admin-link, .logout-button {
  color:var(--ink);
  text-decoration:none;
  font-size:13px;
  font-weight:700;
  border:1px solid var(--line);
  background:transparent;
  height:40px;
  padding:0 16px;
  display:inline-grid;
  place-items:center;
  cursor:pointer;
}
.login-page { min-height:100vh; background:var(--paper); }
.login-layout {
  min-height:calc(100vh - 82px);
  display:grid;
  grid-template-columns:1fr 520px;
  align-items:center;
  gap:60px;
  padding:50px clamp(24px,7vw,100px);
}
.login-copy h1 { font-size:clamp(74px,9vw,130px); line-height:.82; margin:20px 0 30px; letter-spacing:-.08em; }
.login-copy > p:last-child { max-width:430px; color:#68716b; font-size:20px; line-height:1.5; }
.login-card {
  background:var(--ink);
  color:white;
  min-height:520px;
  padding:44px;
  border-radius:4px;
  box-shadow:20px 28px 60px rgba(8,17,31,.18);
}
.login-card h2 { font-size:38px; margin:24px 0 8px; }
.login-card > p { color:#aab4ad; line-height:1.5; margin-bottom:28px; }
.login-symbol { width:90px;height:90px;border:1px dashed rgba(255,255,255,.5);border-radius:50%;display:grid;place-items:center;margin-bottom:8px; }
.login-symbol span { width:58px;height:58px;border-radius:50%;background:var(--lime);border:12px solid rgba(255,255,255,.12); }
.login-card form { display:grid;gap:14px; }
.login-card label,.create-user label { display:grid;gap:8px;font-size:12px;text-transform:uppercase;letter-spacing:.08em; }
.login-card input {
  height:52px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.07);
  color:white;padding:0 14px;font:16px "Outfit",sans-serif;
}
.login-button { width:100%;justify-content:center;margin-top:8px;background:var(--lime);color:var(--ink); }
.login-feedback,.admin-feedback { min-height:20px;color:#ffb27a; }

.admin-page { min-height:100vh; background:#edf1e8; }
.admin-layout { min-height:calc(100vh - 82px); padding:60px clamp(24px,6vw,90px); }
.admin-login { max-width:520px;margin:8vh auto 0;padding:42px;background:white;box-shadow:0 20px 50px rgba(8,17,31,.12); }
.admin-login h1 { font-size:54px;margin:0 0 28px; }
.admin-login form { display:grid;gap:16px; }
.admin-login label { display:grid;gap:8px;font-size:12px;text-transform:uppercase;letter-spacing:.08em; }
.admin-login input { height:52px;border:1px solid var(--line);padding:0 12px;font:16px "Outfit",sans-serif; }
.admin-login .primary-button { justify-content:center;background:var(--ink);color:white; }
.admin-heading { display:flex;justify-content:space-between;align-items:end;margin-bottom:30px; }
.admin-heading h1 { font-size:64px;margin:0; }
.create-user {
  display:grid;grid-template-columns:1fr 1.2fr 180px 220px 220px;gap:14px;align-items:end;
  padding:20px;background:var(--ink);color:white;margin-bottom:16px;
}
.create-user input { height:52px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.08);color:white;padding:0 12px;font:16px "Outfit",sans-serif; }
.create-user > div { display:grid;gap:7px; }
.create-user > div span { font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#abb5ae; }
.create-user > div strong { height:52px;border:1px solid rgba(255,255,255,.18);display:flex;align-items:center;padding:0 12px;font-family:"DM Mono",monospace;color:var(--lime); }
.create-user .primary-button { background:var(--lime);color:var(--ink);justify-content:center;padding:0 14px; }
.user-table { background:white;border:1px solid var(--line); }
.table-head,.user-row { display:grid;grid-template-columns:1fr 1fr 120px 100px;align-items:center;gap:10px; }
.table-head.admin-user-head,.admin-user-head ~ .user-row { grid-template-columns:1fr 1.4fr 1fr 120px 90px; }
.table-head { height:52px;padding:0 18px;border-bottom:1px solid var(--line);font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#727b75; }
.user-row { min-height:64px;padding:10px 18px;border-bottom:1px solid rgba(8,17,31,.08); }
.user-row strong { font-family:"DM Mono",monospace;color:#3d5149; }
.user-row button { height:36px;border:1px solid #d0b0a8;background:#fff7f4;color:#9a4738;cursor:pointer; }
.active-user { color:#426c42;font-size:12px; }
.create-user select {
  height:52px;border:1px solid rgba(255,255,255,.18);background:#132131;color:white;padding:0 12px;
  font:16px "Outfit",sans-serif;
}
.role-badge { width:max-content;padding:6px 9px;border-radius:20px;font-size:11px;font-weight:800; }
.role-schueler { background:#dce7dd;color:#426c42; }
.role-lehrer { background:#d9e6ef;color:#315b75; }
.role-admin { background:#f2dfd2;color:#8a5035; }
.role-summary { display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:16px; }
.role-summary div { background:white;border:1px solid var(--line);padding:18px;display:grid;gap:4px; }
.role-summary strong { font-size:34px; }
.role-summary span { color:#727b75;font-size:12px;text-transform:uppercase;letter-spacing:.08em; }
.teacher-table-head,.teacher-table-head + * .user-row { grid-template-columns:1fr 1fr 1fr 120px; }
.dashboard-actions {
  display:grid;
  grid-template-columns:1fr auto auto;
  gap:10px;
  align-items:end;
  margin-bottom:16px;
  background:white;
  border:1px solid var(--line);
  padding:12px;
}
.dashboard-actions label { display:grid;gap:6px;color:#727b75;font-size:11px;text-transform:uppercase;letter-spacing:.08em; }
.dashboard-actions input { height:42px;border:1px solid var(--line);padding:0 10px;font:14px "Outfit",sans-serif; }
.tool-button { height:42px;border:1px solid var(--line);background:#edf1e8;color:var(--ink);padding:0 14px;font-weight:800;cursor:pointer; }
.tool-button:hover { background:var(--lime); }
.status-done,.status-active,.status-idle { display:block;font-size:10px;margin-top:3px; }
.status-done { color:#426c42; }
.status-active { color:#9b7038; }
.status-idle { color:#7b847e; }
.analytics { display:grid;gap:14px;margin-bottom:16px; }
.metric-grid { display:grid;grid-template-columns:repeat(4,1fr);gap:12px; }
.metric-grid article { min-height:130px;background:var(--ink);color:white;padding:20px;display:flex;flex-direction:column;justify-content:space-between; }
.metric-grid article span { color:#abb5ae;font-size:11px;text-transform:uppercase;letter-spacing:.08em; }
.metric-grid article strong { color:var(--lime);font-size:42px;line-height:1; }
.metric-grid article small { color:#9aa49d; }
.analytics-content { display:grid;grid-template-columns:1fr 1fr;gap:12px; }
.room-progress,.mistake-table { background:white;border:1px solid var(--line);padding:20px; }
.analytics-heading { margin-bottom:18px; }
.analytics-heading p { color:#7b847e;font-size:11px;text-transform:uppercase;letter-spacing:.12em;margin:0 0 5px; }
.analytics-heading h2 { font-size:24px;margin:0; }
.analytics-room { margin-bottom:13px; }
.analytics-room > div:first-child { display:flex;justify-content:space-between;font-size:13px;margin-bottom:6px; }
.analytics-room small { color:#7b847e;font-size:11px; }
.analytics-bar { height:7px;background:#e2e6df;margin-bottom:4px;overflow:hidden; }
.analytics-bar span { display:block;height:100%;background:var(--lime); }
.mistake-table table { width:100%;border-collapse:collapse;font-size:13px; }
.mistake-table th,.mistake-table td { text-align:left;padding:9px 8px;border-bottom:1px solid rgba(8,17,31,.08); }
.mistake-table th { color:#7b847e;font-size:10px;text-transform:uppercase;letter-spacing:.08em; }
.mistake-table td:last-child,.mistake-table th:last-child { text-align:right; }
.room-page .logout-button { color:white;border-color:rgba(255,255,255,.18); }
@media (max-width:900px) {
  .login-layout { grid-template-columns:1fr;padding-top:30px; }
  .login-copy h1 { font-size:72px; }
  .login-card { min-height:auto; }
  .create-user { grid-template-columns:1fr; }
  .table-head { display:none; }
  .user-row { grid-template-columns:1fr 1fr; }
  .metric-grid { grid-template-columns:repeat(2,1fr); }
  .analytics-content { grid-template-columns:1fr; }
}
