/* ==========================================================================
   Density Agent · Homeward Project — Platform, Auth, Hub, Mobile/Desktop UX & Admin
   Unified deep-space sci-fi aesthetic (#07121d ink, #a7edce mint, #e7bb78 amber)
   ========================================================================== */

html {
  height: 100%;
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow-x: hidden;
}

/* ==================== AMBIENT IMMERSION EFFECTS ==================== */
.ambient-aurora {
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(ellipse 55% 35% at 22% 18%, rgba(64, 152, 134, 0.14), transparent 70%),
    radial-gradient(ellipse 45% 30% at 82% 76%, rgba(231, 187, 120, 0.08), transparent 70%);
  animation: auroraDrift 22s ease-in-out infinite alternate;
  pointer-events: none;
}

.ambient-meteors span {
  position: fixed;
  top: 14%;
  right: 12%;
  width: 140px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(167, 237, 206, 0.7), rgba(255, 245, 205, 0.95));
  border-radius: 99px;
  opacity: 0;
  transform: rotate(-28deg);
  animation: subtleMeteor 13s ease-in infinite;
}
.ambient-meteors span:nth-child(2) {
  top: 34%;
  right: 36%;
  width: 95px;
  animation-delay: 6.5s;
  animation-duration: 16s;
}

.cockpit-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  box-shadow: inset 0 0 90px rgba(3, 9, 16, 0.55);
  transition: box-shadow 0.4s ease;
}

body.mission-urgent .cockpit-vignette {
  box-shadow: inset 0 0 110px rgba(243, 120, 108, 0.34);
  animation: urgentVignette 1s ease-in-out infinite;
}

#app > section {
  animation: viewEnter 0.34s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

@keyframes viewEnter {
  from { opacity: 0; transform: translateY(10px) scale(0.994); }
  to { opacity: 1; transform: none; }
}
@keyframes auroraDrift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(2.5%, -2%) scale(1.06); }
}
@keyframes subtleMeteor {
  0%, 86%, 100% { opacity: 0; transform: translate(220px, -110px) rotate(-28deg); }
  90% { opacity: 0.7; }
  96% { opacity: 0; transform: translate(-260px, 145px) rotate(-28deg); }
}
@keyframes urgentVignette {
  50% { box-shadow: inset 0 0 130px rgba(243, 120, 108, 0.52); }
}

/* ==================== MASTHEAD & AGENT CHIP ==================== */
.masthead-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.agent-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(133, 184, 174, 0.34);
  background: rgba(12, 33, 44, 0.72);
  backdrop-filter: blur(8px);
  font-size: 12px;
  color: #dcebe3;
  white-space: nowrap;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px rgba(167, 237, 206, 0.7);
  flex-shrink: 0;
}
.sync-dot.sync-syncing {
  background: var(--amber);
  animation: pulseDot 0.9s infinite;
}
.sync-dot.sync-offline {
  background: var(--red);
  box-shadow: 0 0 8px rgba(243, 155, 143, 0.7);
}
@keyframes pulseDot {
  50% { opacity: 0.35; transform: scale(0.8); }
}

.agent-name {
  font-weight: 700;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-phone {
  font: 11px var(--mono);
  color: #7ea3aa;
}

.victory-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(231, 187, 120, 0.65);
  background: linear-gradient(120deg, rgba(231, 187, 120, 0.25), rgba(186, 122, 48, 0.22));
  color: #ffe2a8;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(231, 187, 120, 0.22);
}
.victory-pill:hover {
  background: linear-gradient(120deg, rgba(231, 187, 120, 0.38), rgba(186, 122, 48, 0.32));
  border-color: #ffe2a8;
}
.pill-spark {
  color: #fde047;
}

.logout-btn:hover {
  border-color: rgba(243, 155, 143, 0.7);
  color: #ffb8b0;
  background: rgba(120, 42, 42, 0.32);
}

/* ==================== BOOT / ERROR ==================== */
.boot-scene {
  min-height: calc(100dvh - 88px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
  gap: 14px;
}
.boot-radar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1.5px solid rgba(167, 237, 206, 0.35);
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}
.boot-radar span {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--mint);
  animation: spin 1.1s linear infinite;
}
.boot-radar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 14px var(--mint);
}
.boot-alert-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: rgba(243, 155, 143, 0.14);
  border: 1px solid rgba(243, 155, 143, 0.45);
  color: var(--red);
}
.boot-scene h1 { font-size: 26px; font-weight: 600; }
.boot-scene p { max-width: 420px; font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== UNIFIED SCI-FI AUTH SCREEN ==================== */
.view-auth {
  max-width: 1320px !important;
  padding: 10px 24px 36px;
}

.auth-scene {
  position: relative;
  min-height: calc(100dvh - 110px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-ring {
  opacity: 0.55;
  right: -4%;
  top: -6%;
}

.auth-planet {
  opacity: 0.42;
  right: 4%;
  top: -4%;
}

.auth-deck {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1040px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(110, 165, 168, 0.42);
  background: linear-gradient(145deg, rgba(13, 35, 47, 0.92), rgba(7, 20, 31, 0.96));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58), inset 0 1px rgba(210, 255, 240, 0.08);
  backdrop-filter: blur(16px);
}

.auth-showcase {
  padding: 36px 34px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  background:
    radial-gradient(ellipse at 30% 15%, rgba(67, 138, 134, 0.24), transparent 62%),
    linear-gradient(160deg, rgba(16, 44, 56, 0.85), rgba(8, 22, 33, 0.92));
  border-right: 1px solid rgba(93, 142, 148, 0.26);
}

.auth-showcase .overline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: #9ec8be;
  margin-bottom: 12px;
}
.auth-showcase .overline i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}
.auth-showcase h1 {
  font-size: clamp(32px, 3.6vw, 46px);
  line-height: 1.16;
  font-weight: 800;
  color: #edf1e2;
  letter-spacing: 0.03em;
}
.auth-showcase h1 span {
  display: block;
  color: var(--mint);
  font-weight: 400;
  font-size: 0.72em;
  margin-top: 4px;
}
.auth-showcase h1 .period {
  font-style: normal;
  color: var(--amber);
  font-weight: 700;
}
.auth-lead {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.85;
  color: #9bb8ba;
}
.auth-lead strong {
  color: #f3d49b;
  font-weight: 600;
}

.auth-ship-stage {
  position: relative;
  min-height: 158px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.auth-ship-svg {
  width: 100%;
  max-height: 135px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: shipTravel 10s ease-in-out infinite;
}
.auth-ship-svg svg {
  width: 100%;
  max-height: 135px;
  object-fit: contain;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.55));
}
.auth-alo-greet {
  display: flex;
  align-items: center;
  gap: 11px;
}
.auth-alo-svg {
  width: 52px;
  height: 54px;
  flex-shrink: 0;
}
.auth-alo-bubble {
  flex: 1;
  padding: 9px 13px;
  border-radius: 6px 12px 12px 12px;
  border: 1px solid rgba(117, 173, 165, 0.32);
  background: rgba(9, 25, 35, 0.78);
}
.auth-alo-bubble span {
  display: block;
  font-size: 10px;
  color: var(--amber);
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}
.auth-alo-bubble p {
  font-size: 12px;
  line-height: 1.65;
  color: #bfd7d3;
}

.auth-showcase-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-info-box {
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(231, 187, 120, 0.25);
  background: rgba(231, 187, 120, 0.06);
}
.auth-info-box strong {
  display: block;
  font-size: 12px;
  color: #f0cf93;
  margin-bottom: 4px;
}
.auth-info-box p {
  font-size: 11.5px;
  line-height: 1.7;
  color: #9cb6b9;
}

.teacher-switch-btn {
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid rgba(145, 200, 194, 0.3);
  background: rgba(20, 48, 60, 0.65);
  color: #cde8e1;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}
.teacher-switch-btn:hover {
  background: rgba(34, 72, 86, 0.85);
  border-color: var(--mint);
}

.auth-panel {
  padding: 38px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-tabs {
  display: inline-flex;
  padding: 5px;
  border-radius: 12px;
  background: rgba(6, 17, 26, 0.85);
  border: 1px solid rgba(86, 132, 140, 0.34);
  margin-bottom: 22px;
  align-self: flex-start;
  gap: 4px;
}

.auth-tab {
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #8baab0;
  font-size: 13px;
  font-weight: 700;
}
.auth-tab:hover {
  color: #e2f0e8;
  background: rgba(255, 255, 255, 0.05);
}
.auth-tab.active {
  background: linear-gradient(120deg, rgba(167, 237, 206, 0.2), rgba(92, 168, 152, 0.24));
  border-color: rgba(167, 237, 206, 0.55);
  color: #dcffec;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.admin-pill-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font: 700 10px var(--mono);
  letter-spacing: 0.12em;
  color: #ffe2a8;
  background: rgba(231, 187, 120, 0.15);
  border: 1px solid rgba(231, 187, 120, 0.4);
  margin-bottom: 10px;
}

.auth-form-head {
  margin-bottom: 20px;
}
.auth-form-head h2 {
  font-size: 22px;
  font-weight: 700;
  color: #eef3e5;
}
.auth-form-head p {
  font-size: 12.5px;
  line-height: 1.75;
  color: #8da9ae;
  margin-top: 6px;
}

.auth-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.65;
  margin-bottom: 16px;
}
.notice-error {
  background: rgba(165, 52, 62, 0.2);
  border: 1px solid rgba(243, 155, 143, 0.55);
  color: #ffcac3;
}
.notice-pending {
  background: rgba(196, 142, 46, 0.18);
  border: 1px solid rgba(231, 187, 120, 0.55);
  color: #ffe3ae;
}
.notice-success {
  background: rgba(48, 138, 102, 0.2);
  border: 1px solid rgba(167, 237, 206, 0.55);
  color: #ceffe7;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field-group > span {
  font-size: 12.5px;
  font-weight: 600;
  color: #c2dad5;
}
.field-group > span em {
  font-style: normal;
  color: var(--red);
}
.field-group > span small {
  color: #7b9da4;
  font-weight: 400;
}
.field-group input {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(102, 148, 154, 0.45);
  background: rgba(6, 19, 29, 0.85);
  color: #edf4ee;
  font-size: 16px; /* Prevents iOS Safari zoom on focus */
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.field-group input::placeholder {
  color: #5b7e88;
  font-size: 13.5px;
}
.field-group input:focus {
  outline: none;
  border-color: var(--mint);
  background: rgba(8, 25, 37, 0.96);
  box-shadow: 0 0 0 3px rgba(167, 237, 206, 0.16);
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
  min-height: 52px;
  border-radius: 12px;
  font-size: 15px;
}

.admin-login-submit {
  background: linear-gradient(120deg, #f3d59c, #d99f54);
  border-color: #ffe9be;
  color: #2c1d0a;
}
.admin-login-submit:hover {
  background: linear-gradient(120deg, #ffebc1, #e8b164);
}

/* ==================== IMPROVED COMMAND HUB ENTRY ==================== */
.hub-scene {
  min-height: calc(100dvh - 82px);
  max-height: none;
  padding: 24px 6% 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hub-grid {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hub-copy {
  max-width: 590px;
}

.hub-subtitle b {
  color: #e6f2d8;
  font-weight: 600;
}

.hub-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 24px;
}

.hub-metric {
  padding: 13px 15px;
  border-radius: 10px;
  border: 1px solid rgba(102, 150, 154, 0.35);
  background: rgba(9, 25, 36, 0.76);
  backdrop-filter: blur(8px);
}
.hub-metric > span {
  display: block;
  font-size: 10px;
  color: #82a7ad;
  letter-spacing: 0.08em;
}
.hub-metric > strong {
  display: block;
  font: 600 22px/1.35 var(--mono);
  color: #e9f5ea;
  margin-top: 4px;
}
.hub-metric > strong small {
  font-size: 12px;
  color: #74989f;
}
.metric-sub {
  display: block;
  font-size: 10.5px;
  color: #7da3a8;
  margin-top: 4px;
}
.hub-mini-bar {
  height: 4px;
  border-radius: 99px;
  background: rgba(74, 110, 120, 0.4);
  overflow: hidden;
  margin-top: 8px;
}
.hub-mini-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), #f0d090);
  border-radius: 99px;
}

.hub-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.hub-secondary-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hub-secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid rgba(114, 162, 166, 0.4);
  background: rgba(12, 33, 45, 0.72);
  color: #c7e1dc;
  font-size: 13px;
  font-weight: 600;
}
.hub-secondary-btn:hover {
  background: rgba(24, 58, 70, 0.88);
  border-color: var(--mint);
}
.hub-secondary-btn svg {
  width: 15px;
  height: 15px;
}

.hub-victory-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid rgba(231, 187, 120, 0.72);
  background: linear-gradient(120deg, rgba(231, 187, 120, 0.25), rgba(186, 122, 48, 0.22));
  color: #ffe6b2;
  font-size: 13px;
  font-weight: 700;
}
.hub-victory-btn:hover {
  background: linear-gradient(120deg, rgba(231, 187, 120, 0.4), rgba(186, 122, 48, 0.35));
}

.hub-journey-bar {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(99, 148, 152, 0.32);
  background: rgba(8, 22, 33, 0.78);
  backdrop-filter: blur(12px);
}
.hub-journey-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font: 11px var(--mono);
  color: #82a7ad;
  margin-bottom: 12px;
}

.journey-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
}

.journey-node {
  padding: 10px 10px;
  border-radius: 9px;
  border: 1px solid rgba(92, 134, 142, 0.34);
  background: rgba(12, 31, 42, 0.78);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  min-width: 0;
}
.journey-node .jn-code {
  font: 10px var(--mono);
  color: #7ca3aa;
}
.journey-node strong {
  font-size: 12.5px;
  color: #dcebe3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.journey-node small {
  font: 10px var(--mono);
  color: #6d929a;
}
.journey-node.is-done {
  border-color: rgba(167, 237, 206, 0.52);
  background: rgba(24, 65, 62, 0.55);
}
.journey-node.is-done small { color: var(--mint); }
.journey-node.is-current {
  border-color: var(--amber);
  background: rgba(74, 58, 26, 0.38);
  box-shadow: 0 0 18px rgba(231, 187, 120, 0.16);
}
.journey-node.is-current .jn-code,
.journey-node.is-current small { color: var(--amber); }

/* ==================== ENHANCED SHIP MAP (TOUCH & DESKTOP) ==================== */
.map-victory-banner {
  position: relative;
  z-index: 4;
  margin: 14px 0 4px;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid rgba(231, 187, 120, 0.55);
  background: linear-gradient(120deg, rgba(64, 53, 27, 0.85), rgba(15, 38, 48, 0.9));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.map-victory-banner strong {
  display: block;
  font-size: 15px;
  color: #ffe3a8;
  margin-top: 3px;
}
.map-victory-banner code {
  font: 700 20px var(--mono);
  letter-spacing: 0.16em;
  color: #fff2cc;
  margin-left: 6px;
}
.map-victory-banner small {
  display: block;
  font-size: 11.5px;
  color: #b5c6be;
  margin-top: 2px;
}

.sector-quick-nav {
  position: relative;
  z-index: 4;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  margin: 4px auto 6px;
  max-width: 1050px;
  scrollbar-width: thin;
}
.sector-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(92, 134, 142, 0.36);
  background: rgba(11, 30, 41, 0.82);
  color: #9cb8bc;
  font-size: 12px;
  font-weight: 600;
}
.sector-pill .sp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #55737d;
}
.sector-pill .sp-count {
  font: 11px var(--mono);
  color: #70949c;
}
.sector-pill.done .sp-dot {
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
}
.sector-pill.active {
  border-color: var(--amber);
  background: rgba(76, 61, 28, 0.45);
  color: #ffe4ae;
}
.sector-pill.active .sp-dot { background: var(--amber); }
.sector-pill.locked { opacity: 0.52; }

.inspector-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.inspector-stars {
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--amber);
}

/* ==================== IN-GAME IMMERSION & PROGRESS BAR ==================== */
.mission-progress-bar {
  height: 4px;
  border-radius: 99px;
  background: rgba(45, 76, 88, 0.45);
  overflow: hidden;
  margin-bottom: 12px;
}
.mission-progress-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), #e7bb78);
  box-shadow: 0 0 12px rgba(167, 237, 206, 0.55);
  transition: width 0.3s ease;
}

.pop-badge {
  position: fixed;
  transform: translate(-50%, 0);
  padding: 4px 10px;
  border-radius: 999px;
  font: 700 12px var(--mono);
  pointer-events: none;
  animation: popRise 0.65s ease-out both;
}
.pop-badge.positive {
  background: rgba(24, 68, 56, 0.9);
  border: 1px solid rgba(167, 237, 206, 0.7);
  color: #d6ffe9;
}
@keyframes popRise {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.85); }
  22% { opacity: 1; transform: translate(-50%, -8px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(0.95); }
}

.result-stars {
  color: var(--amber);
  font-size: 15px;
  letter-spacing: 3px;
}

/* ==================== VICTORY TICKET & 5-DIGIT CODE ==================== */
.golden-ticket {
  border: 1.5px solid rgba(231, 187, 120, 0.72) !important;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(231, 187, 120, 0.14) !important;
}
.ticket-body { flex: 1; }
.ticket-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ticket-status {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.ticket-status.active {
  background: rgba(231, 187, 120, 0.22);
  border: 1px solid rgba(231, 187, 120, 0.55);
  color: #ffe3a8;
}
.ticket-status.redeemed {
  background: rgba(167, 237, 206, 0.18);
  border: 1px solid rgba(167, 237, 206, 0.5);
  color: var(--mint);
}

.victory-digits {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 12px;
  flex-wrap: wrap;
}
.modal-digits {
  justify-content: center;
  margin: 18px 0;
}
.v-digit {
  width: 50px;
  height: 62px;
  border-radius: 12px;
  border: 1.5px solid rgba(231, 187, 120, 0.65);
  background: rgba(7, 20, 31, 0.85);
  color: #ffe2a4;
  font: 800 30px/1 var(--mono);
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px rgba(255, 240, 200, 0.18), 0 8px 18px rgba(0, 0, 0, 0.32);
  animation: digitPop 0.45s cubic-bezier(0.2, 0.85, 0.3, 1.2) calc(var(--di, 0) * 0.07s) both;
}
@keyframes digitPop {
  from { opacity: 0; transform: translateY(12px) scale(0.85); }
  to { opacity: 1; transform: none; }
}

.ticket-copy-row {
  margin-bottom: 10px;
}
.copy-code-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(231, 187, 120, 0.55);
  background: rgba(231, 187, 120, 0.18);
  color: #ffe2a8;
  font-size: 12px;
  font-weight: 700;
}
.copy-code-btn:hover {
  background: rgba(231, 187, 120, 0.3);
}

.modal-code-status {
  text-align: center;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 18px;
}
.modal-code-status.active {
  background: rgba(231, 187, 120, 0.15);
  border: 1px solid rgba(231, 187, 120, 0.42);
  color: #ffe2a8;
}
.modal-code-status.redeemed {
  background: rgba(167, 237, 206, 0.14);
  border: 1px solid rgba(167, 237, 206, 0.42);
  color: var(--mint);
}
.modal-victory-actions {
  justify-content: center;
  flex-wrap: wrap;
}

/* ==================== TEACHER ADMIN PORTAL ==================== */
.view-admin {
  max-width: none !important;
  padding: 0;
}

.admin-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: rgba(6, 17, 27, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(93, 144, 152, 0.32);
  flex-wrap: wrap;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #f3d59c, #d99f54);
  color: #1e1508;
  font: 700 26px Georgia, serif;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.admin-brand h1 {
  font-size: 16px;
  font-weight: 700;
  color: #eff4e8;
}
.admin-brand p {
  font-size: 11px;
  color: #7ea3aa;
}

.admin-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid rgba(98, 142, 150, 0.3);
  background: rgba(15, 36, 48, 0.65);
  color: #b4ced0;
  font-size: 13px;
  font-weight: 700;
}
.admin-tab.active {
  background: linear-gradient(120deg, rgba(167, 237, 206, 0.22), rgba(70, 146, 134, 0.3));
  border-color: var(--mint);
  color: #e4fff2;
}
.admin-tab.tab-reward.active {
  background: linear-gradient(120deg, #f0cc84, #d69345);
  border-color: #ffe6b2;
  color: #261807;
}
.pending-badge {
  font-style: normal;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e14b5a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-error-bar {
  max-width: 1260px;
  width: calc(100% - 40px);
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(243, 155, 143, 0.55);
  background: rgba(145, 42, 52, 0.28);
  color: #ffcac3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.admin-error-bar button {
  padding: 4px 10px;
  font-size: 12px;
}

.admin-main {
  max-width: 1260px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

.admin-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-card {
  border-radius: 16px;
  border: 1px solid rgba(93, 144, 152, 0.34);
  background: linear-gradient(155deg, rgba(13, 34, 46, 0.9), rgba(8, 21, 32, 0.95));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.invite-card {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.invite-copy h2 {
  font-size: 19px;
  margin: 6px 0;
  color: #eef4e6;
}
.invite-copy p { font-size: 12.5px; }
.invite-highlight {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  background: rgba(167, 237, 206, 0.16);
  border: 1px solid rgba(167, 237, 206, 0.45);
  color: var(--mint);
  font: 700 20px var(--mono);
  letter-spacing: 0.08em;
}
.invite-form {
  display: flex;
  align-items: center;
  gap: 10px;
}
.invite-form input {
  width: 170px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid rgba(108, 154, 160, 0.45);
  background: rgba(6, 19, 29, 0.9);
  color: #edf4ee;
  font: 700 15px var(--mono);
}
.small-primary {
  min-height: 44px !important;
  padding: 10px 18px !important;
  gap: 8px !important;
  border-radius: 9px;
}

.table-card-head {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(86, 132, 140, 0.25);
  background: rgba(8, 22, 33, 0.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.table-card-head h3 {
  margin: 0;
  font-size: 16px;
  color: #e9f2e4;
}
.table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-search {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(98, 142, 150, 0.4);
  background: rgba(6, 18, 28, 0.85);
  color: #e6f0eb;
  font-size: 13px;
  width: 210px;
}
.filter-pills {
  display: flex;
  gap: 6px;
}
.filter-pill {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(96, 138, 146, 0.35);
  background: rgba(12, 30, 41, 0.7);
  color: #9cb8bc;
}
.filter-pill.active {
  background: rgba(167, 237, 206, 0.2);
  border-color: var(--mint);
  color: #e2fff0;
}

.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.admin-table th {
  padding: 12px 16px;
  font-size: 12px;
  color: #82a7ad;
  border-bottom: 1px solid rgba(86, 132, 140, 0.25);
  background: rgba(7, 19, 29, 0.45);
  white-space: nowrap;
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(86, 132, 140, 0.16);
  vertical-align: middle;
}
.admin-table tbody tr:hover {
  background: rgba(28, 62, 74, 0.28);
}
.text-right { text-align: right; }
.stu-name { font-weight: 700; color: #eef4e8; }
.stu-phone { font: 12px var(--mono); color: #7ca0a8; margin-top: 2px; }
.stu-time { font-size: 12px; color: #84a5ac; white-space: nowrap; }

.a-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-mint { background: rgba(167, 237, 206, 0.14); border: 1px solid rgba(167, 237, 206, 0.42); color: #bdf7dc; }
.badge-amber { background: rgba(231, 187, 120, 0.15); border: 1px solid rgba(231, 187, 120, 0.45); color: #f6d598; }
.badge-ok { background: rgba(52, 168, 120, 0.18); border: 1px solid rgba(110, 224, 174, 0.45); color: #a7edce; }
.badge-warn { background: rgba(217, 146, 42, 0.2); border: 1px solid rgba(242, 195, 114, 0.52); color: #ffe0a3; }
.badge-danger { background: rgba(196, 68, 78, 0.2); border: 1px solid rgba(243, 155, 143, 0.5); color: #ffb9b0; }

.prog-cell { min-width: 175px; }
.prog-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.prog-meta strong { color: #e8f3e6; }
.prog-meta span { color: var(--amber); font-family: var(--mono); }
.prog-bar {
  height: 5px;
  border-radius: 99px;
  background: rgba(65, 102, 112, 0.45);
  overflow: hidden;
}
.prog-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--amber));
}
.a-mini-tag {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.a-mini-tag.active { background: rgba(231, 187, 120, 0.22); color: #ffe09e !important; }
.a-mini-tag.redeemed { background: rgba(167, 237, 206, 0.18); color: var(--mint) !important; }

.actions-cell { white-space: nowrap; }
.a-btn {
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 4px;
}
.btn-ok { background: #1e7a57; border-color: #6ce0b1; color: #eafff5; }
.btn-ok:hover { background: #26946a; }
.btn-warn { background: rgba(176, 62, 72, 0.22); border-color: rgba(243, 155, 143, 0.5); color: #ffc2ba; }
.btn-amber { background: rgba(231, 187, 120, 0.18); border-color: rgba(231, 187, 120, 0.5); color: #ffe2a8; }
.btn-ghost { background: rgba(18, 43, 56, 0.72); border-color: rgba(102, 146, 152, 0.4); color: #c4ddda; }
.btn-danger { background: rgba(145, 36, 46, 0.24); border-color: rgba(243, 155, 143, 0.45); color: #ffb5ac; }
.btn-danger:hover { background: rgba(186, 48, 58, 0.4); }

.admin-empty {
  padding: 48px 20px;
  text-align: center;
  color: #7ea1a8;
  font-size: 13.5px;
}

/* ==================== TAB 2: 18-LEVEL ANALYTICS ==================== */
.admin-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.kpi-box {
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(93, 144, 152, 0.34);
  background: linear-gradient(155deg, rgba(13, 34, 46, 0.9), rgba(8, 21, 32, 0.95));
}
.kpi-box span { font-size: 12px; color: #84a7ad; }
.kpi-box strong {
  display: block;
  font: 700 32px/1.3 var(--mono);
  color: #edf4ea;
  margin: 4px 0;
}
.kpi-box strong.kpi-mint { color: var(--mint); }
.kpi-box strong.kpi-amber { color: var(--amber); }
.kpi-box small { font-size: 11.5px; color: #7598a0; }

.analytics-head {
  padding: 20px 22px 14px;
  border-bottom: 1px solid rgba(86, 132, 140, 0.24);
}
.analytics-head h2 { font-size: 18px; margin: 6px 0 4px; }
.analytics-head p { font-size: 12.5px; }

.sector-stats-grid {
  padding: 18px 22px 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.sector-stat-card {
  border-radius: 12px;
  border: 1px solid rgba(86, 132, 140, 0.28);
  background: rgba(8, 21, 32, 0.72);
  padding: 14px 16px;
}
.sector-stat-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(86, 132, 140, 0.2);
}
.sector-stat-head h4 { margin: 0; font-size: 14.5px; color: var(--mint); }
.sector-stat-head span { font-size: 11px; color: #7ea0a7; }
.sector-stat-list { display: flex; flex-direction: column; gap: 10px; }
.level-stat-row {
  display: grid;
  grid-template-columns: 30px 1.2fr 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.lvl-num {
  font: 700 13px var(--mono);
  color: var(--amber);
}
.lvl-info strong { display: block; color: #e3eee7; font-size: 12.5px; }
.lvl-info small { color: #75979e; font-size: 11px; }
.lvl-bar {
  height: 5px;
  border-radius: 99px;
  background: rgba(65, 102, 112, 0.45);
  overflow: hidden;
  margin-bottom: 3px;
}
.lvl-bar i { display: block; height: 100%; background: var(--mint); }
.lvl-bar-col small { font-size: 10.5px; color: #84a7ad; }
.lvl-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font: 11px var(--mono);
  color: #a4c2c0;
  white-space: nowrap;
}

/* ==================== TAB 3: VICTORY CODE & EGG SMASH CEREMONY ==================== */
.reward-ceremony-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1.5px solid rgba(231, 187, 120, 0.55);
  background: linear-gradient(160deg, rgba(35, 42, 34, 0.92), rgba(10, 24, 36, 0.96));
  padding: 28px 32px 44px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  text-align: center;
}
.reward-stage-aura {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 12%, rgba(250, 204, 21, 0.18), transparent 58%);
  pointer-events: none;
}
.reward-top-link {
  position: relative;
  display: flex;
  justify-content: flex-end;
}
.ledger-link {
  color: #ebd09b !important;
  font-size: 12.5px !important;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.reward-hero {
  position: relative;
  max-width: 640px;
  margin: 12px auto 26px;
}
.reward-emblem {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, #facc15, #f97316, #e11d48);
  display: grid;
  place-items: center;
  font-size: 36px;
  box-shadow: 0 14px 36px rgba(245, 158, 11, 0.38);
}
.reward-pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(250, 204, 21, 0.42);
  background: rgba(250, 204, 21, 0.12);
  color: #fde047;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}
.reward-hero h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  color: #fff2cc;
  margin-bottom: 10px;
}
.reward-hero p {
  font-size: 14px;
  line-height: 1.8;
  color: #b4cbc6;
}
.reward-hero p strong { color: #fde047; }

.reward-verify-form {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.reward-verify-form input {
  flex: 1;
  min-height: 58px;
  border-radius: 14px;
  border: 2px solid rgba(250, 204, 21, 0.55);
  background: rgba(6, 18, 28, 0.92);
  color: #fff4cf;
  text-align: center;
  font: 800 28px var(--mono);
  letter-spacing: 0.35em;
  padding: 8px 16px;
}
.reward-verify-form input::placeholder {
  font: 600 15px var(--font);
  letter-spacing: normal;
  color: #6e8d95;
}
.reward-submit-btn {
  min-height: 56px;
  padding: 12px 26px;
  border-radius: 14px;
  border: 1px solid #fef08a;
  background: linear-gradient(120deg, #f59e0b, #f97316, #e11d48);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.32);
  white-space: nowrap;
}
.reward-submit-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.reward-error-banner {
  position: relative;
  max-width: 560px;
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(168, 44, 56, 0.25);
  border: 1px solid rgba(243, 155, 143, 0.6);
  color: #ffc8c0;
  font-size: 13.5px;
  font-weight: 700;
}

.reward-steps-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
  font-size: 12px;
  color: #88a7ac;
  flex-wrap: wrap;
}
.reward-steps-row i {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(231, 187, 120, 0.2);
  border: 1px solid rgba(231, 187, 120, 0.5);
  color: var(--amber);
  font-style: normal;
  font-weight: 700;
  margin-right: 6px;
}
.step-dash {
  width: 28px;
  height: 1px;
  background: rgba(145, 180, 182, 0.35);
}

/* ==================== ADMIN MODALS & 3-EGG CEREMONY ==================== */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: rgba(3, 10, 18, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.egg-ceremony-modal {
  position: relative;
  width: 100%;
  max-width: 780px;
  border-radius: 26px;
  border: 2px solid rgba(250, 204, 21, 0.6);
  background: linear-gradient(175deg, #102536, #0b1929 55%, #07121e);
  padding: 32px 28px 34px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  text-align: center;
  animation: viewEnter 0.3s ease-out;
}
.modal-cancel-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 12px;
}
.egg-code-pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: #fde047;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}
.egg-ceremony-head h3 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 29px);
  color: #fff1c2;
}
.egg-ceremony-head p {
  font-size: 13px;
  color: #9cb9bd;
  margin-bottom: 24px;
}

.eggs-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 640px;
  margin: 0 auto;
}
.egg-card {
  border-radius: 20px;
  padding: 20px 14px;
  border: 2px solid rgba(250, 204, 21, 0.32);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.egg-card.is-ready:hover {
  transform: translateY(-6px) scale(1.04);
  border-color: #fde047;
  background: rgba(250, 204, 21, 0.12);
  box-shadow: 0 14px 36px rgba(250, 204, 21, 0.22);
}
.egg-card.is-chosen {
  border-color: #facc15;
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 40px rgba(250, 204, 21, 0.3);
}
.egg-card.is-dim {
  opacity: 0.62;
  border-color: rgba(148, 163, 184, 0.2);
}
.egg-svg {
  width: 108px;
  height: 128px;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.45));
}
.smashed-egg-stage {
  position: relative;
  height: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.egg-burst-ring {
  position: absolute;
  top: 16px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253, 224, 71, 0.65), transparent 70%);
  animation: burstOut 0.65s ease-out both;
}
@keyframes burstOut {
  from { transform: scale(0.3); opacity: 1; }
  to { transform: scale(1.7); opacity: 0; }
}
.egg-coins-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.egg-coin {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  background: rgba(250, 204, 21, 0.22);
  border: 2px solid rgba(250, 204, 21, 0.4);
  color: #fde047;
  animation: coinBounce 0.45s cubic-bezier(0.2, 0.85, 0.3, 1.35) calc(var(--coin-i, 0) * 0.1s) both;
}
.egg-coin.chosen {
  background: linear-gradient(135deg, #fef08a, #f59e0b);
  border-color: #fff;
  color: #5a2d05;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
}
@keyframes coinBounce {
  from { opacity: 0; transform: translateY(24px) scale(0.3); }
  to { opacity: 1; transform: none; }
}
.egg-shell-bottom { width: 92px; height: 38px; }

.egg-cta-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.18);
  color: #fde68a;
  font-size: 12px;
  font-weight: 800;
}
.egg-win-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: #facc15;
  color: #261604;
  font-size: 13.5px;
  font-weight: 900;
}
.egg-other-pill { font-size: 12px; color: #8da6ac; }
.egg-ceremony-footer { margin-top: 24px; }

.admin-sheet-modal {
  width: 100%;
  max-width: 780px;
  max-height: 84dvh;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid rgba(110, 162, 168, 0.45);
  background: linear-gradient(155deg, #102735, #091824);
  overflow: hidden;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.65);
}
.pwd-modal { max-width: 440px; }
.sheet-head {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(86, 132, 140, 0.28);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(6, 18, 28, 0.6);
}
.sheet-head h3 { margin: 0; font-size: 16px; color: #eef4e8; }
.sheet-head p { font-size: 12px; margin-top: 2px; }
.sheet-body { overflow-y: auto; flex: 1; }
.vc-code-cell {
  font: 800 17px var(--mono);
  letter-spacing: 0.15em;
  color: #ffe2a4;
}
.muted-note { font-size: 12px; color: #6e8f97; }

.pwd-form {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pwd-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

/* ==================== MOBILE & TOUCH ERGONOMICS ==================== */
@media (hover: none) and (pointer: coarse) {
  /* Hide desktop keyboard badges on touch devices for cleaner UI */
  .delivery-port > kbd,
  .recycler > kbd {
    display: none;
  }
}

@media (max-width: 960px) {
  .auth-deck {
    grid-template-columns: 1fr;
    max-width: 560px;
  }
  .auth-showcase {
    border-right: 0;
    border-bottom: 1px solid rgba(93, 142, 148, 0.25);
    padding: 24px 22px 20px;
    gap: 14px;
  }
  .auth-ship-stage {
    min-height: 112px;
  }
  .auth-ship-svg svg {
    max-height: 98px;
  }
  .auth-panel {
    padding: 26px 22px 28px;
  }
  .journey-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .admin-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sector-stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .masthead {
    padding: 10px 14px;
    height: 62px;
  }
  .agent-phone {
    display: none;
  }
  .agent-chip {
    padding: 5px 9px;
    font-size: 11px;
  }
  .victory-pill {
    padding: 5px 9px;
    font-size: 11px;
  }
  .view-auth {
    padding: 6px 12px 24px;
  }
  .auth-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .auth-tab {
    text-align: center;
    padding: 10px 8px;
  }
  .hub-scene {
    padding: 185px 5% 28px;
    justify-content: flex-start;
  }
  .hub-scene .title-ship {
    top: -18px;
    height: 250px;
    width: 132%;
    left: -16%;
    opacity: 0.92;
  }
  .hub-copy {
    text-align: left;
  }
  .hub-copy > .overline {
    justify-content: flex-start;
  }
  .hub-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0 18px;
  }
  .hub-metric {
    padding: 10px 10px;
  }
  .hub-metric > strong {
    font-size: 17px;
  }
  .hub-actions {
    align-items: stretch;
  }
  .hub-actions > .primary {
    width: 100%;
  }
  .hub-secondary-row {
    width: 100%;
  }
  .hub-secondary-btn,
  .hub-victory-btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 10px 12px;
  }
  .journey-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Fix mobile ship cutaway clipping! */
  .cutaway-stage {
    height: 240px !important;
    min-height: 220px !important;
    margin: 0 !important;
    overflow: hidden;
  }
  .cutaway-stage > svg {
    width: 100% !important;
    height: 100% !important;
  }

  .v-digit {
    width: 44px;
    height: 54px;
    font-size: 25px;
  }
  .reward-verify-form {
    flex-direction: column;
  }
  .eggs-grid-3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .egg-card {
    flex-direction: row;
    justify-content: space-between;
    padding: 12px 18px;
  }
  .egg-svg {
    width: 68px;
    height: 80px;
  }
  .smashed-egg-stage {
    height: 80px;
  }
  .admin-topbar {
    padding: 12px 14px;
  }
  .admin-main {
    padding: 16px 12px 36px;
  }
  .level-stat-row {
    grid-template-columns: 26px 1fr;
  }
  .lvl-metrics {
    flex-direction: row;
    gap: 12px;
    grid-column: 2;
  }
}

/* ==========================================================================
   LEVEL 1 ENHANCED OPERATION TUTORIAL — High-Visibility Beacon & Spatial Cues
   ========================================================================== */
.mission-tutorial-v2 .tut-safe-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(167, 237, 206, 0.45);
  background: rgba(167, 237, 206, 0.12);
  color: #c8ffe4;
  font-size: 12px;
  font-weight: 700;
}

.mission-tutorial-v2 .tutorial-prompt.tut-beacon {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  margin-bottom: 18px;
  border-radius: 14px;
  border: 2px solid rgba(246, 198, 102, 0.85);
  background:
    linear-gradient(112deg, rgba(245, 178, 66, 0.24) 0%, rgba(30, 74, 72, 0.86) 46%, rgba(11, 32, 44, 0.95) 100%);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.42),
    0 0 28px rgba(245, 185, 76, 0.24),
    inset 0 1px rgba(255, 240, 196, 0.28);
  animation: tutBeaconPulse 2.6s ease-in-out infinite;
}

.mission-tutorial-v2 .tutorial-prompt.tut-beacon::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(180deg, #ffe28a, #f59e0b);
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.85);
}

.mission-tutorial-v2 .tutorial-prompt.tut-beacon::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -35%;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 204, 0.16), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  animation: tutSheen 3.8s ease-in-out infinite;
}

.mission-tutorial-v2[data-state="done"] .tutorial-prompt.tut-beacon {
  border-color: rgba(132, 238, 186, 0.92);
  background: linear-gradient(112deg, rgba(44, 152, 108, 0.34), rgba(14, 48, 46, 0.92));
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42), 0 0 28px rgba(132, 238, 186, 0.28);
  animation: none;
}

.mission-tutorial-v2[data-state="done"] .tutorial-prompt.tut-beacon::before {
  background: linear-gradient(180deg, #a7edce, #34d399);
  box-shadow: 0 0 14px rgba(167, 237, 206, 0.85);
}

.mission-tutorial-v2 .tutorial-prompt.tut-nudge {
  animation: tutNudge 0.42s ease-out !important;
  border-color: #fb923c !important;
  box-shadow: 0 0 32px rgba(251, 146, 60, 0.45) !important;
}

.mission-tutorial-v2 .tutorial-step {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #2b1803;
  font: 800 13px/1 var(--font);
  letter-spacing: 0.04em;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
  white-space: nowrap;
}

.mission-tutorial-v2[data-state="done"] .tutorial-step {
  background: linear-gradient(135deg, #a7edce, #34d399);
  color: #082d23;
  box-shadow: 0 4px 16px rgba(52, 211, 153, 0.4);
}

.mission-tutorial-v2 .tutorial-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mission-tutorial-v2 .tutorial-copy p {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.55;
  color: #fffbe8;
  letter-spacing: 0.02em;
}

.mission-tutorial-v2 .tut-key {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 7px;
  background: rgba(250, 204, 21, 0.24);
  border: 1px solid rgba(253, 224, 71, 0.72);
  color: #fef08a;
  font-weight: 800;
}

.mission-tutorial-v2 .tut-key.tut-key-mint {
  background: rgba(167, 237, 206, 0.22);
  border-color: rgba(167, 237, 206, 0.78);
  color: #c8ffe6;
}

.mission-tutorial-v2 .tut-warn-text {
  color: #ffd09c;
}

.mission-tutorial-v2 .tut-sub-note {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: #a9d5c5;
}

.mission-tutorial-v2 .tut-formula-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(6, 20, 30, 0.65);
  border: 1px solid rgba(167, 237, 206, 0.36);
  font-size: 12.5px;
  color: #c2e5da;
  flex-wrap: wrap;
}

.mission-tutorial-v2 .tut-formula-chip span {
  color: #fde047;
  font-weight: 700;
}

.mission-tutorial-v2 .tut-formula-chip code {
  font: 700 13px var(--mono);
  color: #e6fff2;
}

.mission-tutorial-v2 .tutorial-actions .primary {
  font-size: 15px !important;
  padding: 13px 24px !important;
  box-shadow: 0 0 26px rgba(167, 237, 206, 0.45);
  animation: tutBeaconPulse 2s ease-in-out infinite;
}

/* Spatial Source Cue on Central Sample Card */
.mission-tutorial-v2 .sample-card.tut-source {
  border: 2px solid rgba(250, 204, 21, 0.82);
  box-shadow:
    inset 0 0 40px rgba(250, 204, 21, 0.1),
    0 0 32px rgba(250, 204, 21, 0.24),
    0 12px 30px rgba(0, 0, 0, 0.35);
  animation: tutSourceGlow 2.2s ease-in-out infinite;
}

.mission-tutorial-v2 .tut-source-badge {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #291602;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
  pointer-events: none;
  animation: tutFloatBadge 1.7s ease-in-out infinite;
}

.mission-tutorial-v2 .tut-source-badge i {
  font-style: normal;
  font-size: 14px;
}

body.tutorial-dragging .mission-tutorial-v2 .tut-source-badge {
  opacity: 0;
  transition: opacity 0.15s;
}

/* Animated Drag Flow Bridge between Sample & Ports */
.mission-tutorial-v2 .tut-drag-bridge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 -4px;
  pointer-events: none;
}

.mission-tutorial-v2 .bridge-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(250, 204, 21, 0.45), transparent);
}

.mission-tutorial-v2 .bridge-pill {
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(250, 204, 21, 0.55);
  color: #fde68a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  animation: tutDownBounce 1.5s ease-in-out infinite;
}

/* Spotlight Target Port vs Dimmed Distractor Ports */
.mission-tutorial-v2 .delivery-port.tut-dim {
  opacity: 0.36;
  filter: saturate(0.45);
  transition: opacity 0.25s, filter 0.25s;
}

.mission-tutorial-v2 .delivery-port.tutorial-target {
  overflow: visible;
  border: 2.5px solid #fde047 !important;
  background: linear-gradient(145deg, rgba(66, 108, 86, 0.95), rgba(26, 74, 62, 0.96)) !important;
  box-shadow:
    0 0 0 4px rgba(250, 204, 21, 0.24),
    0 0 34px rgba(167, 237, 206, 0.42),
    inset 0 0 24px rgba(253, 224, 71, 0.16) !important;
  animation: tutTargetPulse 1.6s ease-in-out infinite !important;
}

body.tutorial-dragging .mission-tutorial-v2 .delivery-port.tutorial-target {
  transform: scale(1.04);
  border-color: #a7edce !important;
  box-shadow:
    0 0 0 7px rgba(167, 237, 206, 0.32),
    0 0 44px rgba(167, 237, 206, 0.65) !important;
}

.mission-tutorial-v2 .tut-target-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #261503;
  font-size: 11.5px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.52);
  pointer-events: none;
  animation: tutFloatBadge 1.5s ease-in-out infinite;
}

.mission-tutorial-v2 .tut-target-badge em {
  font-style: normal;
}
.mission-tutorial-v2 .tut-target-badge .t-drag { display: none; }
body.tutorial-dragging .mission-tutorial-v2 .tut-target-badge {
  background: linear-gradient(135deg, #a7edce, #34d399);
  color: #062b21;
}
body.tutorial-dragging .mission-tutorial-v2 .tut-target-badge .t-idle { display: none; }
body.tutorial-dragging .mission-tutorial-v2 .tut-target-badge .t-drag { display: inline; }

@keyframes tutBeaconPulse {
  0%, 100% { box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42), 0 0 22px rgba(245, 185, 76, 0.22), inset 0 1px rgba(255, 240, 196, 0.28); }
  50% { box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42), 0 0 38px rgba(250, 204, 21, 0.44), inset 0 1px rgba(255, 240, 196, 0.4); }
}
@keyframes tutSheen {
  0%, 72%, 100% { left: -35%; }
  95% { left: 120%; }
}
@keyframes tutSourceGlow {
  0%, 100% { border-color: rgba(250, 204, 21, 0.72); box-shadow: inset 0 0 30px rgba(250, 204, 21, 0.08), 0 0 22px rgba(250, 204, 21, 0.18); }
  50% { border-color: rgba(253, 224, 71, 1); box-shadow: inset 0 0 46px rgba(250, 204, 21, 0.16), 0 0 38px rgba(250, 204, 21, 0.38); }
}
@keyframes tutTargetPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.22), 0 0 24px rgba(167, 237, 206, 0.34); }
  50% { box-shadow: 0 0 0 7px rgba(250, 204, 21, 0.38), 0 0 40px rgba(250, 204, 21, 0.52); }
}
@keyframes tutFloatBadge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.mission-tutorial-v2 .tut-target-badge {
  animation: tutFloatTarget 1.5s ease-in-out infinite;
}
@keyframes tutFloatTarget {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -4px); }
}
@keyframes tutDownBounce {
  0%, 100% { transform: translateY(0); opacity: 0.92; }
  50% { transform: translateY(4px); opacity: 1; }
}
@keyframes tutNudge {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@media (max-width: 640px) {
  .mission-tutorial-v2 .tutorial-prompt.tut-beacon {
    padding: 14px 14px 14px 18px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .mission-tutorial-v2 .tutorial-step {
    padding: 5px 11px;
    font-size: 11.5px;
  }
  .mission-tutorial-v2 .tutorial-copy p {
    font-size: 15px;
    line-height: 1.55;
  }
  .mission-tutorial-v2 .tut-formula-chip {
    font-size: 11px;
    padding: 4px 10px;
  }
  .mission-tutorial-v2 .tut-formula-chip code {
    font-size: 11.5px;
  }
  .mission-tutorial-v2 .tut-source-badge {
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    font-size: 11px;
  }
  .mission-tutorial-v2 .mission-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .mission-tutorial-v2 .tut-drag-bridge {
    grid-column: 1 / -1;
    grid-row: 3;
    margin: 2px 0 4px;
  }
  .mission-tutorial-v2 .delivery-ports {
    grid-column: 1 / -1;
    grid-row: 4;
  }
  .mission-tutorial-v2 .operation-bottom {
    grid-column: 1 / -1;
    grid-row: 5;
  }
  .mission-tutorial-v2 .bridge-pill {
    font-size: 11px;
    padding: 3px 11px;
  }
  .mission-tutorial-v2 .tut-target-badge {
    top: -13px;
    font-size: 10px;
    padding: 3px 9px;
  }
  .mission-tutorial-v2 .tut-safe-pill {
    font-size: 10px;
    padding: 3px 8px;
  }
}

/* ==========================================================================
   LEVEL 1 ENHANCED ERROR FEEDBACK & 2-SECOND LOCKOUT
   ========================================================================== */
body.error-flash .cockpit-vignette {
  box-shadow: inset 0 0 130px rgba(244, 63, 94, 0.55);
}

.pop-badge.negative {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.94), rgba(159, 18, 57, 0.94));
  border: 1px solid #fda4af;
  color: #fff1f2;
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.45);
}

.mission .sample-card.scan-locked {
  border: 2px solid #fb7185 !important;
  box-shadow:
    inset 0 0 55px rgba(244, 63, 94, 0.22),
    0 0 34px rgba(244, 63, 94, 0.34),
    0 12px 30px rgba(0, 0, 0, 0.4) !important;
  cursor: not-allowed !important;
  animation: errorCardShake 0.42s ease-out;
}

.error-lock-banner {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  z-index: 8;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid rgba(253, 164, 175, 0.85);
  background: linear-gradient(110deg, rgba(159, 18, 57, 0.94), rgba(88, 16, 36, 0.94));
  box-shadow: 0 10px 28px rgba(159, 18, 57, 0.5);
  animation: viewEnter 0.18s ease-out both;
}

.elb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
}

.elb-badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff1f2;
  color: #9f1239;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.elb-msg {
  flex: 1;
  text-align: left;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffe4e6;
}

.elb-time {
  flex-shrink: 0;
  padding: 2px 9px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(253, 164, 175, 0.45);
  font: 800 15px/1.3 var(--mono);
  color: #fecdd3;
  min-width: 48px;
  text-align: center;
}

.elb-bar {
  height: 4px;
  background: rgba(0, 0, 0, 0.35);
}

.elb-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #fda4af, #fb7185, #f43f5e);
  transition: width 0.06s linear;
}

.mission.mission-locked .delivery-port:not(.port-wrong),
.mission.mission-locked .recycler:not(.port-wrong) {
  opacity: 0.42;
  filter: saturate(0.45);
  cursor: not-allowed;
  pointer-events: none;
}

.delivery-port.port-wrong,
.recycler.port-wrong {
  border: 2px solid #fb7185 !important;
  background: linear-gradient(140deg, rgba(159, 18, 57, 0.88), rgba(76, 15, 34, 0.92)) !important;
  box-shadow:
    0 0 0 3px rgba(244, 63, 94, 0.28),
    0 0 28px rgba(244, 63, 94, 0.45) !important;
  color: #ffe4e6 !important;
  cursor: not-allowed;
  animation: errorCardShake 0.4s ease-out;
}

.delivery-port.port-wrong .port-number,
.delivery-port.port-wrong .port-number > span {
  color: #ffe4e6 !important;
}

.delivery-port.port-wrong::after,
.recycler.port-wrong::after {
  content: '✕';
  position: absolute;
  top: 7px;
  right: 9px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f43f5e;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.65);
}

@keyframes errorCardShake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-7px); }
  36% { transform: translateX(7px); }
  54% { transform: translateX(-5px); }
  72% { transform: translateX(4px); }
}

@media (max-width: 640px) {
  .error-lock-banner {
    top: 8px;
    left: 8px;
    right: 8px;
  }
  .elb-row {
    padding: 7px 10px;
    gap: 7px;
  }
  .elb-badge {
    font-size: 10.5px;
    padding: 2px 8px;
  }
  .elb-msg {
    font-size: 11.5px;
  }
  .elb-time {
    font-size: 13px;
    min-width: 42px;
  }
}

/* ==========================================================================
   UNIFIED TUTORIAL (LEVEL 11 CRYSTAL) & ALL-18-LEVEL LOCKOUT POLISH
   ========================================================================== */
.mission-tutorial-v2 .tut-key.tut-key-red {
  background: rgba(244, 63, 94, 0.24);
  border-color: rgba(253, 164, 175, 0.8);
  color: #fecdd3;
}

.mission-tutorial-v2 .power-choice {
  position: relative;
  overflow: visible;
}

.mission-tutorial-v2 .power-choice.tut-dim {
  opacity: 0.36;
  filter: saturate(0.45);
  transition: opacity 0.25s, filter 0.25s;
}

.mission-tutorial-v2 .power-choice.tutorial-target {
  border: 2.5px solid #fde047 !important;
  box-shadow:
    0 0 0 4px rgba(250, 204, 21, 0.24),
    0 0 28px rgba(250, 204, 21, 0.42) !important;
  animation: tutTargetPulse 1.6s ease-in-out infinite !important;
}

.mission-tutorial-v2 .tut-power-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #261503;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
  pointer-events: none;
  animation: tutFloatTarget 1.5s ease-in-out infinite;
}

.mission-tutorial-v2 .answer-assembly.tut-assembly-target {
  overflow: visible;
  border: 2px dashed #fde047 !important;
  background: radial-gradient(ellipse at 50% 100%, rgba(250, 204, 21, 0.2), transparent 72%), #081d28ee !important;
  box-shadow: 0 0 28px rgba(250, 204, 21, 0.28);
  animation: tutSourceGlow 1.9s ease-in-out infinite;
}

body.tutorial-dragging .mission-tutorial-v2 .answer-assembly.tut-assembly-target {
  border-color: #a7edce !important;
  box-shadow: 0 0 38px rgba(167, 237, 206, 0.55);
}

.mission-tutorial-v2 .tut-assembly-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  padding: 3px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #261503;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
  pointer-events: none;
  animation: tutFloatTarget 1.5s ease-in-out infinite;
}
.mission-tutorial-v2 .tut-assembly-badge em { font-style: normal; }
.mission-tutorial-v2 .tut-assembly-badge .t-drag { display: none; }
body.tutorial-dragging .mission-tutorial-v2 .tut-assembly-badge {
  background: linear-gradient(135deg, #a7edce, #34d399);
  color: #062b21;
}
body.tutorial-dragging .mission-tutorial-v2 .tut-assembly-badge .t-idle { display: none; }
body.tutorial-dragging .mission-tutorial-v2 .tut-assembly-badge .t-drag { display: inline; }

/* Lockout visuals for Crystal power palette & assembly zone (Levels 11-15) */
.mission.mission-locked .power-choice {
  opacity: 0.4;
  filter: saturate(0.45);
  cursor: not-allowed;
  pointer-events: none;
}

.answer-assembly.port-wrong {
  border: 2px solid #fb7185 !important;
  background: linear-gradient(135deg, rgba(159, 18, 57, 0.65), rgba(76, 15, 34, 0.85)) !important;
  box-shadow: 0 0 26px rgba(244, 63, 94, 0.5) !important;
  animation: errorCardShake 0.4s ease-out;
}

/* Clearer in-game bottom interaction hint across all 18 levels */
.mission .interaction-hint {
  font-size: 11px;
  color: #93b8be;
}

@media (max-width: 640px) {
  .mission-tutorial-v2.mission-crystal .mission-workspace {
    grid-template-columns: minmax(0, 1fr) 82px;
  }
  .mission-tutorial-v2.mission-crystal .delivery-ports {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .mission-tutorial-v2.mission-crystal .operation-bottom {
    grid-column: 1 / -1;
    grid-row: 4;
  }
  .mission-tutorial-v2 .tut-power-badge {
    font-size: 9px;
    padding: 2px 6px;
    top: -11px;
  }
  .mission-tutorial-v2 .tut-assembly-badge {
    font-size: 10px;
    padding: 2px 8px;
  }
  .mission .interaction-hint {
    font-size: 10px;
  }
}
