/* Rota da Fibra */
.rt { max-width: 640px; margin: 0 auto; }
.rt-intro { text-align: center; }
.rt-intro h2 { margin: 6px 0 4px; }
.rt-demo { display: flex; align-items: center; justify-content: center; gap: 0; font-size: 34px; margin: 4px 0 6px; }
.rt-demo i { width: 44px; height: 8px; border-radius: 8px; background: var(--brand); box-shadow: 0 0 12px var(--brand); }
.rt-demo .t { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; border: 2px solid var(--pf-line); background: var(--pf-soft); font-size: 24px; font-weight: 800; animation: rt-spin 2.4s ease-in-out infinite; }
@keyframes rt-spin { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(180deg); } }
.rt-how { text-align: left; max-width: 400px; margin: 14px auto 18px; padding-left: 22px; display: grid; gap: 8px; line-height: 1.4; }

.rt-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; }
.rt-phase { font-size: 14px; color: var(--pf-muted); }
.rt-houses { font-size: 15px; }
.rt-score { color: var(--brand-text); }
.rt-timer { position: relative; height: 22px; border-radius: 999px; background: var(--pf-track); overflow: hidden; margin: 10px 0 14px; }
.rt-timer i { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 999px; }
.rt-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); }
.rt-timer.low i { background: var(--pf-bad, #dc2626); animation: rt-pulse .6s ease-in-out infinite; }
@keyframes rt-pulse { 50% { opacity: .55; } }

.rt-board-wrap { position: relative; display: grid; place-items: center; }
.rt-board { display: grid; grid-template-columns: repeat(var(--w), minmax(0, 1fr)); gap: 3px; width: min(100%, calc((100vh - 270px) * var(--w) / var(--h))); min-width: min(100%, 250px); aspect-ratio: var(--w) / var(--h); padding: 6px; border-radius: 16px; background: var(--pf-soft); border: 1px solid var(--pf-line); touch-action: manipulation; }
.rt-cell { position: relative; padding: 0; border: 0; border-radius: 9px; background: var(--pf-card); cursor: pointer; aspect-ratio: 1; min-width: 0; -webkit-tap-highlight-color: transparent; overflow: hidden; }
.rt-cell:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.rt-cell:active { filter: brightness(1.15); }
.rt-cell svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .16s ease-out; }
.rt-cell path { fill: none; stroke-linecap: round; }
.rt-cell .duct { stroke: var(--pf-track); stroke-width: 26; }
.rt-cell .fiber { stroke: var(--pf-muted); stroke-width: 10; opacity: .7; transition: stroke .15s, opacity .15s; }
.rt-cell .hub { fill: var(--pf-muted); transition: fill .15s; }
.rt-cell.lit .fiber { stroke: var(--brand); opacity: 1; filter: drop-shadow(0 0 4px var(--brand)); }
.rt-cell.lit .hub { fill: var(--brand); }
.rt-cell .ico { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(16px, 5.2vw, 30px); line-height: 1; pointer-events: none; filter: grayscale(1) opacity(.75); transition: filter .2s, transform .2s; }
.rt-cell.lit .ico, .rt-cell.src .ico { filter: none; }
.rt-cell.house.lit .ico { transform: scale(1.12); }
.rt-cell.src { background: var(--brand-soft, var(--pf-soft)); }
.rt-board.done .rt-cell { cursor: default; }
.rt-board.done .rt-cell .fiber { animation: rt-glow .8s ease-in-out 2; }
@keyframes rt-glow { 50% { stroke-width: 16; } }

.rt-over { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--pf-card) 72%, transparent); border-radius: 16px; animation: rt-in .25s ease-out; }
.rt-over[hidden] { display: none; }
.rt-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%; }
.rt-pop h3 { margin: 0 0 4px; font-size: 20px; }
.rt-pop .pts { margin: 0; font-size: 30px; font-weight: 900; color: var(--brand-text); }
.rt-pop .pf-muted { margin: 2px 0 14px; }
@keyframes rt-in { from { opacity: 0; } }

.rt-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 13.5px; }
.rt-quit { border: 0; background: none; color: var(--pf-muted); font: inherit; text-decoration: underline; cursor: pointer; padding: 8px 0; white-space: nowrap; }
.rt-quit:hover { color: var(--pf-bad, #dc2626); }

.rt-result { text-align: center; }
.rt-result h2 { margin: 4px 0; }
.rt-stats { display: flex; justify-content: center; gap: 10px; margin: 14px 0; }
.rt-stats div { background: var(--pf-soft); border-radius: 12px; padding: 10px 14px; flex: 0 1 120px; min-width: 0; }
.rt-stats b { display: block; font-size: 22px; }
.rt-stats span { font-size: 12.5px; color: var(--pf-muted); }
.rt-name { display: flex; gap: 8px; justify-content: center; margin: 12px auto 0; max-width: 420px; }
.rt-name .pf-btn { white-space: nowrap; }
.rt-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); }
.rt-cta { margin-top: 18px; padding: 16px; border-radius: 14px; background: var(--brand-soft, var(--pf-soft)); }
.rt-cta h3 { margin: 0 0 4px; }
.rt-cta p { margin: 0 0 10px; color: var(--pf-muted); }
@media (max-width: 480px) {
  .rt-name { flex-direction: column; }
  .rt-play.pf-card-box { padding-left: 10px; padding-right: 10px; }
  .rt-board { gap: 2px; padding: 4px; }
  .rt-foot { flex-direction: column-reverse; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { .rt-cell svg { transition: none; } }
.rt-play { scroll-margin-top: 84px; }
