* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
}

:root {
  --accent: #667eea;
  --accent-dark: #764ba2;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --panel-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background: var(--bg-gradient);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px 16px;
  /* Scroll da página, não interno — no celular o scroll aninhado era inusável */
  overflow-y: auto;
  transition: background 0.5s var(--transition);
}

body.minimized-mode {
  background: #1a1a1a;
  align-items: center;
}

/* ─── Layout ──────────────────────────────────────────────── */

.page-wrapper {
  width: 100%;
  max-width: 1400px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

#full-panel,
#mini-panel {
  transition: opacity 0.3s var(--transition);
  opacity: 1;
}

/* ─── Toggle Mode Button ──────────────────────────────────── */

.toggle-mode-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all var(--transition);
}

.toggle-mode-btn:hover {
  background: white;
  transform: scale(1.1);
}

.toggle-mode-btn .icon-maximize { display: none; }
.toggle-mode-btn.minimized .icon-minimize { display: none; }
.toggle-mode-btn.minimized .icon-maximize { display: block; }

/* ─── Panel Container ─────────────────────────────────────── */

.control-panel-container {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-lg);
  padding: 16px 24px 20px;
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(10px);
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* ─── Header ──────────────────────────────────────────────── */

.panel-header {
  text-align: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.panel-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0;
}

/* ─── Event Tabs ──────────────────────────────────────────── */

.event-tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(102, 126, 234, 0.15);
  flex-shrink: 0;
}

.event-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 40px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.event-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(102, 126, 234, 0.06);
}

.event-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.event-tab-icon {
  font-size: 18px;
  line-height: 1;
}

.event-tab-label {
  white-space: nowrap;
}

/* ─── Event Settings ─────────────────────────────────────── */

.event-settings {
  flex-shrink: 0;
  padding: 12px 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(102, 126, 234, 0.12);
}

.settings-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.event-settings-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-settings .setting-group {
  width: 100%;
}

.event-settings .setting-control-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.event-settings .setting-select {
  flex: 1;
  min-width: 0;
}

.event-settings .setting-save-btn {
  flex-shrink: 0;
}

/* ─── Controls Grid ───────────────────────────────────────── */

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  grid-auto-rows: min-content;
  gap: 14px;
  margin-bottom: 12px;
  overflow-x: hidden;
  padding-right: 4px;
  padding-bottom: 4px;
  align-content: start;
  align-items: start;
}

.controls-grid .group-card {
  height: auto;
  max-height: none;
}

/* ─── Control Card ────────────────────────────────────────── */

.control-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--card-shadow);
  border: 2px solid transparent;
  transition: all var(--transition);
  min-height: 0;
}

.control-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--accent);
}

.control-card.hidden {
  opacity: 0.55;
  border-color: #e2e8f0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-title-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.component-icon {
  font-size: 18px;
}

.component-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.visible {
  background: #dcfce7;
  color: #16a34a;
}

.status-badge.hidden {
  background: #fee2e2;
  color: #dc2626;
}

.card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.component-description {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
  flex: 1;
}

/* ─── Card Settings ──────────────────────────────────────── */

.card-body:has(.card-settings) {
  flex-direction: column;
  align-items: stretch;
}

.card-settings {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.setting-input,
.setting-select {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #1e293b;
  background: #f8fafc;
  transition: border-color var(--transition);
  width: 100%;
}

.setting-input:focus,
.setting-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.setting-hint {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
}

.setting-input--dirty {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

.setting-save-btn {
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  align-self: flex-start;
}

.setting-save-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.setting-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─── Toggle Switch ───────────────────────────────────────── */

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 28px;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Action Buttons ──────────────────────────────────────── */

.action-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.action-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  transform: translateY(-2px);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-info {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.btn-info:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #1e293b;
}

/* ─── Status Message ──────────────────────────────────────── */

.status-message {
  text-align: center;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.status-message.show {
  opacity: 1;
}

.status-message.success { background: #dcfce7; color: #16a34a; }
.status-message.error   { background: #fee2e2; color: #dc2626; }
.status-message.info    { background: #dbeafe; color: #2563eb; }

/* ─── Bottom Section (Similarity + Links) ──────────────────── */

.control-panel-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid rgba(102, 126, 234, 0.12);
  flex-shrink: 0;
  min-height: 0;
}

/* ─── Similarity Section ─────────────────────────────────── */

.similarity-section {
  padding: 12px 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(102, 126, 234, 0.2);
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 4px;
}

.section-description {
  font-size: 11px;
  color: #888;
  margin-bottom: 10px;
  line-height: 1.4;
}

.similarity-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.similarity-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.similarity-status {
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.similarity-threshold {
  display: flex;
  align-items: center;
  gap: 10px;
}

.similarity-threshold label {
  font-size: 14px;
  color: #555;
  white-space: nowrap;
  min-width: 130px;
}

.similarity-threshold input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 3px;
  outline: none;
}

.similarity-threshold input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid #667eea;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

/* ─── Preview Links ───────────────────────────────────────── */

.preview-links {
  padding: 12px 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(102, 126, 234, 0.12);
}

.preview-title {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 10px;
}

.links-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #f1f5f9;
  text-decoration: none;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
  border: 1px solid #e2e8f0;
}

.preview-link:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.link-icon { font-size: 16px; }

/* ─── Loading ─────────────────────────────────────────────── */

.loading-container {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(102, 126, 234, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: #94a3b8;
  font-size: 14px;
}

/* ─── Mini Panel (Remote Control) ────────────────────────── */

.remote-control {
  background: #1a1a1a;
  border-radius: 32px;
  padding: 24px 20px 28px;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.remote-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.remote-logo { font-size: 22px; }

.remote-title {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.remote-event-label {
  margin-left: auto;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.remote-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}

.remote-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.remote-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.remote-btn.active {
  background: rgba(102, 126, 234, 0.25);
  border-color: rgba(102, 126, 234, 0.5);
  color: white;
}

.remote-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.remote-btn-icon { font-size: 20px; flex-shrink: 0; }
.remote-btn-label { flex: 1; font-size: 14px; font-weight: 600; }
.remote-btn-shortcut { font-size: 11px; color: rgba(255, 255, 255, 0.3); }

.remote-btn-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.5px;
}

.remote-btn.active .remote-btn-status {
  background: rgba(102, 126, 234, 0.4);
  color: #a5b4fc;
}

.remote-footer {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.remote-refresh {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.remote-refresh:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

/* ========================================
   GROUPED CARDS (multi-component per card)
   ======================================== */

.group-card {
  background: white;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.09);
  border: 2px solid rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.group-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
  border-color: rgba(102, 126, 234, 0.35);
  transform: translateY(-3px);
}

.group-card.group-active {
  border-color: rgba(76, 175, 80, 0.5);
}

.group-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 11px;
  background: linear-gradient(120deg, #f5f7ff 0%, #eef1ff 100%);
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.group-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.group-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.group-title {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.1px;
}

.group-subtitle {
  font-size: 9px;
  color: #aaa;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.group-rows {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.comp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.042);
  transition: background 0.15s ease;
  position: relative;
}

.comp-row:last-child {
  border-bottom: none;
}

.comp-row:hover {
  background: rgba(102, 126, 234, 0.03);
}

.comp-row.sub-row {
  padding-left: 28px;
  background: rgba(0, 0, 0, 0.014);
}

.comp-row.sub-row::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(102, 126, 234, 0.18);
  border-radius: 1px;
}

.comp-row.sub-row:hover {
  background: rgba(102, 126, 234, 0.025);
}

.comp-row-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.comp-row.sub-row .comp-row-icon {
  font-size: 14px;
  opacity: 0.65;
}

.comp-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.comp-row-title {
  font-size: 12px;
  font-weight: 600;
  color: #2c2c2c;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comp-row.sub-row .comp-row-title {
  font-size: 11px;
  font-weight: 500;
  color: #666;
}

.comp-row-desc {
  font-size: 10px;
  color: #bbb;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comp-row-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.comp-row-badge.on {
  background: #e8f5e9;
  color: #2e7d32;
}

.comp-row-badge.off {
  background: #fff3f3;
  color: #c62828;
}

/* Toggle switch used inside comp-rows */
.comp-row .toggle-switch {
  flex-shrink: 0;
}

/* ========================================
   GRID PLAYBACK CONTROLS
   ======================================== */

.grid-playback {
  padding: 8px 12px 10px;
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.grid-playback-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.grid-playback-row.play-row {
  gap: 6px;
}

.grid-pb-rowlabel {
  flex-shrink: 0;
  width: 64px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  line-height: 1.2;
}

.grid-pb-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.grid-pb-btn:hover {
  background: rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.45);
  color: #fff;
}

.grid-pb-btn:active {
  transform: translateY(1px);
}

.grid-pb-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: #fff;
  flex: 1.3;
}

.grid-pb-btn.primary:hover {
  filter: brightness(1.1);
}

.grid-pb-btn.primary.is-paused {
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
}

.grid-pb-icon {
  font-size: 13px;
  line-height: 1;
}

.grid-pb-label {
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-pb-range {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.grid-pb-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.grid-pb-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.grid-pb-value {
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.grid-pb-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
}

.grid-pb-pill {
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all 0.18s ease;
  min-width: 30px;
  text-align: center;
}

.grid-pb-pill.fx {
  min-width: 52px;
}

.grid-pb-pill:hover {
  background: rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.4);
  color: #fff;
}

.grid-pb-pill.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.grid-pb-stepper {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  transition: all 0.15s ease;
}

.grid-pb-stepper:hover {
  background: rgba(102, 126, 234, 0.25);
  border-color: rgba(102, 126, 234, 0.5);
}

.grid-pb-stepper:active {
  transform: scale(0.92);
}

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 1100px) {
  .control-panel-bottom {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .control-panel-bottom {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  body { padding: 8px; }
  .control-panel-container { padding: 12px 16px; }
  .panel-title { font-size: 20px; }
  .event-tab-label { display: none; }
  .event-tab { padding: 6px 12px; }
  .controls-grid { grid-template-columns: 1fr; }
  .event-settings .setting-group { min-width: 100%; }
}

/* ======================================
   Campeonato toggle (event settings)
   ====================================== */
.campeonato-btn-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.campeonato-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.75);
  padding: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.78rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  text-align: center;
}

.campeonato-btn-preview {
  display: block;
  width: 100%;
  height: 60px;
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-color: #111;
  border-radius: 8px 8px 0 0;
}

.campeonato-preview-desafio {
  background-image: url('../images/formula-vee/principal_desafio.png');
}

.campeonato-preview-ecpa {
  background-image: url('../images/formula-vee/principal_ecpa.png');
}

.campeonato-preview-open {
  background-image: url('../images/formula-vee/principal_open.png');
}

.campeonato-preview-paulista {
  background-image: url('../images/formula-vee/principal_campeonato_paulista.png');
}

.campeonato-btn-label {
  display: block;
  padding: 7px 6px;
  letter-spacing: 0.3px;
}

.campeonato-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.campeonato-btn.active {
  border-color: #e32636;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(227, 38, 54, 0.30);
}

.campeonato-btn.active .campeonato-btn-label {
  background: #e32636;
}

.campeonato-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Telas largas: escala o painel inteiro (UI toda em px fixo fica minúscula em monitores 2K+/4K) */
/* ponytail: degraus fixos de zoom; migrar pra rem/clamp se precisar escala contínua */
@media (min-width: 2200px) {
  body {
    zoom: 1.3;
    height: calc(100vh / 1.3);
  }
}

@media (min-width: 3000px) {
  body {
    zoom: 1.6;
    height: calc(100vh / 1.6);
  }
}

@media (min-width: 3800px) {
  body {
    zoom: 2;
    height: calc(100vh / 2);
  }
}
