:root {
  --bg: #0f172a; --panel: #1e293b; --panel-2: #111827; --border: #334155;
  --input-border: #475569; --input-bg: #0f172a;
  --text: #e2e8f0; --muted: #94a3b8; --danger: #f87171;
  --accent: #2563eb; --accent-text: #fff; --accent-active: #2563eb; --accent-active-text: #fff;
  --ok: #22c55e; --cursor: rgba(37, 99, 235, .35);
}
:root[data-theme="brasil"] {
  --bg: #002776; --panel: #033a97; --panel-2: #001c5c; --border: #1f52b5;
  --input-border: #2b62c9; --input-bg: #001c5c;
  --text: #ffffff; --muted: #c9dcff; --danger: #ff6b6b;
  --accent: #009c3b; --accent-text: #ffffff; --accent-active: #ffdf00; --accent-active-text: #002776;
  --ok: #00e05a; --cursor: rgba(255, 223, 0, .45);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none; user-select: none; touch-action: none; }
.muted { color: var(--muted); }
.erro { color: var(--danger); min-height: 18px; }
.spacer { flex: 1; }

.screen { position: absolute; inset: 0; }
.center { display: flex; align-items: center; justify-content: center; padding: 20px; }
.card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
h1 { margin: 0 0 12px; font-size: 20px; }

input, select, button { font: inherit; }
input:not([type=file]), select { width: 100%; margin: 6px 0; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--input-border); background: var(--input-bg); color: var(--text); }
button { padding: 12px 16px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-weight: 600; cursor: pointer; }
button.ghost { background: var(--panel); border: 1px solid var(--input-border); color: var(--text); font-weight: 500; }
button.sm { padding: 8px 12px; font-size: 13px; }
button.ghost.active { background: var(--accent-active); color: var(--accent-active-text); border-color: var(--accent-active); }
.row { display: flex; gap: 8px; margin-top: 10px; }
.row button { flex: 1; }

/* lista */
header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--panel); border-bottom: 1px solid var(--border); }
#lista #filtro { margin: 10px 14px; width: calc(100% - 28px); }
#grid { padding: 0 14px 20px; display: grid; gap: 10px; overflow-y: auto; height: calc(100% - 118px); }
.pc { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.pc h3 { margin: 0 0 2px; font-size: 16px; }
.pc .cli { color: var(--muted); font-size: 13px; }
.pc .foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.pc .specs { margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.pc .specs div { margin-top: 2px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #64748b; display: inline-block; }
.dot.on { background: var(--ok); }
.pc button { width: 100%; margin-top: 10px; }
.pc button:disabled { opacity: .4; }

/* sessão */
#sessao { display: flex; flex-direction: column; background: #000; }
#palco { position: relative; flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; }
#tela { max-width: 100%; max-height: 100%; object-fit: contain; will-change: transform; }
#cursor { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none;
  border: 2px solid #fff; border-radius: 50%; background: var(--cursor); box-shadow: 0 0 0 1px #000; }
#transfer { position: absolute; left: 8px; bottom: 8px; font-size: 12px; background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 6px; }
#teclasRow { display: flex; gap: 4px; padding: 6px; background: var(--panel-2); overflow-x: auto; }
#teclasRow button { flex: 0 0 auto; padding: 10px 12px; background: var(--panel); border: 1px solid var(--border); font-weight: 500; color: var(--text); }
#teclasRow button.mod.on { background: var(--accent-active); border-color: var(--accent-active); color: var(--accent-active-text); }
#barra { display: flex; gap: 4px; padding: 6px; background: var(--panel-2); overflow-x: auto; align-items: center; }
#barra button, #barra select { flex: 0 0 auto; width: auto; margin: 0; padding: 10px 12px; font-size: 13px; }
#kbCatcher { position: fixed; left: -9999px; top: 0; opacity: 0; height: 1px; width: 1px; }

/* seletor de tema */
#temaSel { padding: 8px 10px; }
