:root {
  --ink: #eaf1f3;
  --muted: #91a3aa;
  --panel: #10222b;
  --panel-2: #142b35;
  --line: #28414a;
  --black: #071219;
  --orange: #ff6a2a;
  --orange-2: #ff8d42;
  --green: #4bd39b;
  --red: #ff5e61;
  --yellow: #ffc857;
  --white: #fff;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.suite-home-link {
  color: var(--amber, #f4a340);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.suite-home-link img { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; margin-right: 6px; }

.suite-home-link span { color: rgba(255,255,255,.3); margin-left: 6px; }

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--black); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 20%, rgba(255,106,42,.08), transparent 30rem),
    linear-gradient(135deg, #071219 0%, #0b1b23 100%);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(255,141,66,.55);
  outline-offset: 3px;
}

.topbar {
  height: 76px;
  padding: 0 clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(18px, 3vw, 44px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(7,18,25,.82);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--orange);
  box-shadow: 0 8px 24px rgba(255,106,42,.25);
}
.brand-mark svg { width: 28px; fill: #fff; }
.brand-mark .inner { fill: #ffbf91; }
.brand strong { display: block; font-size: 18px; letter-spacing: -.3px; }
.brand small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1.3px; margin-top: 2px; }
.topbar-game-controls {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 78px minmax(150px, 1fr) 74px;
  gap: clamp(12px, 2vw, 28px);
  align-items: center;
}
.topbar-game-controls[hidden] { display: none; }
.session-summary { display: flex; gap: 14px; align-items: center; }
.session-summary[hidden] { display: none; }
.tech-badge {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #dce7ea;
  font-weight: 700;
}

button.tech-badge {
  color: var(--white);
  cursor: pointer;
}

button.tech-badge:hover,
button.tech-badge:focus-visible {
  border-color: var(--orange);
  outline: none;
}
.admin-menu-button {
  padding: 8px 14px;
  border: 1px solid rgba(255,141,66,.55);
  border-radius: 10px;
  color: #ffb066;
  background: rgba(255,106,42,.1);
  font-weight: 800;
  letter-spacing: .3px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .18s ease;
}
.admin-menu-button:hover {
  background: rgba(255,106,42,.18);
  border-color: var(--orange);
  transform: translateY(-1px);
}
.admin-menu-button[hidden] { display: none; }
.text-button, .back-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.text-button:hover, .back-button:hover { color: var(--white); }

.screen { display: none; min-height: calc(100vh - 76px); }
.screen.active { display: block; }
.welcome-screen.active {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 480px);
  gap: clamp(40px, 8vw, 130px);
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px clamp(24px, 5vw, 72px);
}
.eyebrow, .step-label, .panel-label {
  margin: 0 0 14px;
  color: var(--orange-2);
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.welcome-copy h1, .section-heading h1 {
  margin: 0;
  font-size: clamp(48px, 6.5vw, 88px);
  line-height: .96;
  letter-spacing: -4px;
}
.welcome-copy h1 span { color: var(--orange); }
.lead {
  max-width: 650px;
  margin: 30px 0;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
  color: #b8c6cb;
}
.feature-row {
  display: flex;
  gap: clamp(20px, 4vw, 56px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.feature-row div { display: flex; flex-direction: column; gap: 4px; }
.feature-row strong { font-size: 28px; }
.feature-row span { color: var(--muted); font-size: 13px; }
.login-card {
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(20,43,53,.98), rgba(13,31,39,.98));
  box-shadow: var(--shadow);
}
.login-card h2, .modal h2 { margin: 0 0 12px; font-size: 32px; letter-spacing: -1px; }
.login-card > p:not(.step-label):not(.local-note), .modal > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
label { display: block; margin: 28px 0 8px; color: #cbd8dc; font-size: 13px; font-weight: 700; }
input {
  width: 100%;
  padding: 17px 18px;
  color: var(--white);
  border: 1px solid #38505a;
  border-radius: 10px;
  background: #091920;
  font-size: 18px;
}
input::placeholder { color: #62767e; }
.primary-button, .secondary-button, .diagnose-button, .hint-button, .bug-report-button {
  min-height: 54px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}
.primary-button {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 9px 25px rgba(255,106,42,.2);
}
.primary-button:hover { background: #ff7b3d; transform: translateY(-1px); }
.primary-button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.secondary-button { background: #203740; color: var(--ink); }
.login-card .primary-button { width: 100%; margin-top: 16px; display: flex; justify-content: space-between; align-items: center; }
.unified-access-card .primary-button { text-decoration: none; }
.local-note { margin: 18px 0 0; text-align: center; font-size: 12px; color: #72868e; }
.auth-tabs {
  margin-top: 24px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border: 1px solid #314953;
  border-radius: 11px;
  background: #0a1b22;
}
.auth-tab {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.auth-tab.active { background: #203a44; color: var(--white); }
.auth-panel[hidden] { display: none; }
.auth-panel label { margin-top: 18px; }
.auth-panel input { padding: 13px 15px; font-size: 15px; }
.pin-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-status { min-height: 21px; margin: 13px 0 0; color: var(--muted); font-size: 12px; }
.auth-status.error { color: var(--red); }
.auth-status.success { color: var(--green); }

.level-screen { max-width: 1320px; margin: 0 auto; padding: 56px clamp(20px, 4vw, 56px) 80px; }
.section-heading { display: flex; justify-content: space-between; gap: 40px; align-items: end; margin-bottom: 38px; }
.section-heading h1 { font-size: clamp(40px, 5vw, 62px); letter-spacing: -2.5px; }
.section-heading > div > p:last-child { color: var(--muted); font-size: 17px; }
.progress-card { width: min(290px, 100%); padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.progress-card > span { font-size: 13px; font-weight: 700; }
.progress-track { height: 7px; background: #08171e; border-radius: 10px; margin-top: 12px; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--orange); border-radius: inherit; transition: width .5s; }
.overall-scoreboard {
  margin-top: 34px;
  padding: 24px;
  border: 1px solid #38545e;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,106,42,.07), transparent 38%),
    #0d2028;
  box-shadow: 0 18px 44px rgba(0,0,0,.2);
}
.overall-board-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
.overall-board-heading h2 { margin: 4px 0 5px; font-size: 27px; }
.overall-board-heading p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.overall-leader {
  min-width: 270px;
  padding: 15px 18px;
  border: 1px solid #8d6238;
  border-radius: 12px;
  background: #2a211a;
}
.overall-leader span,
.overall-leader strong,
.overall-leader small { display: block; }
.overall-leader span { color: #ffad68; font-size: 8px; font-weight: 900; letter-spacing: 1.2px; }
.overall-leader strong { margin-top: 5px; font-size: 18px; }
.overall-leader small { margin-top: 3px; color: #a99a8e; font-size: 9px; }
.overall-summary {
  margin: 20px 0 10px;
  color: #80969e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.overall-standings { display: grid; gap: 7px; }
.overall-standing {
  border: 1px solid #29434d;
  border-radius: 10px;
  background: rgba(8,24,31,.8);
  overflow: hidden;
}
.overall-standing.leader { border-color: #8d6238; }
.overall-standing summary {
  min-height: 56px;
  padding: 10px 13px;
  display: grid;
  grid-template-columns: 38px minmax(130px,1fr) repeat(4, minmax(74px,auto));
  gap: 14px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.overall-standing summary::-webkit-details-marker { display: none; }
.standing-rank { color: var(--orange-2); font-size: 15px; font-weight: 900; }
.standing-tech strong,
.standing-tech small { display: block; }
.standing-tech strong { font-size: 13px; }
.standing-tech small { margin-top: 2px; color: #718991; font-size: 8px; }
.standing-stat { text-align: right; }
.standing-stat span,
.standing-stat strong { display: block; }
.standing-stat span { color: #6f8790; font-size: 7px; font-weight: 900; letter-spacing: .7px; }
.standing-stat strong { margin-top: 3px; font-size: 11px; font-variant-numeric: tabular-nums; }
.standing-breakdown {
  padding: 10px 13px 13px 65px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-top: 1px solid #233d47;
}
.standing-breakdown span {
  padding: 5px 7px;
  border-radius: 5px;
  background: #18313a;
  color: #a9bec4;
  font: 800 8px Consolas,monospace;
}
.overall-empty { padding: 20px; border: 1px dashed #38525c; border-radius: 10px; color: #718991; text-align: center; }

.equipment-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 48px;
}
.equipment-category-card {
  min-height: 210px;
  padding: 22px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, #122731, #0e2028);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: .2s ease;
}
.equipment-category-card:hover {
  border-color: #52717c;
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0,0,0,.2);
}
.equipment-category-card.has-current { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.equipment-category-card.is-complete { border-color: rgba(75,211,155,.5); }
.category-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.category-card-tag {
  display: inline-block;
  padding: 4px 7px;
  border: 1px solid #35505a;
  border-radius: 5px;
  color: #91aab2;
  background: #0b1d24;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .8px;
}
.category-card-count {
  color: var(--orange-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .6px;
  white-space: nowrap;
}
.equipment-category-card h3 {
  margin: 16px 0 8px;
  font-size: 22px;
  letter-spacing: -.5px;
}
.equipment-category-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.category-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: end;
  margin-top: 18px;
}
.category-card-next {
  color: #bcd0d6;
  font-size: 11px;
  line-height: 1.45;
}
.category-card-next strong {
  display: block;
  color: #eff5f6;
  font-size: 12px;
  margin-bottom: 2px;
}
.category-card-action {
  color: var(--orange-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
  white-space: nowrap;
}
.level-board { margin-bottom: 48px; }
.back-to-categories {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 10px 16px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, #122731, #0e2028);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.back-to-categories-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #35505a;
  border-radius: 8px;
  background: #0b1d24;
  color: var(--orange-2);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.back-to-categories-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.back-to-categories-copy small {
  color: var(--orange-2);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
.back-to-categories-copy strong {
  color: #eff5f6;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.2px;
}
.back-to-categories:hover {
  border-color: #52717c;
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0,0,0,.24);
}
.back-to-categories:hover .back-to-categories-icon {
  border-color: rgba(255,141,66,.45);
  background: rgba(255,106,42,.12);
  color: #ffb066;
}
.back-to-categories:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(0,0,0,.16);
}
.back-to-categories:focus-visible {
  outline: 2px solid rgba(255,141,66,.65);
  outline-offset: 3px;
}
.level-board-heading { margin-bottom: 18px; }
.level-board-tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 7px;
  border: 1px solid #35505a;
  border-radius: 5px;
  color: #91aab2;
  background: #0b1d24;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .8px;
}
.level-board-heading h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -1.5px;
}
.level-board-heading p { margin: 0; color: var(--muted); font-size: 15px; }

.admin-screen { max-width: 1500px; margin: 0 auto; padding: 42px clamp(20px, 4vw, 56px) 80px; }
.admin-shell { display: grid; gap: 18px; }
.admin-topbar { display: flex; flex-wrap: wrap; gap: 18px 24px; align-items: end; justify-content: space-between; }
.admin-topbar-meta h1 { margin: 0; font-size: clamp(34px, 5vw, 52px); letter-spacing: -2px; }
.admin-topbar-meta p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.admin-status {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #102730;
  font-size: 13px;
}
.admin-status.success { border-color: rgba(75,211,155,.55); color: var(--green); }
.admin-status.error { border-color: rgba(255,111,114,.55); color: #ff9a9c; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-tab {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #35505a;
  border-radius: 10px;
  color: var(--muted);
  background: #0b1d24;
  font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
}
.admin-tab.active,
.admin-tab[aria-selected="true"] {
  border-color: var(--orange);
  color: #fff;
  background: rgba(255,106,42,.14);
  box-shadow: inset 0 0 0 1px rgba(255,106,42,.35);
}
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.admin-metric {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, #122731, #0e2028);
  box-shadow: 0 15px 35px rgba(0,0,0,.18);
}
.admin-metric span { display: block; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }
.admin-metric strong { display: block; margin-top: 8px; font-size: 28px; letter-spacing: -.5px; }
.admin-metric small { color: #9eb0b6; font-size: 12px; font-weight: 700; }
.admin-dashboard-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; }
.admin-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, #122731, #0e2028);
  box-shadow: 0 15px 35px rgba(0,0,0,.18);
}
.admin-card-wide { grid-column: 1 / -1; }
.admin-card h2 { margin: 0 0 16px; font-size: 20px; letter-spacing: -.4px; }
.admin-panel-intro { margin: -6px 0 16px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.admin-bars { height: 230px; display: flex; align-items: end; gap: 6px; padding-top: 12px; }
.admin-bar-column { min-width: 0; flex: 1; text-align: center; }
.admin-bar-column small { display: block; margin-bottom: 4px; color: #cbd8dc; font-size: 8px; }
.admin-bar {
  min-height: 2px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(#ff945d, var(--orange));
}
.admin-bar-column span { display: block; margin-top: 7px; color: #748a92; font-size: 8px; }
.admin-stats-list { margin: 0; }
.admin-stats-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.admin-stats-list dt { margin: 0; color: #78909a; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; }
.admin-stats-list dd { margin: 0; font-size: 13px; font-weight: 700; }
.admin-level-bars {
  display: grid;
  grid-template-columns: repeat(36, minmax(0, 1fr));
  gap: 5px;
  align-items: end;
  height: 280px;
}
.admin-level-bar { min-width: 0; text-align: center; height: 100%; display: flex; flex-direction: column; justify-content: end; }
.admin-level-bar i {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(#62d9b0, #248c70);
}
.admin-level-bar span { display: block; margin-top: 6px; color: #7f959d; font-size: 8px; }
.admin-skill-list { display: grid; gap: 11px; }
.admin-skill-row { display: grid; grid-template-columns: minmax(140px, 1fr) 3fr 52px; gap: 12px; align-items: center; }
.admin-skill-row strong,
.admin-skill-row small { display: block; }
.admin-skill-row small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.admin-skill-track { height: 11px; overflow: hidden; border-radius: 10px; background: #08181f; }
.admin-skill-track i { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--orange), #ffc06b); }
.admin-skill-score { font-weight: 900; text-align: right; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th { color: #78909a; font-size: 9px; letter-spacing: .8px; text-align: left; text-transform: uppercase; }
.admin-table th,
.admin-table td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table td strong { display: block; }
.admin-table td small { color: var(--muted); }
.admin-role-badge {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid #35505a;
  border-radius: 5px;
  color: #91aab2;
  background: #0b1d24;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.admin-role-badge.admin { border-color: rgba(255,141,66,.45); color: #ffb066; }
.admin-user-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-user-actions input {
  width: 92px;
  padding: 7px 8px;
  border: 1px solid #405b65;
  border-radius: 6px;
  color: #fff;
  background: #081920;
  font-size: 12px;
}
.admin-user-actions button {
  min-height: 0;
  padding: 7px 11px;
  border: 1px solid #3a5660;
  border-radius: 6px;
  color: var(--ink);
  background: #10252d;
  font: 700 11px inherit;
  cursor: pointer;
}
.admin-user-actions button.danger { border-color: rgba(255,111,114,.5); color: #ff9a9c; background: rgba(255,111,114,.08); }
.admin-user-actions button.danger:hover { background: rgba(255,111,114,.18); }
.admin-empty { padding: 28px; color: var(--muted); text-align: center; border: 1px dashed #38525c; border-radius: 10px; }
.admin-note { margin: 14px 0 0; padding: 13px; border-left: 3px solid var(--orange); background: #0b1b22; color: #9dafb5; font-size: 11px; line-height: 1.55; }

.level-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.level-card {
  min-height: 190px;
  padding: 22px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, #122731, #0e2028);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: .2s ease;
}
.level-card:hover:not(:disabled) { border-color: #52717c; transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0,0,0,.2); }
.level-card:disabled { cursor: not-allowed; opacity: .42; filter: saturate(.4); }
.level-card.completed { border-color: rgba(75,211,155,.5); }
.level-card.current { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.level-number { display: flex; justify-content: space-between; color: var(--orange-2); font-weight: 900; font-size: 12px; letter-spacing: 1px; }
.level-number i { font-style: normal; color: var(--green); }
.level-system {
  display: inline-block;
  margin-top: 15px;
  padding: 4px 7px;
  border: 1px solid #35505a;
  border-radius: 5px;
  color: #91aab2;
  background: #0b1d24;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .8px;
}
.level-card h3 { margin: 15px 0 8px; font-size: 20px; letter-spacing: -.5px; }
.level-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.level-tools { display: flex; gap: 5px; margin-top: 18px; }
.level-tools span { padding: 5px 7px; border-radius: 5px; background: #203740; font-size: 10px; color: #bcd0d6; }
.lock-mark { position: absolute; right: 18px; bottom: 18px; color: #6d8188; font-size: 17px; }

.game-screen { padding: 0; }
.back-button { font-weight: 700; text-align: left; }
.game-title { text-align: center; }
.game-title span { color: var(--orange-2); font-size: 10px; font-weight: 900; letter-spacing: 1.6px; }
.game-title h1 {
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timer { text-align: right; }
.timer span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 1.5px; }
.timer strong { display: inline-block; font-variant-numeric: tabular-nums; font-size: 24px; }
.timer strong.penalty-applied { animation: penaltyPulse .7s ease-out; }
@keyframes penaltyPulse {
  35% { color: #ff9f5f; transform: scale(1.12); text-shadow: 0 0 14px rgba(255,106,42,.6); }
}
.game-layout {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: 230px minmax(560px, 1fr) 230px;
}
.call-panel, .readings-panel { padding: 26px 22px; background: rgba(11,29,37,.75); }
.call-panel { border-right: 1px solid var(--line); }
.readings-panel { border-left: 1px solid var(--line); max-height: calc(100vh - 76px); overflow-y: auto; }
.customer-quote { color: #eff5f6; font-size: 17px; line-height: 1.55; font-style: italic; }
.call-facts { margin: 24px 0; border-top: 1px solid var(--line); }
.call-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.call-facts dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .7px; }
.call-facts dd { margin: 0; text-align: right; font-size: 12px; font-weight: 700; }
.objective { margin: 24px 0; padding: 16px; border-left: 3px solid var(--orange); background: #132832; }
.objective span { color: var(--orange-2); font-size: 9px; font-weight: 900; letter-spacing: 1.2px; }
.objective p { margin: 7px 0 0; color: #b3c3c8; font-size: 12px; line-height: 1.55; }
.diagnose-button { width: 100%; background: var(--orange); }
.hint-button {
  padding: 7px 8px;
  border: 1px solid #53727d;
  background: #17323c;
  color: #dce9ec;
}
.dispatch-hint-button {
  width: 100%;
  min-height: 42px;
  margin: 10px 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dispatch-hint-button span { font-size: 11px; }
.dispatch-hint-button small { margin: 0; font-size: 8px; }
.bug-report-button {
  width: 100%;
  min-height: 38px;
  margin: -7px 0 17px;
  padding: 6px 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #3b5660;
  background: transparent;
  color: #aebfc4;
}
.bug-report-button:hover { border-color: #76909a; color: var(--white); background: rgba(255,255,255,.03); }
.bug-report-button span { font-size: 10px; }
.bug-report-button small { color: #6f858d; font-size: 7px; }
.hint-button:hover:not(:disabled) { border-color: #ff9f5f; background: #1d3b46; }
.hint-button span,
.hint-button small { display: block; }
.hint-button span { font-size: 12px; font-weight: 900; }
.hint-button small { margin-top: 3px; color: #91a9b1; font-size: 7px; font-weight: 700; }
.hint-button.used {
  border-color: #52656c;
  background: #10252d;
  color: #80939a;
  cursor: default;
}
.hint-button.used small { color: #6d8188; }
.service-hint {
  margin: -6px 0 16px;
  padding: 12px 13px;
  border: 1px solid #8a6b38;
  border-left: 3px solid #ffad59;
  border-radius: 8px;
  background: #28251b;
  animation: hintReveal .25s ease-out;
}
.service-hint[hidden] { display: none; }
.service-hint span {
  color: #ffb66d;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
}
.service-hint p {
  margin: 5px 0 0;
  color: #d8d5c7;
  font-size: 10px;
  line-height: 1.45;
}
@keyframes hintReveal {
  from { opacity: 0; transform: translateY(-5px); }
}

.workbench { min-width: 0; display: flex; flex-direction: column; background: #09171e; }
.bench-top { height: 64px; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.bench-top .panel-label { margin: 0 0 5px; font-size: 8px; }
.status-lights { display: flex; gap: 14px; font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; }
.status-lights b { font: inherit; }
.light { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: #36515b; }
.light.power, .light.call { background: var(--green); box-shadow: 0 0 8px var(--green); }
.light.fault.active { background: var(--red); box-shadow: 0 0 8px var(--red); }
.furnace-stage {
  flex: 1;
  min-height: 510px;
  padding: 46px 12px 16px;
  position: relative;
  display: grid;
  place-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 24px 24px;
}
.bench-meter {
  position: absolute;
  top: 56px;
  right: 22px;
  z-index: 18;
  width: 178px;
  min-height: 104px;
  padding: 12px 14px;
  border: 3px solid #405159;
  border-radius: 12px;
  background: linear-gradient(145deg,#26383f,#101d22);
  box-shadow: 0 14px 34px rgba(0,0,0,.42);
  pointer-events: none;
}
.bench-meter[hidden] { display: none; }
.bench-meter span {
  display: block;
  color: #ffb06d;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1px;
}
.bench-meter strong {
  display: block;
  margin: 7px 0 5px;
  color: #c9ffe9;
  font: 800 28px Consolas,monospace;
  font-variant-numeric: tabular-nums;
}
.bench-meter small {
  display: block;
  color: #9eb0b6;
  font-size: 9px;
  line-height: 1.35;
}
.bench-meter.black-latched { border-color: #67d5aa; box-shadow: 0 0 0 3px rgba(75,211,155,.12), 0 14px 34px rgba(0,0,0,.42); }
.instrument-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  overflow: hidden;
}
.lead-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lead-cable {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  opacity: 0;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.45));
  transition: opacity .18s;
}
.instrument-overlay.active .lead-cable.visible { opacity: 1; }
.black-cable { stroke: #11181b; }
.red-cable { stroke: #ed3c45; }
.blue-cable { stroke: #28a8df; }
.floating-tool {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  transform: translate(-100px,-100px);
  transition: opacity .1s;
  will-change: transform;
  filter: drop-shadow(0 7px 8px rgba(0,0,0,.5));
}
.floating-tool.visible { opacity: 1; }
.probe-set { width: 72px; height: 92px; }
.probe {
  position: absolute;
  top: 24px;
  width: 14px;
  height: 64px;
  border-radius: 7px 7px 4px 4px;
}
.probe::before {
  content: "";
  position: absolute;
  left: 5px;
  top: -20px;
  width: 4px;
  height: 25px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg,#839096,#e7edef,#707b80);
}
.probe i { position: absolute; inset: 14px 3px; border-radius: 3px; background: rgba(255,255,255,.18); }
.black-probe {
  left: 12px;
  top: 26px;
  background: linear-gradient(90deg,#111,#3c4447,#080a0b);
  transform: rotate(-10deg);
  transform-origin: 50% 8px;
}
.red-probe {
  left: 43px;
  top: 24px;
  background: linear-gradient(90deg,#9f151d,#f24b54,#8e1118);
}
.probe-set.black-active .black-probe {
  left: 29px;
  top: 24px;
  transform: none;
}
.probe-set.black-active .red-probe { opacity: 0; }
.probe-set.red-active .black-probe { opacity: 0; }
.amp-clamp { width: 76px; height: 105px; }
.clamp-jaw {
  position: absolute;
  top: 0;
  width: 38px;
  height: 58px;
  border: 10px solid #f0a72b;
  background: transparent;
  transition: transform .18s;
}
.clamp-jaw.left { left: 4px; border-radius: 38px 0 0 38px; border-right: 0; transform-origin: bottom right; }
.clamp-jaw.right { right: 4px; border-radius: 0 38px 38px 0; border-left: 0; transform-origin: bottom left; }
.amp-clamp.hovering .clamp-jaw.left { transform: rotate(-18deg); }
.amp-clamp.hovering .clamp-jaw.right { transform: rotate(18deg); }
.amp-clamp.testing .clamp-jaw { transform: rotate(0); }
.clamp-body {
  position: absolute;
  left: 17px;
  top: 47px;
  width: 43px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 8px 8px 13px 13px;
  background: linear-gradient(90deg,#202b2f,#4b5a60,#182126);
  border: 2px solid #68777c;
  color: #bcebdd;
  font: 800 17px Consolas,monospace;
}
.pressure-probe { width: 62px; height: 70px; }
.pressure-probe i, .analyzer-probe i {
  position: absolute;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(#e6ecee,#687a81);
  transform-origin: left center;
}
.pressure-probe i { left: 33px; top: 24px; width: 34px; }
.hose-port {
  position: absolute;
  left: 0;
  top: 9px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 5px solid #248ebd;
  background: #182b33;
  color: #8fdcff;
  font-weight: 900;
}
.analyzer-probe { width: 94px; height: 42px; }
.analyzer-probe span {
  position: absolute;
  left: 0;
  top: 4px;
  width: 48px;
  height: 33px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #e3ad2e;
  border: 3px solid #ffe19a;
  color: #182128;
  font: 900 11px Consolas,monospace;
}
.analyzer-probe i { left: 43px; top: 17px; width: 55px; }
.refrigeration-probe {
  width: 104px;
  height: 74px;
}
.refrigeration-display {
  position: absolute;
  left: 21px;
  top: 8px;
  width: 60px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 4px solid #4d5d63;
  border-radius: 9px;
  background: #bcead5;
  color: #18372d;
  font: 900 12px Consolas,monospace;
}
.refrigeration-blue-hose,
.refrigeration-red-hose {
  position: absolute;
  top: 43px;
  width: 43px;
  height: 25px;
  border: 5px solid;
  border-top: 0;
  border-radius: 0 0 28px 28px;
}
.refrigeration-blue-hose { left: 8px; border-color: #279cd1; }
.refrigeration-red-hose { right: 8px; border-color: #df4c52; }
.refrigeration-clamp {
  position: absolute;
  right: -9px;
  top: 4px;
  width: 23px;
  height: 34px;
  border: 6px solid #f1b42c;
  border-left-width: 3px;
  border-radius: 12px;
  transform: rotate(16deg);
}
.meter-anchor {
  position: absolute;
  right: 82px;
  top: 83px;
  width: 54px;
  height: 66px;
  display: none;
  place-items: center;
  border: 3px solid #3c4c52;
  border-radius: 8px;
  background: linear-gradient(145deg,#25363d,#0e1a1f);
  box-shadow: 0 8px 18px rgba(0,0,0,.4);
  color: #bfe5d7;
  font: 800 10px Consolas,monospace;
}
.instrument-overlay.active .meter-anchor { display: grid; }
.furnace-stage.instrument-ready [data-component] { cursor: crosshair; }
.furnace-stage.instrument-ready [data-component]::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px dashed transparent;
  border-radius: inherit;
  pointer-events: none;
}
.furnace-stage.instrument-ready [data-component]:hover::after {
  border-color: rgba(255,141,66,.85);
  animation: targetPulse .85s infinite alternate;
}
.furnace-stage .tested-point { box-shadow: 0 0 0 4px rgba(75,211,155,.18), 0 0 18px rgba(75,211,155,.35) !important; }
@keyframes targetPulse { to { inset: -9px; opacity: .35; } }
.hint-banner {
  position: absolute;
  left: 50%;
  top: 15px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 30px);
  padding: 8px 12px;
  border-radius: 7px;
  color: #9eb2b8;
  background: #132830;
  font-size: 11px;
  text-align: center;
}
.furnace { width: 360px; height: 440px; position: relative; perspective: 700px; }
.furnace-panel {
  position: absolute;
  left: 45px;
  width: 270px;
  border: 2px solid #52646b;
  border-radius: 4px;
  background: linear-gradient(135deg, #728187, #46565d);
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.035), 8px 12px 30px rgba(0,0,0,.28);
  color: #d8e0e2;
  cursor: pointer;
  transition: transform .5s, opacity .5s;
  z-index: 5;
}
.upper-panel { top: 15px; height: 193px; }
.lower-panel { top: 214px; height: 218px; }
.furnace-panel.open { transform: translateX(-245px) rotateY(-12deg); opacity: .48; pointer-events: none; }
.panel-name { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.panel-fastener { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #26373d; top: 8px; }
.panel-fastener.one { left: 9px; } .panel-fastener.two { right: 9px; }
.compartment {
  display: none;
  position: absolute;
  left: 0;
  width: 100%;
  border: 2px solid #344950;
  background:
    radial-gradient(circle at 55% 45%, rgba(54,103,116,.22), transparent 60%),
    #0c1b22;
  box-shadow: inset 0 0 30px rgba(82,143,158,.12);
  z-index: -1;
}
.upper-components { top: 0; height: 193px; }
.lower-components { top: 0; height: 218px; }
.furnace-panel.open .compartment { display: block; transform: translateX(245px) rotateY(12deg); opacity: 2.08; pointer-events: auto; z-index: 6; }
.component, .duct span, .flue span, .gas-line span {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid #56717a;
  background: #18313b;
  color: #d5e0e3;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  cursor: crosshair;
  z-index: 10;
}
.component:hover, .duct span:hover, .flue span:hover, .gas-line span:hover { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,106,42,.13); }
.furnace-panel.open .component {
  border-color: #6f929d;
  background-color: #1b3b47;
  color: #f2f8f9;
  text-shadow: 0 1px 2px #000;
}
.inducer { width: 70px; height: 70px; border-radius: 50%; left: 16px; top: 20px; }
.pressure { width: 65px; height: 40px; left: 100px; top: 18px; border-radius: 20px; }
.igniter { width: 47px; height: 32px; left: 105px; top: 105px; }
.flame { width: 47px; height: 32px; left: 160px; top: 105px; }
.gas { width: 68px; height: 38px; right: 14px; top: 28px; }
.limit { width: 50px; height: 30px; left: 25px; bottom: 14px; }
.board {
  width: 112px;
  height: 104px;
  left: 11px;
  top: 12px;
  display: block;
  padding: 7px;
  background:
    linear-gradient(90deg,transparent 48%,rgba(126,202,114,.12) 49% 51%,transparent 52%),
    #183c32 !important;
  border-color: #6cae84 !important;
}
.board > b { display: block; margin-bottom: 7px; font-size: 8px; color: #d8f3df; }
.line-terminals, .thermostat-strip { display: flex; position: relative; gap: 4px; }
.line-terminals { margin-bottom: 9px; }
.thermostat-strip { gap: 2px; padding-top: 7px; border-top: 1px solid rgba(255,255,255,.18); }
.terminal {
  position: relative;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #b7c3c6;
  background: #202b2f;
  color: #fff;
  font: 900 8px Arial,sans-serif;
  font-style: normal;
  cursor: crosshair;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.35);
}
.line-terminal { border-color: #d7bd56; background: #4b3c0e; }
.neutral-terminal { border-color: #f1f1e8; background: #676963; }
.terminal-r { border-color: #ed4b4b; background: #701d1d; }
.terminal-c { border-color: #4a77c8; background: #1d396d; }
.terminal-g { border-color: #58be73; background: #205c30; }
.terminal-w { border-color: #f1f1e8; background: #777870; }
.terminal-y { border-color: #e2c347; background: #6d5c18; }
.terminal-o { border-color: #ec8b3b; background: #753b12; }
.terminal.black-reference {
  box-shadow: 0 0 0 4px rgba(75,211,155,.24), 0 0 15px rgba(75,211,155,.72);
}
.test-terminal {
  position: absolute;
  bottom: -7px;
  min-width: 15px;
  height: 15px;
  padding: 0 2px;
  display: grid;
  place-items: center;
  border: 2px solid #d7dfe1;
  border-radius: 8px;
  background: #15242a;
  color: #fff;
  font: 900 6px Arial,sans-serif;
  font-style: normal;
  box-shadow: 0 2px 4px rgba(0,0,0,.5);
  z-index: 3;
}
.test-terminal.left { left: 5px; }
.test-terminal.right { right: 5px; }
.test-terminal:hover { border-color: var(--orange); transform: scale(1.18); }
.capacitor { width: 35px; height: 57px; right: 30px; top: 18px; border-radius: 45%; }
.blower { width: 112px; height: 68px; border-radius: 50%; left: 86px; bottom: 15px; }
.transformer { width: 58px; height: 42px; left: 15px; bottom: 21px; }
.filter { width: 20px; height: 105px; right: 10px; bottom: 15px; background: repeating-linear-gradient(90deg,#294651 0 2px,#10232b 2px 5px); writing-mode: vertical-rl; }
.duct { position: absolute; z-index: 1; border: 2px solid #41565e; background: #21353d; }
.supply-duct { top: -40px; left: 75px; width: 160px; height: 65px; }
.return-duct { bottom: -35px; left: 55px; width: 200px; height: 55px; }
.duct span, .flue span, .gas-line span { padding: 5px; border-radius: 5px; }
.supply-duct span { right: 8px; top: 10px; }
.return-duct span { left: 8px; top: 7px; }
.flue { position: absolute; width: 42px; height: 125px; border: 2px solid #41565e; background: #293d45; left: 5px; top: -15px; z-index: 1; }
.flue span { left: -22px; top: 18px; width: 80px; }
.gas-line { position: absolute; width: 95px; height: 8px; background: #d8b52c; right: -34px; top: 150px; }
.gas-line .gas-tap { width: 66px; }
.gas-line .inlet-tap { left: 42px; top: -15px; }
.gas-line .manifold-tap { left: 4px; top: 23px; }

/* --------------------------------------------------------------------------
   Diagram board — real manufacturer wiring diagrams as the playing surface.
   The diagram is a raster render of factory literature; interactive hotspot
   pins are absolutely positioned over it in percent coordinates.
   -------------------------------------------------------------------------- */

.furnace-stage {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  place-items: initial;
}

.equipment-stack {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  gap: 6px;
  position: relative;
}

.board-viewport {
  position: relative;
  flex: 1;
  min-height: 380px;
  max-height: 78vh;
  overflow: auto;
  border: 2px solid #415861;
  border-radius: 10px;
  background: #d9d4c7;
  box-shadow: inset 0 0 24px rgba(0,0,0,.25);
  scrollbar-width: thin;
  scrollbar-color: #4d666f #16262d;
}

.equipment-diagram {
  position: relative;
  width: 100%;
}

.diagram-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  filter: sepia(.06) brightness(1.01);
}

.hotspot-layer { position: absolute; inset: 0; }

.diagram-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  z-index: 3;
}
.diagram-hotspot i {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(10, 26, 33, .85);
  background: radial-gradient(circle at 35% 30%, #ffd97a, #e8a020 65%, #9a6a12);
  box-shadow: 0 1px 3px rgba(0,0,0,.55), 0 0 0 2px rgba(255, 217, 122, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.diagram-hotspot.test-port i {
  border-radius: 3px;
  background: radial-gradient(circle at 35% 30%, #9fd8ff, #2f7fb8 65%, #14496e);
  box-shadow: 0 1px 3px rgba(0,0,0,.55), 0 0 0 2px rgba(159, 216, 255, .25);
}
.diagram-hotspot span {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 1px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(10, 24, 30, .82);
  color: #ffe9b0;
  font: 800 8px/1.2 Consolas, monospace;
  letter-spacing: .4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
  z-index: 4;
}
.diagram-hotspot.test-port span { color: #cdeaff; }
.diagram-hotspot:hover i,
.diagram-hotspot:focus-visible i {
  transform: scale(1.35);
  box-shadow: 0 2px 6px rgba(0,0,0,.6), 0 0 0 4px rgba(255, 141, 66, .45);
}
.diagram-hotspot:hover span,
.diagram-hotspot:focus-visible span,
.calibrate-mode .diagram-hotspot span { opacity: 1; }

.diagram-hotspot.black-reference i {
  background: radial-gradient(circle at 35% 30%, #6f7f89, #21303a 65%, #05090c);
  box-shadow: 0 0 0 3px rgba(20, 32, 39, .9), 0 0 10px rgba(0,0,0,.8);
}
.diagram-hotspot.disconnected i {
  background: radial-gradient(circle at 35% 30%, #ffb1a0, #cf4a33 65%, #6e1d10);
  box-shadow: 0 1px 3px rgba(0,0,0,.55), 0 0 0 3px rgba(255, 120, 90, .4);
  transform: translateY(-4px) rotate(18deg);
}
.diagram-hotspot.disconnected span { opacity: 1; color: #ffb1a0; }

.furnace-stage.terminal-service-ready .diagram-hotspot[data-terminal] { cursor: pointer; }
.furnace-stage.instrument-ready .diagram-hotspot { cursor: crosshair; }
.furnace-stage.instrument-ready .diagram-hotspot::after { border-radius: 50%; }

.board-controls {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  gap: 4px;
  z-index: 6;
}
.board-controls button {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #4d666f;
  border-radius: 6px;
  background: rgba(10, 24, 30, .88);
  color: #cde8dd;
  font: 800 12px Consolas, monospace;
  cursor: pointer;
}
.board-controls button:hover { background: rgba(28, 48, 57, .95); border-color: #6f939f; }

.diagram-attribution {
  flex: 0 0 auto;
  font-size: 9px;
  line-height: 1.4;
  color: #77909b;
  letter-spacing: .3px;
}
.diagram-attribution a { color: #9fc3d2; text-decoration: underline; }
.diagram-attribution a:hover { color: #cde8dd; }

.calibrate-mode .board-viewport { outline: 2px dashed rgba(255, 141, 66, .7); }
.tool-dock { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 10px 0 4px; }
.tool-log-divider { margin-top: 22px; }
.tool-button {
  min-width: 0;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #132832;
  cursor: pointer;
  text-align: left;
}
.tool-button:hover:not(:disabled) { border-color: #58747e; background: #18323d; }
.tool-button.active { border-color: var(--orange); background: rgba(255,106,42,.12); }
.tool-button:disabled { opacity: .24; cursor: not-allowed; }
.tool-icon { flex: 0 0 35px; height: 35px; display: grid; place-items: center; border-radius: 8px; background: #243e48; color: var(--orange-2); font-size: 12px; font-weight: 900; }
.tool-button strong, .tool-button small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-button strong { font-size: 11px; } .tool-button small { color: var(--muted); font-size: 9px; margin-top: 3px; }

.meter-mode { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 4px; border-radius: 8px; background: #091920; }
.mode-button { padding: 7px 2px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }
.mode-button.active { background: #2b4650; color: var(--white); }
.current-reading {
  margin: 16px 0 24px;
  min-height: 136px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid #35505a;
  border-radius: 10px;
  background: #071219;
}
.current-reading span { color: var(--orange-2); font-size: 9px; font-weight: 900; letter-spacing: 1.1px; }
.current-reading strong { margin: 9px 0 4px; color: #d9f6e9; font-family: Consolas, monospace; font-size: 27px; font-variant-numeric: tabular-nums; }
.current-reading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.log-heading { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 9px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: 1px; }
.log-heading button { padding: 0; border: 0; background: none; color: #6e858d; font-size: 9px; cursor: pointer; }
.reading-log { max-height: 430px; overflow-y: auto; }
.empty-log { color: #60747c; font-size: 11px; line-height: 1.5; }
.log-item { padding: 11px 0; border-bottom: 1px solid rgba(40,65,74,.65); }
.log-item span { display: block; color: var(--muted); font-size: 9px; }
.log-item strong { display: block; margin-top: 3px; color: #dce8eb; font-size: 12px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3,10,14,.82);
  backdrop-filter: blur(8px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: clamp(28px, 5vw, 44px);
  border: 1px solid #38515b;
  border-radius: 20px;
  background: #11252e;
  box-shadow: var(--shadow);
  position: relative;
}
.modal-close { position: absolute; right: 18px; top: 14px; border: 0; background: none; color: var(--muted); font-size: 28px; cursor: pointer; }
.diagnosis-options { display: grid; gap: 9px; margin: 25px 0; }
.diagnosis-option {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #314b55;
  border-radius: 10px;
  background: #0d1e26;
  cursor: pointer;
  text-align: left;
}
.diagnosis-option:hover { border-color: #647d86; }
.diagnosis-option.selected { border-color: var(--orange); background: rgba(255,106,42,.1); }
.diagnosis-option i { width: 20px; height: 20px; border: 2px solid #526a73; border-radius: 50%; }
.diagnosis-option.selected i { border: 6px solid var(--orange); }
.modal > .primary-button { width: 100%; }
.bug-report-modal textarea {
  width: 100%;
  min-height: 160px;
  padding: 14px 15px;
  resize: vertical;
  color: var(--white);
  border: 1px solid #38505a;
  border-radius: 10px;
  background: #091920;
  line-height: 1.5;
}
.bug-report-modal textarea::placeholder { color: #62767e; }
.bug-report-modal label { margin-top: 22px; }
.bug-report-level { margin-bottom: 0; padding: 10px 12px; border-radius: 8px; background: #0b1c23; font-size: 12px; }
.bug-report-status { min-height: 21px; margin: 10px 0; color: var(--muted); font-size: 12px; }
.bug-report-status.success { color: var(--green); }
.bug-report-status.error { color: var(--red); }
.result-modal { text-align: center; }
.result-icon { width: 64px; height: 64px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(75,211,155,.14); color: var(--green); font-size: 31px; font-weight: 900; }
.result-modal.incorrect .result-icon { background: rgba(255,94,97,.12); color: var(--red); }
.result-stats { margin: 24px 0; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: #0b1c23; }
.result-stats strong { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.result-stats span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.leaderboard-card { margin: 20px 0; padding: 20px; border-radius: 12px; background: #0b1b22; text-align: left; }
.leaderboard-card > div { display: flex; justify-content: space-between; align-items: baseline; }
.leaderboard-card .panel-label { margin: 0; }
.leaderboard-card > div strong { font-size: 12px; }
.leaderboard-card ol { margin: 15px 0 0; padding: 0; list-style: none; }
.leaderboard-card li { display: grid; grid-template-columns: 24px 1fr auto; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12px; }
.leaderboard-card li span:first-child { color: var(--orange-2); font-weight: 900; }
.leaderboard-card li strong { font-variant-numeric: tabular-nums; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 1120px) {
  .game-layout { grid-template-columns: 230px minmax(480px,1fr); }


  .readings-panel { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 190px 1fr; gap: 16px; max-height: none; overflow: visible; }
  .readings-panel > .panel-label, .readings-panel > .meter-mode { grid-column: 1; }
  .tool-dock { grid-column: 1 / -1; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; }
  .tool-log-divider { grid-column: 1 / -1; margin-top: 6px; }
  .current-reading { grid-column: 1; margin: -2px 0 0; }
  .log-heading, .reading-log { grid-column: 2; }
  .log-heading { grid-row: 1; align-self: end; }
  .reading-log { grid-row: 2 / span 3; max-height: 175px; }
  .level-grid { grid-template-columns: repeat(3,1fr); }
  .equipment-category-grid { grid-template-columns: repeat(2,1fr); }
  .admin-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-dashboard-grid { grid-template-columns: 1fr; }
  .admin-level-bars { grid-template-columns: repeat(18, minmax(0, 1fr)); height: 220px; }
}
@media (max-width: 800px) {
  .topbar.game-active { gap: 12px; }
  .topbar.game-active .session-summary { display: none; }
  .topbar-game-controls { grid-template-columns: 68px minmax(100px, 1fr) 66px; gap: 8px; }
  .welcome-screen.active { grid-template-columns: 1fr; }
  .welcome-copy h1 { letter-spacing: -2.5px; }
  .section-heading { display: block; }
  .progress-card { margin-top: 24px; }
  .overall-board-heading { display: block; }
  .overall-leader { min-width: 0; margin-top: 18px; }
  .overall-standing summary { grid-template-columns: 34px 1fr 70px 70px; }
  .standing-stat:nth-child(5),
  .standing-stat:nth-child(6) { display: none; }
  .standing-breakdown { padding-left: 13px; }
  .level-grid { grid-template-columns: repeat(2,1fr); }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-skill-row { grid-template-columns: 1fr 52px; }
  .admin-skill-track { grid-column: 1 / -1; grid-row: 2; }
  .game-layout { display: block; }
  .call-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .call-facts { display: grid; grid-template-columns: repeat(2,1fr); gap: 0 18px; }
  .workbench { min-height: 700px; }
  .readings-panel { display: block; }
  .current-reading { margin: 16px 0; }
  .reading-log { max-height: 220px; }
}
@media (max-width: 540px) {
  .topbar { height: 66px; padding: 0 14px; }
  .brand small, .text-button { display: none; }
  .topbar.game-active .brand > span:last-child { display: none; }
  .topbar.game-active .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
  .topbar-game-controls { grid-template-columns: 54px minmax(80px, 1fr) 54px; gap: 6px; }
  .topbar-game-controls .back-button { font-size: 12px; }
  .game-title span { font-size: 8px; letter-spacing: .8px; }
  .game-title h1 { font-size: 14px; }
  .timer span { font-size: 8px; }
  .timer strong { font-size: 17px; }
  .screen { min-height: calc(100vh - 66px); }
  .welcome-screen.active { padding: 42px 18px; }
  .feature-row { gap: 16px; }
  .feature-row span { font-size: 10px; }
  .pin-fields { grid-template-columns: 1fr; gap: 0; }
  .level-screen { padding: 38px 14px 60px; }
  .level-grid { grid-template-columns: 1fr; }
  .equipment-category-grid { grid-template-columns: 1fr; }
  .level-card { min-height: 165px; }
  .game-layout { min-height: calc(100vh - 66px); }
  .furnace-stage { padding-left: 5px; padding-right: 5px; overflow-x: auto; justify-content: start; }


  .tool-dock { grid-template-columns: repeat(2,1fr); }
  .result-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion:no-preference) {
  .bench-meter strong { animation:lcd-breathe 3.2s ease-in-out infinite; }
  @keyframes lcd-breathe { 50% { filter:brightness(1.08); } }
}
