:root {
  --abyss: #070512; --deep: #120A2A; --glass: rgba(28, 20, 56, .62); --glass-2: rgba(44, 33, 84, .55);
  --edge: rgba(255, 255, 255, .07); --edge-hi: rgba(255, 255, 255, .14);
  --text: #F4F2FF; --haze: #A9A3C7;
  --volt: #D4FF3A; --volt-deep: #7E9E00; --ink: #172000;
  --ion: #3DF5FF; --pulse: #FF3D9A;
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--abyss); }
body {
  margin: 0; min-height: 100vh; color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.55;
  background:
    radial-gradient(120% 60% at 50% -10%, #2A1263 0%, rgba(42, 18, 99, 0) 60%),
    radial-gradient(80% 40% at 100% 30%, rgba(61, 245, 255, .07), transparent 70%),
    var(--abyss);
  background-attachment: fixed;
}
/* Piso de grade em perspectiva */
body::before {
  content: ""; position: fixed; left: -50%; right: -50%; bottom: -10vh; height: 55vh; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(140, 110, 255, .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 110, 255, .22) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(380px) rotateX(62deg); transform-origin: bottom;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%); mask-image: linear-gradient(to top, #000 10%, transparent 85%);
}
#app { max-width: 480px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px calc(118px + env(safe-area-inset-bottom)); }

h1, h2, h3, .display { font-family: var(--display); letter-spacing: -0.02em; }
h1 { font-size: 26px; font-weight: 700; margin: 2px 0 6px; line-height: 1.15; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
p { margin: 0 0 8px; }
.muted { color: var(--haze); font-size: 14px; }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* Cabeçalho */
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.top h1 { margin: 0; }
.logo3d { width: 40px; height: 40px; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 14; overflow: visible; }
.logo3d .l1 { stroke: var(--volt); filter: drop-shadow(0 0 6px rgba(212, 255, 58, .8)) drop-shadow(0 5px 0 var(--volt-deep)); }
.logo3d .l2 { stroke: var(--ion); opacity: .55; filter: drop-shadow(0 0 6px rgba(61, 245, 255, .6)); }
.logo3d.big { width: 92px; height: 92px; }

/* Superfícies */
.card {
  position: relative; background: var(--glass); border: 1px solid var(--edge); border-radius: 24px; padding: 18px; margin-bottom: 14px;
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 18px 40px -18px rgba(0, 0, 0, .7);
}

/* Mostrador 3D */
.dial-wrap { perspective: 900px; margin: 6px 0 2px; touch-action: pan-y; }
.dial {
  position: relative; width: min(310px, 86vw); aspect-ratio: 1; margin: 0 auto;
  transform: rotateX(var(--rx, 16deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; transition: transform .25s ease-out;
}
.dial::before {
  content: ""; position: absolute; inset: 15%; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #33246A 0%, #160E33 55%, #0B0620 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .1), inset 0 -10px 24px rgba(0, 0, 0, .55), 0 0 0 10px rgba(255, 255, 255, .025), 0 28px 50px rgba(0, 0, 0, .65);
  transform: translateZ(-10px);
}
.dial svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dial .track { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 14; stroke-linecap: round; }
.dial .arc { fill: none; stroke-width: 14; stroke-linecap: round; }
.dial-wrap.anim .arc { animation: draw 1.5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
.dial .tick { stroke: rgba(169, 163, 199, .22); stroke-width: 2; stroke-linecap: round; }
.dial .tick.on { stroke: var(--volt); }
.dial-num {
  position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 37%;
  transform: translateZ(46px); pointer-events: none;
}
.dial-num .num {
  font-family: var(--display); font-weight: 800; font-size: clamp(44px, 14vw, 58px); letter-spacing: -0.04em; color: var(--volt); line-height: 1;
  text-shadow: 0 1px 0 #B6DC1F, 0 2px 0 #9CBF10, 0 3px 0 #86A604, 0 4px 0 var(--volt-deep), 0 10px 14px rgba(0, 0, 0, .55), 0 0 28px rgba(212, 255, 58, .45);
}
.dial-num .unit { font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--text); margin-left: 4px; }
.dial-cap { position: absolute; left: 0; right: 0; top: 60%; text-align: center; color: var(--haze); font-size: 13px; transform: translateZ(30px); line-height: 1.35; }
.dial-cap b { color: var(--text); font-weight: 600; }
.hero-meta { text-align: center; margin: -6px 0 16px; }
.hero-meta .chip { margin-bottom: 6px; }

/* Chips e mensagens */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--glass-2); border: 1px solid var(--edge); }
.chip.bom { color: var(--volt); border-color: rgba(212, 255, 58, .35); box-shadow: 0 0 16px rgba(212, 255, 58, .18); }
.chip.atencao { color: var(--ion); border-color: rgba(61, 245, 255, .35); }
.chip.alerta { color: var(--pulse); border-color: rgba(255, 61, 154, .4); }
.msg { padding-left: 22px; overflow: hidden; }
.msg::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--volt); box-shadow: 0 0 14px var(--volt); }
.msg.neutro::before { background: var(--haze); box-shadow: none; }
.msg.atencao::before { background: var(--ion); box-shadow: 0 0 14px var(--ion); }
.msg.alerta::before { background: var(--pulse); box-shadow: 0 0 14px var(--pulse); }
.msg h2 { margin-bottom: 4px; }

/* Gráfico */
.seg { display: inline-flex; background: rgba(0, 0, 0, .3); border-radius: 999px; padding: 3px; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .4); }
.seg button { border: 0; background: none; color: var(--haze); padding: 5px 12px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--volt); color: var(--ink); box-shadow: 0 2px 0 var(--volt-deep), 0 0 14px rgba(212, 255, 58, .4); }
.chart { width: 100%; height: auto; display: block; margin-top: 10px; overflow: visible; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--haze); margin-top: 6px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* Meta */
.bar { height: 12px; background: rgba(0, 0, 0, .35); border-radius: 999px; overflow: hidden; margin: 12px 0 8px; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .5); }
.bar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ion), var(--volt)); box-shadow: 0 0 14px rgba(212, 255, 58, .5); }

.why p { font-family: var(--display); font-weight: 500; font-size: 17px; line-height: 1.4; letter-spacing: -0.01em; }

/* Missão */
.days { display: flex; justify-content: space-between; margin-top: 14px; }
.day {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--edge-hi); background: var(--glass-2); color: var(--haze);
  font-family: var(--display); font-size: 12px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .45); transition: transform .12s, box-shadow .12s;
}
.day:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .45); }
.day.hoje { border-color: var(--volt); color: var(--text); }
.day.on { background: var(--volt); border-color: var(--volt); color: var(--ink); box-shadow: 0 4px 0 var(--volt-deep), 0 0 18px rgba(212, 255, 58, .45); }
.day:disabled { opacity: .3; cursor: default; box-shadow: none; }

/* Formulários */
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; padding: 13px 14px; border-radius: 16px; border: 1px solid var(--edge); background: rgba(0, 0, 0, .32);
  color: var(--text); font: inherit; font-size: 16px; color-scheme: dark; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .45);
}
input::placeholder, textarea::placeholder { color: rgba(169, 163, 199, .55); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--volt); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .45), 0 0 0 3px rgba(212, 255, 58, .18), 0 0 18px rgba(212, 255, 58, .25); }
select option { background: var(--deep); }
textarea { resize: vertical; min-height: 72px; }
.peso-input { font-family: var(--display); font-size: 44px; font-weight: 800; text-align: center; padding: 16px; letter-spacing: -0.03em; color: var(--volt); text-shadow: 0 0 20px rgba(212, 255, 58, .35); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.err { color: var(--pulse); font-size: 13px; margin-top: 4px; }
.err:empty { display: none; }
.hint { color: var(--haze); font-size: 12px; margin-top: 6px; }

/* Botões com volume */
.btn {
  display: block; width: 100%; border: 0; border-radius: 18px; padding: 16px; margin-top: 18px; cursor: pointer;
  font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  background: linear-gradient(180deg, #E6FF7A 0%, var(--volt) 45%, #BFE81C 100%); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 6px 0 var(--volt-deep), 0 14px 30px -6px rgba(212, 255, 58, .45);
  transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translateY(5px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 0 var(--volt-deep), 0 6px 16px -6px rgba(212, 255, 58, .45); }
.btn.sec { background: var(--glass-2); color: var(--text); border: 1px solid var(--edge-hi); box-shadow: inset 0 1px 0 var(--edge-hi), 0 5px 0 rgba(0, 0, 0, .5); }
.btn.sec:active { box-shadow: inset 0 1px 0 var(--edge-hi), 0 1px 0 rgba(0, 0, 0, .5); }
.btn.perigo { background: transparent; color: var(--pulse); border: 1px solid rgba(255, 61, 154, .45); box-shadow: 0 5px 0 rgba(255, 61, 154, .18); }
.btn.perigo:active { box-shadow: 0 1px 0 rgba(255, 61, 154, .18); }
:focus-visible { outline: 2px solid var(--ion); outline-offset: 3px; }

.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tag { border: 1px solid var(--edge-hi); background: var(--glass-2); color: var(--text); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer; box-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.tag:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.tag.on { background: var(--volt); color: var(--ink); border-color: var(--volt); font-weight: 700; box-shadow: 0 3px 0 var(--volt-deep), 0 0 14px rgba(212, 255, 58, .35); }
.scroll-x { overflow-x: auto; flex-wrap: nowrap; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x .tag { flex: none; }

/* Histórico */
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--edge); gap: 8px; }
.hist li:last-child { border-bottom: 0; }
.hist b { font-family: var(--display); font-size: 17px; font-weight: 700; }
.del { background: none; border: 0; color: var(--haze); font-size: 22px; cursor: pointer; padding: 4px 8px; line-height: 1; border-radius: 10px; }
.del:hover { color: var(--pulse); }

/* Métricas */
.metric { background: rgba(0, 0, 0, .28); border: 1px solid var(--edge); border-radius: 18px; padding: 12px 14px; box-shadow: inset 0 1px 0 var(--edge); }
.metric b { display: block; font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.03em; margin: 2px 0; }
.metric span { font-size: 12px; color: var(--haze); }
.metric .chip { font-size: 11px; padding: 3px 8px; }

/* Prato em perspectiva */
.prato3d { perspective: 700px; display: flex; justify-content: center; padding: 4px 0 26px; }
.plate {
  width: 200px; height: 200px; border-radius: 50%; display: grid; place-items: center; transform: rotateX(56deg);
  background: radial-gradient(circle, #2E2358 0 58%, #3A2D6E 59% 61%, #231A48 62% 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .06), 0 10px 0 #0F0A22, 0 12px 0 rgba(255, 255, 255, .04), 0 34px 40px rgba(0, 0, 0, .7);
}
.plate svg { width: 76%; height: 76%; overflow: visible; }
.legenda-prato { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.legenda-prato li { display: flex; gap: 10px; align-items: baseline; }
.legenda-prato i { flex: none; width: 10px; height: 10px; border-radius: 3px; transform: translateY(1px); }
.maos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; text-align: center; }
.maos div { background: rgba(0, 0, 0, .28); border: 1px solid var(--edge); border-radius: 18px; padding: 12px 6px; font-size: 13px; }
.maos svg { width: 34px; height: 34px; display: block; margin: 0 auto 6px; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.maos b { display: block; font-weight: 600; }
.pf ul { margin: 10px 0; padding-left: 18px; font-size: 15px; }
.pf li::marker { color: var(--volt); }
.pf .dica { font-size: 13px; color: var(--ion); background: rgba(61, 245, 255, .06); border: 1px solid rgba(61, 245, 255, .15); border-radius: 12px; padding: 9px 12px; }
.aviso { font-size: 12px; color: var(--haze); text-align: center; margin: 18px 8px; }

/* Menu flutuante */
.nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 10;
  display: flex; justify-content: space-around; max-width: 456px; margin: 0 auto; padding: 8px;
  background: rgba(20, 13, 44, .78); border: 1px solid var(--edge-hi); border-radius: 26px;
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 8px 0 rgba(0, 0, 0, .35), 0 20px 40px rgba(0, 0, 0, .6);
}
.nav[hidden] { display: none; }
.nav button { position: relative; flex: 1; background: none; border: 0; color: var(--haze); font: inherit; font-size: 11px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; padding: 6px 4px; border-radius: 18px; }
.nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav button.on { color: var(--volt); background: rgba(212, 255, 58, .08); }
.nav button.on svg { filter: drop-shadow(0 0 6px rgba(212, 255, 58, .8)); }

.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); z-index: 20;
  background: var(--volt); color: var(--ink); font-weight: 700; padding: 11px 20px; border-radius: 999px; font-size: 14px;
  box-shadow: 0 4px 0 var(--volt-deep), 0 0 30px rgba(212, 255, 58, .5);
  opacity: 0; pointer-events: none; transition: .25s; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.onb-hero { text-align: center; padding: 28px 0 10px; }
.onb-hero h1 { font-size: 28px; margin-top: 18px; }
.vazio { color: var(--haze); font-size: 14px; text-align: center; padding: 24px 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .dial { transform: rotateX(16deg); }
}
