/* Tablet da pista — LOOG. Vidro escuro + azul elétrico; verde/vermelho fortes para decisão (frentista lê de longe, no sol). */
:root {
  --bg: var(--ink);
  --green: #12c06a;
  --green-dark: #06733f;
  --red: #e5303f;
  --red-dark: #8c0f1a;
  --yellow: #ffc83d;
}
* { -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; user-select: none; }
body { background:
    radial-gradient(900px 420px at 10% -10%, rgba(31, 75, 255, .22), transparent 60%),
    radial-gradient(700px 380px at 110% 0%, rgba(31, 75, 255, .12), transparent 60%),
    linear-gradient(180deg, #070a12, var(--ink) 60%, #03050a); background-attachment: fixed; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(77, 116, 255, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(77, 116, 255, .055) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 0%, #000, transparent 75%); animation: grid-drift 18s linear infinite; }
#app { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; }
#app > * { animation: viewIn .45s var(--ease-out) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

button { font: inherit; color: inherit; border: 0; border-radius: 18px; cursor: pointer; touch-action: manipulation; position: relative; overflow: hidden;
  font-family: var(--font-display); transition: transform .12s var(--ease-out), filter .15s; }
button:active { transform: scale(.97); filter: brightness(1.15); }
button:disabled { opacity: .4; }

/* Barra superior */
.top { display: flex; align-items: center; gap: 16px; padding: 12px 18px; background: rgba(8, 12, 22, .78); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); font-size: 18px; position: relative; animation: none !important; }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--blue-hi), transparent);
  background-size: 50% 100%; background-repeat: no-repeat; animation: topSweep 5s linear infinite; }
@keyframes topSweep { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.top .logo svg { height: 26px; width: auto; display: block; }
.top .who { font: 800 17px/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top .who::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.top .shift { color: var(--muted); font: 600 12px/1 var(--font-display); letter-spacing: .22em; text-transform: uppercase; }
#islandBtn { background: linear-gradient(180deg, var(--blue-hi), var(--blue)); border: 1px solid var(--line-hi); border-radius: 10px; padding: 8px 14px;
  font: 900 17px/1 var(--font-display) !important; letter-spacing: .1em; box-shadow: 0 0 18px rgba(31, 75, 255, .45); }

.screen { flex: 1; display: flex; flex-direction: column; padding: 22px; gap: 18px; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; flex: 1; gap: 18px; padding: 18px; }
.big { font: 900 32px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .01em; }
.title { font: 900 30px/1.05 var(--font-display); text-transform: uppercase; text-align: center; margin: 0; letter-spacing: .01em; }
.title em, .big em { font-style: normal; color: var(--blue-hi); }
.title::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 2px; margin: 14px auto 0; background: var(--blue); box-shadow: 0 0 14px var(--blue-glow);
  animation: ruleGrow .7s var(--ease-out) .25s both; }
@keyframes ruleGrow { from { transform: scaleX(0); } }
.muted { color: var(--muted); }
.eyebrow { font: 700 12px/1 var(--font-display); letter-spacing: .34em; text-transform: uppercase; color: #9db3ff; text-align: center; }

/* Botões */
.btn { min-height: 84px; padding: 0 28px; font: 800 26px/1 var(--font-display); text-transform: uppercase; letter-spacing: .05em; color: #fff;
  background: linear-gradient(180deg, var(--blue-hi), var(--blue) 60%, var(--blue-deep)); border: 1px solid var(--line-hi);
  box-shadow: 0 12px 30px rgba(31, 75, 255, .32), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .28) 50%, transparent 65%);
  transform: translateX(-120%); animation: shine 4.5s var(--ease-out) infinite; pointer-events: none; }
@keyframes shine { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.btn.green { background: linear-gradient(180deg, #2bf29b, var(--green) 55%, var(--green-dark)); border-color: rgba(25, 224, 138, .6); color: #02180c;
  box-shadow: 0 12px 30px rgba(25, 224, 138, .3), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.red { background: linear-gradient(180deg, #ff6470, var(--red) 55%, var(--red-dark)); border-color: rgba(255, 59, 74, .6); }
.btn.gray { background: rgba(255, 255, 255, .05); border-color: var(--line); box-shadow: none; color: #dfe5f5; }
.btn.gray::before { display: none; }
.btn.small { min-height: 64px; font-size: 17px; letter-spacing: .1em; }
.row { display: flex; gap: 14px; }
.row > * { flex: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.grid > * { animation: rise .5s var(--ease-out) both; }
.grid > *:nth-child(2) { animation-delay: .05s; } .grid > *:nth-child(3) { animation-delay: .1s; } .grid > *:nth-child(4) { animation-delay: .15s; }
.grid > *:nth-child(5) { animation-delay: .2s; } .grid > *:nth-child(6) { animation-delay: .25s; } .grid > *:nth-child(n+7) { animation-delay: .3s; }

.name-btn { min-height: 120px; font: 900 28px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .02em;
  background: linear-gradient(180deg, rgba(22, 30, 50, .78), rgba(10, 14, 24, .78)); border: 1px solid var(--line); backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 16px 40px rgba(0, 0, 0, .4); }
.name-btn::after { content: ""; position: absolute; left: 22px; bottom: 18px; width: 30px; height: 3px; background: var(--blue); box-shadow: 0 0 10px var(--blue-glow); }
.name-btn.sel { border: 2px solid var(--blue-hi); box-shadow: 0 0 30px rgba(31, 75, 255, .45); }

/* Login */
.hero { display: grid; justify-items: center; gap: 10px; padding: 26px 0 6px; }
.hero svg { height: 64px; width: auto; }

/* Teclado numérico */
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 520px; width: 100%; margin: 0 auto; }
.pad button { min-height: 84px; font: 800 38px/1 var(--font-display); background: linear-gradient(180deg, rgba(26, 34, 56, .85), rgba(12, 16, 28, .85));
  border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.pad button:active { background: var(--blue); border-color: var(--blue-hi); box-shadow: 0 0 24px var(--blue-glow); }
.pad button.del { color: var(--muted); }
.display { font: 900 52px/1 var(--font-display); text-align: center; background: rgba(0, 0, 0, .55); border-radius: 18px; padding: 18px 14px; letter-spacing: .06em;
  min-height: 92px; max-width: 520px; width: 100%; margin: 0 auto; border: 1px solid var(--line-hi); font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 30px rgba(31, 75, 255, .18), 0 0 0 4px rgba(31, 75, 255, .06); color: #fff; }
.hint { font: 700 18px/1.3 var(--font-display); text-align: center; color: var(--yellow); min-height: 24px; letter-spacing: .03em; }

/* Teclado de placa */
.kbd { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; width: 100%; }
.kbd button { min-height: 64px; font: 800 24px/1 var(--font-display); background: rgba(22, 30, 50, .8); border: 1px solid var(--line); border-radius: 10px; }
.kbd button:active { background: var(--blue); }

/* Cartão de decisão em tela cheia: a cor ocupa tudo (decisão em 1 segundo) */
.decision { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; position: relative; overflow: hidden; }
.decision.GREEN { background: radial-gradient(ellipse at 50% 30%, #1fe486, var(--green) 45%, #058a4a); }
.decision.RED { background: radial-gradient(ellipse at 50% 30%, #ff5562, var(--red) 45%, #a3101e); }
.decision::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px); background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, #000, transparent 70%); }
.decision::after { content: ""; position: absolute; left: 50%; top: 28%; width: 60vmin; height: 60vmin; margin: -30vmin; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .55);
  animation: pulseRing 2.2s var(--ease-out) infinite; pointer-events: none; }
@keyframes pulseRing { from { transform: scale(.3); opacity: .9; } to { transform: scale(1.3); opacity: 0; } }
.decision > * { position: relative; z-index: 1; }
.decision .icon { font: 900 130px/1 var(--font-display); animation: pop .6s var(--ease-snap) both; text-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
@keyframes pop { from { transform: scale(.2) rotate(-20deg); opacity: 0; } }
.decision .msg { font: 900 40px/1.05 var(--font-display); text-transform: uppercase; }
.decision .who-line { font: 700 26px/1.2 var(--font-display); }
.decision .note { font: 600 20px/1.3 var(--font-body); opacity: .92; }
.decision .brand-mark { position: absolute; top: 18px; left: 22px; opacity: .9; }
.decision .brand-mark svg { height: 26px; width: auto; display: block; }
.reasons { list-style: none; padding: 0; margin: 0; font: 800 26px/1.2 var(--font-display); text-transform: uppercase; }
.reasons li { background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .2); border-radius: 12px; padding: 10px 18px; margin: 8px 0; animation: rise .5s var(--ease-out) .3s both; }
.decision .actions { width: 100%; max-width: 700px; display: flex; gap: 14px; }
.decision .actions .btn { flex: 1; background: rgba(0, 0, 0, .3); border-color: rgba(255, 255, 255, .25); box-shadow: none; color: #fff; min-height: 100px; font-size: 30px; }
.decision.GREEN .actions .btn.main { background: #fff; color: var(--green-dark); }
.decision.RED .actions .btn.main { background: #fff; color: var(--red-dark); }
.lead-btn { background: linear-gradient(180deg, #ffffff, #e6ebff) !important; color: var(--blue-deep) !important; width: 100%; max-width: 700px; min-height: 96px; font-size: 28px !important; }

/* Placa Mercosul */
.plate { display: inline-flex; flex-direction: column; background: linear-gradient(180deg, #fff, #e9ecf3); color: #0b0f19; border: 4px solid #0b0f19; border-radius: 12px;
  font: 900 clamp(34px, 10vw, 64px)/1 var(--font-display); letter-spacing: .08em; white-space: nowrap; overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45), inset 0 -3px 0 rgba(0, 0, 0, .08); animation: plateIn .7s var(--ease-snap) both; }
.plate::before { content: "BRASIL"; display: block; background: linear-gradient(90deg, #0b3fb3, #1449c9); color: #fff; font: 700 .2em/1 var(--font-display);
  letter-spacing: .5em; padding: .3em 0 .25em; text-align: center; }
.plate { padding: 0 0 .08em; text-indent: .08em; }
@keyframes plateIn { from { transform: perspective(600px) rotateX(55deg) translateY(-20px); opacity: 0; } }

/* Fila de placas na tela inicial */
.queue { display: flex; flex-direction: column; gap: 12px; }
.qcard { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 16px; font: 800 21px/1.2 var(--font-display); text-transform: uppercase; text-align: left;
  border: 1px solid rgba(255, 255, 255, .2); animation: slideIn .5s var(--ease-out) both; color: #fff; }
@keyframes slideIn { from { transform: translateX(-30px); opacity: 0; } }
.qcard.GREEN { background: linear-gradient(90deg, var(--green), #0a9a54); box-shadow: 0 10px 30px rgba(25, 224, 138, .25); }
.qcard.RED { background: linear-gradient(90deg, var(--red), #b51a28); box-shadow: 0 10px 30px rgba(255, 59, 74, .2); }
.qcard .plate { font-size: 28px; border-width: 3px; animation: none; }
.qcard .grow { flex: 1; }
.waiting { display: grid; justify-items: center; gap: 18px; text-align: center; padding: 44px 0; }
.waiting .radar { position: relative; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(31, 75, 255, .25), transparent 65%); border: 1px solid var(--line-hi); }
.waiting .radar::before, .waiting .radar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--blue-hi); animation: pulseRing 2.4s var(--ease-out) infinite; }
.waiting .radar::after { animation-delay: 1.2s; }
.waiting .radar svg { width: 92px; height: auto; }
.waiting .txt { font: 800 22px/1.2 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: #c9d2ea; }
.waiting .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); margin-right: 10px; box-shadow: 0 0 10px var(--ok); animation: live 1.4s infinite; vertical-align: middle; }
.bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; padding: 14px 18px; background: rgba(8, 12, 22, .82); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); }

.fuel-btn { min-height: 120px; font: 900 27px/1.1 var(--font-display); text-transform: uppercase; color: #fff; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; border: 1px solid rgba(255, 255, 255, .18); box-shadow: 0 14px 34px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.fuel-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, .18), transparent 45%, rgba(0, 0, 0, .18)); pointer-events: none; }
.fuel-btn small { font: 700 17px/1.2 var(--font-body); text-transform: none; }
.fuel-btn.light { color: #0b0f19; text-shadow: none; }

.charge { font: 900 80px/1 var(--font-display); color: var(--yellow); font-variant-numeric: tabular-nums; text-shadow: 0 0 30px rgba(255, 200, 61, .35); }
.callout { font: 600 22px/1.4 var(--font-body); background: rgba(255, 176, 32, .08); border: 1px solid rgba(255, 176, 32, .35); border-radius: 14px; padding: 14px 20px; max-width: 700px; }
.callout b { font-family: var(--font-display); font-weight: 900; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: linear-gradient(180deg, #ff5562, var(--red)); color: #fff; padding: 18px 28px;
  border-radius: 16px; font: 800 22px/1.25 var(--font-display); text-transform: uppercase; max-width: 92vw; text-align: center; box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  z-index: 10; border: 1px solid rgba(255, 255, 255, .25); animation: toastIn .4s var(--ease-snap) both; }
.toast.ok { background: linear-gradient(180deg, #2bf29b, var(--green)); color: #02180c; }
@keyframes toastIn { from { transform: translate(-50%, 30px); opacity: 0; } }
.offline { background: var(--yellow); color: #111; text-align: center; font: 800 14px/1 var(--font-display); letter-spacing: .14em; padding: 8px; animation: none !important; }
.offline.training { background: linear-gradient(90deg, #4a2bff, #7c4dff); color: #fff; }
.sim-tag { background: #7c4dff; color: #fff; padding: 6px 14px; border-radius: 10px; font: 800 14px/1 var(--font-display); letter-spacing: .12em; }

/* Abertura do turno: encerrantes já preenchidos com o último fechamento */
.meters { display: grid; gap: 12px; max-width: 700px; width: 100%; margin: 0 auto; }
.meter-row { display: grid; grid-template-columns: 14px 1fr auto auto; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(22, 30, 50, .78), rgba(10, 14, 24, .78)); border: 1px solid var(--line); animation: rise .5s var(--ease-out) both; }
.meter-row:nth-child(2) { animation-delay: .06s; } .meter-row:nth-child(3) { animation-delay: .12s; }
.meter-row .swatch { width: 14px; align-self: stretch; border-radius: 6px; }
.meter-row .who b { display: block; font: 900 22px/1.1 var(--font-display); text-transform: uppercase; }
.meter-row .who small { color: var(--muted); font: 600 15px/1.3 var(--font-body); }
.meter-row .val { text-align: right; font: 900 34px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.meter-row .val small { display: block; margin-top: 6px; font: 700 11px/1 var(--font-display); letter-spacing: .18em; color: var(--ok); }
.meter-row.empty, .meter-row.changed { border-color: rgba(255, 176, 32, .55); }
.meter-row.empty .val small, .meter-row.changed .val small { color: var(--warn); }
.meter-row .btn.small { min-height: 56px; padding: 0 18px; }

/* =====================================================================
   MODO FÁCIL (padrão do tablet): leve para tablet barato e legível no sol.
   Sem animação contínua, sem desfoque de fundo, cores de decisão mais fortes.
   ===================================================================== */
body::before { animation: none; }
#app > * { animation: viewInLite .2s ease-out both; }
@keyframes viewInLite { from { opacity: 0; } }
.btn::before { animation: none; display: none; }
.top, .bar, .name-btn { backdrop-filter: none; }
.top { background: #080c16; } .bar { background: #080c16; }
.name-btn { background: #121a2c; }
.decision::after { animation-duration: 3s; animation-iteration-count: 2; }
/* Verde e vermelho escuros o bastante para o texto branco ler a 2 m, no sol */
.decision.GREEN { background: radial-gradient(ellipse at 50% 30%, #0f9a55, #087a41 55%, #055c31); }
.decision.RED { background: radial-gradient(ellipse at 50% 30%, #d4202f, #b0101e 55%, #860a16); }
.qcard.GREEN { background: #087a41; } .qcard.RED { background: #b0101e; }
.toast { pointer-events: none; }
#islandBtn { min-height: 44px; }

/* Treino: simular carro na câmera pelo próprio tablet */
.btn.sim { background: linear-gradient(180deg, #8f6bff, #6a3df0 60%, #4a22c9); border-color: rgba(167, 139, 255, .7); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qplate { min-height: 76px; display: grid; place-items: center; gap: 4px; background: #121a2c; border: 1px solid var(--line-hi); }
.qplate b { font: 900 24px/1 var(--font-display); letter-spacing: .06em; }
.qplate small { font: 700 12px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* Tela de simular cabe em tablet de 800 px de altura */
.screen:has(.quick) { gap: 10px; padding-top: 14px; }
.screen:has(.quick) .kbd button { min-height: 52px; }
.screen:has(.quick) .display { min-height: 72px; padding: 10px; font-size: 46px !important; }
.screen:has(.quick) .title::after { margin-top: 8px; }
