:root {
  --bg: #0f172a;
  --fg: #f1f5f9;
  --accent: #38bdf8;
  --accent-danger: #f87171;
  --card: #1e293b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--fg);
  font-family: "Segoe UI", system-ui, sans-serif;
}

h1 {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  opacity: 0.85;
  text-align: center;
  padding: 0 1rem;
}

.timer-wrap {
  position: relative;
  width: min(80vw, 70vh);
  height: min(80vw, 70vh);
}

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

.track {
  fill: none;
  stroke: #334155;
  stroke-width: 6;
}

.progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s linear, stroke 0.3s;
}

.progress.warning {
  stroke: var(--accent-danger);
}

.time-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: min(20vw, 15vh);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.status {
  margin-top: 1.25rem;
  font-size: 1.1rem;
  opacity: 0.7;
}

.audio-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: #1e293b;
  color: var(--fg);
  text-align: center;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  z-index: 60;
  border-bottom: 1px solid #334155;
}

.audio-banner-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.audio-banner-sub {
  font-size: 0.78rem;
  opacity: 0.65;
}

.fullscreen-btn {
  display: none;
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  width: auto;
  margin: 0;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: #334155;
  color: var(--fg);
  border: 1px solid #475569;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  opacity: 0.75;
  z-index: 50;
}

.fullscreen-btn:hover {
  opacity: 1;
}

.debug-panel {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  max-width: 60ch;
  font-family: monospace;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.75);
  color: #9ae6b4;
  padding: 0.4rem 0.6rem;
  z-index: 200;
  white-space: pre-wrap;
  max-height: 40vh;
  overflow: auto;
}

.test-sound-btn {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: auto;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: #334155;
  color: var(--fg);
  border: 1px solid #475569;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.7;
  z-index: 50;
}

.test-sound-btn:hover {
  opacity: 1;
}

/* ---- Panel admina ---- */
.admin {
  width: min(520px, 92vw);
  background: var(--card);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.admin h1 {
  margin-top: 0;
}

.field {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

input, select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #0f172a;
  color: var(--fg);
  font-size: 1rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tab {
  flex: 1;
  padding: 0.6rem;
  text-align: center;
  border-radius: 8px;
  background: #0f172a;
  cursor: pointer;
  border: 1px solid #334155;
}

.tab.active {
  background: var(--accent);
  color: #0f172a;
  font-weight: 600;
}

.duration-row {
  display: flex;
  gap: 0.5rem;
}

.duration-row .field {
  flex: 1;
}

button {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}

button.secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid #475569;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-top: 1rem;
  text-align: center;
}

.panel-state {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #0f172a;
  border-radius: 10px;
  text-align: center;
}

.panel-countdown {
  margin-top: 1rem;
  padding: 1.25rem;
  background: #0f172a;
  border-radius: 10px;
  text-align: center;
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.panel-countdown.warning {
  color: var(--accent-danger);
}

.panel-countdown.idle {
  color: #64748b;
  font-size: 1.3rem;
  font-weight: 500;
}
