/* Caça-interferência */
.ci { max-width: 640px; margin: 0 auto; }
.ci-intro { text-align: center; }
.ci-intro h2 { margin: 6px 0 4px; }
.ci-how { text-align: left; max-width: 430px; margin: 14px auto 18px; padding-left: 22px; display: grid; gap: 8px; line-height: 1.4; }
.ci-how .g { color: #16a34a; font-weight: 800; } .ci-how .r { color: #dc2626; font-weight: 800; }

.ci-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; }
.ci-phase { font-size: 14px; color: var(--pf-muted); min-width: 0; }
.ci-phase b { color: var(--pf-ink); }
.ci-score { color: var(--brand-text); white-space: nowrap; }
.ci-timer { position: relative; height: 22px; border-radius: 999px; background: var(--pf-track); overflow: hidden; margin: 10px 0 12px; }
.ci-timer i { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 999px; }
.ci-timer span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--pf-ink); font-variant-numeric: tabular-nums; text-shadow: 0 0 4px var(--pf-card); }
.ci-timer.low i { background: var(--pf-bad, #dc2626); animation: ci-pulse .6s ease-in-out infinite; }
@keyframes ci-pulse { 50% { opacity: .55; } }

.ci-board-wrap { position: relative; display: grid; place-items: center; }
/* a planta é sempre clara (como papel), nos dois temas: as cores do mapa de calor dependem disso */
.ci-board { position: relative; width: min(100%, calc((100vh - 300px) * 100 / var(--h))); min-width: min(100%, 260px); aspect-ratio: 100 / var(--h); border-radius: 10px; background: #f8fafc; border: 4px solid #334155; overflow: hidden; touch-action: none; user-select: none; cursor: crosshair; }
.ci-heat { position: absolute; inset: 0; width: 100%; height: 100%; filter: blur(5px) saturate(1.1); transform: scale(1.04); }
.ci-plan { position: absolute; inset: 0; width: 100%; height: 100%; }
.ci-plan .wall { stroke: #334155; stroke-width: 1.6; stroke-linecap: round; vector-effect: none; }
.ci-plan .wall.thick { stroke-width: 2.8; stroke: #1e293b; }
.ci-plan .ring { fill: rgba(15, 23, 42, .1); stroke: rgba(15, 23, 42, .55); stroke-width: .5; stroke-dasharray: 1.6 1.4; transition: opacity .2s; }
.ci-plan .ring.barreira { fill: rgba(30, 64, 175, .12); }
.ci-plan .ring.off { opacity: 0; }
.ci-label { position: absolute; transform: translate(-50%, -50%); font-size: clamp(9px, 2.4vw, 12px); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: rgba(15, 23, 42, .55); white-space: nowrap; pointer-events: none; }
.ci-villain, .ci-router { position: absolute; transform: translate(-50%, -50%); border: 0; padding: 0; background: none; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ci-villain span { display: grid; place-items: center; width: clamp(34px, 9.5vw, 44px); height: clamp(34px, 9.5vw, 44px); border-radius: 50%; background: #fff; border: 2px solid #0f172a; font-size: clamp(18px, 5vw, 24px); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .15s, opacity .15s, filter .15s; }
.ci-villain:hover span { transform: scale(1.08); }
.ci-villain.off span { opacity: .45; filter: grayscale(1); transform: scale(.78); border-style: dashed; }
.ci-villain.off::after { content: "✕"; position: absolute; right: -4px; top: -6px; width: 18px; height: 18px; border-radius: 50%; background: #dc2626; color: #fff; font-size: 11px; font-weight: 900; display: grid; place-items: center; }
.ci-villain:focus-visible span, .ci-router:focus-visible span { outline: 3px solid #2563eb; outline-offset: 2px; }
.ci-dev { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 1px; pointer-events: none; }
.ci-dev .e { font-size: clamp(20px, 5.6vw, 26px); line-height: 1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
.ci-dev b { min-width: 30px; padding: 1px 6px; border-radius: 999px; font-size: 11.5px; line-height: 1.35; text-align: center; color: #fff; background: #dc2626; font-variant-numeric: tabular-nums; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.ci-dev.ok b { background: #b45309; }
.ci-dev.good b { background: #15803d; }
.ci-dev.bad .e { animation: ci-shake .9s ease-in-out infinite; }
@keyframes ci-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
.ci-router { z-index: 3; cursor: grab; touch-action: none; padding: 8px; }
.ci-router span { display: grid; place-items: center; width: clamp(40px, 11vw, 50px); height: clamp(40px, 11vw, 50px); border-radius: 14px; background: #0f172a; border: 3px solid #fff; font-size: clamp(20px, 5.6vw, 26px); box-shadow: 0 4px 12px rgba(0, 0, 0, .45), 0 0 0 6px rgba(37, 99, 235, .25); transition: transform .12s; }
.ci-router.drag { cursor: grabbing; }
.ci-router.drag span { transform: scale(1.15); }

.ci-over { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--pf-card) 70%, transparent); border-radius: 10px; z-index: 5; animation: ci-in .25s ease-out; }
.ci-over[hidden] { display: none; }
.ci-pop { text-align: center; padding: 20px 24px; border-radius: 18px; background: var(--pf-card); border: 1px solid var(--pf-line); box-shadow: 0 18px 44px rgba(0, 0, 0, .35); max-width: 92%; }
.ci-pop h3 { margin: 0 0 4px; font-size: 20px; }
.ci-pop .pts { margin: 0; font-size: 30px; font-weight: 900; color: var(--brand-text); }
.ci-pop .pf-muted { margin: 2px 0 14px; }
@keyframes ci-in { from { opacity: 0; } }

.ci-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 14px; font-weight: 700; }
.ci-status i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--pf-muted); margin-left: 4px; vertical-align: -1px; }
.ci-status i.on { background: var(--brand); border-color: var(--brand); }
.ci-status [data-need] { color: var(--pf-muted); text-align: right; }
.ci-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.ci-quit { border: 0; background: none; color: var(--pf-muted); font: inherit; font-size: 13.5px; text-decoration: underline; cursor: pointer; padding: 8px 0; white-space: nowrap; }
.ci-quit:hover { color: var(--pf-bad, #dc2626); }

.ci-result { text-align: center; }
.ci-result h2 { margin: 4px 0; }
.ci-stats { display: flex; justify-content: center; gap: 10px; margin: 14px 0; }
.ci-stats div { background: var(--pf-soft); border-radius: 12px; padding: 10px 14px; flex: 0 1 120px; min-width: 0; }
.ci-stats b { display: block; font-size: 22px; }
.ci-stats span { font-size: 12.5px; color: var(--pf-muted); }
.ci-name { display: flex; gap: 8px; justify-content: center; margin: 12px auto 0; max-width: 420px; }
.ci-name .pf-btn { white-space: nowrap; }
.ci-name input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 11px 12px; border: 1.5px solid var(--pf-line); border-radius: 10px; background: var(--pf-card); color: var(--pf-ink); }
.ci-learn { text-align: left; margin: 16px auto 4px; max-width: 440px; padding: 12px 14px; border-radius: 12px; background: var(--pf-soft); font-size: 14.5px; }
.ci-learn ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.ci-cta { margin-top: 18px; padding: 16px; border-radius: 14px; background: var(--brand-soft, var(--pf-soft)); }
.ci-cta h3 { margin: 0 0 4px; }
.ci-cta p { margin: 0 0 10px; color: var(--pf-muted); }
@media (max-width: 480px) {
  .ci-name { flex-direction: column; }
  .ci-play.pf-card-box { padding-left: 10px; padding-right: 10px; }
  .ci-status { font-size: 13px; }
}
.ci-tip { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 9px 12px; border-radius: 12px; background: var(--pf-soft); font-size: 13.5px; line-height: 1.35; animation: ci-in .25s ease-out; }
.ci-tip[hidden] { display: none; }
.ci-tip > span:first-child { font-size: 20px; line-height: 1; }
.ci-play { scroll-margin-top: 84px; }
