/* Learning surfaces reuse the hangar's type, metal and energy palette.
   Existing system; variance 2/10, motion 2/10, density 5/10. */
#levelup { overflow-y: auto; touch-action: pan-y; justify-content: flex-start; padding: clamp(16px, 4vh, 40px) 20px; gap: 20px; }
#levelup .lu-head { flex: none; margin-top: auto; }
#levelup .lu-hint { flex: none; margin-bottom: auto; text-align: center; color: var(--text); letter-spacing: .08em; }
#lu-build { line-height: 1.6; max-width: 800px; }
#cards { width: min(100%, 1020px); flex: none; gap: 16px; perspective: none; }
#levelup .card { width: 0; min-width: 0; flex: 1; align-items: stretch; padding: 22px; gap: 12px; text-align: left; font-family: var(--font-ui); color: var(--text); border-radius: 4px; }
#levelup .card canvas { align-self: flex-start; width: 64px !important; height: 64px !important; }
#levelup .card .rarity { align-self: flex-start; border: 0; padding: 0 28px 0 0; letter-spacing: .12em; font-size: 12px; }
#levelup .card .c-name { font-size: 20px; letter-spacing: .05em; line-height: 1.15; min-height: 46px; }
#levelup .card .c-desc { font-size: 15px; line-height: 1.4; min-height: 64px; color: var(--text); }
#levelup .card:hover { transform: translateY(-3px); box-shadow: none; }
#levelup .card:focus-visible { transform: none; outline: 2px solid var(--cyan); outline-offset: 4px; box-shadow: none; }
.upgrade-key { position: absolute; top: 20px; right: 20px; color: var(--text); font: 600 14px var(--font-mono); }
.upgrade-changes { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.upgrade-change { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 14px; }
.upgrade-change strong { color: var(--cyan); font: 600 13px var(--font-mono); white-space: nowrap; }
.upgrade-link { color: var(--text); font-size: 14px; line-height: 1.45; }
.upgrade-evolution { color: var(--gold); font-size: 13px; line-height: 1.45; }
#levelup .card .pips { padding-top: 10px; }
.death-recap { max-width: 560px; margin: 12px auto 16px; padding: 12px 16px; border-left: 2px solid var(--red); text-align: left; }
.death-recap strong { display: block; color: var(--text); font-size: 16px; letter-spacing: .04em; }
.death-recap span { display: block; margin-top: 4px; font-size: 14px; color: var(--text); }
.death-recap p { margin-top: 8px; font-size: 15px; line-height: 1.4; color: var(--text); }
@media (max-width: 600px) {
  #levelup { padding: 20px 16px; gap: 16px; }
  #levelup .lu-kicker { letter-spacing: .15em; }
  #cards { flex-direction: column; gap: 12px; }
  #levelup .card { width: 100%; flex: none; display: grid; grid-template-columns: 48px minmax(0, 1fr); padding: 16px; gap: 8px 14px; }
  #levelup .card .rarity { grid-column: 2; padding-right: 16px; }
  #levelup .card canvas { grid-column: 1; grid-row: 1 / 4; width: 48px !important; height: 48px !important; align-self: center; }
  #levelup .card .c-name { grid-column: 2; min-height: 0; font-size: 18px; }
  #levelup .card .c-desc { grid-column: 1 / -1; min-height: 0; font-size: 14px; }
  .upgrade-changes, .upgrade-link, .upgrade-evolution, #levelup .card .pips { grid-column: 1 / -1; }
  .upgrade-changes { padding: 10px 0 0; }
  #levelup .card .pips { padding-top: 4px; }
  .upgrade-key { top: 16px; right: 16px; }
}
@media (max-height: 500px) and (min-width: 601px) {
  #levelup { padding: 16px; gap: 12px; }
  #levelup .card { padding: 16px; }
  #levelup .card canvas { width: 40px !important; height: 40px !important; }
  #levelup .lu-level { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  #levelup .card, #levelup .lu-head, #levelup .lu-hint { animation: none; transition: none; }
  #levelup .card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #gameover .go-inner, #gameover .run-actions { animation: none; }
}

/* Depth is a decision overlay, including the extraction-only last layer. */
#depth-choice { flex-direction: column; justify-content: flex-start; padding: 28px 20px; gap: 24px; background: rgba(5, 9, 18, .96); }
#depth-choice .lu-head { display: block; flex: none; margin-top: auto; width: min(100%, 720px); }
#depth-title { font-size: clamp(24px, 4vw, 36px); letter-spacing: .06em; margin: 14px 0; }
#depth-choice .lu-kicker { font-size: 12px; letter-spacing: .16em; line-height: 1.6; }
#depth-info { color: var(--text); font-size: 15px; line-height: 1.8; letter-spacing: .04em; }
.depth-actions { display: flex; flex: none; gap: 16px; flex-wrap: wrap; justify-content: center; width: min(100%, 720px); }
.depth-actions .mbtn { min-height: 48px; max-width: 100%; font-size: 14px; letter-spacing: .12em; }
#depth-cap-note { display: block; flex: none; max-width: 560px; margin-bottom: auto; font-size: 13px; line-height: 1.6; text-align: center; letter-spacing: .04em; color: var(--dim); }
@media (max-width: 600px) {
  #depth-choice { padding: 24px 20px; gap: 20px; }
  .depth-actions { flex-direction: column; }
  .depth-actions .mbtn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #depth-choice, #depth-choice .lu-head, #depth-choice .lu-hint { animation: none; }
}

@media (max-height: 480px) {
  #depth-choice { padding: 14px 20px; gap: 12px; }
  #depth-title { font-size: 24px; margin: 8px 0; }
  #depth-info { font-size: 14px; line-height: 1.5; }
}
