/* ---------- top bar additions ---------- */
.topbar-actions { display: flex; gap: 8px; }
.primary.small { padding: 6px 12px; font-size: 13px; }

/* ---------- Academy ---------- */
.academy {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center; padding: 14px;
  background: rgba(2, 4, 9, .74);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .3s ease;
}
.ac-card {
  width: min(1180px, 100%); height: min(720px, 100%);
  display: grid; grid-template-rows: auto 1fr auto;
  background: #0b1019; border: 1px solid var(--line-strong); border-radius: 20px;
  overflow: hidden; box-shadow: 0 40px 120px rgba(0, 0, 0, .6);
  animation: rise .35s ease;
}
.ac-head { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.ac-brand { font-weight: 600; letter-spacing: .06em; white-space: nowrap; }
.ac-dots { display: flex; gap: 6px; margin: 0 auto; }
.ac-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 5px; background: rgba(255, 255, 255, .18); transition: width .25s, background .25s; }
.ac-dot.done { background: rgba(255, 122, 26, .5); }
.ac-dot.active { background: var(--accent); width: 28px; }
.ac-toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; user-select: none; white-space: nowrap; }
.ac-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.ac-close { background: transparent; border: 0; font-size: 20px; color: var(--muted); padding: 4px 8px; }
.ac-close:hover { color: var(--text); }

.ac-body { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 0; }
.ac-stage { display: grid; grid-template-rows: 1fr auto; gap: 12px; padding: 16px; min-height: 0; }
.ac-canvas-wrap { position: relative; min-height: 0; border-radius: 14px; overflow: hidden; background: #070b14; border: 1px solid var(--line); }
.ac-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ac-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; min-height: 40px; }
.ac-controls .seg button { padding: 9px 16px; font-size: 14px; }
.ac-controls .ghost { padding: 9px 16px; font-size: 14px; }
.ac-slider { display: flex; align-items: center; gap: 12px; flex: 1 1 280px; font-size: 14px; color: var(--muted); }
.ac-slider input { flex: 1; accent-color: var(--accent); height: 28px; cursor: pointer; }
.ac-slider output { font-family: var(--mono); color: var(--text); min-width: 110px; text-align: right; font-size: 13px; }

.ac-text { padding: 22px 26px 22px 10px; overflow-y: auto; scrollbar-width: thin; }
.ac-kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 600; }
.ac-title { font-size: clamp(22px, 2.6vw, 32px); line-height: 1.15; margin: 8px 0 12px; }
.ac-simple { font-size: 17px; line-height: 1.6; color: #dfe5ef; margin: 0 0 14px; }
.ac-try { padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); border-left: 3px solid var(--accent); font-size: 15px; line-height: 1.45; }
.ac-label { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 6px; font-weight: 600; }
.ac-science { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(79, 209, 255, .06); border: 1px solid rgba(79, 209, 255, .25); }
.ac-science .ac-label { color: var(--cyan); }
.ac-formula { font-family: var(--mono); font-size: 17px; padding: 8px 12px; margin-bottom: 8px; border-radius: 8px; background: rgba(0, 0, 0, .3); overflow-x: auto; white-space: nowrap; }
.ac-science p, .ac-fact p { margin: 0; font-size: 14.5px; line-height: 1.55; color: #cdd5e2; }
.ac-fact { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 197, 61, .07); border: 1px solid rgba(255, 197, 61, .25); }
.ac-fact .ac-label { color: var(--warn); }
.academy.hide-science .ac-science { display: none; }

.ac-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--line); }
.ac-foot button { padding: 10px 20px; font-size: 15px; }
.ac-foot button:disabled { opacity: .35; cursor: default; }
.ac-count { color: var(--muted); font-size: 13px; }

.ac-cta { display: grid; gap: 10px; margin-top: 22px; max-width: 400px; }
.ac-cta button { padding: 13px 18px; font-size: 16px; text-align: left; }
.ac-cta.row { display: flex; flex-wrap: wrap; max-width: none; margin-top: 16px; }
.ac-meta { color: var(--muted); font-size: 13px; margin-top: 12px; }

.ac-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-chip { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); transition: all .2s; }
.ac-chip.done { color: var(--text); border-color: rgba(255, 122, 26, .45); }
.ac-chip.active { background: var(--accent); color: #140800; border-color: var(--accent); font-weight: 600; }

.ac-steps { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; }
.ac-steps li { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; font-size: 15px; line-height: 1.4; color: #d6dce7; }
.ac-steps .ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, .05); color: var(--accent); font-size: 18px; }
.ac-steps svg { width: 26px; height: 26px; fill: currentColor; fill-opacity: .25; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.ac-steps svg .line { fill: none; }
.ac-steps svg .thick { stroke-width: 3; stroke-linecap: round; }
.ac-steps svg .soft { fill-opacity: .1; stroke-opacity: .5; }
.ac-steps b { color: var(--text); }

/* ---------- guided first launch ---------- */
.guide-hole {
  position: fixed; z-index: 70; pointer-events: none;
  border: 2px solid var(--accent); border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(2, 4, 9, .5), 0 0 24px rgba(255, 122, 26, .6);
  transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease;
  animation: guidePulse 1.8s ease-in-out infinite;
}
@keyframes guidePulse { 50% { box-shadow: 0 0 0 9999px rgba(2, 4, 9, .5), 0 0 38px rgba(255, 122, 26, .95); } }
.guide-card {
  position: fixed; z-index: 75; width: 330px;
  padding: 16px 16px 14px;
  background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  transition: top .3s ease, left .3s ease;
}
.guide-step { color: var(--accent); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.guide-card h3 { margin: 4px 0 6px; font-size: 19px; }
.guide-card p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; color: #d6dce7; }
.guide-task { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; line-height: 1.4; }
.guide-task.done { background: rgba(61, 220, 132, .15); color: #bff3d4; }
.guide-fact { margin-bottom: 12px; padding: 2px 0 2px 10px; border-left: 3px solid var(--warn); font-size: 13px; line-height: 1.45; color: #cdd5e2; }
.guide-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.guide-actions .spacer { margin-right: auto; }
.guide-x { position: absolute; top: 8px; right: 8px; background: transparent; border: 0; color: var(--muted); font-size: 17px; padding: 4px 8px; }

/* ---------- in-flight science tips ---------- */
.fact-pop {
  position: fixed; right: 16px; bottom: 90px; z-index: 12; width: 340px;
  padding: 12px 14px;
  background: rgba(10, 14, 23, .94); border: 1px solid rgba(255, 197, 61, .35); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  animation: rise .35s ease;
}
.fact-pop .ac-label { color: var(--warn); }
.fact-pop h4 { margin: 0 0 4px; font-size: 16px; }
.fact-pop p { margin: 0; font-size: 13.5px; line-height: 1.5; color: #d6dce7; }
.fact-close { position: absolute; top: 6px; right: 6px; background: transparent; border: 0; color: var(--muted); padding: 4px 8px; }
.fact-bar { height: 3px; margin-top: 10px; border-radius: 2px; background: var(--warn); transform-origin: left; animation: factTimer linear forwards; }
@keyframes factTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (max-width: 900px) {
  .academy { padding: 0; }
  .ac-card { height: 100%; border-radius: 0; }
  .ac-body { grid-template-columns: 1fr; grid-template-rows: minmax(240px, 42vh) auto; overflow-y: auto; }
  .ac-stage { padding: 10px; }
  .ac-text { padding: 6px 18px 18px; overflow: visible; }
  .ac-dots { display: none; }
  .ac-brand { margin-right: auto; }
  .ac-simple { font-size: 16px; }
  .guide-card { left: 8px !important; right: 8px; top: 60px !important; width: auto; }
  .fact-pop { left: 8px; right: 8px; width: auto; bottom: 140px; }
}
@media (max-width: 600px) {
  .topbar-actions .lbl { display: none; }
  .brand { font-size: 12px; letter-spacing: .12em; }
}
