/* ============================================================
   InclusionBot — Tema ARCADE "Neon Command Center"
   Aditivo ao Tailwind (compilado localmente em css/tailwind.css —
   o CDN jsdelivr de tailwindcss@3 não publica dist CSS: era 404).
   Paleta: #0a1128 navy · #00d4ff cyan · #0066ff blue · #f2f6ff milk
   Fontes self-hosted (CSP da lib bloqueia fonts.googleapis.com).
   ============================================================ */

/* ===== Fontes (subsets completos, incl. latin-ext p/ PT-BR) ===== */
@font-face { font-family: 'Press Start 2P'; font-style: normal; font-weight: 400; src: url('../fonts/pressstart2p-1.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Press Start 2P'; font-style: normal; font-weight: 400; src: url('../fonts/pressstart2p-2.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Press Start 2P'; font-style: normal; font-weight: 400; src: url('../fonts/pressstart2p-3.woff2') format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'Press Start 2P'; font-style: normal; font-weight: 400; src: url('../fonts/pressstart2p-4.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Press Start 2P'; font-style: normal; font-weight: 400; src: url('../fonts/pressstart2p-5.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Orbitron'; font-style: normal; font-weight: 400; src: url('../fonts/orbitron-6.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Orbitron'; font-style: normal; font-weight: 500; src: url('../fonts/orbitron-7.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Orbitron'; font-style: normal; font-weight: 700; src: url('../fonts/orbitron-8.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'VT323'; font-style: normal; font-weight: 400; src: url('../fonts/vt323-9.woff2') format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'VT323'; font-style: normal; font-weight: 400; src: url('../fonts/vt323-10.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'VT323'; font-style: normal; font-weight: 400; src: url('../fonts/vt323-11.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Silkscreen'; font-style: normal; font-weight: 400; src: url('../fonts/silkscreen-12.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Silkscreen'; font-style: normal; font-weight: 400; src: url('../fonts/silkscreen-13.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Silkscreen'; font-style: normal; font-weight: 700; src: url('../fonts/silkscreen-14.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Silkscreen'; font-style: normal; font-weight: 700; src: url('../fonts/silkscreen-15.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ===== Tokens ===== */
:root {
  --arcade-navy: #0a1128;
  --arcade-navy-2: #0d1f3c;
  --arcade-navy-3: #12294d;
  --arcade-cyan: #00d4ff;
  --arcade-cyan-2: #00e5ff;
  --arcade-cyan-glow: rgba(0, 212, 255, .25);
  --arcade-blue: #0066ff;
  --arcade-blue-deep: #0052cc;
  --arcade-white: #ffffff;
  --arcade-milk: #f2f6ff;
  --arcade-dim: #5a6c8f;
  --arcade-warn: #ffb020;
  --arcade-danger: #ff3b3b;
  --arcade-success: #22c55e;
  --font-arcade: 'Press Start 2P', monospace;
  --font-tech: 'Orbitron', sans-serif;
  --font-crt: 'VT323', monospace;
  --font-chip: 'Silkscreen', monospace;
  --shadow-neon: 0 0 8px #00d4ff, 0 0 24px rgba(0, 212, 255, .4);
  --shadow-neon-soft: 0 0 6px rgba(0, 212, 255, .35);
}

/* ===== Base ===== */
body {
  background: var(--arcade-navy);
  color: var(--arcade-milk);
  font-family: var(--font-crt);
  font-size: 20px;
  min-height: 100vh;
}

h1, h2, .font-arcade {
  font-family: var(--font-arcade);
  font-weight: 400;
  letter-spacing: .02em;
}
h1 { font-size: 24px; }
h2 { font-size: 16px; }
.font-tech { font-family: var(--font-tech); }
.font-crt { font-family: var(--font-crt); }
.font-chip { font-family: var(--font-chip); }

/* ===== Scanlines / CRT overlay ===== */
.crt-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, .14) 3px,
    rgba(0, 0, 0, .14) 4px
  );
  mix-blend-mode: multiply;
}

/* ===== Grid de fundo ===== */
.grid-bg {
  background-image:
    linear-gradient(rgba(0, 212, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, .06) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ===== Neon text ===== */
.neon-text {
  color: var(--arcade-cyan);
  text-shadow: 0 0 8px var(--arcade-cyan), 0 0 24px var(--arcade-cyan-glow);
}

/* ===== Botões arcade ===== */
.btn-arcade {
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--arcade-navy);
  background: var(--arcade-cyan);
  border: 0;
  border-radius: 0;
  padding: 12px 22px;
  box-shadow: 0 4px 0 var(--arcade-blue-deep), var(--shadow-neon-soft);
  cursor: pointer;
  transition: transform .1s steps(2), box-shadow .1s steps(2), filter .1s steps(2);
  user-select: none;
}
.btn-arcade:hover { filter: brightness(1.15); box-shadow: 0 4px 0 var(--arcade-blue-deep), var(--shadow-neon); }
.btn-arcade:active { transform: translateY(4px); box-shadow: 0 0 0 var(--arcade-blue-deep), var(--shadow-neon-soft); }
.btn-arcade:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-arcade-danger {
  background: var(--arcade-danger);
  color: var(--arcade-white);
  box-shadow: 0 4px 0 #8f0f0f, 0 0 8px rgba(255, 59, 59, .4);
}
.btn-arcade-danger:active { box-shadow: 0 0 0 #8f0f0f; }

.btn-arcade-success {
  background: var(--arcade-success);
  color: var(--arcade-navy);
  box-shadow: 0 4px 0 #0f6b31, 0 0 8px rgba(34, 197, 94, .4);
}
.btn-arcade-success:active { box-shadow: 0 0 0 #0f6b31; }

.btn-arcade-ghost {
  background: transparent;
  color: var(--arcade-cyan);
  border: 2px solid var(--arcade-cyan);
  box-shadow: none;
}
.btn-arcade-ghost:hover { background: var(--arcade-cyan-glow); box-shadow: var(--shadow-neon-soft); }
.btn-arcade-ghost:active { transform: translateY(2px); }

.btn-lg { padding: 18px 34px; font-size: 18px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ===== Cards ===== */
.arcade-card {
  background: linear-gradient(180deg, var(--arcade-navy-2), var(--arcade-navy));
  border: 2px solid var(--arcade-blue-deep);
  box-shadow: inset 0 0 24px rgba(0, 102, 255, .08), 0 0 0 2px rgba(0, 0, 0, .4);
  padding: 20px;
  position: relative;
}
.arcade-card::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px;
  width: 14px; height: 14px;
  border-top: 3px solid var(--arcade-cyan);
  border-left: 3px solid var(--arcade-cyan);
}
.arcade-card:hover { border-color: var(--arcade-cyan); box-shadow: inset 0 0 24px rgba(0, 212, 255, .1), var(--shadow-neon-soft); }

/* ===== Inputs ===== */
.arcade-input {
  font-family: var(--font-crt);
  font-size: 20px;
  background: var(--arcade-navy);
  color: var(--arcade-milk);
  border: 2px solid var(--arcade-blue-deep);
  padding: 10px 14px;
  outline: none;
  width: 100%;
  border-radius: 0;
}
.arcade-input:focus {
  border-color: var(--arcade-cyan);
  box-shadow: var(--shadow-neon-soft);
}
.arcade-input::placeholder { color: var(--arcade-dim); }

/* ===== Badges / chips ===== */
.arcade-badge {
  font-family: var(--font-chip);
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--arcade-cyan);
  color: var(--arcade-cyan);
  background: rgba(0, 212, 255, .08);
  white-space: nowrap;
}
.arcade-badge-red { border-color: var(--arcade-danger); color: var(--arcade-danger); background: rgba(255, 59, 59, .08); }
.arcade-badge-green { border-color: var(--arcade-success); color: var(--arcade-success); background: rgba(34, 197, 94, .08); }
.arcade-badge-yellow { border-color: var(--arcade-warn); color: var(--arcade-warn); background: rgba(255, 176, 32, .08); }
.arcade-badge-dim { border-color: var(--arcade-dim); color: var(--arcade-dim); background: transparent; }

/* ===== INSERT COIN (blink steps) ===== */
.insert-coin {
  font-family: var(--font-arcade);
  font-size: 16px;
  color: var(--arcade-cyan);
  animation: coin-blink 1.2s steps(1) infinite;
  text-shadow: var(--shadow-neon);
}
@keyframes coin-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .15; } }

/* ===== Typewriter cursor ===== */
.typewriter::after {
  content: '█';
  color: var(--arcade-cyan);
  animation: cursor-blink 1s steps(1) infinite;
  margin-left: 2px;
}
@keyframes cursor-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ===== Marquesa ===== */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  display: block;
}
.marquee > span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 18s linear infinite;
}
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* ===== Tabs ===== */
.arcade-tab {
  font-family: var(--font-tech);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--arcade-dim);
  background: transparent;
  border: 2px solid transparent;
  border-bottom: 2px solid var(--arcade-blue-deep);
  padding: 10px 16px;
  cursor: pointer;
}
.arcade-tab.active {
  color: var(--arcade-cyan);
  border-color: var(--arcade-cyan);
  border-bottom-color: var(--arcade-cyan);
  text-shadow: var(--shadow-neon-soft);
  background: rgba(0, 212, 255, .06);
}

/* ===== Terminal ===== */
.arcade-terminal {
  font-family: var(--font-crt);
  font-size: 19px;
  line-height: 1.45;
  background: #050b1c;
  border: 2px solid var(--arcade-blue-deep);
  padding: 14px;
  color: #9be8ff;
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.arcade-terminal .t-prompt { color: var(--arcade-cyan); }
.arcade-terminal .t-ok { color: var(--arcade-success); }
.arcade-terminal .t-warn { color: var(--arcade-warn); }
.arcade-terminal .t-err { color: var(--arcade-danger); }
.arcade-terminal .t-dim { color: var(--arcade-dim); }
.arcade-terminal .t-head { color: var(--arcade-warn); font-weight: 700; letter-spacing: .04em; margin-top: 6px; }
.arcade-terminal .t-bullet { color: var(--arcade-success); }
.arcade-terminal .t-num { color: var(--arcade-cyan); }
.arcade-terminal .t-spacer { height: 6px; }
.arcade-terminal .t-step-thinking { color: var(--arcade-dim); }
.arcade-terminal .t-step-exec { color: var(--arcade-cyan-2); }
.arcade-terminal .t-step-approval { color: var(--arcade-warn); }

/* ===== Janela de contexto (barrinha do console) ===== */
.context-track {
  height: 10px;
  background: var(--arcade-navy-2);
  border: 1px solid var(--arcade-blue-deep);
  border-radius: 5px;
  overflow: hidden;
}
.context-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #16a34a, var(--arcade-success), var(--arcade-cyan));
  transition: width .9s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 0 10px rgba(34, 197, 94, .45);
}
.context-fill.warn {
  background: linear-gradient(90deg, #d97706, var(--arcade-warn), #ffd24a);
  box-shadow: 0 0 10px rgba(255, 176, 32, .5);
}
.context-fill.danger {
  background: linear-gradient(90deg, #b91c1c, var(--arcade-danger));
  box-shadow: 0 0 10px rgba(255, 59, 59, .6);
}
.context-fill.compressing {
  animation: ctx-compress .9s ease;
}
@keyframes ctx-compress {
  0% { filter: brightness(2.2); }
  60% { filter: brightness(1.4); }
  100% { filter: brightness(1); }
}
.ctx-flash {
  animation: ctx-flash-pulse .5s ease-in-out 6;
}
@keyframes ctx-flash-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .2; }
}

/* ===== Tabela arcade ===== */
.arcade-table { width: 100%; border-collapse: collapse; font-size: 17px; }
.arcade-table th {
  font-family: var(--font-tech);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--arcade-cyan);
  text-align: left;
  border-bottom: 2px solid var(--arcade-cyan);
  padding: 8px 10px;
}
.arcade-table td { border-bottom: 1px solid var(--arcade-blue-deep); padding: 8px 10px; vertical-align: top; }
.arcade-table tr:hover td { background: rgba(0, 212, 255, .05); }

/* ===== Skeleton ===== */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--arcade-navy-2);
  border: 2px solid var(--arcade-blue-deep);
  min-height: 96px;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, .12), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ===== Fade / boot ===== */
.crt-flicker {
  animation: flicker .18s steps(2) 2;
}
@keyframes flicker {
  0% { opacity: 1; } 25% { opacity: .2; } 50% { opacity: .9; } 75% { opacity: .4; } 100% { opacity: 1; }
}
.fade-in { animation: fadeIn .3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== Focus acessível ===== */
:focus-visible {
  outline: 3px solid var(--arcade-cyan);
  outline-offset: 2px;
}

/* ===== Acessibilidade: reduz movimento ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--arcade-navy); }
::-webkit-scrollbar-thumb { background: var(--arcade-blue-deep); border: 2px solid var(--arcade-navy); }
::-webkit-scrollbar-thumb:hover { background: var(--arcade-cyan); }

/* ===== Toast (messages.js) ===== */
.arcade-toast {
  font-family: var(--font-crt);
  font-size: 19px;
  background: var(--arcade-navy-2);
  border: 2px solid var(--arcade-cyan);
  color: var(--arcade-milk);
  box-shadow: var(--shadow-neon);
  padding: 10px 18px;
  margin-top: 8px;
}
.arcade-toast.err { border-color: var(--arcade-danger); }
.arcade-toast.ok { border-color: var(--arcade-success); }

/* ===== Mute button ===== */
#mute-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  width: 44px;
  height: 44px;
  font-size: 18px;
  background: var(--arcade-navy-2);
  border: 2px solid var(--arcade-blue-deep);
  color: var(--arcade-cyan);
  cursor: pointer;
}
#mute-btn:hover { border-color: var(--arcade-cyan); box-shadow: var(--shadow-neon-soft); }
