@font-face { font-family: "DSEG7"; src: url(/fonts/DSEG7Classic-Bold.woff2) format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "Shoulders"; src: url(/fonts/big-shoulders-display-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Shoulders"; src: url(/fonts/big-shoulders-display-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(/fonts/barlow-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(/fonts/barlow-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(/fonts/barlow-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --asfalto: #2F3236;
  --asfalto-claro: #3B3F44;
  --painel: #1C1F22;
  --betao: #DAD6CC;
  --betao-2: #A9A59C;
  --aluminio: #C7CBCF;
  --led-preco: #FFB21E;
  --led-sobe: #FF5533;
  --led-desce: #46F08C;
  --placa-gasoleo: #F5C400;
  --placa-gasolina: #13854A;
  --linha: rgba(218, 214, 204, .14);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--betao);
  background-color: var(--asfalto);
  /* grão de asfalto */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  font: 400 1.0625rem/1.55 "Barlow", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-underline-offset: .2em; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--led-preco); outline-offset: 3px; border-radius: 4px; }

.estrada { max-width: 1120px; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1rem, 4vw, 2.5rem) 0; }

/* ------------------------------------------------ palco: totem + leitura */
.palco {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: end;
  padding-bottom: 3.25rem;
}
/* o chão onde o totem está assente: berma + traço da estrada */
.palco::after {
  content: "";
  position: absolute; left: calc(50% - 50vw); width: 100vw; bottom: 0; height: 3.25rem;
  background:
    repeating-linear-gradient(90deg, rgba(240,238,232,.82) 0 64px, transparent 64px 128px) 0 62% / 100% 7px no-repeat,
    linear-gradient(#26292C, #232528);
  border-top: 2px solid #474B50;
  z-index: -1;
}

.totem { margin: 0; justify-self: center; width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; }
.totem-cabeca, .totem-linhas {
  width: 100%;
  background: var(--painel);
  border: 9px solid var(--aluminio);
  border-image: linear-gradient(180deg, #E2E5E8, #9EA4AA 55%, #C9CDD1) 1;
}
.totem-cabeca {
  border-bottom-width: 0;
  padding: 1rem 1rem .85rem;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  box-shadow: inset 0 -1px 0 #34383C;
}
.totem-quando { margin: 0; font: 800 1.45rem/1 "Shoulders", sans-serif; letter-spacing: .01em; color: #F3F1EC; }

.alternador { display: inline-flex; background: #101214; border-radius: 999px; padding: 3px; box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
.alternador button {
  font: 600 .8125rem/1 "Barlow", sans-serif; color: var(--betao-2);
  background: transparent; border: 0; border-radius: 999px; padding: .5rem .8rem; cursor: pointer;
  min-height: 34px;
}
.alternador button[aria-pressed="true"] { background: #2B2F33; color: #F3F1EC; box-shadow: 0 1px 0 rgba(255,255,255,.08) inset; }

.totem-linhas { border-top-width: 0; padding: 0 .75rem .75rem; display: grid; gap: .75rem; }

.linha { display: grid; grid-template-columns: 7.2rem 1fr; min-height: 8.6rem; border-radius: 3px; overflow: hidden; background: #0E1012; box-shadow: inset 0 0 0 1px #2A2E32; }
.linha-vazia { display: flex; align-items: center; justify-content: center; color: var(--betao-2); font-size: .95rem; }

.placa { display: flex; flex-direction: column; justify-content: center; padding: .7rem .75rem; line-height: 1; }
.placa b { font: 800 1.75rem/0.92 "Shoulders", sans-serif; letter-spacing: .005em; }
.placa small { font: 500 .78rem/1.2 "Barlow", sans-serif; margin-top: .45rem; opacity: .85; }
.placa-gasoleo { background: var(--placa-gasoleo); color: #15130E; }
.placa-gasolina { background: var(--placa-gasolina); color: #F6F4EE; }

.led { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; padding: .6rem .8rem .6rem .5rem; gap: .5rem;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.045) 1px, transparent 1.4px) 0 0 / 4px 4px,
    #0B0C0E; }
.digitos { position: relative; font: 700 clamp(2.4rem, 9vw, 2.95rem)/1 "DSEG7", monospace; color: var(--led-preco); text-shadow: 0 0 6px rgba(255,178,30,.55), 0 0 18px rgba(255,140,0,.25); white-space: nowrap; }
.digitos::before { content: attr(data-fantasma); position: absolute; inset: 0; color: rgba(255,178,30,.075); text-shadow: none; }
.digitos .eur { font: 700 .95rem/1 "Barlow", sans-serif; color: var(--betao-2); text-shadow: none; margin-left: .25rem; vertical-align: top; }

.delta { display: flex; align-items: center; gap: .45rem; font: 700 1.05rem/1 "DSEG7", monospace; }
.delta .seta { font: 400 1.15rem/1 system-ui, sans-serif; }
.delta-sobe { color: var(--led-sobe); text-shadow: 0 0 8px rgba(255,85,51,.55); }
.delta-desce { color: var(--led-desce); text-shadow: 0 0 8px rgba(70,240,140,.45); }
.delta-mantem { color: var(--led-preco); text-shadow: 0 0 8px rgba(255,178,30,.45); }
.delta .unid { font: 600 .74rem/1 "Barlow", sans-serif; color: var(--betao-2); text-shadow: none; }
.delta[hidden] { display: none; }

.a-piscar { animation: pisca .32s steps(1) 3; }
@keyframes pisca { 50% { opacity: .15; } }

.totem-pe { width: 100%; display: flex; justify-content: center; height: clamp(5rem, 16vw, 11rem); }
.totem-pe span { width: 30px; height: 100%; background: linear-gradient(90deg, #6E747A, #C9CED3 40%, #8A9096 70%, #5B6066); box-shadow: 0 10px 0 -2px #1A1C1F; position: relative; }
.totem-pe span::after { content: ""; position: absolute; bottom: -4px; left: 50%; width: 96px; height: 10px; translate: -50% 0; background: #1D1F22; border-radius: 50%; filter: blur(3px); z-index: -1; }

/* ------------------------------------------------ leitura */
.leitura { padding-bottom: clamp(1.5rem, 6vw, 5rem); max-width: 34rem; }
.semana { margin: 0 0 .9rem; font-weight: 500; color: var(--betao-2); font-size: 1.05rem; }
.titulo { margin: 0; font: 800 clamp(2.7rem, 6.4vw, 5.1rem)/.93 "Shoulders", sans-serif; letter-spacing: -.005em; color: #F3F1EC; text-wrap: balance; }
.titulo span { display: block; }
.conselho { margin: 1.4rem 0 0; font-size: 1.25rem; line-height: 1.45; max-width: 30em; }
.estado { margin: 1.2rem 0 0; color: var(--betao-2); font-size: .95rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.dias { display: inline-flex; gap: 5px; }
.dias i { width: 10px; height: 10px; border-radius: 50%; background: #45494E; }
.dias i.on { background: var(--led-preco); box-shadow: 0 0 7px rgba(255,178,30,.7); }

/* ------------------------------------------------ histórico e método */
.historico, .metodo { max-width: 46rem; padding-top: clamp(3rem, 7vw, 5rem); }
h2 { font: 800 clamp(1.9rem, 4vw, 2.6rem)/1 "Shoulders", sans-serif; margin: 0 0 .8rem; color: #F3F1EC; }
.acerto { margin: 0 0 1.4rem; font-size: 1.15rem; }
.tabela-rolar { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 30rem; }
th, td { padding: .6rem .75rem; text-align: right; border-bottom: 1px solid var(--linha); }
th { font-weight: 500; color: var(--betao-2); font-size: .9rem; }
thead tr:first-child th { color: var(--betao); font-weight: 600; font-size: 1rem; border-bottom: 0; padding-bottom: 0; }
th:first-child, td:first-child { text-align: left; }
td.previsto { color: var(--betao-2); }
td .s { color: var(--led-sobe); } td .d { color: var(--led-desce); } td .m { color: var(--led-preco); }
td:nth-child(3) { border-right: 1px solid var(--linha); }
th[colspan] { text-align: center; }
.marca-retro { color: var(--led-preco); margin-left: .2rem; }
.nota-retro { color: var(--betao-2); font-size: .9rem; margin-top: .8rem; }
.metodo p { max-width: 38em; }
.fontes { color: var(--betao-2); font-size: .95rem; }

.rodape { max-width: 1120px; margin: 4rem auto 0; padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 2.5rem; color: var(--betao-2); font-size: .9rem; border-top: 1px solid var(--linha); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.rodape p { margin: 0; }

/* ------------------------------------------------ telemóvel */
@media (max-width: 760px) {
  .palco { grid-template-columns: 1fr; gap: 1.75rem; align-items: start; padding-bottom: 0; }
  .palco::after { display: none; }
  .leitura { padding-bottom: 0; }
  .totem { position: relative; padding-bottom: 3rem; }
  .totem::after { content: ""; position: absolute; left: calc(50% - 50vw); width: 100vw; bottom: 0; height: 3rem;
    background: repeating-linear-gradient(90deg, rgba(240,238,232,.82) 0 48px, transparent 48px 96px) 0 60% / 100% 6px no-repeat, linear-gradient(#26292C, #232528);
    border-top: 2px solid #474B50; z-index: -1; }
  .totem-pe { height: 4rem; }
  .linha { grid-template-columns: 6.2rem 1fr; min-height: 7.6rem; }
  .placa b { font-size: 1.5rem; }
  table { min-width: 0; font-size: .95rem; }
  th, td { padding: .55rem .4rem; }
  thead tr:first-child th { font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .a-piscar { animation: none; }
}

html { overflow-x: hidden; }
