/* The first-time tutorial (tutor.js), in tangibles.fun's own two pieces, copied value for value from their player css
   (owner 2026-10-22: "these are from tangibles but I want the exact same design on our site"):
   .tutor  the hint in the middle of the screen: one line of what to do, a small line under it (green when it went
           well, amber for a miss or a dodge)
   .dlg    the story box at the bottom: a face (the book for the narrator), a name and role, the words typed out, the
           bouncing chevron and "skip"
   Their dark theme's colours are set here so the pieces look the same whatever the HUD around them uses. */
#mpHud .tutor, #mpHud .dlg {
  --glass-hi: #1e1e23cc; --line-hi: #f3edd352; --row-hi: #f3edd321; --gold: #e8c766; --muted: #f3edd3a3; --text: #f3edd3;
  --cream-ink: #f3edd3; --cream-85: #f3edd3d9; --accent: #e6dc3a; --blue: #74cde4; --kbd-rim: #2b3f5c59;
  --display: "Fira Sans", "Segoe UI", system-ui, sans-serif; font-family: "Fira Sans", "Segoe UI", system-ui, sans-serif; }

/* ---- the hint ---- */
#mpHud .tutor { z-index: 6; box-sizing: border-box; text-align: center; color: #f3edd3; background: #181c24c7; border: 1px solid #f3edd338;
  border-radius: 14px; justify-items: center; gap: 4px; width: max-content; max-width: min(92vw, 640px); padding: 12px 26px 13px;
  animation: .3s tutorin; display: grid; position: absolute; top: 58%; left: 50%; transform: translate(-50%); box-shadow: 0 8px 30px #00000059; }
@keyframes tutorin { 0% { opacity: 0; transform: translate(-50%, 6px); } }
#mpHud .tutor b { font-family: var(--display); flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; font-size: 22px;
  font-weight: 500; line-height: 1.25; display: flex; }
#mpHud .tutor b kbd { box-sizing: border-box; letter-spacing: 0; text-transform: none; vertical-align: middle; white-space: nowrap; flex: none;
  place-items: center; font-style: normal; display: inline-grid; box-shadow: 0 1px 2px #00000047; color: #2b3f5c; border: 1px solid var(--kbd-rim);
  background: #f5f1e1; font-weight: 700; line-height: 1; border-radius: 15px; width: auto; min-width: 30px; height: 30px; padding: 0 8px; font-size: 15px; }
#mpHud .tutor small { color: #f3edd3c7; font-size: 14px; }
#mpHud .tutor.good { border-color: #8fe36bb3; box-shadow: 0 0 0 2px #8fe36b40, 0 8px 30px #00000059; }
#mpHud .tutor.good b { color: #c9f5b4; }
#mpHud .tutor.warn b { color: #ffd98a; }
@media (orientation: portrait) and (width <= 760px) {
  #mpHud .tutor { top: auto; bottom: 30%; max-width: calc(100vw - 24px); padding: 9px 16px 10px; }
  #mpHud .tutor b { font-size: 17px; }
  #mpHud .tutor small { font-size: 12.5px; }
}
@media (orientation: landscape) and (height <= 500px) {
  #mpHud .tutor { top: auto; bottom: 66px; gap: 2px; max-width: min(48vw, 100vw - 500px); padding: 7px 14px 8px; }
  #mpHud .tutor b { font-size: 15px; }
  #mpHud .tutor b kbd { min-width: 24px; height: 24px; font-size: 12.5px; }
  #mpHud .tutor small { font-size: 11.5px; }
}
/* the gems strip at the top while the tutorial points at it: tangibles' good green, pulsing round the torn paper's
   own shape (its drop shadow kept) */
#mpHud .mp-money.tutor-point { animation: tutorpoint 1.4s ease-in-out infinite; }
@keyframes tutorpoint { 50% { filter: drop-shadow(0 2px 4px #00000066) drop-shadow(0 0 3px #8fe36b) drop-shadow(0 0 12px #8fe36bb3); } }

/* ---- the story box ---- */
#mpHud .dlg { background: var(--glass-hi); border: 1.5px solid var(--line-hi); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  z-index: 34; cursor: pointer; pointer-events: auto; border-radius: 20px; grid-template-columns: auto 1fr; gap: 6px 16px; width: min(860px, 94vw);
  padding: 16px 20px 12px; animation: .25s cubic-bezier(.2, 1.3, .4, 1) dlgpop; display: grid; position: absolute; bottom: 26px; left: 50%;
  transform: translate(-50%); box-shadow: 0 14px 40px #00000080; box-sizing: border-box; text-align: left; }
@keyframes dlgpop { 0% { opacity: 0; transform: translate(-50%) scale(.96) translateY(6px); } }
#mpHud .dlg-face { background: var(--row-hi); border: 1px solid var(--line-hi); border-radius: 18px; grid-row: span 2; place-items: center;
  width: 76px; height: 76px; font-size: 44px; display: grid; color: var(--cream-ink); box-sizing: border-box; }
#mpHud .dlg-face img { width: 70px; height: 70px; }
#mpHud .dlg-face .ic { vertical-align: -.14em; fill: none; stroke: currentColor; stroke-width: 1.75px; stroke-linecap: round; stroke-linejoin: round;
  flex: none; width: 1em; height: 1em; overflow: visible; }
#mpHud .dlg-face .ic .w { fill: currentColor; fill-opacity: .22; stroke: none; }
#mpHud .dlg-who { align-items: baseline; gap: 10px; min-height: 20px; display: flex; }
#mpHud .dlg-who b { font-family: var(--display); color: var(--gold); font-size: 18px; }
#mpHud .dlg-who small { color: var(--muted); font-size: 12px; }
#mpHud .dlg p { min-height: 3.1em; color: var(--cream-ink); margin: 2px 0 0; font-size: 17px; line-height: 1.5; }
#mpHud .dlg[data-who=narr] p { color: var(--cream-85); font-style: italic; }
#mpHud .dlg-foot { grid-column: 2; justify-content: flex-end; align-items: center; gap: 14px; font-size: 12px; display: flex; }
#mpHud .dlg-more { color: var(--accent); animation: .8s ease-in-out infinite alternate dlgbob; display: inline-grid; }
#mpHud .dlg-more .ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.75px; stroke-linecap: round; stroke-linejoin: round; }
@keyframes dlgbob { to { transform: translateY(4px); } }
#mpHud .dlg .link { color: var(--muted); text-underline-offset: 2px; background: 0 0; border: none; padding: 0; font-size: inherit; text-decoration: underline; cursor: pointer; }
#mpHud .dlg .link:hover { color: var(--text); }
@media (height <= 520px) {
  #mpHud .dlg { padding: 10px 14px 8px; bottom: 8px; }
  #mpHud .dlg-face { width: 54px; height: 54px; font-size: 30px; }
  #mpHud .dlg p { min-height: 2.8em; font-size: 14px; }
}
@media (orientation: portrait) and (width <= 760px) {
  #mpHud .dlg { border-radius: 16px; gap: 4px 12px; width: calc(100vw - 16px); padding: 12px 14px 8px; bottom: 12px; }
  #mpHud .dlg-face { border-radius: 14px; width: 56px; height: 56px; font-size: 30px; }
  #mpHud .dlg-face img { width: 52px; height: 52px; }
  #mpHud .dlg p { min-height: 2.9em; font-size: 15px; line-height: 1.45; }
  #mpHud .dlg-foot { font-size: 13px; }
  #mpHud .dlg-foot .link { padding: 6px 4px; }
}
/* while the story box is up, the bag and the balls that share the bottom of the screen step aside (as for the game's own
   cards, dock.css and field.css) */
#mpHud.mp-dlg-on .mp-bag, #mpHud.mp-dlg-on .field-balls { opacity: 0; pointer-events: none; }

/* ---- the game's own first cards (How to Move?, Sprint, Jump: its .popup) in the hint's dress ----
   (owner 2026-10-22: "this needs to be restyled right with the tutorial styling"): the hint's dark glass box, cream
   Fira Sans title and line, and its round cream key caps; the paper card, its stitch and the game's white keys gone.
   The game's own place and fade stay. (!important over paper.css's kraft card, which also sets them that way.) */
body .popup {
  background: #181c24c7 !important; color: #f3edd3 !important; border: 1px solid #f3edd338 !important; border-radius: 14px !important;
  box-shadow: 0 8px 30px #00000059 !important; -webkit-backdrop-filter: none; backdrop-filter: none; text-shadow: none !important;
  width: max-content !important; max-width: min(92vw, 640px); height: auto !important; padding: 12px 26px 13px !important; gap: 22px;
  align-items: center; box-sizing: border-box; font-family: "Fira Sans", "Segoe UI", system-ui, sans-serif !important; }
body .popup::after { content: none !important; display: none !important; }
body .popup .instruction { margin: 0; width: auto; display: grid; gap: 4px; }
body .popup .instruction .title { margin: 0; font-family: "Fira Sans", "Segoe UI", system-ui, sans-serif !important; font-size: 22px; font-weight: 500 !important;
  font-style: normal; line-height: 1.25; color: #f3edd3 !important; }
body .popup .caption { color: #f3edd3c7 !important; font-size: 14px; line-height: 1.35; }
body .popup .keyboard { width: auto; gap: 6px; }
body .popup .key-row { gap: 6px; }
body .popup .key { box-sizing: border-box; margin: 0; width: auto; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 15px;
  background: #f5f1e1 !important; color: #2b3f5c !important; border: 1px solid #2b3f5c59 !important; box-shadow: 0 1px 2px #00000047 !important;
  font: 700 15px/1 "Fira Sans", "Segoe UI", system-ui, sans-serif; }
body .popup :is(.spacebarkey, .shiftkey) { padding: 0 18px; }
/* both sit at the bottom: the game's card waits while the story box is up */
body:has(#mpHud.mp-dlg-on) .popup { opacity: 0 !important; }
