html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #05070b;
  color: #f5f5f5;
}

/* Container */
#tv-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Top bar */
#topBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: linear-gradient(90deg, #111827, #020617);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

#tvInfoLabel {
  font-weight: 600;
  font-size: 16px;
}

#statusLabel {
  font-size: 14px;
  opacity: 0.8;
}

/* Map full-screen under bar */
#map {
  flex: 1;
  width: 100%;
}

/* Modal backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(
      circle at top,
      rgba(15, 23, 42, 0.9),
      rgba(15, 23, 42, 0.98)
    );
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-backdrop.hidden {
  display: none;
}

/* Modal box */
.modal {
  width: 320px;
  max-width: 90vw;
  background: #020617;
  border-radius: 16px;
  padding: 20px 24px 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.modal h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.modal .subtitle {
  margin: 0 0 16px;
  font-size: 13px;
  color: #9ca3af;
}

/* Form controls */
.modal label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
}

.modal input {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #f9fafb;
  font-size: 14px;
}

.modal input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.7);
}

/* Error text */
.error-text {
  min-height: 16px;
  font-size: 12px;
  color: #fca5a5;
  margin-bottom: 10px;
}

/* Button */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.modal-actions button {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 10px 30px rgba(22, 163, 74, 0.5);
}

.modal-actions button:disabled {
  opacity: 0.6;
  cursor: wait;
  box-shadow: none;
}

/* Reuse your existing .hidden if you already use it for the modal */
.hidden {
  display: none !important;
}

/* Full-width toolbar over the screen/map */
.tv-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px; /* taller for large buttons */
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 2000;
}
.tv-toolbar-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 220px;
}

.tv-toolbar-title {
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
}

.tv-toolbar-status {
  color: #e0e0e0;
  font-size: 14px;
  opacity: 0.9;
}

.tv-toolbar-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}


/* Icon-only buttons in toolbar */
.tool-btn {
  border: none;
  outline: none;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 28px; /* big icon for remote click */
  transition: background 0.15s ease, transform 0.1s ease;
}

.tool-btn .btn-icon {
  width: 25px;
  height: 25px;
  pointer-events: none; /* so clicks hit the button, not the image */
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.tool-btn:active {
  transform: translateY(0);
}


/* Small settings (gear) button at top-left */
.settings-toggle-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  outline: none;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 26px;
  z-index: 2100;
  transition: background 0.15s ease, transform 0.1s ease;
}

.settings-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.95);
  transform: translateY(-1px);
}

.settings-toggle-btn:active {
  transform: translateY(0);
}

.rotation-label {
  min-width: 56px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  opacity: 0.9;
}
.tool-select {
  height: 32px;
  padding: 4px 8px;
  margin-right: 8px;
  border-radius: 4px;
  border: 1px solid #444;
  background: #222;
  color: #fff;
}
