/* =========================================================================
   Mitsidi Quiz — design system "Arena de Energia"
   Identidade provisória baseada no Brand Book Mitsidi. Troque os tokens
   abaixo para ajustar cores; o logotipo fica em /static/img/.
   ========================================================================= */

@font-face { font-family: "Carlito"; src: url("/assets/fonts/Carlito-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Carlito"; src: url("/assets/fonts/Carlito-Bold.ttf") format("truetype"); font-weight: 700 900; font-display: swap; }

:root {
  --turq: #00B4D0;
  --turq-claro: #2CE3FF;
  --teal: #65C5B4;
  --amarelo: #FFC400;
  --cinza-tec: #404041;

  --bg-0: #061219;
  --bg-1: #0A1C25;
  --bg-2: #0F2A36;
  --bg-3: #163744;
  --linha: rgba(101, 197, 180, 0.18);
  --linha-forte: rgba(0, 180, 208, 0.45);
  --texto: #ECF7F9;
  --texto-2: #A7C1C8;
  --texto-3: #6F8E97;

  --opc-a: #00A3E0;
  --opc-b: #97D700;
  --opc-c: #FFD100;
  --opc-d: #E8562A;
  --opc-texto: #061219;

  --ok: #3DDC97;
  --erro: #FF5D5D;

  --raio: 18px;
  --raio-g: 28px;
  --fonte: "Segoe UI", "Segoe UI Variable Display", Carlito, "Helvetica Neue", Arial, system-ui, sans-serif;
  --sombra: 0 18px 50px rgba(0, 0, 0, 0.45);
  --brilho: 0 0 0 1px rgba(0, 180, 208, 0.35), 0 0 32px rgba(0, 180, 208, 0.25);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-mola: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--fonte);
  color: var(--texto);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--turq-claro); outline-offset: 3px; }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- fundo */
.fundo {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(0, 180, 208, 0.22), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(101, 197, 180, 0.16), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
.fundo canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.fundo::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}

/* ------------------------------------------------------------- botões */
.btn {
  --c: var(--turq);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  border: 0; border-radius: 999px; padding: .85em 1.6em;
  background: var(--c); color: var(--opc-texto); font-weight: 700; letter-spacing: .01em;
  box-shadow: 0 6px 0 rgba(0,0,0,.28), 0 10px 30px rgba(0,180,208,.25);
  transition: transform .15s var(--ease-out), box-shadow .15s, filter .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.28); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-amarelo { --c: var(--amarelo); box-shadow: 0 6px 0 rgba(0,0,0,.28), 0 10px 30px rgba(255,196,0,.25); }
.btn-fantasma { background: rgba(255,255,255,.06); color: var(--texto); box-shadow: inset 0 0 0 1px var(--linha); }
.btn-fantasma:hover { background: rgba(255,255,255,.1); }
.btn-perigo { --c: var(--erro); color: #fff; box-shadow: 0 6px 0 rgba(0,0,0,.28); }
.btn-icone { padding: .7em; border-radius: 14px; }
.btn svg { width: 1.2em; height: 1.2em; }

/* --------------------------------------------------------- ícones-forma */
.forma { width: 1em; height: 1em; display: inline-block; flex: none; }
:root { --opc: var(--turq); }
.opc-0 { --opc: var(--opc-a); }
.opc-1 { --opc: var(--opc-b); }
.opc-2 { --opc: var(--opc-c); }
.opc-3 { --opc: var(--opc-d); }
.vf.opc-0 { --opc: var(--opc-a); }
.vf.opc-1 { --opc: var(--opc-d); }

/* ----------------------------------------------------------- avatares */
.avatar {
  --a: var(--turq);
  width: 2.2em; height: 2.2em; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--a); color: var(--opc-texto); font-weight: 800; flex: none;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18);
}
.av-0 { --a: #00B4D0; } .av-1 { --a: #97D700; } .av-2 { --a: #FFC400; } .av-3 { --a: #65C5B4; }
.av-4 { --a: #00A3E0; } .av-5 { --a: #ED8B00; } .av-6 { --a: #A9E8FF; } .av-7 { --a: #E5FFA6; }

/* -------------------------------------------------------- animações base */
@keyframes surgir { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pulso { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: .8; } }
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes tremer { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
@keyframes brilhar { 0%, 100% { box-shadow: 0 0 0 0 rgba(61,220,151,.0); } 50% { box-shadow: 0 0 0 14px rgba(61,220,151,.18); } }
@keyframes varrer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.anim-surgir { animation: surgir .6s var(--ease-out) both; }
.anim-pop { animation: pop .55s var(--ease-mola) both; }

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

/* ----------------------------------------------------------- pausa / rede */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(6, 18, 25, .72); backdrop-filter: blur(10px);
  animation: surgir .35s var(--ease-out);
}
.overlay-caixa { text-align: center; }
.overlay-caixa .icone-pausa { display: inline-flex; gap: .35em; margin-bottom: .4em; }
.overlay-caixa .icone-pausa i { width: .35em; height: 1.2em; border-radius: .1em; background: var(--amarelo); display: block; }
.faixa-rede {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; padding: .6em 1em; text-align: center;
  background: var(--amarelo); color: var(--opc-texto); font-weight: 700; font-size: .95rem;
  transform: translateY(-100%); transition: transform .3s var(--ease-out);
}
.faixa-rede.ativa { transform: none; }
.faixa-rede::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .5em; vertical-align: -.05em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: girar .8s linear infinite; }

/* ---------------------------------------------------------------- confete */
.confete { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(150%);
  background: var(--bg-3); color: var(--texto); padding: .8em 1.2em; border-radius: 14px; z-index: 70;
  box-shadow: var(--sombra), inset 0 0 0 1px var(--linha); transition: transform .35s var(--ease-out); max-width: 90vw;
}
.toast.ativo { transform: translateX(-50%) translateY(0); }
.toast.erro { box-shadow: var(--sombra), inset 0 0 0 1px var(--erro); }
