/* Kairós · estilos de la app (cargado por kairos.html). 2-space indent; tokens CSS en :root. */
  :root {
    --ent: #1d4f91;
    --dec: #76953a;
    --vor: #e8930c;
    --exp: #5b7e9e;
    --res: #a9c6cd;
    --nuc: #c8175d;
    --yellow: #f3d100;
    --navy: #1d4f91;
    --ink: #20303c;
    --ink-dim: #75807e;
    --paper: #f7f6f0;
    --paper-2: #fdfcf8;
    --line: #d9d6ca;
    --silo: #234c83;
    --print-pink: #e74e9b;
    --display: 'Unbounded', 'Archivo', sans-serif;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; min-height: 100%; }
  body {
    font-family: 'Archivo', Helvetica, sans-serif;
    color: var(--ink);
    min-height: 100vh;        /* fallback para navegadores sin dvh */
    min-height: 100dvh;       /* se ajusta al viewport VISIBLE: la barra del navegador del iPad/iOS, al mostrarse u ocultarse, ya no empuja el contenido fuera de pantalla */
    overflow-x: hidden;       /* nunca scroll horizontal */
    overflow-y: auto;         /* scroll vertical disponible si el contenido no cabe */
    -webkit-overflow-scrolling: touch;
    background-color: #c6c5bf;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.10'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  /* ---- hoja de imprenta ---- */
  .app-root {
    position: relative;
    width: min(1240px, calc(100% - 40px));
    margin: 22px auto;
    height: calc(100vh - 44px);   /* fallback sin dvh */
    height: calc(100dvh - 44px);  /* encaja en el área visible real */
    background: var(--paper);
    border-radius: 18px;
    box-shadow: 0 2px 4px rgba(40, 40, 32, 0.18), 0 22px 54px rgba(40, 40, 32, 0.32);
    display: flex; flex-direction: column;
    padding: clamp(16px, 3vh, 34px) clamp(16px, 3vw, 38px) clamp(10px, 1.6vh, 18px);
    overflow: hidden;
  }
  .print-frame {
    position: absolute; inset: 13px; pointer-events: none;
    border: 1px dashed rgba(231, 78, 155, 0.55);
    border-radius: 10px;
  }
  body.no-marks .print-frame { display: none; }

  .screen {
    flex: 1; min-height: 0;
    width: min(1100px, 100%);
    margin: 0 auto;
    padding: clamp(4px, 1vh, 10px) 0 clamp(4px, 0.8vh, 8px);
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.8vh, 18px);
  }

  /* ---- marca ---- */
  .brand-header { text-align: center; margin-top: clamp(4px, 1.6vh, 18px); }
  .brand-mark {
    font-family: var(--display);
    font-size: clamp(26px, 5vh, 46px); font-weight: 900; letter-spacing: 0.3em;
    color: var(--navy); padding-left: 0.3em;
  }
  .brand-tag {
    margin-top: clamp(4px, 1.2vh, 10px);
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(10px, 1.5vh, 13px); letter-spacing: 0.2em; color: var(--ink-dim);
    text-transform: uppercase;
  }
  .screen-hint { text-align: center; margin: 2px 0 0; font-size: clamp(12px, 1.7vh, 15px); color: var(--ink-dim); letter-spacing: 0.03em; }
  .proto-footer {
    margin-top: auto; padding: clamp(6px, 1.4vh, 18px) 0 4px; text-align: center;
    font-family: 'IBM Plex Mono', monospace; font-size: 10px;
    letter-spacing: 0.14em; color: #a39f90; text-transform: uppercase;
  }
  .proto-footer.light { color: #a39f90; }

  /* ---- placeholders ---- */
  .placeholder-stripes {
    background: repeating-linear-gradient(
      -45deg, #f0eee4, #f0eee4 10px, #e7e4d7 10px, #e7e4d7 20px
    );
    display: flex; align-items: center; justify-content: center;
  }
  .placeholder-note {
    font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.06em;
    color: #80796a; background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--line);
    padding: 4px 10px; border-radius: 3px;
  }

  /* ---- vista monumentos: naipes ---- */
  .monument-row {
    flex: 1; min-height: 0;
    display: flex; flex-wrap: wrap; gap: clamp(12px, 2vw, 26px); justify-content: center; align-items: center;
    margin-top: clamp(4px, 1vh, 14px); padding-bottom: clamp(4px, 1.5vh, 20px);
  }
  .tarot-card {
    appearance: none; cursor: pointer; color: var(--ink);
    width: clamp(150px, 18vw, 236px);
    height: min(58vh, calc(clamp(150px, 18vw, 236px) * 1.475));
    padding: clamp(8px, 1.4vh, 16px) clamp(8px, 1vw, 14px) clamp(10px, 1.6vh, 18px);
    display: flex; flex-direction: column;
    background: var(--paper-2);
    border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 1px 2px rgba(40, 40, 32, 0.10), 0 12px 26px rgba(40, 40, 32, 0.16);
    transform: rotate(var(--rot)) translateY(var(--dy));
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    position: relative;
  }
  .tarot-card::before {
    content: ''; position: absolute; inset: 6px; border-radius: 7px;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
    pointer-events: none;
  }
  .tarot-card:hover {
    transform: rotate(0deg) translateY(calc(var(--dy) - 12px)) scale(1.03);
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
    box-shadow: 0 2px 4px rgba(40, 40, 32, 0.12), 0 24px 44px rgba(40, 40, 32, 0.26);
    z-index: 2;
  }
  .tarot-numeral {
    font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.3em;
    color: var(--accent); text-align: center; padding-left: 0.3em; font-weight: 500;
  }
  .tarot-scene {
    position: relative; flex: 1; min-height: 0; margin: clamp(6px, 1.2vh, 12px) 4px clamp(8px, 1.4vh, 14px); overflow: hidden;
    border-radius: 6px;
    background:
      radial-gradient(95% 58% at 50% 104%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 76%),
      linear-gradient(180deg, #f4f2e9 0%, #edeadd 100%);
    border: 1px solid #e3e0d2;
  }
  .tarot-sun {
    position: absolute; top: 22px; right: 30px;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--accent); opacity: 0.9;
  }
  .tarot-ground {
    position: absolute; left: 0; right: 0; bottom: 0; height: 12px;
    background: color-mix(in srgb, var(--accent) 7%, #e9e6d8);
    border-top: 2px solid var(--silo);
  }
  .tarot-name { font-family: var(--display); font-size: clamp(11px, 1.6vh, 14px); font-weight: 700; text-align: center; letter-spacing: 0.04em; color: var(--navy); }
  .tarot-place {
    font-family: 'IBM Plex Mono', monospace; font-size: clamp(8px, 1.2vh, 10px); letter-spacing: 0.22em;
    text-transform: uppercase; color: var(--ink-dim); text-align: center;
    margin-top: clamp(4px, 1vh, 8px); padding-left: 0.22em;
  }

  /* ---- siluetas de los monumentos (CSS, tinta navy) ---- */
  .silo {
    position: absolute; bottom: 12px; left: 50%; width: 170px; height: 96px;
    transform: translateX(-50%) scale(var(--silo-scale, 1));
    transform-origin: bottom center;
  }
  .silo span, .silo i { background: var(--silo); }

  .col-body {
    position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 152px; height: 62px; background: var(--silo);
    clip-path: polygon(0% 100%, 0% 24%, 5% 20%, 9% 4%, 46% 0%, 50% 18%, 68% 24%, 100% 32%, 100% 100%);
    display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; padding: 0 10px 8px;
  }
  .col-row { display: flex; gap: 9px; }
  .col-row span { width: 9px; height: 14px; background: rgba(247, 246, 240, 0.82); border-radius: 5px 5px 0 0; flex: none; }
  .col-row.upper { width: 48%; }
  .col-row.upper span { height: 12px; }

  .sh-tri { position: absolute; bottom: 0; display: flex; flex-direction: column; }
  .sh-tri.a { left: 12px; width: 38px; height: 52px; }
  .sh-tri.b { left: 66px; width: 42px; height: 66px; }
  .sh-tri.c { left: 122px; width: 36px; height: 46px; }
  .sh-lintel { height: 9px; width: 100%; border-radius: 2px; }
  .sh-legs { flex: 1; display: flex; justify-content: space-between; margin-top: 3px; background: none !important; }
  .sh-legs i { width: 10px; border-radius: 1px 1px 0 0; }
  .sh-fallen { position: absolute; bottom: 1px; right: -8px; width: 26px; height: 9px; border-radius: 2px; transform: rotate(-8deg); }

  .silo-chichen span { position: absolute; left: 50%; transform: translateX(-50%); }
  .ch-step.s1 { bottom: 0; width: 144px; height: 15px; }
  .ch-step.s2 { bottom: 15px; width: 114px; height: 14px; }
  .ch-step.s3 { bottom: 29px; width: 88px; height: 13px; }
  .ch-step.s4 { bottom: 42px; width: 62px; height: 12px; }
  .ch-temple { bottom: 54px; width: 34px; height: 18px; }
  .ch-roof { bottom: 72px; width: 42px; height: 5px; }
  .ch-stair { bottom: 0; width: 18px; height: 58px; background: rgba(247, 246, 240, 0.7); z-index: 1; }

  .silo-taj span { position: absolute; }
  .tj-base { bottom: 0; left: 50%; transform: translateX(-50%); width: 152px; height: 9px; }
  .tj-body { bottom: 9px; left: 50%; transform: translateX(-50%); width: 66px; height: 34px; }
  .tj-dome { bottom: 40px; left: 50%; transform: translateX(-50%); width: 46px; height: 42px; border-radius: 50% 50% 46% 46%; }
  .tj-finial { bottom: 80px; left: 50%; transform: translateX(-50%); width: 3px; height: 12px; }
  .tj-arch { bottom: 11px; left: 50%; transform: translateX(-50%); width: 14px; height: 22px; background: rgba(247, 246, 240, 0.82); border-radius: 7px 7px 0 0; z-index: 1; }
  .tj-min { bottom: 9px; width: 7px; height: 56px; border-radius: 3px 3px 0 0; }
  .tj-min.l { left: 16px; }
  .tj-min.r { right: 16px; }
  .tj-min::after {
    content: ''; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
    width: 11px; height: 6px; background: var(--silo); border-radius: 50% 50% 0 0;
  }

  /* ---- botones genéricos ---- */
  .ghost-btn {
    appearance: none; border: 1.5px solid var(--navy); background: #fff;
    color: var(--navy); font: 700 13px 'Archivo', sans-serif; letter-spacing: 0.04em;
    padding: 8px 18px; border-radius: 999px; cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .ghost-btn:hover { background: var(--navy); color: #fff; }
  .ghost-btn.light { border-color: var(--navy); color: var(--navy); }
  .ghost-btn.light:hover { background: var(--navy); color: #fff; }
  .primary-btn {
    appearance: none; border: none; background: var(--navy); color: #fff;
    font: 700 15px 'Archivo', sans-serif; letter-spacing: 0.05em;
    padding: 12px 36px; border-radius: 999px; cursor: pointer;
  }
  .primary-btn:hover { filter: brightness(1.15); }

  /* ---- tablero ---- */
  .board-topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-top: 4px; }
  .board-topbar .ghost-btn { justify-self: start; }
  .board-monument {
    justify-self: end; font-family: var(--display); font-weight: 700; font-size: 12px;
    letter-spacing: 0.16em; text-transform: uppercase; color: var(--navy);
  }
  .time-pill {
    appearance: none; cursor: pointer;
    display: flex; align-items: center; gap: 14px;
    background: #fff; border: 3px solid var(--yellow); border-radius: 999px;
    padding: 7px 24px;
    box-shadow: 0 2px 6px rgba(40, 40, 32, 0.14);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
  }
  .time-pill:hover { box-shadow: 0 5px 14px rgba(40, 40, 32, 0.2); transform: translateY(-1px); }
  .time-pill-label {
    font: 700 11px 'Archivo', sans-serif; text-transform: uppercase;
    letter-spacing: 0.18em; color: var(--ink-dim);
  }
  .time-pill-value { font: 500 23px 'IBM Plex Mono', monospace; color: var(--ink); }
  .time-pill.running .time-pill-value { color: var(--navy); font-weight: 500; }

  .stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 1.4vw, 16px); }
  .stat-square {
    background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px;
    padding: clamp(8px, 1.4vh, 13px) clamp(10px, 1.4vw, 17px); box-shadow: 0 1px 2px rgba(40, 40, 32, 0.08), 0 6px 16px rgba(40, 40, 32, 0.08);
  }
  .stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
  .stat-id {
    font-family: var(--display); font-size: 12px; font-weight: 700;
    letter-spacing: 0.16em; color: var(--navy); text-transform: uppercase;
  }
  /* steppers manuales del tracker (ajuste a mano, p.ej. recibir materia de otro equipo) */
  .stat-steppers { display: inline-flex; gap: 4px; flex: none; }
  .stat-step {
    appearance: none; width: 24px; height: 24px; border-radius: 7px;
    border: 1.5px solid var(--line); background: var(--paper-2); color: var(--navy);
    font-size: 15px; font-weight: 700; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; padding: 0;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
  }
  .stat-step:hover:not(:disabled) { background: var(--navy); color: #fff; border-color: var(--navy); }
  .stat-step:disabled { opacity: 0.32; cursor: default; }
  .stat-value { font-family: var(--display); font-size: clamp(20px, 3.4vh, 32px); font-weight: 700; line-height: 1.25; margin-top: 3px; color: var(--ink); }
  .stat-max { font-size: 14px; font-weight: 500; color: var(--ink-dim); margin-left: 4px; }
  .stat-track { height: 8px; border-radius: 4px; background: #e8e5d9; margin-top: 9px; overflow: hidden; position: relative; }
  .stat-fill { height: 100%; background: var(--navy); }
  .stat-track::after {
    content: ''; position: absolute; inset: 0;
    background: repeating-linear-gradient(90deg,
      transparent 0, transparent calc(10% - 2px),
      var(--paper-2) calc(10% - 2px), var(--paper-2) 10%);
  }
  .stat-label { margin-top: 9px; font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }

  .board-main { display: grid; grid-template-columns: 1fr; flex: 1; min-height: 0; }
  .node-panel {
    position: relative; background: var(--paper-2); border: 1px solid var(--line);
    border-radius: 12px; box-shadow: 0 1px 2px rgba(40, 40, 32, 0.08), 0 10px 26px rgba(40, 40, 32, 0.10);
    min-height: 240px; height: 100%; overflow: hidden;
  }
  .zone-bands { position: absolute; inset: 0; display: flex; flex-direction: column; pointer-events: none; }
  .zone { position: relative; flex: 1; }
  .zone.z1 { background: rgba(118, 149, 58, 0.10); }
  .zone.z2 { background: rgba(91, 126, 158, 0.10); border-top: 1px dashed rgba(32, 48, 60, 0.14); }
  .zone.z3 { background: rgba(140, 130, 112, 0.13); border-top: 1px dashed rgba(32, 48, 60, 0.14); }
  .zone span {
    position: absolute; left: 9px; top: 50%;
    writing-mode: vertical-rl; transform: translateY(-50%) rotate(180deg);
    font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: 0.3em;
    text-transform: uppercase; color: rgba(32, 48, 60, 0.34);
  }
  .node-links { position: absolute; inset: 0; width: 100%; height: 100%; }
  .node-links line { stroke: #b8b5a7; stroke-width: 0.4; }
  .node-circle {
    position: absolute; transform: translate(-50%, -50%);
    width: clamp(60px, 9vh, 86px); height: clamp(60px, 9vh, 86px); border-radius: 50%; border: none; cursor: pointer;
    color: #fff; font: 700 clamp(10px, 1.4vh, 12px) var(--display); letter-spacing: 0.08em;
    box-shadow: 0 0 0 4px var(--paper-2), 0 3px 8px rgba(40, 40, 32, 0.28);
    transition: transform 0.14s ease, box-shadow 0.14s ease;
  }
  .node-circle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 0 4px var(--paper-2), 0 8px 18px rgba(40, 40, 32, 0.32);
  }
  .node-circle.dark-text { color: var(--ink); }

  .sprint-box {
    position: absolute; left: 18px; bottom: 16px;
    background: #fff; border: 1.5px solid var(--ink); border-radius: 12px;
    padding: 10px 16px 12px;
    box-shadow: 0 3px 10px rgba(40, 40, 32, 0.14);
  }
  .sprint-label {
    font: 700 10px 'Archivo', sans-serif; text-transform: uppercase;
    letter-spacing: 0.22em; color: var(--ink-dim);
  }
  .sprint-controls { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
  .sprint-num { font-family: var(--display); font-size: clamp(22px, 3vh, 32px); font-weight: 700; min-width: 44px; text-align: center; color: var(--ink); }
  .sprint-btn {
    appearance: none; width: 30px; height: 30px; border-radius: 50%;
    border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
    font-size: 16px; font-weight: 700; cursor: pointer; line-height: 1;
  }
  .sprint-btn:hover { background: var(--ink); color: #fff; }

  .legend {
    position: absolute; right: 16px; bottom: 16px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 12px 18px 14px;
    box-shadow: 0 3px 10px rgba(40, 40, 32, 0.12);
    display: flex; flex-direction: column; gap: 8px;
  }
  .legend-title {
    font: 700 10px 'Archivo', sans-serif; text-transform: uppercase;
    letter-spacing: 0.22em; color: var(--ink-dim); margin-bottom: 2px;
  }
  .legend-row { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--ink); }
  .legend-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }

  /* ---- cronómetro ---- */
  .timer-overlay {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(46, 44, 38, 0.5); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
  }
  .timer-card {
    position: relative; background: var(--paper);
    border: 1px solid var(--line); border-radius: 14px;
    padding: 26px 40px 32px; width: min(480px, calc(100vw - 40px));
    box-shadow: 0 30px 80px rgba(30, 28, 22, 0.45);
    display: flex; flex-direction: column; align-items: center; gap: 18px;
  }
  .timer-close { position: absolute; top: 16px; right: 16px; }
  .timer-ring-wrap { position: relative; width: 300px; height: 300px; margin-top: 16px; }
  .timer-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
  .ring-bg { fill: none; stroke: #e7e4d6; stroke-width: 12; }
  .ring-fg {
    fill: none; stroke: var(--yellow); stroke-width: 12; stroke-linecap: round;
    transition: stroke-dashoffset 0.4s linear;
  }
  .timer-readout {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font: 500 58px 'IBM Plex Mono', monospace; color: var(--ink);
  }
  .timer-presets { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
  .preset-btn {
    appearance: none; border: 1.5px solid var(--line); background: #fff;
    color: var(--ink); font: 600 13px 'IBM Plex Mono', monospace;
    padding: 7px 14px; border-radius: 999px; cursor: pointer;
  }
  .preset-btn:hover { border-color: var(--navy); color: var(--navy); }
  .preset-btn.active { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
  .timer-actions { display: flex; gap: 12px; align-items: center; }

  /* ---- cartas ---- */
  .cards-screen { padding-top: 14px; }
  .cards-topbar { display: flex; align-items: center; justify-content: space-between; }
  .cards-context {
    font-family: var(--display); font-size: 11px; letter-spacing: 0.16em;
    color: var(--ink-dim); text-transform: uppercase;
  }
  .cards-context strong { color: var(--navy); }
  .deck-stack { position: relative; width: min(560px, 100%); margin: clamp(8px, 2vh, 30px) auto clamp(6px, 1.4vh, 14px); }
  .deck-under {
    position: absolute; inset: 0; border-radius: 14px;
    background: #fff; border: 1px solid var(--line);
    box-shadow: 0 8px 22px rgba(40, 40, 32, 0.16);
    overflow: hidden;
  }
  .deck-under::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 14px;
    background: var(--accent); opacity: 0.85;
  }
  .deck-under.u1 { transform: rotate(2.2deg) translate(10px, -4px); }
  .deck-under.u2 { transform: rotate(-3.1deg) translate(-12px, 4px); }
  .deck-under.u3 { transform: rotate(5deg) translate(20px, 6px); opacity: 0.85; }
  .deck-card {
    position: relative; z-index: 1; width: 100%; margin: 0;
    transform: rotate(-0.7deg);
    background: #fff; color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 14px; overflow: hidden;
    box-shadow: 0 2px 4px rgba(40, 40, 32, 0.10), 0 26px 54px rgba(40, 40, 32, 0.26);
    padding: 0;
  }
  .deck-card-inner {
    margin: clamp(8px, 1.4vh, 14px); margin-top: 0; padding: clamp(6px, 1vh, 10px) 12px clamp(10px, 1.6vh, 16px);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-top: none; border-radius: 0 0 9px 9px;
  }
  .deck-card-head {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 12px;
    background: var(--accent); color: #fff; padding: clamp(10px, 1.8vh, 18px) 26px;
    margin: clamp(8px, 1.4vh, 14px); margin-bottom: 0; border-radius: 9px 9px 0 0;
  }
  .deck-card-glyph {
    position: absolute; right: -22px; top: 50%; transform: translateY(-50%);
    width: 92px; height: 92px; border-radius: 50%;
    border: 14px solid rgba(255, 255, 255, 0.18);
  }
  .deck-card-glyph::before {
    content: ''; position: absolute; inset: 18px; border-radius: 50%;
    border: 6px solid rgba(255, 255, 255, 0.14);
  }
  .deck-card-badge {
    background: rgba(255, 255, 255, 0.24); border-radius: 999px;
    font: 800 11px 'Archivo', sans-serif; letter-spacing: 0.12em;
    padding: 5px 12px;
  }
  .deck-card-type { font: 700 14px var(--display); letter-spacing: 0.16em; }
  .deck-card-title { margin: clamp(12px, 2vh, 20px) 14px 0; font-family: var(--display); font-size: clamp(16px, 2.3vh, 21px); font-weight: 700; line-height: 1.3; color: var(--ink); }
  .deck-card-body { margin: clamp(8px, 1.5vh, 14px) 14px 0; font-size: clamp(12.5px, 1.7vh, 15px); line-height: 1.55; color: #4d5760; }
  .deck-card-divider { height: 1px; background: var(--line); margin: clamp(12px, 2.2vh, 22px) 14px; }
  .deck-card-divider span { display: none; }
  .deck-option {
    height: clamp(40px, 6.4vh, 58px); border-radius: 8px; margin: 0 14px 10px;
    border: 1.5px dashed #cdcaba;
  }
  .deck-card-foot {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: clamp(10px, 1.8vh, 18px);
    font-family: 'IBM Plex Mono', monospace; font-size: 9px;
    letter-spacing: 0.26em; color: #a39f90; text-transform: uppercase;
  }
  .deck-card-foot-dot { display: none; }
  .deck-card-foot .dot { opacity: 0.6; }

  /* ---- cartas con datos reales (DECIDE / VÓRTICE / EXPLORA) ---- */
  .cards-screen { overflow-y: auto; min-height: 0; }
  .pre { white-space: pre-line; }

  .deck-body { display: flex; flex-direction: column; }
  .card-meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin: 0 14px clamp(6px, 1.2vh, 12px);
  }
  .meta-pill {
    font: 700 10px 'Archivo', sans-serif; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--ink);
    background: color-mix(in srgb, var(--accent) 16%, #fff);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    padding: 3px 9px; border-radius: 999px;
  }
  .meta-dim {
    font: 600 10px 'IBM Plex Mono', monospace; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--ink-dim);
  }
  .card-id {
    margin-left: auto;
    font: 500 10px 'IBM Plex Mono', monospace; letter-spacing: 0.12em;
    color: #a39f90;
  }
  .tipo-pill {
    font: 800 10px 'Archivo', sans-serif; letter-spacing: 0.12em;
    text-transform: uppercase; padding: 4px 11px; border-radius: 999px; color: #fff;
  }
  .tipo-pill.sinc { background: #4f8a3d; }
  .tipo-pill.entr { background: #c0392b; }

  .situacion { font-style: italic; color: #424c54; }

  .opt-block {
    margin: 0 14px clamp(8px, 1.4vh, 12px); padding: clamp(8px, 1.4vh, 12px) 13px;
    border: 1px solid var(--line); border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 5%, #fff);
  }
  .opt-head { display: flex; gap: 11px; align-items: flex-start; }
  .opt-letter {
    flex: none; width: 26px; height: 26px; border-radius: 50%;
    background: var(--accent); color: #fff;
    font: 800 13px var(--display); display: flex; align-items: center; justify-content: center;
  }
  .opt-text { font-size: clamp(12.5px, 1.7vh, 14.5px); line-height: 1.45; color: var(--ink); padding-top: 2px; }
  .opt-tag {
    display: inline-block; margin: 9px 0 0 37px;
    font: 600 10px 'IBM Plex Mono', monospace; letter-spacing: 0.06em;
    color: var(--ink-dim); background: #f1efe6; border: 1px solid var(--line);
    padding: 2px 8px; border-radius: 5px;
  }
  .opt-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 0 37px; align-items: center; }
  .opt-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font: 500 11px 'IBM Plex Mono', monospace; letter-spacing: 0.04em;
    padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); background: #fff;
  }
  .opt-chip b { font-weight: 700; font-size: 9px; letter-spacing: 0.1em; color: var(--ink-dim); }
  .opt-chip.pos { color: #2f7d2f; border-color: #bfe0bf; background: #f1f9f1; }
  .opt-chip.neg { color: #c0392b; border-color: #efc9c4; background: #fdf2f1; }
  .opt-chip.zero { color: #9a9384; }
  .opt-score {
    margin-left: 4px; font: 700 11px 'Archivo', sans-serif; letter-spacing: 0.04em;
    padding: 3px 10px; border-radius: 999px;
  }
  .opt-score.pos { color: #2f7d2f; background: #e7f4e7; }
  .opt-score.neg { color: #c0392b; background: #fbe9e7; }
  .opt-score.zero { color: #75807e; background: #efece3; }

  .deck-sub { margin: clamp(4px, 0.8vh, 8px) 14px 0; font-size: 13px; font-style: italic; color: #5c6670; }
  .deck-sub.closing { margin-top: clamp(8px, 1.4vh, 14px); color: var(--ink-dim); border-top: 1px dashed var(--line); padding-top: 10px; }

  .efecto-box {
    margin: clamp(8px, 1.4vh, 14px) 14px 0; padding: 11px 14px;
    background: color-mix(in srgb, var(--accent) 10%, #fff);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-left: 4px solid var(--accent); border-radius: 8px;
    font: 500 13.5px 'IBM Plex Mono', monospace; line-height: 1.5; color: var(--ink);
    display: flex; flex-direction: column; gap: 6px;
  }
  .efecto-box.accion { background: #faf7ee; border-color: var(--line); border-left-color: var(--yellow); }
  .mov-flag {
    align-self: flex-start; font: 800 10px 'Archivo', sans-serif; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--ink); background: var(--yellow);
    padding: 2px 9px; border-radius: 999px;
  }

  .deck-empty, .deck-msg {
    padding: clamp(28px, 6vh, 56px) 24px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 200px; justify-content: center;
  }
  .empty-glyph {
    width: 52px; height: 52px; border-radius: 50%;
    border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  }
  .empty-title { font: 700 16px var(--display); letter-spacing: 0.1em; color: var(--navy); margin: 0; }
  .empty-note { font: 500 12px 'IBM Plex Mono', monospace; letter-spacing: 0.04em; color: var(--ink-dim); margin: 0; }
  .deck-msg p { margin: 2px 0; color: var(--ink-dim); }
  .deck-msg.error p:first-child { color: #c0392b; font-weight: 700; }

  /* cartas especiales sin mazo: RESPIRO (propuesta) y NÚCLEO (cierre) */
  .deck-special {
    padding: clamp(26px, 5vh, 48px) clamp(20px, 4vw, 36px); text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 1.8vh, 16px);
    min-height: 220px; justify-content: center;
  }
  .special-glyph {
    width: 56px; height: 56px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: #fff; background: var(--accent);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 45%, transparent);
  }
  .respiro .special-glyph { color: var(--ink); } /* RESPIRO es claro: glifo en tinta */
  .special-kicker {
    margin: 0; font: 800 12px 'IBM Plex Mono', monospace; letter-spacing: 0.22em; text-transform: uppercase;
    color: color-mix(in srgb, var(--accent) 70%, var(--ink));
  }
  .special-lead { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(17px, 2.6vh, 22px); color: var(--ink); max-width: 26ch; }
  .special-note { margin: 2px 0 0; font-size: clamp(12.5px, 1.7vh, 14px); line-height: 1.45; color: var(--ink-dim); max-width: 34ch; }
  .special-body {
    margin: 0; max-width: 30ch; font-size: clamp(14px, 2vh, 16.5px); line-height: 1.5; color: var(--ink);
  }
  .propose-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
    width: 100%; max-width: 360px; margin-top: 4px;
  }
  .propose-chip {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    padding: 11px 12px; border-radius: 12px;
    border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--line));
    background: color-mix(in srgb, var(--accent) 10%, #fff);
    font-weight: 700; font-size: 14px; color: var(--ink);
  }
  .propose-chip b { color: color-mix(in srgb, var(--accent) 80%, var(--ink)); font-size: 16px; }
  .propose-chip .q { color: var(--ink-dim); font-weight: 700; }
  @media (max-width: 420px) { .propose-grid { grid-template-columns: 1fr; } }

  .cards-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: clamp(8px, 1.6vh, 16px); }
  .primary-btn:disabled, .ghost-btn:disabled { opacity: 0.5; cursor: default; }

  /* opciones DECIDE clicables (los puntos se revelan al elegir) */
  .opt-text { flex: 1; }
  /* el botón es flex-item con margen lateral 14px (igual que la opción ya elegida,
     que es un div): width descuenta esos 28px para NO desbordar a la derecha
     — si no, width:100% + márgenes se sale de la tarjeta */
  button.opt-block { appearance: none; font-family: inherit; text-align: left; width: calc(100% - 28px); display: block; cursor: pointer; }
  .opt-block.opt-clickable { transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease; }
  .opt-block.opt-clickable:hover {
    border-color: color-mix(in srgb, var(--accent) 75%, transparent);
    box-shadow: 0 3px 12px rgba(40, 40, 32, 0.12);
  }
  .opt-block.opt-clickable:active { transform: translateY(1px); }
  .opt-hint {
    display: inline-block; margin: 9px 0 0 37px;
    font: 600 11px 'IBM Plex Mono', monospace; letter-spacing: 0.04em; color: var(--ink-dim);
  }
  .opt-block.chosen { border-color: var(--accent); border-width: 2px; background: color-mix(in srgb, var(--accent) 12%, #fff); }
  .opt-block.passed { opacity: 0.6; }
  .opt-chosen-badge {
    margin-left: auto; flex: none; align-self: flex-start;
    font: 800 10px 'Archivo', sans-serif; letter-spacing: 0.06em; text-transform: uppercase;
    color: #fff; background: var(--accent); padding: 3px 9px; border-radius: 999px;
  }
  .decide-hint {
    text-align: center; margin: 4px 14px 0;
    font: 600 11px 'IBM Plex Mono', monospace; letter-spacing: 0.05em; color: var(--ink-dim);
  }

  /* banner "aplicado a tus trackers" (Vórtice/Explora aceptadas) */
  .applied-banner {
    display: flex; align-items: center; gap: 9px;
    margin: clamp(8px, 1.4vh, 14px) 14px 0; padding: 9px 13px;
    background: #eef6ee; border: 1px solid #bfe0bf; border-radius: 9px;
    font-size: 12.5px; color: #2f6d2f; line-height: 1.4;
  }
  .applied-banner b { color: #245724; }
  .applied-check {
    flex: none; width: 20px; height: 20px; border-radius: 50%;
    background: #4f8a3d; color: #fff; font-size: 12px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
  }
  .applied-note { color: #5c6670; font-style: italic; }

  /* ===================== Sala · lobby (crear / entrar) ===================== */
  .lobby-screen { justify-content: flex-start; }
  .lobby-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(14px, 2.4vw, 26px);
    width: min(820px, 100%); margin: clamp(10px, 2.6vh, 30px) auto 0;
  }
  .lobby-card {
    display: flex; flex-direction: column; align-items: flex-start;
    background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 16px;
    padding: clamp(18px, 2.6vw, 30px);
    box-shadow: 0 2px 4px rgba(40, 40, 32, 0.06);
  }
  .lobby-card.create { border-color: color-mix(in srgb, var(--navy) 35%, var(--line)); }
  .lobby-card-icon {
    width: 50px; height: 50px; margin-bottom: 14px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; line-height: 1; color: var(--navy);
    background: color-mix(in srgb, var(--navy) 10%, #fff);
  }
  .lobby-card.join .lobby-card-icon { color: var(--vor); background: color-mix(in srgb, var(--vor) 12%, #fff); }
  .lobby-card-title {
    margin: 0 0 6px; font-family: var(--display); font-weight: 700;
    font-size: clamp(18px, 2.4vh, 23px); color: var(--ink); letter-spacing: 0.01em;
  }
  .lobby-card-desc { margin: 0 0 18px; font-size: 13.5px; line-height: 1.5; color: var(--ink-dim); }
  .lobby-card .lobby-btn { width: 100%; margin-top: auto; }
  .lobby-join { display: flex; gap: 10px; width: 100%; margin-top: auto; }
  .lobby-join .lobby-btn { width: auto; flex: none; }
  .lobby-input {
    flex: 1; min-width: 0; appearance: none; text-align: center;
    border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 18px; background: #fff;
    font: 700 18px 'IBM Plex Mono', monospace; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink);
  }
  .lobby-input:focus { outline: none; border-color: var(--navy); }
  .lobby-input::placeholder { color: #bdb9ac; letter-spacing: 0.16em; }
  .lobby-error { text-align: center; margin: 14px auto 0; max-width: 520px; color: var(--nuc); font-size: 13px; font-weight: 600; }
  @media (max-width: 680px) { .lobby-grid { grid-template-columns: 1fr; } }

  /* ===================== Barra de sala (dentro de la partida) ===================== */
  .room-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 0 0 6px; padding: 0 0 10px; border-bottom: 1px solid var(--line);
  }
  .room-bar-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .room-bar-label { font: 600 10px 'IBM Plex Mono', monospace; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-dim); }
  .room-bar-code { font-family: var(--display); font-weight: 700; font-size: clamp(17px, 2.3vh, 23px); letter-spacing: 0.18em; color: var(--navy); }
  .room-bar-live { display: inline-flex; align-items: center; gap: 6px; font: 600 10px 'IBM Plex Mono', monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
  .room-bar-dot { width: 8px; height: 8px; border-radius: 50%; background: #bdb9ac; }
  .room-bar-live.on .room-bar-dot { background: #4f8a3d; animation: room-pulse 2s infinite; }
  .room-bar-live.off { color: var(--nuc); }
  .room-bar-live.off .room-bar-dot { background: var(--nuc); }
  @keyframes room-pulse {
    0% { box-shadow: 0 0 0 0 rgba(79, 138, 61, 0.45); }
    70% { box-shadow: 0 0 0 6px rgba(79, 138, 61, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 138, 61, 0); }
  }
  .room-bar-leave { padding: 5px 14px; font-size: 12px; }
  @media (max-width: 480px) {
    /* ocultamos el TEXTO pero conservamos el punto de color (señal de conexión) */
    .room-bar-live { font-size: 0; gap: 0; }
    .room-bar-leave { padding: 5px 12px; }
  }

  @media (max-width: 1100px) {
    .silo { --silo-scale: 0.78; }
  }
  @media (max-width: 860px) {
    .silo { --silo-scale: 0.6; }
    .monument-row { gap: 12px; }
    .tarot-card { width: clamp(130px, 22vw, 200px); }
  }
  @media (max-width: 760px) {
    body { overflow: auto; }
    .app-root { width: calc(100% - 16px); margin: 8px auto; height: auto; min-height: calc(100vh - 16px); min-height: calc(100dvh - 16px); padding: 26px 16px 14px; }
    .monument-row { flex-wrap: wrap; }
    .tarot-card { width: clamp(140px, 42vw, 200px); height: auto; min-height: 230px; }
    .tarot-scene { min-height: 110px; }
    .silo { --silo-scale: 0.62; }
    .stat-row { grid-template-columns: repeat(2, 1fr); }
    .board-topbar { grid-template-columns: 1fr; justify-items: center; }
    .board-topbar .ghost-btn { justify-self: center; }
    .board-monument { justify-self: center; }
    .legend { position: static; margin: 0 18px 16px auto; width: max-content; }
    .sprint-box { position: static; margin: 16px 18px 0; width: max-content; }
    .node-panel { display: flex; flex-direction: column; min-height: 380px; }
    .brand-mark { font-size: 30px; }
  }

  /* ── iPad / tablets táctiles (más anchas que el móvil) ──
     El chrome del navegador (barra de búsqueda) aparece/desaparece y cambia
     la altura visible. Aquí la hoja se ajusta al área visible (dvh) y, si el
     contenido no cabe, la hoja CRECE y la página hace scroll en lugar de
     recortarse. Así funcionan a la vez el scroll y el autoajuste. */
  @media (min-width: 761px) and (pointer: coarse) {
    body { min-height: 100dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .app-root {
      height: auto;
      min-height: calc(100dvh - 44px);   /* mínimo = alto visible; puede crecer */
    }
    .board-main { min-height: 58dvh; }
    .node-panel { min-height: 440px; }   /* sitio para casillas, leyenda y sprint */
  }
