/* «Sanlúcar 1519 · La vuelta al mundo» — hoja de estilos de la interfaz (agente UI/UX).
   Estética: pergamino, tinta, madera y latón. Mobile-first (360×640 y apaisado), objetivos táctiles ≥ 44 px.
   Conserva #app / #world / #ui / #loading del coordinador. */

:root {
  --ink: #2a1c10;
  --ink2: #5a4630;
  --parch: #f3e6c3;
  --parch2: #e8d6a6;
  --parch3: #d6bf86;
  --wood: #3b2a1b;
  --wood2: #52391f;
  --wood3: #261a10;
  --brass: #c9a04a;
  --brass2: #e8c46f;
  --brassd: #8a6a28;
  --sea: #1f4a5e;
  --red: #9a2a22;
  --redl: #c4463a;
  --green: #3d6b3a;
  --amber: #a8741a;
  --light: #f8efd6;
  --light2: #d9c9a0;
  --tap: 44px;
  --nav-h: 58px;
  --hud-h: 100px;
  --obj-h: 84px;
  --rail: 0px;
  --font-title: 'IM Fell English', Georgia, 'Times New Roman', serif;
  --font: Georgia, 'Palatino Linotype', Palatino, 'Book Antiqua', 'Times New Roman', serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #12202a; color: var(--light); font-family: var(--font); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior: none; }
#app { position: fixed; inset: 0; }
#world { position: absolute; inset: 0; touch-action: none; }

/* ───────── Pantalla de carga (coordinador) ───────── */
#loading { position: absolute; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #2a3f4c, #12202a 70%); transition: opacity .5s; }
#loading.done { opacity: 0; pointer-events: none; }
.ld-box { text-align: center; width: min(80vw, 360px); }
.ld-box h1 { margin: 0; font-family: var(--font-title); font-weight: 400; font-size: clamp(28px, 9vw, 40px); color: var(--brass2); text-shadow: 0 2px 0 #000a; }
.ld-box p { margin: 4px 0 18px; opacity: .85; font-style: italic; }
.ld-bar { height: 8px; background: #2b3d49; border-radius: 4px; overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; background: var(--brass); transition: width .3s; }
.ld-box small { display: block; margin-top: 10px; opacity: .75; }

/* ───────── Capa de interfaz ───────── */
#ui {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  font-size: 15px; line-height: 1.38; overflow-wrap: break-word;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
/* :where() = especificidad cero, para que las clases de cada componente manden sobre estos valores base */
:where(#ui) button, :where(#ui) input, :where(#ui) select { font: inherit; color: inherit; }
#ui button { cursor: pointer; touch-action: manipulation; -webkit-appearance: none; appearance: none; margin: 0; }
:where(#ui) a { color: inherit; } #ui a { touch-action: manipulation; }
#ui img { -webkit-user-drag: none; user-drag: none; }
#ui :focus-visible { outline: 3px solid var(--brass2); outline-offset: 2px; }
#ui [hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.selectable, .selectable * { -webkit-user-select: text; user-select: text; }

/* Iconos de línea (máscara) y de bienes (imagen) */
.ic { display: inline-block; flex: none; width: 1.3em; height: 1.3em; vertical-align: -0.25em; background: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ic.lg { width: 1.7em; height: 1.7em; }
.ic.xl { width: 2.4em; height: 2.4em; }
.gi { display: inline-block; flex: none; width: 1.6em; height: 1.6em; vertical-align: -0.35em; }
.gi.lg { width: 2.2em; height: 2.2em; }

/* Placa de madera con filete de latón */
.plate {
  background: linear-gradient(#4b3722, #32231a);
  border: 1px solid var(--brassd); border-radius: 10px; color: var(--light);
  box-shadow: inset 0 1px 0 #7d5d3a, 0 2px 6px rgba(0, 0, 0, .5);
}
.paper {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, .35), transparent 60%),
    linear-gradient(#f5e9c8, #e9d8aa);
  color: var(--ink);
}

/* ───────── HUD ───────── */
.hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10; display: flex; flex-direction: column; gap: 6px; pointer-events: none;
  padding: max(6px, var(--sat)) max(8px, var(--sar)) 0 max(8px, var(--sal));
}
.hud > * { pointer-events: auto; }
.hud-top { display: flex; gap: 6px; align-items: stretch; }
.hud-date { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 2px 10px; min-height: var(--tap); }
.hud-date .ic { color: var(--brass2); }
.hud-date b { font-family: var(--font-title); font-weight: 400; font-size: clamp(14px, 4.2vw, 18px); line-height: 1.12; overflow-wrap: anywhere; }

.hud-speed { flex: none; display: flex; padding: 0; overflow: hidden; }
.spd { width: var(--tap); min-height: var(--tap); background: none; border: 0; border-left: 1px solid #0006; color: var(--light2); font-weight: 700; font-size: 14px; display: grid; place-items: center; padding: 0; }
.spd:first-child { border-left: 0; }
.spd[aria-pressed="true"] { background: linear-gradient(#d4ac55, #a97f2b); color: var(--ink); box-shadow: inset 0 1px 0 #fff6, inset 0 -2px 0 #0003; }
.spd:active { filter: brightness(1.2); }

.hud-chips { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; touch-action: pan-x; padding: 1px 0 3px; margin: 0 calc(-1 * max(8px, var(--sar))) 0 calc(-1 * max(8px, var(--sal))); padding-left: max(8px, var(--sal)); padding-right: max(8px, var(--sar)); }
.hud-chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: var(--tap); display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; border: 1px solid var(--brassd); background: linear-gradient(#4b3722, #32231a); color: var(--light); border-radius: 22px; box-shadow: 0 2px 5px #0006; white-space: nowrap; }
.chip .ic { color: var(--brass2); }
.chip small { font-weight: 400; font-size: 14px; color: var(--light2); }
.chip.low { border-color: var(--redl); }
.chip.low b { color: #ffb3a8; }
.chip.good .gi { width: 1.3em; height: 1.3em; }
.chip { padding: 0 7px; gap: 3px; font-size: 14px; }
.chip .ic { width: 1.15em; height: 1.15em; }
.hud-chips { gap: 4px; }
.chip.more { padding: 0 11px; }
@media (max-width: 460px) { .chip.more .lbl { display: none; } .chip.more { width: var(--tap); padding: 0; justify-content: center; } }
.chip.more { background: linear-gradient(#d4ac55, #a97f2b); color: var(--ink); border-color: #7a5a1c; }
.chip.more .ic { color: var(--ink); }
.chip .pulse { animation: pulse .7s ease; }
@keyframes pulse { 40% { transform: scale(1.18); color: var(--brass2); } }

/* Tarjeta «Siguiente paso»: fija, abajo (al alcance del pulgar) */
.obj { position: absolute; z-index: 18; left: max(8px, var(--sal)); right: max(8px, var(--sar)); bottom: calc(var(--nav-h) + var(--sab) + 8px); max-width: 520px; margin: 0 auto; pointer-events: auto;
  padding: 8px 10px 9px; border: 1px solid var(--brass); transition: opacity .2s, transform .25s; overflow: hidden; }
.obj.away { opacity: 0; transform: translateY(24px); pointer-events: none; }
.obj-row { display: flex; gap: 10px; align-items: center; }
.obj-row > .ic { color: var(--brass2); }
.obj-body { flex: 1 1 0; min-width: 0; }
.obj-body small { display: block; font-size: 14px; color: var(--brass2); letter-spacing: .04em; line-height: 1.1; }
.obj-t { margin: 1px 0 0; font-family: var(--font-title); font-size: 16px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.obj-cta { flex: none; max-width: 46%; min-height: var(--tap); padding: 0 12px; white-space: normal; font-size: 14px; }
.obj .bar { margin-top: 7px; }
.obj.done { border-color: #7fb36f; animation: objdone .9s ease; }
.obj.done .obj-t { color: #cfe8c4; }
@keyframes objdone { 30% { transform: scale(1.04); box-shadow: 0 0 0 4px #7fb36f88, 0 0 24px #7fb36fcc; } }
.obj-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.obj-fx .ic { position: absolute; bottom: 4px; left: calc(14% + var(--i) * 13%); width: 22px; height: 22px; color: var(--brass2); opacity: 0; animation: coinup 1.2s ease-out forwards; animation-delay: calc(var(--i) * 70ms); }
@keyframes coinup { 0% { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-46px) scale(1.1); opacity: 0; } }
.fab { position: absolute; z-index: 12; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; padding: 0; pointer-events: auto; border: 1px solid var(--brassd); background: linear-gradient(#4b3722, #32231a); color: var(--brass2); box-shadow: 0 2px 8px #0008; }
.fab:active { filter: brightness(1.25); }
.fab.center { top: calc(var(--hud-h) + 8px); right: max(8px, var(--sar)); }
.bar { height: 8px; border-radius: 4px; background: #1b120b; border: 1px solid #0008; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(#e8c46f, #b3862f); transition: width .4s; }
.bar.ok > i { background: linear-gradient(#7fb36f, #4a8043); }
.paper .bar, .sheet .bar { background: #cdb67f; border-color: #8a6a28; }

/* ───────── Barra inferior ───────── */
.nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; pointer-events: auto;
  padding: 0 var(--sar) var(--sab) var(--sal); height: calc(var(--nav-h) + var(--sab));
  background: linear-gradient(#4b3722, #2c1f14); border-top: 2px solid var(--brass);
  box-shadow: 0 -3px 10px #0007;
}
.nav button { position: relative; flex: 1 1 0; min-width: 0; min-height: calc(var(--nav-h) - 2px); max-height: calc(var(--nav-h) - 2px); background: none; border: 0; color: var(--light2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 1px; font-size: 14px; line-height: 1.1; overflow: hidden; }
.nav button .ic { width: 24px; height: 24px; }
.nav button span { max-width: 100%; overflow-wrap: normal; word-break: normal; white-space: nowrap; text-align: center; }
.nav button[aria-pressed="true"] { color: var(--ink); background: linear-gradient(#e0b960, #b48a33); box-shadow: inset 0 1px 0 #fff7; }
.nav button:active { filter: brightness(1.25); }
.nav .dot { position: absolute; top: 5px; right: calc(50% - 22px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center; border: 1px solid #fff9; }

/* ───────── Hojas (paneles inferiores) ───────── */
.sheet-layer { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: var(--nav-h); max-height: calc(100% - var(--hud-h) - var(--nav-h) - 6px);
  height: var(--sheet-h, auto); display: flex; flex-direction: column; pointer-events: auto;
  border-radius: 16px 16px 0 0; border: 2px solid var(--brass); border-bottom: 0; overflow: hidden;
  box-shadow: 0 -6px 22px #0009; transform: translateY(calc(100% + var(--nav-h) + 20px)); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
  margin-bottom: var(--sab); touch-action: pan-y;
}
.sheet.show { transform: none; }
.sheet.tall { --sheet-h: 78%; }
.sheet.mid { --sheet-h: 56%; }
.sheet.low { --sheet-h: 44%; }
.sheet.full { bottom: 0; top: 0; max-height: none; height: auto; border-radius: 0; border: 0; margin-bottom: 0; z-index: 2; transform: translateY(104%); }
.sheet.full.show { transform: none; }
.sheet-head { flex: none; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; min-height: 52px; background: linear-gradient(#4b3722, #32231a); color: var(--light); border-bottom: 2px solid var(--brass); touch-action: none; position: relative; }
.sheet.full .sheet-head { padding-top: var(--sat); padding-left: max(12px, var(--sal)); padding-right: max(6px, var(--sar)); }
.sheet-head::before { content: ''; position: absolute; top: 4px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: #c9a04a88; }
.sheet.full .sheet-head::before { display: none; }
.sheet-title { flex: 1 1 auto; min-width: 4.5em; overflow-wrap: break-word; margin: 0; font-family: var(--font-title); font-weight: 400; font-size: clamp(18px, 5.2vw, 22px); color: var(--brass2); line-height: 1.1; padding-top: 6px; }
.sheet.full .sheet-title { padding-top: 0; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: 12px max(12px, var(--sar)) 14px max(12px, var(--sal)); }
.sheet-foot { flex: none; padding: 6px max(10px, var(--sar)) 6px max(10px, var(--sal)); border-top: 1px solid var(--parch3); display: flex; gap: 6px; background: var(--parch2); }
.sheet-foot .btn { flex: 1 1 0; min-width: 0; padding: 0 8px; font-size: 14px; }

.ibtn { flex: none; width: var(--tap); height: var(--tap); display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--light); padding: 0; }
.ibtn:active { background: #fff2; }
.ibtn.txt { width: auto; padding: 0 10px; gap: 5px; display: inline-flex; align-items: center; font-size: 14px; }
.ibtn .lbl { white-space: nowrap; }
@media (max-width: 480px) { .sheet-head .ibtn.txt .lbl { display: none; } .sheet-head .ibtn.txt { width: var(--tap); padding: 0; justify-content: center; } }
.ibtn[disabled] { opacity: .4; }
.ibtn[aria-pressed="true"] { background: var(--redl); color: #fff; }

/* Botones sobre pergamino */
.btn { min-height: var(--tap); padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; border-radius: 8px; border: 1px solid var(--brassd); background: linear-gradient(#f7edd0, #e2cd98); color: var(--ink); font-weight: 700; font-size: 15px; text-decoration: none; box-shadow: 0 2px 0 #8a6a2866; line-height: 1.15; }
.btn:active { transform: translateY(1px); filter: brightness(.95); }
.btn.primary { background: linear-gradient(#d9b25c, #a97f2b); border-color: #6e4f14; }
.btn.red { background: linear-gradient(#c4463a, #8f241c); border-color: #5e130d; color: #fff; }
.btn.block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn.sm { min-height: var(--tap); padding: 0 12px; font-size: 14px; }

/* Textos dentro de hojas */
.sheet.paper .sheet-body, .paper .sheet-body, .sheet-body { color: var(--ink); }
.sec { margin: 16px 0 6px; font-family: var(--font-title); font-weight: 400; font-size: 18px; color: var(--wood2); border-bottom: 1px solid var(--parch3); padding-bottom: 3px; }
.sec:first-child { margin-top: 0; }
.muted { color: var(--ink2); }
.note { font-size: 14px; color: var(--ink2); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; margin: 0; }
.kv > div { display: contents; }
.kv dt { color: var(--ink2); }
.kv dd { margin: 0; padding-left: 12px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.kv > div > * { padding: 6px 0; border-bottom: 1px dotted #8a6a2855; }
.lines p { margin: 0 0 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.empty { text-align: center; padding: 22px 8px; color: var(--ink2); font-style: italic; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 10px; font-size: 14px; background: var(--parch3); color: var(--ink); font-weight: 700; }

/* ───────── Construir ───────── */
.tabs { flex: none; display: flex; gap: 4px; padding: 6px 8px 0; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; background: var(--parch2); border-bottom: 2px solid var(--brassd); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; min-width: max-content; min-height: var(--tap); padding: 0 2px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 14px; line-height: 1.05; white-space: nowrap; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: none; color: var(--ink2); font-weight: 700; }
.tab .ic { width: 20px; height: 20px; }
.tab[aria-selected="true"] { background: var(--parch); border-color: var(--brassd); color: var(--ink); margin-bottom: -2px; padding-bottom: 2px; }
.tab .n { font-weight: 400; opacity: .7; }
/* Tarjetas grandes de edificio: una columna, botón principal «Construir aquí» */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--brassd); border-radius: 12px; background: linear-gradient(#fbf2d6, #ecdcae); color: var(--ink); box-shadow: 0 2px 0 #8a6a2844; }
.card.sug { border: 2px solid var(--brass); box-shadow: 0 0 0 3px #e8c46f66, 0 2px 0 #8a6a2844; }
.ribbon { position: absolute; top: -9px; right: 12px; padding: 0 10px; border-radius: 10px; background: var(--red); color: #fff; font-size: 14px; font-weight: 700; line-height: 20px; }
.card-main { display: flex; gap: 10px; align-items: center; text-align: left; width: 100%; min-height: 60px; padding: 0; border: 0; background: none; color: inherit; }
.card-img { flex: none; width: 64px; height: 56px; border-radius: 8px; background: var(--parch3) center / contain no-repeat; display: grid; place-items: center; color: var(--wood2); overflow: hidden; }
.card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.card-txt { flex: 1 1 0; min-width: 0; }
.card-name { font-family: var(--font-title); font-size: 18px; line-height: 1.1; font-weight: 400; overflow-wrap: anywhere; }
.card-desc { font-size: 14px; line-height: 1.25; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.card-foot { display: flex; gap: 6px; align-items: stretch; }
.card-go { flex: 1 1 0; min-width: 0; min-height: 48px; font-size: 16px; justify-content: center; }
.card-go .pr { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 700; opacity: .9; }
.pick { width: 48px; height: 48px; border: 1px solid var(--brassd); border-radius: 8px; background: linear-gradient(#f7edd0, #e2cd98); color: var(--ink); }
.card-state { font-size: 14px; font-weight: 700; color: var(--green); }
.card-state.locked { color: var(--red); } .card-state.poor { color: var(--amber); margin-top: 4px; }
.card.locked { background: #cbb98c; color: #5a4630; border-style: dashed; }
.card.locked .card-img { filter: grayscale(1); opacity: .6; }
.card.locked .card-main { cursor: default; }
.costs { display: flex; flex-wrap: wrap; gap: 3px 8px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cost-i { display: inline-flex; align-items: center; gap: 3px; }
.cost-i.miss { color: var(--red); }

/* Barra de colocación: nombre + calidad, motivo corto, [Cancelar] [Otro sitio] [OK] */
.pbar {
  position: absolute; left: max(8px, var(--sal)); right: max(8px, var(--sar)); bottom: calc(var(--nav-h) + var(--sab) + 8px); z-index: 25; pointer-events: auto; max-width: 520px; margin: 0 auto;
  border: 2px solid var(--brass); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 4px 16px #0009; transition: transform .2s, opacity .2s;
}
.pbar[hidden] { display: none; }
.pbar-h { display: flex; align-items: center; gap: 8px; }
.pbar-t { flex: 1 1 0; min-width: 0; font-family: var(--font-title); font-size: 18px; line-height: 1.1; overflow-wrap: anywhere; }
.pbar-s { font-size: 14px; line-height: 1.25; display: flex; gap: 6px; align-items: flex-start; }
.pbar-s.ok { color: var(--green); font-weight: 700; }
.pbar-s.bad { color: var(--red); font-weight: 700; }
.pbar-s.warn { color: #7a5208; font-weight: 700; }
.pbar-b { display: flex; gap: 6px; }
.pbar-b .btn { flex: 1 1 0; min-width: 0; padding: 0 6px; font-size: 14px; min-height: 48px; }
.pbar-b .btn.okbtn { flex: 1.5 1 0; font-size: 18px; }
.pbar-b .btn.cancel { flex: none; }
@media (max-width: 460px) { .pbar-b .btn.undo .ic, .pbar-b .btn.again .ic, .pbar-b .btn.alt .ic { display: none; } .pbar-b .btn.cancel { width: 48px; padding: 0; } .pbar-b .btn.cancel .lbl { display: none; } .pbar-b .btn { white-space: nowrap; } }
.qb { flex: none; padding: 2px 12px; border-radius: 14px; font-size: 14px; font-weight: 700; border: 2px solid; line-height: 1.2; }
.qb.bueno { background: #e1efd8; color: #264d22; border-color: #3d6b3a; }
.qb.regular { background: #f6e8bd; color: #6d4a07; border-color: #a8741a; }
.qb.malo, .qb.no { background: #f3d7d0; color: #7a1f17; border-color: #9a2a22; }

/* ───────── Existencias / villa ───────── */
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 6px; }
.stock-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: #fbf2d6; border: 1px solid var(--parch3); min-height: 48px; }
.stock-item .nm { flex: 1 1 0; min-width: 0; font-size: 14px; line-height: 1.15; overflow-wrap: anywhere; }
.stock-item b { font-variant-numeric: tabular-nums; font-size: 16px; }
.stock-item.zero { opacity: .6; }
.stock-item.locked b, .stock-item.locked .nm { color: var(--ink2); }

/* Flota */
.prov { display: flex; flex-direction: column; gap: 8px; }
.prov-i { padding: 8px; border-radius: 10px; background: #fbf2d6; border: 1px solid var(--parch3); }
.prov-h { display: flex; align-items: center; gap: 8px; }
.prov-h .nm { flex: 1 1 0; min-width: 0; font-weight: 700; line-height: 1.15; }
.prov-h .qt { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; max-width: 58%; line-height: 1.15; }
.prov-n { font-size: 14px; color: var(--ink2); margin-top: 4px; }
.prov-i .btn { margin-top: 6px; }
.ship { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 6px 0; border-bottom: 1px dotted #8a6a2855; }
.ship b { font-family: var(--font-title); font-weight: 400; font-size: 16px; }
.ship span { font-size: 14px; color: var(--ink2); }
.ship .r { text-align: right; }
.ship.me { background: linear-gradient(90deg, #d9b25c33, transparent); }

/* ───────── Menú, ajustes y créditos ───────── */
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 12px; text-align: left; border: 1px solid var(--brassd); border-radius: 10px; background: linear-gradient(#fbf2d6, #ecdcae); color: var(--ink); font-weight: 700; }
.menu-item .ic { color: var(--wood2); width: 26px; height: 26px; }
.menu-item small { display: block; font-weight: 400; color: var(--ink2); font-size: 14px; }
.menu-item .grow { flex: 1 1 0; min-width: 0; }
.menu-item:active { filter: brightness(.95); }
.switch { flex: none; width: 60px; height: var(--tap); background: none; border: 0; position: relative; padding: 0; }
.switch::before { content: ''; position: absolute; left: 3px; right: 3px; top: 6px; bottom: 6px; border-radius: 16px; background: #8a7a5e; border: 2px solid var(--wood2); transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 9px; left: 6px; width: 26px; height: 26px; border-radius: 50%; background: #f8efd6; box-shadow: 0 1px 3px #0006; transition: transform .2s; }
.switch[aria-checked="true"]::before { background: var(--green); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.row-set { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 4px 0; border-bottom: 1px dotted #8a6a2855; }
.row-set .grow { flex: 1 1 0; min-width: 0; }
.row-set small { display: block; color: var(--ink2); font-size: 14px; }
.credits { text-align: center; }
.credits .logo { width: 72px; height: 72px; margin: 4px auto 6px; display: block; }
.credits h3 { font-family: var(--font-title); font-weight: 400; margin: 6px 0 2px; font-size: 22px; }
.credits p { margin: 4px 0; }
.lic { text-align: left; margin-top: 10px; }
.lic details { border: 1px solid var(--parch3); border-radius: 8px; margin-bottom: 6px; background: #fbf2d6; }
.lic summary { min-height: var(--tap); display: flex; align-items: center; padding: 0 10px; font-weight: 700; cursor: pointer; }
.lic ul { margin: 0; padding: 0 10px 8px 26px; font-size: 14px; }
.lic li { margin-bottom: 6px; }

/* ───────── Códice ───────── */
.cx-top { flex: none; padding: 8px max(10px, var(--sar)) 6px max(10px, var(--sal)); background: var(--parch2); border-bottom: 1px solid var(--parch3); }
.cx-search { position: relative; }
.cx-search input { width: 100%; min-height: var(--tap); padding: 0 12px 0 40px; border: 1px solid var(--brassd); border-radius: 22px; background: #fbf5e2; color: var(--ink); font-size: 16px; -webkit-user-select: text; user-select: text; }
.cx-search .ic { position: absolute; left: 12px; top: 50%; margin-top: -0.65em; color: var(--ink2); pointer-events: none; }
.cx-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; padding: 8px 0 2px; }
.cx-filters::-webkit-scrollbar { display: none; }
.fchip { flex: none; min-height: var(--tap); padding: 0 12px; border-radius: 19px; border: 1px solid var(--brassd); background: #fbf2d6; color: var(--ink); font-size: 14px; font-weight: 700; }
.fchip[aria-pressed="true"] { background: var(--wood2); color: var(--brass2); border-color: var(--wood3); }
.cx-count { font-size: 14px; color: var(--ink2); padding: 4px 2px 0; }
.cx-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cx-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 10px; text-align: left; border-radius: 10px; border: 1px solid var(--parch3); background: #fbf2d6; color: var(--ink); position: relative; }
.cx-item:active { filter: brightness(.95); }
.cx-item .ic.cat { width: 24px; height: 24px; color: var(--wood2); }
.cx-item .grow { flex: 1 1 0; min-width: 0; }
.cx-item b { font-family: var(--font-title); font-weight: 400; font-size: 17px; line-height: 1.12; display: block; overflow-wrap: anywhere; }
.cx-item small { color: var(--ink2); font-size: 14px; display: block; }
.cx-item.locked { background: #d9c79c; border-style: dashed; color: #6d5a3a; }
.cx-item.locked b { letter-spacing: .25em; }
.newtag { display: inline-block; vertical-align: middle; margin-left: 8px; font-family: var(--font); font-size: 14px; font-weight: 700; padding: 0 6px; border-radius: 8px; background: var(--red); color: #fff; letter-spacing: 0; }
.cx-sep { margin: 12px 0 6px; font-size: 14px; color: var(--ink2); font-style: italic; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 7px; border-radius: 14px; font-size: 14px; font-weight: 700; line-height: 1.1; border: 1.5px solid; }
.badge .ic { width: 1.15em; height: 1.15em; }
.badge.confirmado { background: #e1efd8; color: #264d22; border-color: #3d6b3a; }
.badge.probable { background: #f6e8bd; color: #6d4a07; border-color: #a8741a; }
.badge.dudoso { background: #f3d7d0; color: #7a1f17; border-color: #9a2a22; }
.badge.sm { font-size: 14px; padding: 1px 7px 1px 5px; }

.cx-detail h2 { font-family: var(--font-title); font-weight: 400; font-size: clamp(24px, 7vw, 30px); line-height: 1.08; margin: 4px 0 4px; color: var(--wood3); overflow-wrap: anywhere; }
.cx-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--ink2); font-size: 14px; margin-bottom: 10px; }
.cx-fig { margin: 0 0 12px; border: 1px solid var(--brassd); border-radius: 6px; overflow: hidden; background: var(--parch3); }
.cx-fig img { display: block; width: 100%; max-height: 38vh; object-fit: contain; background: #2a1c10; }
.cx-fig figcaption { padding: 6px 10px; font-size: 14px; line-height: 1.3; color: var(--ink2); background: #efe0b4; }
.cx-fig figcaption a { color: var(--wood2); font-weight: 700; }
.cx-lead { font-size: 17px; font-style: italic; line-height: 1.4; margin: 6px 0 10px; color: var(--ink); }
.cx-body { font-size: 16px; line-height: 1.55; -webkit-user-select: text; user-select: text; }
.cx-body p { margin: 0 0 10px; }
.cx-cert .badge { align-self: flex-start; }
.cx-cert { border-radius: 8px; padding: 8px 10px; margin: 10px 0; font-size: 14px; display: flex; flex-direction: column; gap: 6px; border: 1px dashed; }
.cx-cert.confirmado { background: #edf5e6; border-color: #3d6b3a; }
.cx-cert.probable { background: #faf0cf; border-color: #a8741a; }
.cx-cert.dudoso { background: #f8e3dd; border-color: #9a2a22; }
.cx-did { margin: 12px 0; padding: 10px 12px 10px 14px; border-left: 5px solid var(--brass); background: #f8eec9; border-radius: 0 8px 8px 0; }
.cx-did strong { display: block; font-family: var(--font-title); font-weight: 400; font-size: 17px; color: var(--wood2); }
.cx-src { margin: 0; padding: 0; list-style: none; }
.cx-src li { margin: 0; }
.cx-src a { display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 4px 0; color: #1d4d6b; font-weight: 700; text-decoration: underline; overflow-wrap: anywhere; }
.cx-rel { display: flex; flex-wrap: wrap; gap: 6px; }

/* ───────── Avisos, tarjetas didácticas y diálogos ───────── */
.toasts { position: absolute; left: 0; right: 0; top: calc(var(--hud-h) + 6px); z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 max(10px, var(--sar)) 0 max(10px, var(--sal)); }
.toast { pointer-events: auto; max-width: min(100%, 440px); padding: 9px 14px; border-radius: 10px; background: #2c1f14ee; color: var(--light); border: 1px solid var(--brassd); border-left: 6px solid var(--brass); box-shadow: 0 3px 12px #0008; font-size: 14.5px; line-height: 1.3; animation: toastin .25s ease; overflow-wrap: anywhere; }
.toast.ok { border-left-color: #6fb065; }
.toast.warn { border-left-color: #e0813a; background: #3a1e14ee; }
.toast.hist { border-left-color: #e8c46f; font-style: italic; }
@keyframes toastin { from { transform: translateY(-10px); opacity: 0; } }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .3s; }
.cxcard { pointer-events: auto; width: min(100%, 440px); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; padding: 10px 6px 10px 12px; border-radius: 12px; border: 2px solid var(--brass); box-shadow: 0 4px 16px #000a; animation: toastin .3s ease; }
.cxcard .ic { color: var(--red); width: 28px; height: 28px; margin-top: 2px; }
.cxcard h4 { margin: 0; font-family: var(--font-title); font-weight: 400; font-size: 17px; line-height: 1.12; }
.cxcard small { display: block; color: var(--red); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.cxcard p { margin: 3px 0 0; font-size: 14px; line-height: 1.3; }
.cxcard .acts { grid-column: 2 / -1; display: flex; gap: 6px; margin-top: 4px; }
.cxcard .ibtn { color: var(--ink); width: 44px; height: 44px; }

.modal-layer { position: absolute; inset: 0; z-index: 60; display: none; place-items: center; padding: max(12px, var(--sat)) max(12px, var(--sar)) max(12px, var(--sab)) max(12px, var(--sal)); background: rgba(14, 8, 3, .66); pointer-events: auto; }
.modal-layer.on { display: grid; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.modal { width: min(100%, 460px); max-height: 100%; display: flex; flex-direction: column; border-radius: 14px; border: 3px double var(--brassd); box-shadow: 0 10px 40px #000c; overflow: hidden; animation: pop .25s ease; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 14px 16px 6px; }
.modal-body h3 { margin: 0 0 4px; font-family: var(--font-title); font-weight: 400; font-size: clamp(22px, 6.4vw, 27px); line-height: 1.1; color: var(--wood3); }
.modal-body .kicker { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--red); margin-bottom: 4px; }
.modal-body img.hero { display: block; width: 100%; max-height: 28vh; object-fit: contain; background: #2a1c10; border: 1px solid var(--brassd); border-radius: 6px; margin: 8px 0; }
.modal-body p { margin: 6px 0; }
.modal-foot { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 14px; }
.modal-foot .btn { flex: 1 1 130px; }

/* Final de partida */
.over .modal-body { text-align: center; }
.score { font-family: var(--font-title); font-size: 56px; line-height: 1; color: var(--red); margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.over .kv { text-align: left; margin-top: 10px; }

/* ───────── Tutorial ───────── */
.tour { position: absolute; inset: 0; z-index: 70; pointer-events: none; }
.tour-spot { position: absolute; border-radius: 12px; border: 3px solid var(--brass2); box-shadow: 0 0 0 9999px rgba(12, 7, 2, .6), 0 0 18px 4px #e8c46fcc; transition: left .25s, top .25s, width .25s, height .25s; pointer-events: none; }
.tour-spot.none { border-color: transparent; box-shadow: 0 0 0 9999px rgba(12, 7, 2, .45); left: 50%; top: 50%; width: 0; height: 0; }
.tour-card { position: absolute; width: min(calc(100% - 20px), 360px); pointer-events: auto; border: 2px solid var(--brass); border-radius: 12px; padding: 12px 14px 10px; box-shadow: 0 8px 28px #000c; transition: top .25s, left .25s; }
.tour-card h4 { margin: 0 0 4px; font-family: var(--font-title); font-weight: 400; font-size: 20px; color: var(--wood3); line-height: 1.1; }
.tour-card p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.4; }
.tour-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tour-foot { justify-content: flex-end; }
.tour-foot .skip { margin-right: auto; padding: 0; }
.tour-foot .btn { min-height: var(--tap); padding: 0 14px; }
.tour-foot .skip { background: none; border: 0; box-shadow: none; color: var(--ink2); text-decoration: underline; font-weight: 400; }
.tour-dots { display: flex; gap: 4px; margin: 0 0 6px; }
.tour-dots i { width: 14px; height: 4px; border-radius: 2px; background: var(--parch3); }
.tour-dots i.on { background: var(--red); }
.tour-dots i.done { background: var(--brass); }

/* ───────── Escritorio ancho: hojas como panel lateral ───────── */
@media (min-width: 760px) and (min-height: 521px) {
  .hud { max-width: 640px; }
  .nav { left: 50%; right: auto; width: min(560px, 100%); transform: translateX(-50%); border-radius: 14px 14px 0 0; border: 2px solid var(--brass); border-bottom: 0; }
  .sheet { left: auto; right: 12px; width: min(440px, calc(100% - 24px)); bottom: calc(var(--nav-h) + var(--sab)); border-radius: 14px 14px 0 0; }
  .sheet.full { right: 0; left: 0; width: auto; border-radius: 0; }
  .sheet.full > * { width: 100%; max-width: 820px; margin-left: auto; margin-right: auto; }
  .sheet.full { background: var(--parch); }
  .sheet.full .sheet-head { max-width: none; padding-left: max(12px, calc((100% - 820px) / 2 + 12px)); padding-right: max(6px, calc((100% - 820px) / 2 + 6px)); }
  .sheet.full .sheet-body, .sheet.full .cx-top { max-width: none; }
  .sheet.full .sheet-body { padding-left: max(12px, calc((100% - 820px) / 2)); padding-right: max(12px, calc((100% - 820px) / 2)); }
  .sheet.full .cx-top { padding-left: max(10px, calc((100% - 820px) / 2)); padding-right: max(10px, calc((100% - 820px) / 2)); }
  .pbar, .obj { left: 50%; right: auto; width: 520px; transform: translateX(-50%); margin: 0; }
  .obj.away { transform: translateX(-50%) translateY(24px); }
  .toasts { top: calc(var(--hud-h) + 6px); }
}

/* ───────── Apaisado en móvil (poca altura): barra lateral y hoja a la derecha ───────── */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --nav-h: 0px; --rail: 62px; }
  .bubbles { clip-path: inset(var(--hud-h) 0 0 calc(var(--rail) + var(--sal))); }
  .nav { top: 0; bottom: 0; height: auto; left: 0; right: auto; width: calc(var(--rail) + var(--sal)); min-height: 0; flex-direction: column; padding: max(4px, var(--sat)) 0 max(4px, var(--sab)) var(--sal); border-top: 0; border-right: 2px solid var(--brass); box-shadow: 3px 0 10px #0007; }
  .nav button { min-height: 52px; max-height: none; flex: 1 1 0; }
  .nav button .ic { width: 22px; height: 22px; }
  .nav button span { font-size: 14px; }
  .nav .dot { right: 8px; }
  .obj { left: calc(var(--rail) + var(--sal) + 8px); right: auto; width: min(420px, calc(100% - var(--rail) - 24px)); margin: 0; bottom: 8px; padding: 5px 8px 7px; }
  .obj-t { -webkit-line-clamp: 2; font-size: 15px; }
  .obj-body small { display: none; }
  .fab.center { top: calc(var(--hud-h) + 4px); }
  .hud { left: calc(var(--rail) + var(--sal)); padding-left: 8px; flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 4px 6px; right: 0; }
  .hud-top { flex: 0 1 auto; }
  .hud-date { flex: 0 1 220px; }
  .hud-chips { flex: 1 1 100%; min-width: 0; margin: 0; padding-left: 0; padding-right: 0; }
  .sheet-layer { left: calc(var(--rail) + var(--sal)); }
  .sheet { left: auto; right: 0; top: calc(var(--hud-h) - 6px); bottom: 0; width: min(46vw, 420px); height: auto !important; max-height: none; border-radius: 14px 0 0 0; border: 2px solid var(--brass); border-right: 0; border-bottom: 0; margin-bottom: 0; transform: translateX(105%); }
  .sheet.show { transform: none; }
  .sheet.full { left: 0; top: 0; width: auto; border: 0; border-radius: 0; z-index: 2; }
  .sheet.full { margin-left: calc(-1 * (var(--rail) + var(--sal))); }
  .sheet-head { min-height: 44px; }
  .sheet-head .ibtn.txt .lbl { display: none; } .sheet-head .ibtn.txt { width: var(--tap); padding: 0; justify-content: center; }
  .sheet-head::before { display: none; }
  .sheet-title { padding-top: 0; font-size: 19px; }
  .pbar { bottom: 8px; left: calc(var(--rail) + var(--sal) + 8px); right: auto; width: min(460px, calc(100% - var(--rail) - 24px)); margin: 0; padding: 6px 8px; gap: 4px; }
  .pbar-b .btn { min-height: 44px; }

  .toasts { top: calc(var(--hud-h) + 4px); left: calc(var(--rail) + var(--sal)); }
  .modal-layer { padding-top: 6px; padding-bottom: 6px; }
  .modal { max-height: 100%; }
  .modal-body img.hero { max-height: 22vh; }
  .tour-card { width: min(calc(100% - 100px), 340px); }
}

/* ───────── Reducir animaciones ───────── */
body.rm *, body.rm *::before, body.rm *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  #ui *, #ui *::before, #ui *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
/* Pantallas muy estrechas (<340 px) */
@media (max-width: 340px) {
  .spd { width: 40px; }
  .chip { padding: 0 8px; font-size: 14px; }
}

/* ───────── Burbujas de aviso sobre los edificios ───────── */
.bubbles { position: absolute; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; clip-path: inset(var(--hud-h) 0 calc(var(--nav-h) + var(--sab)) var(--rail, 0px)); }
.bubble { position: absolute; left: 0; top: 0; pointer-events: auto; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 2px solid #fff; background: var(--amber); color: #fff; box-shadow: 0 2px 8px #000a; will-change: transform; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
.bubble .ic { width: 24px; height: 24px; }
.bubble.k-sin_materia, .bubble.k-sin_salida { background: var(--red); }
.bubble.k-sin_trabajadores { background: #1f4a5e; }
.bubble.k-lleno { background: #6b4a8a; }
.bubble.k-sin_recurso { background: #6a5a3a; }
.bubble.new { animation: bounce 1s ease 2; }
@keyframes bounce { 50% { margin-top: -10px; } }
.bubble .bl { display: none; }
.bubble.lead .bl { display: block; position: absolute; top: 100%; margin-top: 8px; left: 50%; transform: translateX(-50%); width: max-content; max-width: 150px; padding: 2px 8px; border-radius: 8px; background: #2c1f14ee; color: var(--light); font-size: 14px; line-height: 1.2; pointer-events: none; text-align: center; }
.alertline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 8px; border-radius: 10px; background: #f3d7d0; color: #7a1f17; border: 1px solid #9a2a22; font-weight: 700; }
.alertline span { flex: 1 1 140px; }
.more-btn { margin-top: 6px; }
.lines.more { margin-top: 4px; padding-top: 6px; border-top: 1px dotted #8a6a2866; }
.toast.tap { cursor: pointer; border-left-color: var(--brass2); }

/* Flota simplificada */
.cover { padding: 4px 0 2px; }
.cover-n { display: flex; align-items: baseline; gap: 10px; }
.cover-n b { font-family: var(--font-title); font-weight: 400; font-size: 44px; line-height: 1; color: var(--wood2); font-variant-numeric: tabular-nums; }
.cover-n span { flex: 1 1 0; min-width: 0; font-size: 16px; line-height: 1.2; }
.cover .bar { height: 14px; margin-top: 8px; border-radius: 7px; }
.miss { display: flex; flex-direction: column; gap: 6px; }
.miss-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: #fbf2d6; border: 1px solid var(--parch3); min-height: 56px; }
.miss-row .grow { flex: 1 1 0; min-width: 0; }
.miss-row b { display: block; line-height: 1.15; }
.miss-row small { display: block; color: var(--ink2); font-size: 14px; line-height: 1.2; }

/* Pantalla de inicio */
.intro { position: absolute; inset: 0; z-index: 55; display: grid; place-items: center; padding: max(12px, var(--sat)) max(12px, var(--sar)) max(12px, var(--sab)) max(12px, var(--sal)); pointer-events: auto;
  background: radial-gradient(ellipse at 50% 35%, rgba(42, 63, 76, .78), rgba(12, 22, 30, .92) 75%); transition: opacity .4s; }
.intro.out { opacity: 0; pointer-events: none; }
.intro-box { width: min(100%, 380px); max-height: 100%; overflow-y: auto; text-align: center; padding: 18px 18px 14px; border-radius: 16px; border: 3px double var(--brassd); box-shadow: 0 10px 40px #000c; }
.intro-box .logo { width: 64px; height: 64px; display: block; margin: 0 auto 4px; }
.intro-box h1 { margin: 0; font-family: var(--font-title); font-weight: 400; font-size: clamp(30px, 9vw, 40px); color: var(--wood3); line-height: 1.05; }
.intro-box .sub { margin: 2px 0 14px; font-style: italic; color: var(--ink2); font-size: 16px; }
.intro-btns { display: flex; flex-direction: column; gap: 8px; }
.btn.big { min-height: 52px; font-size: 17px; width: 100%; }
.intro-box .cred { margin: 14px 0 0; font-size: 14px; color: var(--ink2); }

/* Pistas de un toque y guía */
.hint { position: absolute; z-index: 66; pointer-events: auto; padding: 10px 12px; border: 2px solid var(--brass); border-radius: 12px; box-shadow: 0 6px 22px #000b; }
.hint p { margin: 0 0 8px; font-size: 15px; line-height: 1.35; }
.hint-b { display: flex; gap: 6px; justify-content: flex-end; }
.hint-ring { position: absolute; z-index: 65; pointer-events: none; border-radius: 14px; border: 3px solid var(--brass2); box-shadow: 0 0 14px 3px #e8c46fcc; animation: ring 1.2s ease-in-out infinite; }
@keyframes ring { 50% { transform: scale(1.06); opacity: .6; } }
.guide { width: min(100%, 400px); }
.guide > .tour-dots { margin: 14px 16px 0; }
.guide-body { text-align: center; padding-top: 8px; }
.guide-pic { height: 120px; margin: 0 0 8px; border-radius: 10px; background: var(--parch3); display: grid; place-items: center; overflow: hidden; color: var(--wood2); }
.guide-pic img { width: 100%; height: 100%; object-fit: cover; }
.guide-body p { font-size: 16px; }
.guide .modal-foot .skip { flex: 0 0 auto; background: none; border: 0; box-shadow: none; text-decoration: underline; color: var(--ink2); font-weight: 400; }
.sheet-open .pbar { visibility: hidden; }

@media (orientation: landscape) and (max-height: 520px) {
  .intro-box { padding: 10px 14px; width: min(100%, 560px); }
  .intro-box .logo { display: none; }
  .intro-box h1 { font-size: 28px; }
  .intro-box .sub { margin-bottom: 8px; }
  .intro-btns { flex-direction: row; flex-wrap: wrap; }
  .intro-btns .btn.big { flex: 1 1 150px; width: auto; min-height: 48px; }
  .intro-box .cred { margin-top: 8px; }
  .cover-n b { font-size: 34px; }
  .guide-pic { height: 70px; }
  .guide-body p { font-size: 15px; }
}
