:root {
  --bg: #0f120d;
  --panel: rgba(20, 26, 18, 0.86);
  --text: #d8ddc8;
  --muted: #858b75;
  --accent: #c8a96b;
  --green: #7c8f5b;
  --danger: #b46a55;
  --line: rgba(200, 169, 107, 0.16);
  --shadow: rgba(0, 0, 0, 0.55);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.fx__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(124, 143, 91, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(124, 143, 91, 0.08) 1px, transparent 1px);
  background-size: 68px 68px;
  opacity: 0.55;
  mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 0.92), transparent 120%);
}

.fx__noise {
  position: absolute;
  inset: 0;
  opacity: 0.065;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  animation: noiseShift 6s steps(10) infinite;
}

.fx__scanlines {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.0) 0px,
    rgba(0, 0, 0, 0.0) 2px,
    rgba(0, 0, 0, 0.6) 3px
  );
  animation: scanFlicker 7.5s ease-in-out infinite;
}

.fx__vignette {
  position: absolute;
  inset: -10%;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.0) 0%,
    rgba(0, 0, 0, 0.45) 62%,
    rgba(0, 0, 0, 0.82) 100%
  );
  opacity: 0.85;
}

@keyframes noiseShift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  20% {
    transform: translate3d(-1.5%, 0.5%, 0);
  }
  40% {
    transform: translate3d(1%, -1%, 0);
  }
  60% {
    transform: translate3d(0.5%, 1.2%, 0);
  }
  80% {
    transform: translate3d(-1%, -0.4%, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes scanFlicker {
  0%,
  100% {
    opacity: 0.055;
  }
  35% {
    opacity: 0.075;
  }
  62% {
    opacity: 0.05;
  }
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(200, 169, 107, 0.28);
  background: rgba(20, 26, 18, 0.6);
  box-shadow: 0 12px 40px var(--shadow);
  border-radius: 10px;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  user-select: none;
}

.chip--green {
  border-color: rgba(124, 143, 91, 0.4);
  color: rgba(216, 221, 200, 0.95);
}

.chip--muted {
  color: rgba(133, 139, 117, 0.92);
}

.wrap {
  position: relative;
  z-index: 2;
  max-width: 980px;
  margin: 24px auto 40px;
  padding: 0 16px;
  display: grid;
  gap: 14px;
}

.panel {
  border: 1px solid rgba(200, 169, 107, 0.22);
  border-radius: 18px;
  background: var(--panel);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.panel--thin {
  background: rgba(20, 26, 18, 0.64);
}

.panel__heading {
  padding: 26px 22px 14px;
  border-bottom: 1px solid rgba(200, 169, 107, 0.16);
  background:
    linear-gradient(to bottom, rgba(200, 169, 107, 0.09), transparent 58%),
    radial-gradient(1200px 600px at 20% 0%, rgba(124, 143, 91, 0.09), transparent 60%);
}

.title {
  margin: 0;
  font-size: clamp(28px, 4.2vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.panel__body {
  padding: 18px 22px 22px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.kpi {
  border: 1px solid rgba(200, 169, 107, 0.16);
  border-radius: 14px;
  background: rgba(15, 18, 13, 0.55);
  padding: 12px 12px 11px;
}

.kpi__label {
  color: rgba(133, 139, 117, 0.95);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kpi__value {
  margin-top: 6px;
  font-size: 14px;
  color: rgba(216, 221, 200, 0.98);
}

.kpi__value--danger {
  color: rgba(180, 106, 85, 0.98);
}

.action {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 10px 0 14px;
}

.btn {
  width: min(720px, 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(200, 169, 107, 0.42);
  color: var(--text);
  background:
    linear-gradient(to bottom, rgba(200, 169, 107, 0.18), rgba(20, 26, 18, 0.6)),
    radial-gradient(900px 140px at 50% 0%, rgba(124, 143, 91, 0.16), transparent 60%);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  user-select: none;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    filter 120ms ease,
    background 120ms ease;
}

.btn__label {
  text-align: center;
  line-height: 1.15;
}

.btn:hover {
  border-color: rgba(200, 169, 107, 0.62);
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}

.btn:focus-visible {
  outline: 2px solid rgba(124, 143, 91, 0.75);
  outline-offset: 2px;
}

.btn[disabled] {
  opacity: 0.72;
  cursor: not-allowed;
  filter: grayscale(0.15);
}

.btn__icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(124, 143, 91, 0.38);
  background: rgba(15, 18, 13, 0.55);
  color: rgba(216, 221, 200, 0.95);
}

.counter {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.01em;
}

.answer {
  margin-top: 10px;
}

.answer__frame {
  position: relative;
  border: 1px solid rgba(200, 169, 107, 0.2);
  background: rgba(15, 18, 13, 0.62);
  border-radius: 18px;
  padding: 18px 16px 16px;
  min-height: 110px;
  overflow: hidden;
}

.answer__frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(200, 169, 107, 0.1),
    transparent 35%,
    rgba(124, 143, 91, 0.08)
  );
  opacity: 0.7;
  pointer-events: none;
}

.answer__label {
  position: absolute;
  top: 12px;
  left: 14px;
  font-size: 11px;
  color: rgba(133, 139, 117, 0.92);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.answer__value {
  position: relative;
  margin-top: 16px;
  font-size: clamp(18px, 3.2vw, 24px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: pre-wrap;
}

.answer__value.is-loading {
  color: rgba(216, 221, 200, 0.86);
}

.hint {
  margin-top: 10px;
  color: rgba(133, 139, 117, 0.9);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.meta {
  padding: 16px 18px;
  display: grid;
  gap: 10px;
}

.meta__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(200, 169, 107, 0.12);
  background: rgba(15, 18, 13, 0.5);
}

.meta__key {
  color: rgba(133, 139, 117, 0.95);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta__val {
  font-size: 12px;
  color: rgba(216, 221, 200, 0.92);
  text-align: right;
}

.meta__val--muted {
  color: rgba(133, 139, 117, 0.92);
}

.footer {
  position: relative;
  z-index: 2;
  padding: 16px;
  margin-bottom: 10px;
}

.footer__inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 12px;
  border: 1px solid rgba(200, 169, 107, 0.12);
  border-radius: 14px;
  background: rgba(20, 26, 18, 0.55);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(133, 139, 117, 0.95);
  font-size: 12px;
}

.footer__muted {
  color: rgba(133, 139, 117, 0.9);
}

.footer__sep {
  display: none;
}

@media (max-width: 760px) {
  .topbar {
    padding: 12px 12px;
    flex-wrap: wrap;
  }

  .wrap {
    margin-top: 12px;
  }

  .panel__heading {
    padding: 22px 16px 12px;
  }

  .panel__body {
    padding: 16px;
  }

  .kpis {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx__noise,
  .fx__scanlines {
    animation: none !important;
  }

  .btn {
    transition: none;
  }
}
