/* A0819: the mount button on the screen and the Montarias window.
   The button is a plate of the HUD (A0744) with the mount's own drawing, cut from its sheet (`mounted-ram/icon.png`);
   the window is the backpack's card with the head of Mistfall UI (A0761), laid out like the window Aparência of the
   owner's model: the preview that turns on the left, the list beside it, the detail and the quest under them, the two
   buttons at the foot. Only the tokens, frames and colours the interface already has. No text under 11 px; on a
   phone everything a finger touches is 44 px. */

/* ── The button on the screen ─────────────────────────────────────────────────────────────────────────────────── */
.quick .mount { order: 0; position: relative; }
/* The plate keeps its frame; the drawn icon sheet of the other buttons is not used here. */
.quick > .glass.mount:not(.attack)::before { display: none; }
.mount-icon { width: 82%; height: 82%; object-fit: contain; pointer-events: none; image-rendering: auto; filter: drop-shadow(0 1px 1px #000a); }
.mount-icon:not([src]) { visibility: hidden; }
/* Not earned yet: the drawing dims and a small lock sits in the corner. */
.quick .mount[data-state="locked"] .mount-icon { filter: grayscale(.85) brightness(.62) drop-shadow(0 1px 1px #000a); }
.mount-lock { position: absolute; right: 2px; bottom: 2px; display: none; place-items: center; width: 17px; height: 17px; border: 1px solid var(--ms-bronze-dark);
  border-radius: 50%; background: var(--ms-ink-deep); color: var(--ms-gold); pointer-events: none; }
.quick .mount[data-state="locked"] .mount-lock { display: grid; }
.mount-lock-icon { width: 9px; height: 9px; fill: currentColor; }
/* Ridden: the plate is lit, the way a chosen control is. */
.quick .mount[aria-pressed="true"] { filter: drop-shadow(0 0 3px #f1c56d) drop-shadow(0 0 1px #f1c56d); }
.quick > .glass.mount:not(.attack):active { filter: brightness(1.3); }
/* A wide screen places it out of the row of the right thumb, which it would widen: over the column of ATK, above the
   row of Falar, Mochila, Diário and Mapa. On a phone the game places it, like the follow switch (`hud-layout.js`). */
@media (min-width: 700px) and (min-height: 521px) {
  .quick .mount { position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: calc(max(94px, calc(env(safe-area-inset-bottom) + 94px)) + 58px); }
}
/* ── The window ───────────────────────────────────────────────────────────────────────────────────────────────── */
.mounts .map-head { gap: 8px; align-items: center; }
.mounts .map-head > div { flex: 1 1 auto; min-width: 0; }
.mounts .map-head b { font-size: var(--ms-text-title); line-height: 1.15; letter-spacing: .01em; }
.mounts .map-head span:not(.ms-banner) { font-size: var(--ms-text-body); }
.mounts .map-head .ms-close { --ix: 3; --iy: 1; position: relative; flex: none; width: 30px; min-width: 30px; height: 30px; min-height: 30px; padding: 0; border: 0; border-image: none;
  background: var(--ms-icons) 100% 50% / 400% 300% no-repeat; }
/* Small to the eye, 44 px to the finger. */
.mounts .map-head .ms-close::after { content: ""; position: absolute; inset: -7px; }
.mounts .map-head .ms-close:active { filter: brightness(1.25); }
.mounts.floating .map-card { width: min(348px, calc((100vw - 8px) / var(--hud-scale))); }
.mounts.floating .backpack-pane { gap: 8px; }
/* The preview and, beside it, the list of mounts with what the chosen one does. */
.mounts-top { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 10px; align-items: start; }
.mounts-preview { position: relative; margin: 0; display: grid; place-items: center; height: 168px; padding: 0 0 18px; border: 1px solid transparent;
  border-image: var(--hud-slot) 20 fill / 10px; background: radial-gradient(ellipse 34% 7% at 50% 80%, #0009, transparent 75%); }
.mounts-preview canvas { display: block; width: 140px; height: 140px; image-rendering: pixelated; }
.mounts-preview-note { position: absolute; inset: 30px 12px auto; margin: 0; color: var(--ms-muted); font-size: var(--ms-text-min); line-height: 1.3; text-align: center; }
.mounts-preview-note[hidden] { display: none; }
.mounts-preview figcaption { position: absolute; left: 10px; right: 10px; bottom: 5px; display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--ms-gold); font-size: var(--ms-text-min); font-weight: 700; letter-spacing: .04em; }
.mounts-preview figcaption::before, .mounts-preview figcaption::after { content: ""; flex: 0 1 18px; height: 1px; background: var(--ms-bronze); }
.mounts-turn { position: absolute; top: 58px; z-index: 1; display: grid; place-items: center; width: 30px; min-width: 30px; height: 30px; min-height: 30px; padding: 0; color: var(--ms-gold); }
.mounts-turn.left { left: 5px; }
.mounts-turn.right { right: 5px; }
.mounts-turn svg { width: 14px; height: 14px; fill: currentColor; pointer-events: none; }
.mounts-turn.right svg { transform: scaleX(-1); }
.mounts-turn::after { content: ""; position: absolute; inset: -7px; }
.mounts-side { display: grid; align-content: start; gap: 6px; min-width: 0; }
.mounts-list { display: grid; gap: 6px; }
/* One mount: its drawing in a small slot, the name, and whether it is the character's. The chosen one is lit. */
.mounts .mount-card { min-width: 0; min-height: 52px; padding: 5px 8px 5px 5px; display: grid; grid-template-columns: 40px minmax(0, 1fr); place-items: center start;
  align-content: center; gap: 1px 8px; color: var(--ms-text); text-align: left; }
.mount-card-icon { grid-row: 1 / span 2; width: 40px; height: 40px; object-fit: contain; border: 1px solid transparent; border-image: var(--hud-slot) 20 fill / 8px; }
.mount-card b { min-width: 0; color: var(--ms-text); font-size: var(--ms-text-strong); line-height: 1.15; overflow-wrap: anywhere; }
.mount-card-state { color: var(--ms-muted); font-size: var(--ms-text-min); font-weight: 700; }
.mounts .mount-card[aria-selected="true"] { color: var(--ms-gold); filter: drop-shadow(0 0 2px #f1c56d); }
.mounts .mount-card[aria-selected="true"] b { color: var(--ms-gold-bright); }
.mount-card[data-state="owned"] .mount-card-state { color: var(--ms-gold); }
.mount-card[data-state="mounted"] .mount-card-state { color: #8be37f; }
.mount-card[data-state="locked"] .mount-card-icon { filter: grayscale(.85) brightness(.62); }
.mounts-line { margin: 0; color: var(--ms-muted); font-size: var(--ms-text-body); line-height: 1.35; }
.mounts-line:empty, .mounts-line[hidden] { display: none; }
.mounts-speed { color: var(--ms-text); }
.mounts-locked { color: #f0a08a; }
/* The title of a part, between two bronze lines (the "Cor da roupa" of the model). */
.mounts-section { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; color: var(--ms-gold); font-size: var(--ms-text-strong); font-weight: 700; letter-spacing: .02em; }
.mounts-section::before, .mounts-section::after { content: ""; flex: 1 1 12px; height: 1px; background: var(--line); }
.mounts-section[hidden] { display: none; }
/* The quest that gives the mount: what to do, where, how far it is (the gold of the bars of progress) and its state. */
.mount-quest { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--ms-bronze-dark); border-radius: 4px; background: var(--ms-ink); }
.mount-quest[hidden] { display: none; }
.mount-quest b { color: var(--ms-gold); font-size: var(--ms-text-strong); }
.mount-quest p { margin: 0; color: var(--ms-text); font-size: var(--ms-text-body); line-height: 1.35; }
.mount-quest .mount-quest-place { color: var(--ms-muted); font-size: var(--ms-text-min); }
.mount-quest .mount-quest-place[hidden] { display: none; }
.mount-quest-meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.mount-quest-meter span { display: block; height: 8px; overflow: hidden; border-radius: 4px; background: #0c0f0bd9; box-shadow: inset 0 0 0 1px #3b2a12; }
.mount-quest-meter i { display: block; width: var(--fill, 0%); height: 100%; background: linear-gradient(to right, #b9832e, var(--gold)); }
.mount-quest-meter output { color: var(--ms-gold); font-size: var(--ms-text-strong); font-weight: 700; font-variant-numeric: tabular-nums; }
.mount-quest .mount-quest-state { color: var(--ms-muted); font-size: var(--ms-text-min); }
.mount-quest[data-state="ready"] .mount-quest-state { color: var(--ms-gold-bright); }
.mount-quest[data-state="done"] .mount-quest-state { color: #8be37f; }
.mounts-note, .mounts-status { margin: 0; font-size: var(--ms-text-min); }
.mounts-status { color: var(--ms-muted); }
.mounts-status.failed { color: #f0a08a; }
.mounts-note:empty, .mounts-status:empty { display: none; }
/* The foot: Fechar and, for a mount that is the character's, Montar or Desmontar. */
.mounts .mounts-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.mounts .mounts-foot:has(#mountsRide[hidden]) { grid-template-columns: 1fr; }
.mounts-foot .glass { min-height: 40px; padding: 0 12px; font-size: var(--ms-text-strong); font-weight: 700; }
.mounts-foot .glass[hidden] { display: none; }
.mounts-foot .glass.primary { color: var(--ms-gold-bright); filter: drop-shadow(0 0 2px #f1c56d); }
.mounts-foot .glass:disabled { opacity: .55; cursor: default; }
@media (max-width: 699px), (min-width: 560px) and (max-height: 520px) {
  .mounts-foot .glass { min-height: 44px; }
  .mounts .mount-card { min-height: 52px; }
}
/* A narrow phone: the preview a little smaller, so the list keeps its room. */
@media (max-width: 359px) {
  .mounts-top { grid-template-columns: 128px minmax(0, 1fr); }
  .mounts-preview canvas { width: 120px; height: 120px; }
  .mounts-preview { height: 150px; }
  .mounts-turn { top: 50px; }
}

/* ── The conversation: the entry of the mount's quest beside the NPC's own lines (`story-panel.js`) ──────────── */
.npc-dialogue .npc-dialogue-extra .glass { color: var(--gold); }
