:root {
  color-scheme: dark;
  --bg: #111612;
  --bg-soft: #192219;
  --panel: rgba(248, 250, 252, 0.94);
  --ink: #121812;
  --muted: #687466;
  --text: #f6faf5;
  --line: rgba(255, 255, 255, 0.16);
  --diesel: #1f9d55;
  --super: #d9480f;
  --e10: #f59f00;
  --plus: #4057c9;
  --accent: #70e000;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 16%, rgba(112, 224, 0, 0.18), transparent 30rem),
    radial-gradient(circle at 84% 74%, rgba(245, 159, 0, 0.16), transparent 32rem),
    linear-gradient(135deg, #10140f 0%, #182417 52%, #263027 100%);
  color: var(--text);
}

button,
input,
select { font: inherit; }

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 22px;
  background: var(--accent);
  color: #10200a;
  cursor: pointer;
  font-weight: 900;
}

input,
select {
  min-width: 0;
  width: 100%;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 12px 16px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus { border-color: var(--accent); }

.screen {
  height: 100dvh;
  padding: clamp(14px, 2.1vw, 34px);
  padding-bottom: 74px;
  overflow: hidden;
}

.search-view {
  height: 100%;
  display: grid;
  place-items: center;
}

.search-panel {
  width: min(800px, 100%);
  display: grid;
  gap: clamp(14px, 2vh, 24px);
  padding: clamp(22px, 4vh, 46px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: #a9ff68;
  font-size: clamp(0.86rem, 1.1vw, 1.05rem);
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search-panel .eyebrow { color: #2b8a3e; }

h1 {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.field-label {
  color: var(--muted);
  font-weight: 850;
}

.field-label.inline {
  align-self: center;
}

.search-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 180px) auto;
  gap: 12px;
  align-items: center;
}

.fuel-view {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: clamp(8px, 1.4vh, 18px);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr minmax(460px, 620px);
  gap: 24px;
  align-items: end;
}

.compact-search {
  display: grid;
  grid-template-columns: 1fr 112px auto;
  gap: 10px;
}

.status {
  min-height: 24px;
  color: #dfffd4;
  font-size: clamp(0.9rem, 1.7vh, 1.12rem);
  font-weight: 750;
}

.cards {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: clamp(10px, 1.4vw, 20px);
  align-items: stretch;
}

.card {
  --fuel-color: var(--diesel);
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: clamp(8px, 1.15vh, 16px);
  padding: clamp(12px, 1.35vw, 22px);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--fuel-color), white 82%) 0%, rgba(255,255,255,0.94) 46%, #f8fafc 100%);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.card.diesel { --fuel-color: var(--diesel); }
.card.e5 { --fuel-color: var(--super); }
.card.e10 { --fuel-color: var(--e10); }

.card-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: clamp(0.78rem, 1.55vh, 1rem);
  font-weight: 850;
}

.fuel-icon {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(92px, 21vh, 205px);
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--fuel-color), transparent 78%), rgba(255, 255, 255, 0.45));
}

.pump {
  position: relative;
  width: clamp(72px, 7.2vw, 126px);
  height: clamp(86px, 10vw, 158px);
  border-radius: 10px 10px 7px 7px;
  background: var(--fuel-color);
  box-shadow: inset 0 -18px 0 rgba(0,0,0,0.14), 0 18px 28px rgba(18, 24, 18, 0.2);
}

.pump::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 14%;
  height: 28%;
  border-radius: 5px;
  background: rgba(255,255,255,0.88);
}

.pump::after {
  content: "";
  position: absolute;
  right: -32%;
  top: 14%;
  width: 30%;
  height: 48%;
  border: clamp(4px, 0.45vw, 7px) solid var(--fuel-color);
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 16px 0 0;
}

.summary {
  align-self: start;
  display: grid;
  align-content: start;
  gap: clamp(4px, 0.7vh, 8px);
}

.best-name {
  min-height: 2.2em;
  color: #202920;
  font-size: clamp(1rem, 2.1vh, 1.55rem);
  font-weight: 900;
  line-height: 1.08;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.price strong {
  color: var(--fuel-color);
  font-size: 2.18rem;
  line-height: 0.95;
}

.price span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
}

.stations {
  align-self: stretch;
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: clamp(4px, 0.82vh, 8px);
  margin: 0;
}

.station {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-top: 0;
  border-top: 1px solid rgba(18, 24, 18, 0.13);
  color: #2f3d2e;
  font-size: clamp(0.75rem, 1.45vh, 0.96rem);
  font-weight: 750;
}

.station dt,
.station dd { margin: 0; }
.station dt { min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.station dd { text-align: right; }

.place-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-top: 1px solid var(--line);
  background: rgba(12, 18, 12, 0.9);
  color: #f0ffe8;
  backdrop-filter: blur(12px);
  font-size: clamp(1rem, 1.45vw, 1.35rem);
  font-weight: 850;
  text-align: center;
}

[hidden] { display: none !important; }

@supports not (background: color-mix(in srgb, red, white)) {
  .card { background: var(--panel); }
  .fuel-icon { background: rgba(255,255,255,0.34); }
}

@media (max-width: 980px) {
  body { overflow-y: auto; }
  .screen { min-height: 100dvh; height: auto; overflow: visible; }
  .fuel-view { height: auto; }
  .topbar { grid-template-columns: 1fr; }
  .compact-search { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: auto; }
}

@media (max-width: 560px) {
  .screen { padding: 18px; padding-bottom: 92px; }
  .search-row { grid-template-columns: 1fr; }
  button { width: 100%; }
}

.price sup,
.station sup {
  font-size: 0.52em;
  line-height: 0;
  vertical-align: super;
}

.price sup {
  margin-left: 0.04em;
}
