/* ═══════════════════════════════════════════════════════════════════
   COBRINHA ONLINE — LOADING SCREEN CSS
   Estilo: Battle Arena / HUD Tático / Jogo Moderno PVP
═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Teko:wght@400;500;700&display=swap');

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --cyan:      #00d4ff;
  --cyan-dim:  rgba(0,212,255,0.12);
  --orange:    #ff8c00;
  --orange-dim:rgba(255,140,0,0.15);
  --red:       #ff3030;
  --gold:      #ffd000;
  --bg:        #03070f;
  --text:      #cce8ff;
  --muted:     rgba(150,200,255,0.35);
  --panel-bg:  rgba(4,15,35,0.92);
  --panel-bdr: rgba(0,200,255,0.18);
}

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  font-family: 'Rajdhani', 'Teko', sans-serif;
  overflow: hidden;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Fundo ─────────────────────────────────────────────────────── */
#bg-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 100% 100% at 50% 50%,
    transparent 40%, rgba(0,0,0,0.7) 100%);
}
.scanlines {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.025;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, #fff 2px, #fff 3px);
}

/* ── Unity ─────────────────────────────────────────────────────── */
#unity-container { position: fixed; inset: 0; z-index: 10; }
#unity-canvas    { width: 100%; height: 100%; background: #000; display: block; }
#unity-warning   {
  position: absolute; left: 50%; top: 5%; transform: translateX(-50%);
  z-index: 20; display: none;
  font-family: monospace; font-size: 13px;
}

/* ════════════════════════════════════════════════════════════════
   LOADING SCREEN
════════════════════════════════════════════════════════════════ */
#loading-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 32px;
  transition: opacity .8s ease, visibility .8s ease;
}
#loading-screen.out { opacity: 0; visibility: hidden; }

/* Grade de fundo HUD */
.hud-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,200,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,200,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 80%);
}

/* ── Cantos decorativos ────────────────────────────────────────── */
.corner {
  position: absolute; width: 28px; height: 28px; z-index: 2; pointer-events: none;
}
.corner::before, .corner::after {
  content: ''; position: absolute; background: var(--cyan); border-radius: 1px;
}
.corner::before { width: 100%; height: 2px; top: 0; }
.corner::after  { width: 2px; height: 100%; top: 0; }
.c-tl { top: 20px; left: 20px; }
.c-tr { top: 20px; right: 20px; transform: scaleX(-1); }
.c-bl { bottom: 20px; left: 20px; transform: scaleY(-1); }
.c-br { bottom: 20px; right: 20px; transform: scale(-1); }

/* ── Logo ──────────────────────────────────────────────────────── */
.ls-logo {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: logo-in .8s cubic-bezier(.22,1,.36,1) both;
}
@keyframes logo-in {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.logo-eyebrow {
  font-family: 'Teko', sans-serif; font-size: 12px; font-weight: 500;
  letter-spacing: 8px; color: var(--orange); text-transform: uppercase;
  border: 1px solid rgba(255,140,0,0.25); padding: 3px 16px; border-radius: 2px;
  background: rgba(255,140,0,0.06);
}
.logo-main { position: relative; }
.logo-img {
  max-width: 340px; max-height: 120px; object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(0,212,255,0.4)) drop-shadow(0 0 40px rgba(0,212,255,0.2));
}
.logo-fallback {
  display: flex; align-items: baseline; gap: 0;
  filter: drop-shadow(0 0 20px rgba(0,212,255,0.5));
}
.lf-c    { font-family:'Teko',sans-serif; font-size:88px; font-weight:700; color:var(--cyan); line-height:1; }
.lf-rest { font-family:'Teko',sans-serif; font-size:76px; font-weight:500; color:#fff; letter-spacing:2px; line-height:1; }
.logo-tagline {
  display: flex; align-items: center; gap: 12px;
  font-family: 'Teko', sans-serif; font-size: 13px; letter-spacing: 4px;
  color: var(--muted); text-transform: uppercase;
}
.tag-line {
  display: block; height: 1px; width: 50px;
  background: linear-gradient(90deg, transparent, var(--cyan-dim));
}
.logo-tagline .tag-line:last-child { transform: scaleX(-1); }

/* ── Painel ────────────────────────────────────────────────────── */
.ls-panel {
  position: relative; z-index: 3;
  width: min(520px, 92vw);
  background: var(--panel-bg);
  border: 1px solid var(--panel-bdr);
  border-radius: 4px;
  padding: 0;
  overflow: hidden;
  animation: panel-in .8s .2s cubic-bezier(.22,1,.36,1) both;
  box-shadow:
    0 0 0 1px rgba(0,212,255,0.06),
    0 20px 60px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(0,212,255,0.08);
}
@keyframes panel-in {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:translateY(0); }
}

/* Header do painel */
.panel-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: rgba(0,212,255,0.05);
  border-bottom: 1px solid rgba(0,212,255,0.1);
}
.ph-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}
.ph-dot.blink { animation: dot-blink 1.2s ease-in-out infinite; background: var(--orange); box-shadow: 0 0 6px var(--orange); }
@keyframes dot-blink { 0%,100%{opacity:1} 50%{opacity:.2} }
.panel-header span {
  font-family: 'Teko', sans-serif; font-size: 14px; letter-spacing: 3px;
  color: var(--cyan); text-transform: uppercase; flex: 1;
}

/* ── Barra HUD por segmentos ───────────────────────────────────── */
.hud-bar-wrap { padding: 18px 18px 4px; position: relative; }

.hud-bar-segments {
  display: flex; gap: 3px; margin-bottom: 6px;
}
.seg {
  flex: 1; height: 4px; border-radius: 1px;
  background: rgba(255,255,255,0.06);
  transition: background .15s, box-shadow .15s;
}
.seg.lit {
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(0,212,255,0.5);
}
.seg.active {
  background: #fff;
  box-shadow: 0 0 10px rgba(255,255,255,0.9), 0 0 20px var(--cyan);
  animation: seg-pulse .4s ease-in-out infinite alternate;
}
@keyframes seg-pulse { to { box-shadow: 0 0 16px rgba(255,255,255,.6), 0 0 30px var(--cyan); } }

.hud-bar-track {
  width: 100%; height: 8px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 2px; overflow: visible; position: relative;
}
.hud-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, rgba(0,180,255,0.8), var(--cyan), #a0f0ff);
  border-radius: 2px;
  transition: width .25s ease;
  position: relative; overflow: hidden;
}
.bar-glare {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 60%);
}
.hud-bar-glow {
  position: absolute; top: 50%; left: 0%;
  width: 40px; height: 20px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(0,212,255,0.6) 0%, transparent 70%);
  pointer-events: none;
  transition: left .25s ease;
}
.hud-bar-labels {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-family: 'Teko', sans-serif; font-size: 13px; letter-spacing: 2px;
  color: var(--muted); text-transform: uppercase;
}
.pct-value { color: var(--gold); font-size: 15px; font-weight: 700; }

/* ── Stats HUD ─────────────────────────────────────────────────── */
.hud-stats {
  display: flex; align-items: center;
  padding: 14px 18px 18px;
  gap: 0;
}
.hs-item {
  flex: 1; display: flex; align-items: center; gap: 10px;
}
.hs-icon {
  font-size: 20px; opacity: 0.7; filter: grayscale(0.3);
  flex-shrink: 0;
}
.hs-data { display: flex; flex-direction: column; }
.hs-val {
  font-family: 'Teko', sans-serif; font-size: 22px; font-weight: 700;
  color: #fff; line-height: 1;
}
.hs-label {
  font-family: 'Teko', sans-serif; font-size: 10px; letter-spacing: 2px;
  color: var(--muted); text-transform: uppercase;
}
.hs-divider {
  width: 1px; height: 36px; flex-shrink: 0;
  background: linear-gradient(180deg, transparent, var(--panel-bdr), transparent);
  margin: 0 16px;
}

/* ── Footer ────────────────────────────────────────────────────── */
.ls-footer {
  position: absolute; bottom: 22px;
  display: flex; align-items: center; gap: 10px;
  font-family: 'Teko', sans-serif; font-size: 13px; letter-spacing: 3px;
  color: rgba(255,255,255,0.15); text-transform: lowercase; z-index: 3;
}
.footer-sep { color: rgba(0,212,255,0.3); }

/* ════════════════════════════════════════════════════════════════
   BANNERS PWA
════════════════════════════════════════════════════════════════ */
/* iOS */
#ios-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: rgba(4,15,35,0.97);
  border-top: 1px solid var(--panel-bdr);
  padding: 16px 20px 32px;
  display: flex; align-items: center; gap: 14px;
  backdrop-filter: blur(30px);
  transform: translateY(100%);
  transition: transform .5s cubic-bezier(.34,1.4,.64,1);
}
#ios-banner.show { transform: translateY(0); }
#ios-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer; padding: 4px 8px; line-height: 1;
}
.ib-ico { width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0; }
.ib-body { display: flex; flex-direction: column; gap: 3px; }
.ib-body strong { font-size: 15px; color: #fff; font-family: 'Rajdhani', sans-serif; }
.ib-body span   { font-size: 12px; color: var(--muted); font-family: 'Rajdhani', sans-serif; line-height: 1.4; }

/* Chrome */
#chrome-banner {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(120px);
  z-index: 300;
  display: flex; align-items: center; gap: 12px;
  background: rgba(4,15,35,0.96);
  border: 1px solid var(--panel-bdr);
  border-radius: 6px; padding: 12px 16px;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 40px rgba(0,0,0,.7), 0 0 0 1px rgba(0,212,255,.05);
  transition: transform .5s cubic-bezier(.34,1.4,.64,1);
  white-space: nowrap; max-width: calc(100vw - 32px);
}
#chrome-banner.show { transform: translateX(-50%) translateY(0); }
.cb-ico { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; }
.cb-body { display: flex; flex-direction: column; gap: 2px; }
.cb-body strong { font-size: 14px; color: #fff; font-family: 'Rajdhani', sans-serif; font-weight: 700; }
.cb-body span   { font-size: 11px; color: var(--muted); font-family: 'Rajdhani', sans-serif; }

#chrome-install {
  background: var(--cyan); color: #03070f;
  border: none; border-radius: 3px;
  padding: 9px 20px;
  font-family: 'Teko', sans-serif; font-size: 14px; font-weight: 700;
  letter-spacing: 1px; cursor: pointer; flex-shrink: 0;
  box-shadow: 0 0 16px rgba(0,212,255,0.3);
  transition: opacity .15s, transform .1s;
}
#chrome-install:hover  { opacity: .85; }
#chrome-install:active { transform: scale(.97); }

#chrome-dismiss {
  background: none; border: none; color: var(--muted);
  font-size: 14px; cursor: pointer; padding: 4px 8px;
  border-radius: 4px; transition: color .2s; flex-shrink: 0; line-height: 1;
}
#chrome-dismiss:hover { color: #fff; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .logo-img { max-width: 240px; }
  .lf-c     { font-size: 64px; }
  .lf-rest  { font-size: 56px; }
  .logo-eyebrow { font-size: 10px; letter-spacing: 5px; }
  .ls-panel { border-radius: 2px; }
  .cb-body span { display: none; }
  .corner   { width: 18px; height: 18px; }
}
