:root {
  --bg: #050b09;
  --bg-soft: #09130f;
  --panel: rgba(10, 25, 19, .82);
  --panel-strong: rgba(12, 34, 24, .94);
  --line: rgba(185, 255, 218, .14);
  --line-bright: rgba(185, 255, 218, .35);
  --text: #eefbf3;
  --muted: #9ab4a5;
  --green: #65f59a;
  --green-2: #18c96d;
  --red: #ff565d;
  --gold: #ffd76a;
  --belarus-red: #d22730;
  --belarus-green: #137b42;
  --shadow: 0 24px 80px rgba(0, 0, 0, .36);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 5%, rgba(24, 201, 109, .11), transparent 30%),
    radial-gradient(circle at 8% 40%, rgba(210, 39, 48, .06), transparent 26%),
    linear-gradient(180deg, #07110e 0%, var(--bg) 55%, #030705 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(101, 245, 154, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(101, 245, 154, .025) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 84%);
  z-index: -1;
}

button, input { font: inherit; }
button { color: inherit; }

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  opacity: .09;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.035) 3px 4px);
}

.topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: .08em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  color: var(--green);
  background: linear-gradient(145deg, rgba(101,245,154,.18), rgba(101,245,154,.04));
  border: 1px solid rgba(101,245,154,.32);
  border-radius: 13px;
  box-shadow: inset 0 0 20px rgba(101,245,154,.08), 0 0 24px rgba(101,245,154,.08);
}

.brand-mark svg { width: 29px; }
.brand b { display: block; font-size: 17px; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; letter-spacing: .18em; }

.top-actions { display: flex; align-items: center; gap: 10px; }
.connection { color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.connection i, .live-badge i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
  animation: pulse 1.6s infinite;
}

.button, .icon-button, .modal-close {
  border: 1px solid var(--line-bright);
  background: rgba(255,255,255,.035);
  border-radius: 12px;
  cursor: pointer;
  transition: .2s ease;
}

.button {
  min-height: 48px;
  padding: 0 20px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.button:hover, .icon-button:hover, .modal-close:hover {
  transform: translateY(-1px);
  border-color: rgba(101,245,154,.65);
  background: rgba(101,245,154,.08);
}

.button-compact { min-height: 40px; padding-inline: 15px; }
.button-primary {
  border-color: var(--green);
  color: #032511;
  background: linear-gradient(135deg, var(--green), #a9ffc8);
  box-shadow: 0 10px 34px rgba(101,245,154,.18);
}
.button-primary:hover { color: #02170b; background: linear-gradient(135deg, #83ffae, #d0ffdf); }

.icon-button {
  width: 40px;
  height: 40px;
  font-size: 18px;
}

.hero { padding-top: 30px; }
.hero-grid {
  display: grid;
  grid-template-columns: .86fr 1.14fr;
  gap: 48px;
  align-items: center;
  min-height: 590px;
  padding: 62px 0;
}

.ornament, .footer-ornament {
  height: 16px;
  opacity: .8;
  background:
    linear-gradient(45deg, transparent 38%, var(--belarus-red) 38% 47%, transparent 47% 53%, var(--belarus-red) 53% 62%, transparent 62%) 0 0/28px 14px,
    linear-gradient(-45deg, transparent 38%, var(--text) 38% 47%, transparent 47% 53%, var(--text) 53% 62%, transparent 62%) 14px 0/28px 14px;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.ornament-bottom { transform: scaleY(-1); }

.eyebrow, .kicker {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow span { color: var(--text); }

h1 {
  margin: 24px 0 20px;
  font-size: clamp(55px, 7.7vw, 104px);
  line-height: .85;
  letter-spacing: -.065em;
  text-transform: uppercase;
}
h1 em { color: transparent; font-style: normal; -webkit-text-stroke: 1px rgba(238,251,243,.55); }

.lead {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.glass, .panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(18,43,31,.84), rgba(7,18,14,.78));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(18px);
}

.subject-card {
  width: min(100%, 480px);
  margin-top: 34px;
  padding: 13px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  border-radius: 17px;
}
.avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #062211;
  background: var(--green);
  border-radius: 13px;
  font-weight: 950;
}
.subject-card span, .subject-card small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
.subject-card strong { display: block; margin: 4px 0; font-size: 18px; }
.status-chip { padding: 8px 10px; color: var(--green) !important; border: 1px solid rgba(101,245,154,.3); border-radius: 999px; background: rgba(101,245,154,.07); }

.countdown-wrap {
  position: relative;
  padding: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  container-type: inline-size;
}
.countdown-wrap::after {
  content: "+";
  position: absolute;
  right: -20px;
  top: -66px;
  color: rgba(101,245,154,.025);
  font-size: 300px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}
.panel-head, .progress-meta, .progress-dates {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
}

.countdown {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr) 14px minmax(0, 1fr) 14px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  margin: 38px 0 34px;
}
.time-unit {
  position: relative;
  min-width: 0;
  height: 120px;
  padding: 18px 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 15px;
  background: rgba(0,0,0,.19);
  box-shadow: inset 0 -18px 30px rgba(0,0,0,.1);
}
.time-unit.featured { border-color: rgba(101,245,154,.34); background: rgba(101,245,154,.07); }
.time-unit strong {
  display: block;
  width: 100%;
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: clamp(34px, 9.6cqw, 52px);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: .95;
  letter-spacing: -.055em;
  white-space: nowrap;
  text-shadow: 0 0 28px rgba(101,245,154,.18);
}
.time-unit span {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.separator {
  height: 98px;
  display: grid;
  place-items: center;
  color: var(--green);
  font-family: ui-monospace, monospace;
  font-size: 27px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  animation: blink 1s steps(1) infinite;
}

.progress-block { margin-bottom: 25px; }
.progress-meta b { color: var(--green); font-size: 13px; }
.progress-track {
  position: relative;
  height: 12px;
  margin: 14px 0 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  background: rgba(0,0,0,.28);
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(135deg, var(--green) 0 9px, #42dc79 9px 18px);
  box-shadow: 0 0 20px rgba(101,245,154,.35);
  transition: width .8s cubic-bezier(.2,.8,.2,1);
}
.progress-milestone {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 18px;
  background: rgba(255,255,255,.18);
}
.progress-milestone span { position: absolute; top: 22px; left: 50%; color: rgba(255,255,255,.22); font-size: 8px; transform: translateX(-50%); }
.progress-dates { margin-top: 20px; font-size: 8px; }
.countdown-wrap > .button { width: 100%; }
.microcopy { margin: 11px 0 0; color: var(--muted); text-align: center; font-size: 11px; }

.dashboard, .briefing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 22px;
}
.panel { padding: 25px; border-radius: var(--radius); }
.panel-title { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.panel h2 { margin: 6px 0 0; font-size: 24px; letter-spacing: -.03em; }
.live-badge, .level-badge {
  padding: 7px 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
}
.level-badge b { color: var(--gold); }

.ecg { height: 120px; margin: 21px -6px 14px; overflow: hidden; }
.ecg svg { width: 100%; height: 100%; }
.ecg-grid { fill: none; stroke: rgba(101,245,154,.08); stroke-width: .7; }
.ecg-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 7px rgba(101,245,154,.65));
  stroke-dasharray: 850;
  animation: ecg 3.2s linear infinite;
}
.vitals-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.vital { padding: 13px; border: 1px solid rgba(255,255,255,.065); border-radius: 13px; background: rgba(0,0,0,.16); }
.vital > span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .11em; }
.vital strong { display: block; margin: 8px 0 5px; font-family: monospace; font-size: 27px; }
.vital strong small { color: var(--muted); font-size: 10px; }
.vital em { color: rgba(238,251,243,.48); font-size: 8px; font-style: normal; }
.vital .diagnosis { color: var(--green); font-family: inherit; font-size: 18px; }

.quests { display: grid; gap: 10px; margin-top: 25px; }
.quest {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  background: rgba(0,0,0,.15);
}
.quest-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.055); }
.quest strong, .quest small { display: block; }
.quest strong { font-size: 13px; }
.quest small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.quest > b { color: var(--muted); font-family: monospace; font-size: 10px; }
.quest.complete { opacity: .55; }
.quest.complete .quest-icon { color: var(--green); }
.quest.active { border-color: rgba(101,245,154,.3); background: rgba(101,245,154,.05); }
.quest.active > b { color: var(--green); }
.quest.locked { opacity: .5; }
.achievement-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 22px; }
.achievement {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.25);
  border: 1px dashed rgba(255,255,255,.12);
  border-radius: 50%;
  background: rgba(0,0,0,.18);
  font-size: 10px;
  font-weight: 900;
  filter: grayscale(1);
}
.achievement.unlocked { color: #07150d; border-style: solid; border-color: var(--gold); background: var(--gold); box-shadow: 0 0 24px rgba(255,215,106,.18); filter: none; }
.achievement.crown { font-size: 18px; }

.briefing { grid-template-columns: .8fr 1.2fr; margin-bottom: 22px; }
.quote-panel { display: flex; flex-direction: column; justify-content: center; min-height: 235px; }
blockquote { margin: 17px 0 20px; font-size: clamp(23px, 3vw, 34px); font-weight: 800; line-height: 1.22; letter-spacing: -.04em; }
.text-button { width: fit-content; padding: 0; color: var(--green); border: 0; background: none; cursor: pointer; font-weight: 800; font-size: 11px; letter-spacing: .06em; }
.text-button:hover { text-decoration: underline; }

.belarus-panel { position: relative; overflow: hidden; }
.belarus-panel::before {
  content: "";
  position: absolute;
  right: -36px;
  top: -36px;
  width: 190px;
  height: 190px;
  opacity: .08;
  transform: rotate(45deg);
  background:
    repeating-linear-gradient(90deg, var(--text) 0 8px, transparent 8px 16px),
    repeating-linear-gradient(0deg, var(--belarus-red) 0 8px, transparent 8px 16px);
}
.flag-line { display: flex; height: 5px; margin: -25px -25px 23px; }
.flag-line span:first-child { flex: 2; background: var(--belarus-red); }
.flag-line span:last-child { flex: 1; background: var(--belarus-green); }
.belarus-panel p { max-width: 650px; color: var(--muted); line-height: 1.65; }
.belarus-stats { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 24px; }
.belarus-stats span { padding: 9px 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; font-size: 9px; letter-spacing: .08em; }
.belarus-stats b { margin-left: 6px; color: var(--text); }

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 110px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.footer span { color: var(--belarus-red); }
.footer-ornament { width: 170px; height: 12px; flex: 0 0 auto; }
.footer p { flex: 1; }

.settings-modal {
  width: min(650px, calc(100% - 28px));
  padding: 0;
  color: var(--text);
  border: 1px solid var(--line-bright);
  border-radius: 22px;
  background: #0b1812;
  box-shadow: 0 35px 100px rgba(0,0,0,.7);
}
.settings-modal::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(8px); }
.settings-modal form { padding: 27px; }
.modal-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 25px; }
.modal-head h2 { margin: 6px 0 0; font-size: 28px; }
.modal-close { width: 39px; height: 39px; font-size: 25px; }
.settings-modal label { display: block; margin-top: 16px; }
.settings-modal label > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.settings-modal input {
  width: 100%;
  height: 49px;
  padding: 0 14px;
  color: var(--text);
  color-scheme: dark;
  border: 1px solid var(--line);
  outline: 0;
  border-radius: 11px;
  background: rgba(0,0,0,.22);
}
.settings-modal input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(101,245,154,.08); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-note { margin-top: 19px; padding: 13px; color: var(--muted); border-left: 3px solid var(--green); background: rgba(101,245,154,.045); font-size: 11px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 150;
  max-width: min(480px, calc(100% - 30px));
  padding: 12px 17px;
  color: #05200f;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 18px 45px rgba(0,0,0,.4);
  font-size: 12px;
  font-weight: 800;
  transform: translate(-50%, 30px);
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

#confetti { position: fixed; inset: 0; z-index: 140; width: 100%; height: 100%; pointer-events: none; }

@keyframes pulse { 50% { opacity: .4; transform: scale(.82); } }
@keyframes blink { 50% { opacity: .2; } }
@keyframes ecg { from { stroke-dashoffset: 850; } to { stroke-dashoffset: -850; } }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; padding: 55px 0; }
  .hero-copy { text-align: center; }
  .lead, .subject-card { margin-inline: auto; }
  .eyebrow { justify-content: center; }
  .dashboard, .briefing { grid-template-columns: 1fr; }
  .briefing { grid-template-columns: 1fr 1fr; }
  .vitals-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .shell { width: min(100% - 24px, 1180px); }
  .topbar { min-height: 72px; }
  .connection, .button-compact { display: none; }
  .brand small { display: none; }
  .hero { padding-top: 18px; }
  .hero-grid { min-height: auto; padding: 44px 0; }
  h1 { font-size: clamp(49px, 16vw, 78px); }
  .lead { font-size: 15px; }
  .countdown-wrap { padding: 17px; }
  .countdown { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 27px 0; }
  .separator { display: none; }
  .time-unit { height: 104px; min-height: 0; padding: 14px 3px 11px; }
  .time-unit strong { font-size: clamp(27px, 10vw, 43px); }
  .time-unit span { margin-top: 11px; }
  .panel-head span:last-child { display: none; }
  .dashboard, .briefing { gap: 14px; margin-top: 14px; }
  .briefing { grid-template-columns: 1fr; }
  .panel { padding: 19px; }
  .flag-line { margin: -19px -19px 20px; }
  .panel h2 { font-size: 21px; }
  .vitals-grid { grid-template-columns: repeat(2, 1fr); }
  .quest { grid-template-columns: auto 1fr; }
  .quest > b { grid-column: 2; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .footer { flex-wrap: wrap; padding: 25px 0; }
  .footer-ornament { width: 100%; }
  .subject-card { grid-template-columns: auto 1fr; text-align: left; }
  .status-chip { display: none !important; }
}

@media (max-width: 430px) {
  .brand-mark { width: 40px; height: 40px; }
  .brand b { font-size: 14px; }
  .countdown-wrap { margin-inline: -2px; }
  .time-unit strong { font-size: clamp(24px, 8.3vw, 31px); }
  .time-unit span { font-size: 7px; }
  .vital strong { font-size: 22px; }
  .achievement-row { gap: 6px; }
  .subject-card { padding: 10px; }
  .avatar { width: 45px; height: 45px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

.footer > p { text-align: right; }
@media (max-width: 720px) { .footer > p { text-align: left; } }
