/* PWO learning layer — NEW FILE. Nothing here restyles the original game;
 * every rule is namespaced `lo-` (learning overlay) except the question pill,
 * which reuses the game's own .pill look.
 * E.M. Designs: white, near-black, coral emphasis and gold rewards.
 * Colors follow /assets/emd-shared.css; standalone exports keep local tokens.
 * Every font-family ends in Arial, sans-serif (the platform iframe may block
 * the Google Fonts request; the page must still read correctly).
 */

.lo-hide { display: none !important; }

/* Free hosted links carry their own branding, including inside an iframe. */
#emd-watermark { display: none; position: fixed; bottom: 12px; right: 14px; width: 90px; height: auto; opacity: .7; pointer-events: none; z-index: 100; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
#emd-watermark.show { display: block; }

/* ------------------------------------------------------------------ HUD
   Owner play-test fix 2026-09-07 ("it just needs to be obvious that the real
   way to win is by answering correctly"): this pill is now the dominant HUD
   element — gold, bigger than the clock pill, top-centre (not a small "?"
   pill tucked next to kills) — with a pulse on every right answer and an
   "ALL ANSWERED" state (see updateHud in learn.js). Positioned absolute so it
   floats free of the hud-top flex row (clock left, progress centre, kills
   right) instead of competing with the progress bar for the same space. */
.pill.lo-qpill {
  position: absolute; top: 54px; left: 50%; transform: translateX(-50%);
  background: #ffc53d; color: #191b1f;
  font: 900 26px "Baloo 2", "Figtree", Arial, sans-serif;
  padding: 8px 22px; border-radius: 16px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); z-index: 6;
}
.pill.lo-qpill .lo-q { font: 900 13px "Figtree", Arial, sans-serif; letter-spacing: 2px; color: #191b1f; opacity: .8; }
.pill.lo-qpill.lo-done { background: #8cff5c; }
.pill.lo-qpill.lo-pulse { animation: loPillPulse .5s ease-out; }
@keyframes loPillPulse {
  0%   { transform: translateX(-50%) scale(1); }
  35%  { transform: translateX(-50%) scale(1.22); }
  100% { transform: translateX(-50%) scale(1); }
}

/* the pointer that sits on the rim of your own hole and aims at the nearest
   uneaten question cube, plus a distance readout ("? 18 m"). Lives inside
   #labels so it hides with the labels. The wrapper itself never rotates —
   only .lo-arrow-tri does — so the distance text always reads upright.
   Play-test fix: bigger than before (was an 11/18px triangle only, no distance). */
#lo-arrow {
  position: absolute; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transform: translate(-50%, -50%);
  transition: opacity .2s linear;
}
#lo-arrow .lo-arrow-tri {
  width: 0; height: 0;
  border-left: 17px solid transparent; border-right: 17px solid transparent;
  border-bottom: 28px solid #ffc53d;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
}
#lo-arrow .lo-arrow-dist {
  font: 900 13px "Figtree", "Segoe UI", Arial, sans-serif; color: #191b1f;
  background: #ffc53d; padding: 2px 8px; border-radius: 20px; white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

/* ------------------------------------------------------------------ card */
#lo-card {
  position: fixed; inset: 0; z-index: 20; display: flex;
  align-items: center; justify-content: center; padding: 16px;
  box-sizing: border-box; background: rgba(12, 14, 19, 0.52);
  font-family: "Figtree", "Segoe UI", Arial, sans-serif;
}
#lo-card .lo-box {
  background: #ffffff; border: 1px solid #e4e5e7; border-top: 6px solid #ff7366; border-radius: 14px;
  width: 760px; max-width: 96vw; max-height: 92vh;
  padding: 16px 22px 18px; box-sizing: border-box;
  overflow-y: auto; overscroll-behavior: contain; text-align: left; color: #191b1f;
}
#lo-card .lo-eyebrow {
  font: 800 12px "Figtree", "Segoe UI", Arial, sans-serif; letter-spacing: 2px;
  text-transform: uppercase; color: #55585f; margin-bottom: 6px;
}
#lo-card .lo-stem {
  margin: 0 0 8px; font: 800 21px/1.4 "Figtree", "Segoe UI", Arial, sans-serif; color: #191b1f;
}
#lo-card .lo-hint { margin: 0 0 10px; font-size: 13px; color: #62656e; }

#lo-card .lo-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#lo-card .lo-work { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#lo-card .lo-work h4 {
  margin: 0 0 6px; font: 800 12px "Figtree", "Segoe UI", Arial, sans-serif;
  letter-spacing: 1.5px; text-transform: uppercase; color: #55585f;
}
#lo-card .lo-work .lo-col button.lo-opt { margin: 0 0 6px; }
#lo-card .lo-work .lo-placed button.lo-opt { background: #ffd5d1; }
#lo-card .lo-work .lo-empty { color: #62656e; font-size: 13px; font-style: italic; }

#lo-card button {
  font: 700 15px "Figtree", "Segoe UI", Arial, sans-serif; padding: 10px 18px;
  border-radius: 10px; border: 1px solid #e4e5e7; background: #f7f7f8; color: #191b1f;
  box-shadow: 0 4px 0 #c8c9ce; transition: transform .1s, box-shadow .1s, background .1s;
  cursor: pointer;
}
#lo-card button:hover:enabled { background: #ffd5d1; border-color: #191b1f; }
#lo-card button:active:enabled { transform: translateY(4px); box-shadow: none; }
#lo-card button:focus-visible { outline: 3px solid #191b1f; outline-offset: 3px; }
#lo-card button:disabled { cursor: default; opacity: .55; }
#lo-card button.lo-opt {
  display: block; width: 100%; text-align: left; margin: 0;
  padding: 9px 12px; font-size: 14px; line-height: 1.3;
}
#lo-card button.lo-opt kbd {
  display: inline-block; min-width: 18px; margin-right: 8px; padding: 0 5px;
  border-radius: 4px; background: #ffffff; border: 1px solid #e4e5e7;
  font-family: "Consolas", "Courier New", monospace; color: #55585f;
}
#lo-card button.lo-opt.lo-on { background: #ffd5d1; border-color: #191b1f; box-shadow: 0 4px 0 #191b1f; }
#lo-card button.lo-opt.lo-right { background: #e6f5e9; color: #205c36; border-color: #32804e; opacity: 1; }
#lo-card button.lo-opt.lo-wrong { background: #fff0ee; color: #901409; border-color: #901409; opacity: 1; }

#lo-card .lo-check { margin-top: 12px; background: #0c0e13; color: #fff; border-color: #0c0e13; box-shadow: 0 4px 0 #62656e; }
#lo-card .lo-fb { margin-top: 12px; border-top: 1px solid #e4e5e7; padding-top: 10px; }
#lo-card .lo-msg { font: 900 17px "Figtree", "Segoe UI", Arial, sans-serif; color: #901409; }
#lo-card .lo-msg.lo-good { color: #205c36; }
#lo-card .lo-why { margin: 6px 0 10px; font-size: 14px; line-height: 1.45; color: #55585f; white-space: pre-line; }
#lo-card .lo-go { background: #0c0e13; color: #fff; border-color: #0c0e13; box-shadow: 0 4px 0 #62656e; font-weight: 900; }
#lo-card .lo-go:hover:enabled, #lo-card .lo-check:hover:enabled { background: #ff7366; color: #0c0e13; }

@media (max-width: 820px), (max-height: 700px) {
  #lo-card .lo-opts, #lo-card .lo-work { grid-template-columns: 1fr; }
  #lo-card .lo-stem { font-size: 17px; }
  #lo-card .lo-box { padding: 12px 16px 14px; }
}

/* --------------------------------------------------------- boost celebration
   Play-test fix ("I couldn't tell if I was getting a boost"): a much bigger
   screen-centre banner than the base game's .callout (44px) — shown above
   even the question card (z-index 25 > #lo-card's 20) so it reads as the
   focal moment of a right/wrong answer. CSS-animated (not JS-timed) so its
   1.2s dwell is exact regardless of frame rate; learn.js only sets the text
   and toggles the class. */
#lo-boost {
  position: fixed; left: 50%; top: 50%; z-index: 25; pointer-events: none;
  text-align: center; white-space: nowrap; opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
}
#lo-boost .lo-boost-main {
  font: 900 84px "Baloo 2", "Figtree", Arial, sans-serif;
  color: #ffc53d; -webkit-text-stroke: 3px #191b1f;
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.35); letter-spacing: 2px;
}
/* owner play-test fix 2026-09-07: a second, smaller line spelling out WHY —
   "+1 answer" / "wrong answer" — so the celebration itself teaches the win
   condition, not just the size change. */
#lo-boost .lo-boost-sub {
  margin-top: 4px;
  display: inline-block; padding: 5px 12px; border-radius: 10px; background: #0c0e13;
  font: 800 22px "Figtree", "Segoe UI", Arial, sans-serif;
  color: #fff; letter-spacing: .5px;
}
#lo-boost.lo-boost-show { animation: loBoostPop 1.2s ease-out forwards; }
#lo-boost.lo-boost-down .lo-boost-main { color: #ff5c6c; }
@keyframes loBoostPop {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  12%  { transform: translate(-50%, -50%) scale(1.18); opacity: 1; }
  22%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translate(-50%, -62%) scale(1); opacity: 0; }
}
@media (max-width: 700px) {
  #lo-boost .lo-boost-main { font-size: 52px; }
  #lo-boost .lo-boost-sub { font-size: 15px; }
}

/* --------------------------------------------------- results, learning half */
.lo-learn {
  margin: 0 0 12px; padding: 12px 14px; border-radius: 14px;
  background: #ffffff; border: 1px solid #e4e5e7; border-top: 5px solid #ff7366; text-align: left;
  font-family: "Figtree", "Segoe UI", Arial, sans-serif;
}
.lo-learn .lo-head {
  font: 900 13px "Figtree", "Segoe UI", Arial, sans-serif; letter-spacing: 2px;
  text-transform: uppercase; color: #55585f; margin-bottom: 4px;
}
.lo-learn .lo-big { font: 900 30px "Figtree", "Segoe UI", Arial, sans-serif; color: #191b1f; line-height: 1.1; }
.lo-learn .lo-sub { font-size: 14px; color: #55585f; margin-top: 2px; }
.lo-learn ul { margin: 8px 0 0; padding-left: 18px; }
.lo-learn li { font-size: 13px; line-height: 1.4; color: #55585f; margin-bottom: 5px; }
.lo-learn li b { color: #191b1f; }
.lo-learn li i { color: #62656e; }

/* under the launcher the menu's name field and personal best are meaningless */
body.lo-hosted .menu-row, body.lo-hosted #bestLine { display: none; }

/* item 5 (results): under the launcher the learning result is the headline
   (render.js writes it into #resultTitle), so it needs to read as the biggest
   text on the screen even with the old #N rank badge (96px) now hidden. The
   city rank moves into its own small cell in the stat block, matching CITY
   SCORE / SIZE / KILLS / CITY EATEN. Standalone is untouched. */
body.lo-hosted #resultTitle, body.lo-pwo #resultTitle { font-size: clamp(28px, 7vw, 58px); }
/* .result-stats div (style.css) is class+element specificity; match it here so
   the hide actually wins in standalone. */
.result-stats .result-rank-cell { display: none; }
body.lo-hosted .result-rank-cell, body.lo-pwo .result-rank-cell { display: flex; }
.result-rank-cell b { font-size: 15px; letter-spacing: .5px; }

/* the one line of instructions, repeated under the READY 3-2-1 */
.lo-cdhint {
  position: absolute; left: 50%; top: 54%; transform: translate(-50%, 0);
  font: 800 17px "Figtree", "Segoe UI", Arial, sans-serif; color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 0 8px rgba(0, 0, 0, 0.35);
  white-space: nowrap; pointer-events: none; text-align: center;
}
@media (max-width: 700px) { .lo-cdhint { font-size: 13px; white-space: normal; width: 92vw; } }

/* owner play-test fix 2026-09-07: a second countdown line, under the repeated
   one-liner, naming the mechanic in gold. */
.lo-cdfind {
  position: absolute; left: 50%; top: 61%; transform: translate(-50%, 0);
  font: 900 15px "Figtree", "Segoe UI", Arial, sans-serif; color: #ffc53d;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 0 8px rgba(0, 0, 0, 0.35);
  letter-spacing: .5px; white-space: nowrap; pointer-events: none; text-align: center;
}
@media (max-width: 700px) { .lo-cdfind { font-size: 12px; white-space: normal; width: 92vw; } }

/* item 3: the rivals leaderboard header, launcher-only (see body.lo-hosted below) —
   "city pts" so the numbers there never read as the way to win. */
.board-head { display: none; }
body.lo-hosted .board-head {
  display: block; position: absolute; top: 58px; right: 12px;
  font: 900 11px "Figtree", Arial, sans-serif; letter-spacing: 1.5px; text-transform: uppercase;
  color: #ffffff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
body.lo-hosted #board { top: 78px; }

.lo-reyebrow {
  font: 900 13px "Figtree", "Segoe UI", Arial, sans-serif; letter-spacing: 4px;
  color: #ffc53d; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

/* Near-zero friction: the one line on the title card (repeated over the 3-2-1)
   is the ONLY instruction in the game, so the original in-play "Drag to move
   your hole" hint is retired rather than contradicting it. */
#hint { display: none !important; }

/* The results card now carries a learning half as well as the ranking; on a
   short iframe (1024x640, or a run that missed every question) that is taller
   than the screen, so the screens scroll instead of running off the bottom. */
#menu, #results { overflow-y: auto; overflow-x: hidden; align-items: flex-start; }
#menu .menu-inner, #results .menu-inner { margin: auto; padding: 18px 12px; max-width: 96vw; }
.lo-learn ul { max-height: 32vh; overflow-y: auto; }
