/* Stars, goal bar, Cargo Ramp button and the Cargo Loadmaster panel */
.count-box.stars b { color: #ffd84d; white-space: nowrap; }
.count-box.pop { animation: star-pop 0.6s ease-out; }
@keyframes star-pop { 30% { transform: scale(1.35); box-shadow: 0 0 18px #ffd84d; } }

.goal { display: flex; align-items: center; gap: 10px; padding: 5px 14px; background: #081220; border-bottom: 1px solid var(--line); }
.goal-bar { flex: 1; max-width: 360px; height: 12px; background: #12233a; border-radius: 999px; overflow: hidden; }
.goal-fill { height: 100%; width: 0; background: linear-gradient(90deg, #ffb347, #ffd84d); border-radius: 999px; transition: width 0.6s ease; }
.goal-label { font-size: 13px; font-weight: 700; color: var(--dim); }

.ramp-btn {
  position: absolute; right: 14px; bottom: 30px; z-index: 900;
  min-height: 64px; padding: 0 22px;
  font-family: inherit; font-size: 18px; font-weight: 800; letter-spacing: 0.06em; color: #2a1800;
  background: var(--amber); border: 0; border-radius: 16px; cursor: pointer;
  box-shadow: 0 6px 0 #a86a12, 0 10px 24px rgba(0, 0, 0, 0.5);
}
.ramp-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #a86a12; }

.edge-chip span {
  display: block; padding: 0 10px; line-height: 34px; white-space: nowrap; text-align: center;
  font-size: 13px; font-weight: 800; color: #2a1800; background: var(--amber); border-radius: 999px; cursor: pointer;
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.35);
}

.lm { position: absolute; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 12px; background: rgba(3, 6, 12, 0.82); }
.lm[hidden], .lm-play[hidden], .lm-done[hidden], .lm-hint[hidden] { display: none; }
.lm-sheet {
  position: relative; width: min(920px, 100%); max-height: 100%; overflow: auto; padding: 18px 20px 20px;
  background: var(--panel); border: 3px solid var(--amber); border-radius: 20px; animation: pop 0.2s ease-out;
}
.lm-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.lm-head .card-close { position: static; }
.lm-title { margin-top: 6px; font-size: 26px; font-weight: 900; }
.lm-sub { color: var(--dim); font-size: 15px; }

.lm-play { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.lm-story { margin: 6px 0 10px; font-size: 25px; line-height: 1.45; font-weight: 500; -webkit-user-select: none; user-select: none; }
.lm-story b { color: #ffd84d; font-weight: 900; }
.lm-story .is-spoken { background: rgba(127, 227, 255, 0.3); border-radius: 6px; box-shadow: 0 0 0 3px rgba(127, 227, 255, 0.3); }
.lm-hear { min-height: 48px; padding: 0 16px; font-family: inherit; font-size: 16px; font-weight: 700; color: var(--cyan); background: #0d2236; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; }
.lm-hint { margin-top: 12px; padding: 12px 14px; font-size: 19px; font-weight: 700; color: #06231a; background: var(--green); border-radius: 12px; }
.lm-hint.pop { animation: pop 0.25s ease-out; }

.lm-answers { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.lm-answer {
  flex: 1 1 96px; min-height: 84px; font-family: inherit; font-size: 40px; font-weight: 900; color: var(--text);
  background: #12304a; border: 3px solid var(--cyan); border-radius: 16px; cursor: pointer;
}
.lm-answer:disabled { opacity: 0.3; cursor: default; }
.lm-answer.right { opacity: 1; background: var(--green); border-color: var(--green); color: #06231a; }
.lm-answer.glow { border-color: #ffd84d; animation: glow 1s ease-in-out infinite; }
.lm-answer.shake { animation: shake 0.4s; }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes glow { 50% { box-shadow: 0 0 0 8px rgba(255, 216, 77, 0.45); } }

.lm-counter { margin-bottom: 8px; font-size: 16px; color: var(--dim); font-weight: 700; }
.lm-counter b { font-size: 34px; color: var(--amber); }
.lm-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; padding: 10px; background: #081220; border: 2px solid var(--line); border-radius: 14px; }
.lm-grid i { aspect-ratio: 1; border-radius: 4px; background: #101f33; }
.lm-grid i.goal { background: transparent; outline: 2px dashed rgba(255, 179, 71, 0.55); outline-offset: -2px; }
.lm-grid i.try { background: rgba(127, 227, 255, 0.55); }
.lm-grid i.on { background: var(--amber); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25); }
.lm-grid i:nth-child(10n+5) { margin-right: 5px; }

.lm-done { text-align: center; padding: 10px 0 4px; }
.lm-done-plane { font-size: 72px; color: var(--amber); animation: fly 1.2s ease-in both; }
@keyframes fly { from { transform: translate(-140px, 40px) rotate(-12deg); opacity: 0; } to { transform: translate(0, 0) rotate(-12deg); opacity: 1; } }
.lm-done-title { font-size: 34px; font-weight: 900; letter-spacing: 0.04em; color: var(--green); }
.lm-done-stars { font-size: 64px; color: #ffd84d; letter-spacing: 8px; animation: star-pop 0.7s ease-out; }
.lm-done-text { font-size: 22px; font-weight: 700; margin-bottom: 16px; }
.lm-done-buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.big-btn { min-height: 64px; padding: 0 26px; font-family: inherit; font-size: 20px; font-weight: 800; color: var(--text); background: #12304a; border: 3px solid var(--line); border-radius: 16px; cursor: pointer; }
.big-btn.primary { color: #2a1800; background: var(--amber); border-color: var(--amber); }

@media (max-width: 720px) {
  .lm-play { grid-template-columns: minmax(0, 1fr); }
  .lm-grid { max-width: 190px; }
  .lm-answer { min-height: 68px; font-size: 32px; }
  .lm-sheet { padding: 12px 14px 14px; }
  .lm-title { font-size: 21px; }
  .count-box.planes { display: none; }
  .lm-story { font-size: 21px; }
  .goal-label { font-size: 11px; }
  .ramp-btn { min-height: 56px; font-size: 15px; padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) { .lm-done-plane, .lm-answer.glow, .count-box.pop { animation: none; } }

/* ---------- Milestone 3: paid read-aloud, card buttons, pictures, Hangar, alerts ---------- */
.lm-story .word { cursor: pointer; border-radius: 6px; padding: 0 1px; }
.lm-story .word.is-picked { background: rgba(255, 216, 77, 0.28); box-shadow: 0 0 0 3px rgba(255, 216, 77, 0.5); }
.lm-hearbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lm-hearbar[hidden], .lm-hear[hidden], .lm-hear-tip[hidden] { display: none; }
.lm-hear-tip { font-size: 14px; color: var(--dim); }
.lm-answer.is-text { flex: 1 1 100%; min-height: 62px; font-size: 22px; font-weight: 800; padding: 6px 12px; }

.lm[data-mode="spotter"] .lm-sheet { border-color: var(--cyan); }
.lm[data-mode="explorer"] .lm-sheet { border-color: var(--green); }
.tag-explorer { background: #12331f; color: var(--green); }
.tag-r-common { background: #12304a; color: var(--cyan); }
.tag-r-uncommon { background: #12331f; color: var(--green); }
.tag-r-rare { background: #2b1a4a; color: #c9a3ff; }
.tag-r-legendary { background: #3a2a10; color: #ffd84d; }

.lm-visual.v-compare { display: grid; gap: 12px; }
.cmp-card, .num-card { padding: 14px 16px; text-align: center; background: #081220; border: 3px solid var(--line); border-radius: 16px; transition: transform 0.3s, border-color 0.3s, opacity 0.3s; }
.cmp-name { font-size: 16px; font-weight: 800; color: var(--dim); }
.cmp-value, .num-value { font-size: 52px; font-weight: 900; line-height: 1.1; color: var(--cyan); letter-spacing: 0.02em; }
.num-value { font-size: 60px; }
.cmp-unit { font-size: 14px; color: var(--dim); font-weight: 700; }
.cmp-card.is-best, .num-card.is-best { border-color: var(--green); transform: scale(1.04); }
.cmp-card.is-rest { opacity: 0.45; }

.compass { position: relative; width: min(280px, 100%); aspect-ratio: 1; margin: 0 auto; border: 3px solid var(--line); border-radius: 50%; background: #081220; }
.compass-home { position: absolute; inset: 38%; display: grid; place-items: center; font-weight: 900; font-size: 15px; color: var(--bg); background: var(--green); border-radius: 50%; }
.compass-arm { position: absolute; display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 8px; font-weight: 900; font-size: 20px; color: var(--dim); border-radius: 12px; white-space: nowrap; }
.arm-north { top: 6%; left: 50%; transform: translateX(-50%); }
.arm-south { bottom: 6%; left: 50%; transform: translateX(-50%); }
.arm-east { right: 5%; top: 50%; transform: translateY(-50%); }
.arm-west { left: 5%; top: 50%; transform: translateY(-50%); }
.compass-arm.is-best { color: #06231a; background: var(--green); font-size: 16px; }

.card-actions { display: grid; gap: 8px; margin-top: 12px; }
.card-actions .big-btn { min-height: 56px; font-size: 18px; width: 100%; }
.card-actions .big-btn[hidden] { display: none; }
.big-btn.explore { color: #06231a; background: var(--green); border-color: var(--green); }
.card-photo { margin: 10px 0 0; }
.card-photo[hidden] { display: none; }
.card-photo img { display: block; width: 100%; border-radius: 10px; }
.card-photo figcaption { font-size: 11px; color: var(--dim); margin-top: 3px; }
.card-photo a { color: var(--dim); }
.card { max-height: calc(100% - 28px); overflow: auto; z-index: 950; }

.hangar-btn {
  position: absolute; right: 14px; bottom: 106px; z-index: 900; min-height: 56px; padding: 0 18px;
  font-family: inherit; font-size: 16px; font-weight: 800; letter-spacing: 0.06em; color: var(--text);
  background: #12304a; border: 3px solid var(--cyan); border-radius: 16px; cursor: pointer;
}
.hangar-btn b { margin-left: 6px; padding: 2px 8px; color: var(--bg); background: var(--cyan); border-radius: 999px; }
.hangar-sheet { border-color: var(--cyan); }
.hangar-empty { font-size: 20px; color: var(--dim); }
.hangar-empty[hidden] { display: none; }
.hangar-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.hangar-row { padding: 10px 12px; background: #081220; border-left: 6px solid var(--cyan); border-radius: 10px; }
.hangar-row.r-uncommon { border-color: var(--green); }
.hangar-row.r-rare { border-color: #c9a3ff; }
.hangar-row.r-legendary { border-color: #ffd84d; }
.hangar-rarity { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.hangar-name { font-size: 18px; font-weight: 800; }
.hangar-facts, .hangar-n { font-size: 13px; color: var(--dim); }

.toast {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 1500;
  min-height: 56px; max-width: calc(100% - 28px); padding: 10px 22px;
  font-family: inherit; font-size: 18px; font-weight: 900; color: #2a1800;
  background: #ffd84d; border: 0; border-radius: 16px; cursor: pointer;
  box-shadow: 0 0 0 4px rgba(255, 216, 77, 0.35), 0 10px 30px rgba(0, 0, 0, 0.6); animation: pop 0.25s ease-out;
}
.toast[hidden] { display: none; }

@media (max-width: 720px) {
  .cmp-value { font-size: 36px; }
  .num-value { font-size: 42px; }
  .lm-visual.v-compare { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .hangar-btn { bottom: 96px; min-height: 48px; font-size: 14px; }
}
