/* =============================================================
   style.css — Cidade Conectada · Seanet Telecom
   Tema "fundo do mar + tecnologia". Mobile-first, 320px pra cima.
   ============================================================= */

:root {
  --deep-0: #04121e;
  --deep-1: #072135;
  --deep-2: #0b2d46;
  --panel: rgba(10, 42, 66, 0.62);
  --panel-line: rgba(95, 227, 255, 0.16);
  --cyan: #29aad4;          /* ciano da marca Seanet */
  --cyan-bright: #5fe3ff;
  --gold: #ffc24b;
  --green: #3fe0a0;
  --text: #eaf7ff;
  --text-dim: #8fb2c7;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }   /* vence regras de display por classe */

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
  color: var(--text);
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, #0d3a5c 0%, transparent 60%),
    radial-gradient(ellipse 90% 60% at 20% 110%, #0a2c48 0%, transparent 55%),
    linear-gradient(180deg, var(--deep-1) 0%, var(--deep-0) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#app { position: relative; height: 100%; }

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.screen.active { display: flex; animation: screenIn .3s cubic-bezier(.2,.7,.3,1); }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------- bolhas ambiente (fundo do mar) ---------------- */

.ocean-bubbles {
  position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
}
.ocean-bubbles b {
  position: absolute; bottom: -40px; display: block; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(180,240,255,.55), rgba(95,200,240,.10) 70%);
  box-shadow: inset 0 0 6px rgba(255,255,255,.25);
  opacity: 0; animation: rise linear infinite;
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0) scale(.7); opacity: 0; }
  12%  { opacity: .5; }
  85%  { opacity: .35; }
  100% { transform: translateY(-102vh) translateX(var(--drift,12px)) scale(1); opacity: 0; }
}
#app > .screen { z-index: 1; }   /* telas acima das bolhas */

.scroll { flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }

/* ---------------- marca ---------------- */

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-img { width: min(64vw, 280px); height: auto; display: block; }
.brand-mark { width: 46px; height: 46px; flex: none; }
.brand-word {
  display: flex; flex-direction: column; line-height: 0.9;
}
.brand-word b {
  font-size: 34px; font-weight: 800; letter-spacing: -0.02em; color: #fff;
}
.brand-word b i { font-style: normal; color: var(--cyan); }
.brand-word span {
  font-size: 9px; font-weight: 600; letter-spacing: 0.42em;
  color: var(--text-dim); text-transform: lowercase; margin-top: 4px;
}

/* ---------------- botões ---------------- */

.btn {
  font: inherit; font-weight: 600; border: 0; cursor: pointer;
  border-radius: 999px; padding: 13px 26px; color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--panel-line);
  transition: transform .12s ease, filter .12s ease, background .12s ease;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(180deg, var(--cyan-bright), var(--cyan));
  color: #03202f; border-color: transparent;
  box-shadow: 0 8px 22px rgba(41, 170, 212, 0.35);
}
.btn-ghost { background: rgba(255, 255, 255, 0.05); }
.btn-lg { padding: 16px 46px; font-size: 18px; }
.btn-sm { padding: 10px 18px; font-size: 13px; }
.btn-block { display: block; width: 100%; margin: 22px auto 8px; max-width: 320px; }

.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--panel-line);
  color: var(--text); font-size: 19px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; touch-action: manipulation;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn[disabled] { opacity: 0.32; pointer-events: none; }
.icon-btn.is-muted { color: var(--text-dim); opacity: .7; }
.icon-btn--hint { border-color: rgba(255, 194, 75, .35); }

/* ---------------- splash ---------------- */

#screenSplash { justify-content: center; align-items: center; padding: 24px; }
.splash-inner { text-align: center; max-width: 460px; }
.splash-shark { margin: 18px 0 4px; }
.splash-shark { filter: drop-shadow(0 12px 26px rgba(41, 170, 212, 0.45)); }
.splash-shark .fibrao-img { margin: 0 auto; }
.splash-title { margin: 0; }
.splash-logo { display: block; width: min(100%, 420px); height: auto; margin: 0 auto; }
.splash-sub { color: var(--text-dim); font-size: 15px; line-height: 1.5; margin: 10px 0 26px; }
.splash-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.splash-actions .btn { min-width: 220px; }
.splash-actions #btnPlay:not(:only-child) {   /* vira secundário quando há "Continuar" */
  background: rgba(255,255,255,.06); color: var(--text);
  border: 1px solid var(--panel-line); box-shadow: none;
  padding: 12px 32px; font-size: 15px;
}
.splash-progress {
  color: var(--gold); font-size: 13px; font-weight: 600; margin-top: 14px;
}
.splash-progress span { color: var(--text-dim); font-weight: 400; }
.splash-gatehint { color: var(--text-dim); font-size: 12px; margin-top: 12px; }
.splash-foot { color: var(--text-dim); font-size: 12px; margin-top: 18px; opacity: .75; }

/* ---------------- topbar ---------------- */

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--panel-line);
  background: rgba(4, 18, 30, 0.5);
}
.topbar-title { flex: 1; font-weight: 600; font-size: 16px; line-height: 1.15; min-width: 0; }
.topbar-title small { display: block; font-size: 11px; font-weight: 400; color: var(--text-dim); }
.topbar-actions { display: flex; gap: 8px; }
.star-count { font-size: 13px; font-weight: 600; color: var(--gold); white-space: nowrap; }

/* ---------------- mundos ---------------- */

.world-list { display: grid; gap: 14px; max-width: 560px; margin: 0 auto; }
.world-card {
  text-align: left; padding: 18px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--panel-line);
  box-shadow: var(--shadow); cursor: pointer; color: var(--text);
  font: inherit; transition: transform .12s ease, border-color .12s ease;
}
.world-card:active { transform: scale(0.985); }
.world-card[disabled] { opacity: 0.45; cursor: not-allowed; }
.world-card h3 { font-size: 19px; font-weight: 700; }
.world-card .wc-sub { font-size: 12px; color: var(--cyan-bright); margin-top: 2px; }
.world-card .wc-desc { font-size: 13px; color: var(--text-dim); margin: 10px 0 12px; line-height: 1.45; }
.world-card .wc-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); }
.wc-progress { height: 6px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 8px; }
.wc-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--cyan-bright)); }
.world-card--special {
  background: linear-gradient(160deg, rgba(41,170,212,.20), rgba(10,42,66,.62));
  border-color: rgba(95,227,255,.30);
}
.world-card--special .stars { display: inline-flex; }

/* ---------------- níveis ---------------- */

.levels-sub { color: var(--text-dim); font-size: 13px; margin: 2px 0 16px; text-align: center; }
.level-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 10px; max-width: 560px; margin: 0 auto;
}
.level-cell {
  aspect-ratio: 1; border-radius: 14px; cursor: pointer; font: inherit; color: var(--text);
  background: var(--panel); border: 1px solid var(--panel-line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 4px; transition: transform .12s ease;
}
.level-cell:active { transform: scale(0.94); }
.level-cell b { font-size: 19px; font-weight: 700; }
.level-cell .lc-name { font-size: 8.5px; color: var(--text-dim); text-align: center; line-height: 1.1;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.level-cell.done { border-color: rgba(41, 170, 212, 0.5); }
.level-cell.locked { opacity: 0.35; cursor: not-allowed; }
.stars { display: flex; gap: 2px; font-size: 9px; line-height: 1; color: rgba(255,255,255,.18); }
.stars .on { color: var(--gold); }

/* ---------------- HUD do jogo ---------------- */

.hud {
  display: flex; gap: 12px; padding: 12px 14px; align-items: flex-start;
  border-bottom: 1px solid var(--panel-line);
}
.hud-item { flex: 1; min-width: 0; }
.hud-item--right { flex: none; text-align: right; }
.hud-label { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.hud-value { font-size: 15px; }
.hud-value b { font-weight: 700; font-size: 19px; color: var(--cyan-bright); }
.hud-value i { font-style: normal; font-size: 12px; color: var(--text-dim); }
.hud-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); margin-top: 6px; overflow: hidden; }
.hud-bar span { display: block; height: 100%; width: 0; background: var(--green); transition: width .18s ease, background .18s ease; }
.hud-bar span.warn { background: var(--gold); }
.hud-bar span.over { background: #ff7a6b; }
.hud-stars { display: flex; gap: 3px; justify-content: flex-end; margin-top: 7px; font-size: 12px; color: rgba(255,255,255,.18); }
.hud-stars .on { color: var(--gold); }

/* ---------------- tabuleiro ---------------- */

.board-wrap { position: relative; flex: 1; min-height: 0; margin: 4px 0; overflow: hidden; }
#board { display: block; position: relative; z-index: 2; touch-action: none; }
.board-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

/* mapa real da localidade, escurecido, atrás da grade */
.board-map {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  z-index: 0; opacity: 0; transition: opacity .5s ease;
  filter: grayscale(.25) saturate(.85) brightness(.42) contrast(1.05);
}
.board-map.show { opacity: 1; }
.board-veil {
  position: absolute; inset: 0; z-index: 1; opacity: 0; pointer-events: none;
  transition: opacity .5s ease;
  background:
    radial-gradient(ellipse 75% 65% at 50% 45%, transparent 30%, rgba(4,18,30,.55) 100%),
    linear-gradient(180deg, rgba(4,18,30,.35), rgba(4,18,30,.5));
}
.board-veil.show { opacity: 1; }
.map-credit {
  position: absolute; right: 6px; bottom: 4px; z-index: 4;
  font-size: 9px; color: rgba(234,247,255,.45); pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,.6); opacity: 0; transition: opacity .5s ease;
}
.map-credit.show { opacity: 1; }

/* explosão de partículas na conclusão do nível */
.spark {
  position: absolute; left: 0; top: 0; width: 9px; height: 9px; border-radius: 50%;
  will-change: transform, opacity; pointer-events: none;
}
.spark.gold { background: radial-gradient(circle, #ffe9a8, #ffbf3b 70%); }
.spark.cyan { background: radial-gradient(circle, #d4fbff, #5fe3ff 70%); }

.fibrao-swimmer {
  position: absolute; left: 0; top: 0;
  transition: opacity .4s ease;
  filter: drop-shadow(0 0 12px rgba(95, 227, 255, .7));
}
.fibrao-swimmer .fibrao-img { display: block; }
.fibrao-swimmer.fade { opacity: 0; }

/* imagem oficial do mascote */
.fibrao-img { display: block; height: auto; user-select: none; -webkit-user-drag: none; }

/* ---------------- Fibrão no rodapé ---------------- */

.fibrao {
  position: relative; display: flex; align-items: flex-end; gap: 8px;
  padding: 4px 14px 14px; min-height: 100px; flex: none;
}
.fibrao-body { flex: none; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .4)); }
.fibrao-body .fibrao-img { display: block; }
.fibrao-bubble {
  order: 2; max-width: 260px; font-size: 13px; line-height: 1.35;
  background: #fff; color: #06283c; padding: 10px 13px; border-radius: 14px;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(6px) scale(.94);
  transition: opacity .22s ease, transform .22s ease; pointer-events: none;
  margin-bottom: 14px; position: relative;
}
.fibrao-bubble::after {
  content: ''; position: absolute; left: -6px; bottom: 12px;
  border: 7px solid transparent; border-right-color: #fff; border-left: 0;
}
.fibrao-bubble.show { opacity: 1; transform: translateY(0) scale(1); }

.fibrao.nudge .fibrao-body { animation: nudge .7s ease; }
.fibrao.celebrate .fibrao-body { animation: celebrate 1s ease; }
@keyframes nudge {
  0%,100% { transform: rotate(0) translateY(0); }
  30% { transform: rotate(-7deg) translateY(-5px); }
  60% { transform: rotate(6deg) translateY(-2px); }
}
@keyframes celebrate {
  0%,100% { transform: scale(1) rotate(0); }
  25% { transform: scale(1.14) rotate(-9deg); }
  50% { transform: scale(1.06) rotate(7deg); }
  75% { transform: scale(1.12) rotate(-4deg); }
}

/* Portal de captura de leads: ver css/kiosk.css */

/* ---------------- avisos de conquista ---------------- */

.toast-wrap {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 12px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 380px; width: 100%;
  background: linear-gradient(180deg, #12496b, #0b3149);
  border: 1px solid rgba(255, 194, 75, .45); border-radius: 14px;
  padding: 10px 14px; box-shadow: var(--shadow);
  animation: toastIn .35s cubic-bezier(.2,1.2,.4,1);
}
.toast.out { animation: toastOut .3s ease forwards; }
.toast b { font-size: 22px; line-height: 1; }
.toast div { min-width: 0; }
.toast .t-title { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.toast .t-name { font-size: 14px; font-weight: 600; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px); } }

/* ---------------- modal de vitória ---------------- */

.modal {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(3, 14, 24, 0.78); backdrop-filter: blur(6px); padding: 20px; z-index: 20;
}
.modal.active { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal-card {
  background: linear-gradient(180deg, var(--deep-2), var(--deep-1));
  border: 1px solid var(--panel-line); border-radius: 22px; box-shadow: var(--shadow);
  padding: 26px 22px; text-align: center; max-width: 380px; width: 100%;
  animation: pop .3s cubic-bezier(.2,1.3,.5,1);
}
@keyframes pop { from { transform: scale(.85); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.win-stars { font-size: 34px; letter-spacing: 6px; color: rgba(255,255,255,.16); margin-bottom: 6px; }
.win-stars .on { color: var(--gold); text-shadow: 0 0 18px rgba(255,194,75,.55); }
.win-stars .on:nth-child(1) { animation: starPop .4s .05s both; }
.win-stars .on:nth-child(2) { animation: starPop .4s .18s both; }
.win-stars .on:nth-child(3) { animation: starPop .4s .31s both; }
@keyframes starPop { from { transform: scale(0) rotate(-40deg); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.modal-card h2 { font-size: 23px; font-weight: 700; }
.win-stats { color: var(--text-dim); font-size: 14px; line-height: 1.6; margin-top: 8px; }
.win-stats b { color: var(--cyan-bright); }
.win-shark { margin: 6px 0 14px; }
.modal-card--wide { max-width: 440px; }
.trophy-list {
  display: grid; gap: 8px; margin: 14px 0 16px;
  max-height: 52vh; overflow-y: auto; text-align: left;
}
.trophy {
  display: flex; align-items: center; gap: 11px;
  background: rgba(255,255,255,.04); border: 1px solid var(--panel-line);
  border-radius: 12px; padding: 9px 12px;
}
.trophy.got { border-color: rgba(255,194,75,.45); background: rgba(255,194,75,.08); }
.trophy b { font-size: 21px; line-height: 1; filter: grayscale(1); opacity: .45; }
.trophy.got b { filter: none; opacity: 1; }
.trophy .t-name { font-size: 14px; font-weight: 600; }
.trophy .t-desc { font-size: 11.5px; color: var(--text-dim); line-height: 1.35; }

.modal-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.modal-actions .btn { padding: 12px 20px; font-size: 14px; }

/* ---------------- telas maiores ---------------- */

@media (min-width: 720px) {
  .hud { padding: 14px 24px; }
  .topbar { padding: 14px 24px; }
  .fibrao { padding: 4px 24px 16px; }
  .fibrao-bubble { max-width: 380px; font-size: 14px; }
}
@media (min-width: 900px) and (min-height: 640px) {
  .board-wrap { max-width: 640px; width: 100%; margin: 4px auto; }
}
@media (max-height: 640px) {
  .fibrao { min-height: 68px; padding-bottom: 6px; }
  .fibrao-body .fibrao-img { width: 66px; }
  .hud { padding: 8px 14px; }
  .topbar { padding: 8px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
