/* 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; }
/* o bairro é sempre claro (como uma maquete), nos dois temas */
.rt-board { position: relative; width: min(100%, calc((100vh - 270px) * var(--ar))); min-width: min(100%, 260px); aspect-ratio: var(--ar); border-radius: 16px; background: linear-gradient(#f4f7fb, #e3eaf3); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.rt-iso { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rt-iso polygon { stroke: rgba(15, 23, 42, .3); stroke-width: .16; stroke-linejoin: round; }
.rt-iso .lot { fill: #e9efe3; }
.rt-iso .lot.src { fill: #dbe7f5; }
.rt-iso path { fill: none; stroke-linecap: round; }
.rt-iso .duct { stroke: #b6c0b0; stroke-width: 3; }
.rt-iso .fiber { stroke: #7c8794; stroke-width: 1.15; transition: stroke .15s; }
.rt-iso .hub { fill: #7c8794; transition: fill .15s; }
.rt-iso .rt-spin { transition: transform .16s ease-out; }
.rt-iso .rt-t.lit .fiber { stroke: var(--brand); stroke-width: 1.5; }
.rt-iso .rt-t.lit .hub { fill: var(--brand); }
.rt-iso .shade { fill: rgba(15, 23, 42, .18); }
.rt-iso .br { fill: var(--brand); }
.rt-iso .s1 { filter: brightness(.84); }
.rt-iso .s2 { filter: brightness(.68); }
.rt-iso .roof { fill: #9aa3ad; transition: fill .2s; }
.rt-iso .win { fill: #94a3b8; transition: fill .2s; }
.rt-iso .rt-v.lit .roof { fill: var(--brand); }
.rt-iso .rt-v.lit .win { fill: #fde047; }
.rt-cells { position: absolute; inset: 0; }
/* cada peça é um losango clicável do tamanho da quadra */
.rt-cell { position: absolute; transform: translate(-50%, -50%); padding: 0; border: 0; background: transparent; cursor: pointer; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); -webkit-tap-highlight-color: transparent; }
.rt-cell:hover { background: rgba(255, 255, 255, .28); }
.rt-cell:active { background: rgba(255, 255, 255, .5); }
.rt-cell:focus-visible { outline: 0; background: rgba(37, 99, 235, .35); }
.rt-board.done .rt-cell { cursor: default; }
.rt-board.done .rt-iso .fiber { animation: rt-glow .8s ease-in-out 2; }
@keyframes rt-glow { 50% { stroke-width: 2.4; } }

.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-wrap { margin: 0 -6px; }
  .rt-foot { flex-direction: column-reverse; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { .rt-iso .rt-spin { transition: none; } }
.rt-play { scroll-margin-top: 84px; }
