/* NEXBRAIN: coluna única de app móvel. Fundo Tinta Noturna, turquesa de marca, coral para chamadas de ação, amarelo para conquistas.
   Fonte da marca: Nunito (títulos e texto). */
:root {
  --bg: #14224F;
  --surface: #1B2C63;
  --surface-2: #22377A;
  --line: #2E4590;
  --fg: #F5FAFC;
  --muted: #9FB0D6;
  --accent: #22C3D3;
  --accent-deep: #1AA6B6;
  --accent-ink: #0E7C86;
  --ok: #4CB782;
  --bad: #FF5A5F;
  --gold: #FFC93C;
  /* cores de estímulo dos jogos */
  --stim-yellow: #FFD23F;
  --stim-black: #000000;
  --stim-red: #FF2E2E;
  --font-display: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 14px;
  color-scheme: dark;
  --coral: #FF7A59;
  --sun: #FFC93C;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--font-body);
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app {
  height: 100%;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 12px 28px;
  gap: 18px;
}

/* ---------- Topo ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px;
}
.topbar .logo { height: 34px; width: auto; display: block; }
.topbar h1 { font: 600 18px/1.2 var(--font-display); letter-spacing: .06em; text-transform: uppercase; margin: 0; flex: 1; text-align: center; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; flex: none;
}
.icon-btn svg { width: 20px; height: 20px; }
.acct-btn {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px 0 6px;
  border-radius: 21px; background: var(--surface); border: 1px solid var(--line); cursor: pointer;
  font-size: 13px; font-weight: 600;
}
.acct-btn .av { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--accent); font: 700 13px var(--font-display); }
.acct-btn.pro .av { background: var(--accent); color: var(--bg); }

/* ---------- Início ---------- */
.hero { display: grid; gap: 6px; padding-top: 4px; }
.hero h2 { margin: 0; font: 600 26px/1.15 var(--font-display); text-wrap: balance; }
.hero p { margin: 0; color: var(--muted); max-width: 40ch; }
.today { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.chip b { color: var(--fg); font-weight: 700; }

.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; }
.section-h h3 { margin: 0; font: 600 13px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.section-h span { font-size: 12px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card {
  position: relative; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; display: grid; gap: 10px; align-content: start; min-height: 150px;
  transition: transform .12s ease, border-color .12s ease;
}
.card:active { transform: scale(.98); }
.card:hover { border-color: #3B55A8; }
.card .gi { width: 44px; height: 44px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; border: 1px solid var(--line); }
.card .gi svg { width: 28px; height: 28px; }
.card .nm { font: 700 15px/1.15 var(--font-display); letter-spacing: .04em; text-transform: uppercase; }
.card .ar { font-size: 12px; color: var(--muted); }
.card .last { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card .last b { color: var(--accent); }
.badge {
  position: absolute; top: 12px; right: 12px;
  font: 700 10px var(--font-display); letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 6px;
}
.badge.free { color: var(--ok); background: rgba(76, 183, 130, .1); }
.badge.pro { color: var(--accent); background: rgba(34, 195, 211, .12); display: inline-flex; gap: 4px; align-items: center; }
.badge.pro svg { width: 10px; height: 10px; }
.card.locked .gi svg, .card.locked .nm { opacity: .6; }

.promo {
  border-radius: var(--r); padding: 18px; display: grid; gap: 10px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(34, 195, 211, .22), transparent 60%),
    var(--surface);
  border: 1px solid rgba(34, 195, 211, .35);
}
.promo h3 { margin: 0; font: 600 19px/1.2 var(--font-display); }
.promo p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Botões / formulários ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  min-height: 52px; padding: 0 24px; border-radius: 999px;
  font: 800 16px var(--font-display); letter-spacing: .03em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent-ink); color: #fff;
}
.btn.cta { background: var(--coral); color: var(--bg); }
.btn:active { filter: brightness(.9); }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.soft { background: var(--surface-2); color: var(--fg); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 140px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 14px; }
.panel h4 { margin: 0; font: 600 13px var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.input {
  height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  color: var(--fg); padding: 0 14px; font: 15px var(--font-body); width: 100%;
}
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  flex: 1 1 auto; min-height: 40px; padding: 0 12px; border-radius: 10px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); font-size: 14px; font-weight: 600;
}
.seg button[aria-pressed="true"] { background: rgba(34, 195, 211, .14); border-color: var(--accent); color: var(--accent); }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 44px; height: 44px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line);
  font: 700 20px var(--font-display); cursor: pointer;
}
.stepper output { min-width: 56px; text-align: center; font: 700 24px var(--font-display); font-variant-numeric: tabular-nums; }

.how { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.how li::marker { color: var(--accent); font-family: var(--font-display); }

.notice { font-size: 13px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 197, 66, .08); border: 1px solid rgba(255, 197, 66, .3); color: #FFE4A0; }
.error-text { color: var(--bad); font-size: 13px; min-height: 1em; }

/* ---------- Planos ---------- */
.plans { display: grid; gap: 10px; }
.plan {
  text-align: left; cursor: pointer; border-radius: var(--r); padding: 16px;
  background: var(--surface); border: 1.5px solid var(--line); display: grid; gap: 4px; position: relative;
}
.plan[aria-pressed="true"] { border-color: var(--accent); background: rgba(34, 195, 211, .07); }
.plan .pn { font: 700 14px var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.plan .pp { font: 700 28px var(--font-display); font-variant-numeric: tabular-nums; }
.plan .pp small { font-size: 14px; color: var(--muted); font-weight: 500; }
.plan .tag { position: absolute; top: 14px; right: 14px; font: 700 10px var(--font-display); letter-spacing: .1em; padding: 4px 8px; border-radius: 6px; background: var(--accent); color: var(--bg); text-transform: uppercase; }
.feat { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feat li { display: flex; gap: 10px; align-items: flex-start; }
.feat li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(34, 195, 211, .18); }

/* ---------- Tela de jogo ---------- */
.play { height: 100%; display: flex; flex-direction: column; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); padding-block: 8px 12px; gap: 8px; }
.hud { display: flex; align-items: center; gap: 8px; }
.hud .title { flex: 1; min-width: 0; font: 700 14px var(--font-display); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud .stats { display: flex; gap: 6px; }
.hud .stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px 7px; text-align: center; min-width: 44px; }
.hud .stat small { display: block; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hud .stat b { font: 700 16px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.progressbar { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.progressbar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }
.stage {
  position: relative; flex: 1; min-height: 0; border-radius: 16px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.overlay {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px;
  background: rgba(20, 34, 79, .8); z-index: 30;
}
.overlay .big { font: 700 56px var(--font-display); color: var(--accent); }
.overlay .msg { font: 600 20px/1.3 var(--font-display); }
.overlay .sub { color: var(--muted); margin-top: 6px; }
.flash { position: absolute; inset: 0; pointer-events: none; z-index: 25; opacity: 0; transition: opacity .25s; }
.flash.ok { background: radial-gradient(circle, rgba(76, 183, 130, .25), transparent 70%); opacity: 1; transition: none; }
.flash.bad { background: radial-gradient(circle, rgba(255, 90, 95, .3), transparent 70%); opacity: 1; transition: none; }
.toast {
  position: absolute; left: 50%; top: 64px; transform: translateX(-50%); z-index: 40;
  background: var(--accent); color: var(--bg); padding: 6px 14px; border-radius: 999px;
  font: 700 13px var(--font-display); letter-spacing: .08em; text-transform: uppercase; pointer-events: none;
  animation: toast 1.4s ease forwards;
}
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -8px); } 15%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* elementos genéricos de estímulo */
.dot { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); cursor: pointer; border: 0; padding: 0; }
.dot.yellow { background: var(--stim-yellow); box-shadow: 0 0 24px rgba(255, 210, 63, .35); }
.dot.black { background: var(--stim-black); box-shadow: 0 0 0 3px #4A5FA3, 0 0 18px rgba(0, 0, 0, .8); }
.dot.red { background: var(--stim-red); box-shadow: 0 0 28px rgba(255, 46, 46, .6); }
.dot.pop { animation: pop .14s ease-out; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.4); } to { transform: translate(-50%, -50%) scale(1); } }
.cue {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line);
  font: 700 18px var(--font-display); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
.cue i { width: 22px; height: 22px; border-radius: 50%; display: block; }
.timerbar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--accent); z-index: 6; }

/* ---------- Resultado ---------- */
.result-hero { text-align: center; display: grid; gap: 4px; padding: 10px 0; }
.result-hero .score { font: 700 64px/1 var(--font-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.result-hero .rec { color: var(--gold); font: 700 13px var(--font-display); letter-spacing: .12em; text-transform: uppercase; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.metric small { display: block; color: var(--muted); font-size: 12px; }
.metric b { font: 700 22px var(--font-display); font-variant-numeric: tabular-nums; }
.tip { background: var(--surface); border-left: 3px solid var(--accent); padding: 12px 14px; border-radius: 0 12px 12px 0; color: var(--muted); font-size: 14px; }

/* ---------- Evolução ---------- */
.evo { display: grid; gap: 8px; }
.evo-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.evo-row .gi svg { width: 26px; height: 26px; }
.evo-row .nm { font: 700 13px var(--font-display); letter-spacing: .06em; text-transform: uppercase; }
.evo-row .sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trend { font: 700 13px var(--font-display); font-variant-numeric: tabular-nums; }
.trend.up { color: var(--ok); } .trend.down { color: var(--bad); } .trend.flat { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (min-width: 520px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.logo-wrap { display: flex; align-items: center; }
.logo-wrap svg { height: 34px; width: auto; display: block; }

/* ---------- Jogadores ---------- */
.player-bar { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
.player-bar.invite { border-color: var(--coral); background: rgba(255, 122, 89, .1); }
.pl-av { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 800 15px var(--font-display); color: var(--bg); }
.pl-av.big { width: 48px; height: 48px; font-size: 18px; }
.pl-nm { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.pl-nm small { color: var(--muted); font-size: 12px; }
.pl-nm b { font-weight: 800; }
.pl-ch { color: var(--accent); font-weight: 800; font-size: 14px; }
.pl-head { display: flex; align-items: center; gap: 12px; }
.pl-head > div { flex: 1; }

/* ---------- Notebook e PC ---------- */
@media (min-width: 900px) {
  #app { max-width: 1120px; }
  .screen:not(.wide), .play { max-width: 640px; margin-left: auto; margin-right: auto; width: 100%; }
  .screen.wide { padding-left: 32px; padding-right: 32px; gap: 22px; }
  .screen.wide .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .screen.wide .hero h2 { font-size: 32px; }
  .screen.wide .hero p, .screen.wide .promo { max-width: 720px; }
  .screen.wide .evo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card, .evo-row, .btn, .player-bar, .acct-btn { transition: border-color .15s, background-color .15s; }
  .card:hover, .evo-row:hover, .player-bar:hover { border-color: var(--accent); }
  .btn:hover { filter: brightness(1.08); }
  .player-bar { max-width: 420px; }
}

.link-btn { align-self: center; text-align: center; appearance: none; background: none; border: 0; color: var(--accent); font: 700 14px var(--font-body); cursor: pointer; padding: 10px; text-decoration: underline; text-underline-offset: 3px; }
