/* ===== TIMER ESTAÇÕES ROTATIVAS ===== */

.timer-header {
  padding: 10px 20px !important;
  position: sticky;
  top: 0;
  z-index: 100;
}

.timer-header .logo {
  display: none;
}

.timer-header .tagline,
.timer-header .subtitle {
  display: none;
}

.timer-header .back-link {
  margin-bottom: 4px !important;
  font-size: 0.78rem !important;
}

.timer-header .nav-menu {
  margin-top: 4px;
}

.timer-header .nav-item {
  padding: 6px 14px;
  font-size: 0.78rem;
}

.timer-main {
  flex: 1;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.site-footer {
  display: none;
}

:root {
  --phase-estacao: #3b82f6;
  --phase-revelacao: #22c55e;
  --phase-pausa: #a855f7;
  --phase-batalha: #f59e0b;
  --phase-especial: #ec4899;
  --phase-default: #64748b;
}

body {
  height: 100vh;
  overflow: hidden;
}

.timer-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 24px;
  min-height: 0;
}

.timer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 12px;
  flex-shrink: 0;
}

.timer-topbar .title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.timer-topbar .clock {
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.timer-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 0;
}

.phase-label {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

.phase-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  max-width: 90vw;
}

.phase-subtitle {
  font-size: 1.3rem;
  color: var(--muted);
  text-align: center;
  max-width: 80vw;
}

.timer-ring {
  position: relative;
  width: 280px;
  height: 280px;
}

.timer-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.ring-fill {
  fill: none;
  stroke: var(--phase-estacao);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s linear, stroke 0.3s ease;
}

.ring-fill.warning { stroke: var(--phase-batalha); }
.ring-fill.danger { stroke: var(--danger); }

.timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-digits {
  font-size: 5.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0.02em;
}

.timer-digits.warning { color: var(--phase-batalha); }
.timer-digits.danger { color: var(--danger); }

.timer-seconds-only {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  opacity: 0.7;
  margin-top: 4px;
}

.timer-status {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 4px;
}

.phase-bar {
  display: flex;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  padding: 6px 0;
  flex-shrink: 0;
}

.phase-dot {
  flex: 1;
  min-width: 24px;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  transition: background 0.3s ease, transform 0.2s ease;
  cursor: pointer;
  position: relative;
}

.phase-dot:hover { transform: scaleY(2); }
.phase-dot.completed { background: var(--muted); }
.phase-dot.active { background: var(--phase-estacao); transform: scaleY(1.6); }
.phase-dot.future { background: var(--border); }

.phase-dot[data-type="estacao"].active,
.phase-dot[data-type="estacao"].completed { background: var(--phase-estacao); }
.phase-dot[data-type="revelacao"].active,
.phase-dot[data-type="revelacao"].completed { background: var(--phase-revelacao); }
.phase-dot[data-type="pausa"].active,
.phase-dot[data-type="pausa"].completed { background: var(--phase-pausa); }
.phase-dot[data-type="batalha"].active,
.phase-dot[data-type="batalha"].completed { background: var(--phase-batalha); }
.phase-dot[data-type="especial"].active,
.phase-dot[data-type="especial"].completed { background: var(--phase-especial); }
.phase-dot[data-type="default"].active,
.phase-dot[data-type="default"].completed { background: var(--phase-default); }

.timer-controls {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  padding-bottom: 12px;
  justify-content: center;
}

.ctrl-btn {
  padding: 8px 18px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-btn:hover { background: var(--border); }
.ctrl-btn.primary { background: var(--phase-estacao); border-color: var(--phase-estacao); color: #fff; }
.ctrl-btn.primary:hover { background: #2563eb; }
.ctrl-btn.warn { background: var(--phase-batalha); border-color: var(--phase-batalha); color: var(--bg); }
.ctrl-btn.warn:hover { background: #d97706; }

.flash-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  pointer-events: none;
  z-index: 999;
  transition: background 0.15s ease;
}

.flash-overlay.active { background: rgba(59, 130, 246, 0.15); }
.flash-overlay.warning-active { background: rgba(245, 158, 11, 0.15); animation: flashPulse 1s ease-in-out 3; }

@keyframes flashPulse {
  0%, 100% { background: transparent; }
  50% { background: rgba(245, 158, 11, 0.12); }
}


.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 860px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}

.modal h2 { margin-bottom: 16px; font-size: 1.3rem; }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.phase-row {
  display: grid;
  grid-template-columns: auto auto auto 1fr 1fr auto auto auto auto;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.phase-row .p-grip { color: var(--muted); cursor: grab; font-size: 0.85rem; user-select: none; padding: 2px; }
.phase-row .p-color { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; align-self: center; }
.phase-row input[type="text"] { width: 100%; min-width: 60px; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-family: inherit; font-size: 0.82rem; }
.phase-row input[type="number"] { width: 48px; padding: 5px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-family: inherit; font-size: 0.82rem; text-align: center; }
.phase-row select { padding: 5px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-family: inherit; font-size: 0.8rem; max-width: 110px; }
.phase-row button { padding: 4px 8px; min-height: 28px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-family: inherit; cursor: pointer; font-size: 0.78rem; line-height: 1; white-space: nowrap; }
.phase-row button:hover:not(:disabled) { background: var(--border); color: var(--text); }
.phase-row button:disabled { opacity: 0.3; cursor: default; }
.phase-row button.danger:hover:not(:disabled) { background: #7f1d1d; color: #fca5a5; border-color: #7f1d1d; }

.phase-summary {
  padding: 12px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.phase-summary strong { color: var(--text); }

.next-phase-preview {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  opacity: 0.7;
  margin-top: 4px;
}

@media (min-width: 1024px) {
  .timer-digits { font-size: 7rem; }
  .timer-ring { width: 340px; height: 340px; }
  .phase-title { font-size: 4rem; }
}
