:root {
  --page: #081126;
  --panel: #12244a;
  --panel-2: #172b57;
  --panel-3: #0f1d3c;
  --line: #29457a;
  --line-soft: rgba(111, 149, 221, 0.32);
  --ink: #f6f9ff;
  --muted: #9fb0cf;
  --blue: #4d8cff;
  --cyan: #23c7d9;
  --green: #30d17e;
  --amber: #ffb648;
  --red: #ff5c62;
  --violet: #a778ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Segoe UI, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 30% -10%, rgba(77, 140, 255, 0.22), transparent 34%),
    linear-gradient(180deg, #071028 0, #0a1328 320px, #081126 100%);
}

.uni-rail {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  height: 58px;
  color: #fff;
  font-weight: 800;
  background:
    linear-gradient(90deg, rgba(45, 101, 216, 0.98), rgba(77, 140, 255, 0.94) 48%, rgba(135, 62, 230, 0.94));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.uni-rail span {
  display: flex;
  align-items: center;
  width: min(1380px, calc(100vw - 32px));
  height: 100%;
  margin: 0 auto;
  padding: 0 max(18px, calc((100vw - 1380px) / 2 + 18px));
  font-size: 18px;
  letter-spacing: 0;
}

.topbar {
  position: sticky;
  top: 58px;
  z-index: 25;
  border-bottom: 1px solid rgba(100, 137, 202, 0.25);
  background: rgba(7, 16, 40, 0.82);
  backdrop-filter: blur(16px);
}

.topbar > div {
  width: min(1380px, calc(100vw - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar strong {
  font-size: 22px;
}

.topbar span {
  color: var(--muted);
  font-size: 15px;
}

.shell {
  width: min(1380px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 26px 0 78px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 28px;
  align-items: end;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 36, 74, 0.92);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: #8db3ff;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.search-form {
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(8, 17, 38, 0.42);
}

.search-form label {
  display: block;
  margin-bottom: 9px;
  color: #c9d8f5;
  font-weight: 800;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #5271aa;
  border-radius: 8px;
  background: #0b1732;
  color: var(--ink);
  font-size: 20px;
}

button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-size: 17px;
  font-weight: 900;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.message {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: #dce7ff;
}

.message.error {
  border-color: rgba(255, 92, 98, 0.55);
  color: #ffd6d8;
  background: rgba(120, 22, 36, 0.5);
}

.result {
  margin-top: 22px;
}

.summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 22px;
  border: 1px solid #3f6abe;
  border-radius: 8px;
  background: linear-gradient(135deg, #153573, #10234a);
}

.summary h2,
.section-title,
.card h3,
.chart-card h3 {
  margin: 0;
}

.summary h2 {
  font-size: 32px;
}

.summary p {
  max-width: 760px;
  margin: 8px 0 0;
  color: #d7e4ff;
  font-size: 18px;
  line-height: 1.45;
}

.summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #eff5ff;
  font-size: 13px;
  font-weight: 800;
}

.prediction {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 220px);
  gap: 16px;
  align-items: stretch;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(48, 209, 126, 0.7);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(19, 79, 68, 0.95), rgba(18, 36, 74, 0.95));
}

.prediction-wait {
  border-color: rgba(255, 182, 72, 0.72);
  background: linear-gradient(135deg, rgba(92, 61, 17, 0.92), rgba(18, 36, 74, 0.95));
}

.prediction-label {
  display: block;
  margin-bottom: 7px;
  color: #bfffd9;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.prediction h3 {
  margin: 0 0 7px;
  font-size: 18px;
}

.prediction > div > strong {
  display: block;
  font-size: 27px;
  line-height: 1.15;
}

.prediction p {
  margin: 8px 0 0;
  color: #d7ffe8;
}

.prediction-score {
  padding: 14px;
  border: 1px solid rgba(48, 209, 126, 0.72);
  border-radius: 8px;
  background: rgba(48, 209, 126, 0.14);
}

.prediction-wait .prediction-score {
  border-color: rgba(255, 182, 72, 0.72);
  background: rgba(255, 182, 72, 0.14);
}

.prediction-score strong {
  color: #7dffb2;
  font-size: 44px;
  line-height: 1;
}

.prediction-wait .prediction-score strong {
  color: #ffd08a;
}

.prediction-score span {
  display: block;
  margin-top: 8px;
  color: #d7ffe8;
  font-weight: 900;
}

.prediction-score em {
  display: block;
  margin-top: 8px;
  color: #bfe8ce;
  font-size: 13px;
  font-style: normal;
}

.section-title {
  margin-top: 30px;
  margin-bottom: 12px;
  font-size: 22px;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  margin-top: 16px;
}

.card,
.direction-card,
.chart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.card {
  padding: 18px;
}

.chance-grid,
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.scenario-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chance-card {
  border-color: rgba(48, 209, 126, 0.62);
  background: linear-gradient(135deg, rgba(16, 58, 52, 0.92), var(--panel));
}

.chance-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  gap: 16px;
  align-items: stretch;
}

.chance-head p {
  margin: 8px 0 0;
  color: #d7eadd;
  line-height: 1.45;
}

.real-chance {
  min-height: 138px;
  padding: 16px;
  border: 1px solid rgba(48, 209, 126, 0.8);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(48, 209, 126, 0.26), rgba(48, 209, 126, 0.10));
  box-shadow: 0 0 0 1px rgba(48, 209, 126, 0.18), 0 18px 44px rgba(48, 209, 126, 0.18);
}

.real-chance strong {
  display: block;
  color: #7dffb2;
  font-size: 56px;
  line-height: 1;
}

.real-chance span {
  display: block;
  margin-top: 9px;
  color: #d7ffe8;
  font-weight: 800;
}

.chance-item {
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-3);
}

.chance-item strong {
  display: block;
  font-size: 32px;
}

.chance-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.legend-note {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.legend-note b {
  color: #eef5ff;
}

.why-card {
  margin-top: 16px;
  border-color: rgba(48, 209, 126, 0.56);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.why-grid div {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0d1b39;
}

.why-grid strong {
  display: block;
  color: #7dffb2;
  font-size: 26px;
}

.why-grid span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.why-card p,
.risk-note li {
  color: #d7e4ff;
  line-height: 1.4;
}

.risk-note ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.directions {
  display: grid;
  gap: 12px;
}

.direction-card {
  padding: 16px;
}

.direction-primary {
  border-color: rgba(48, 209, 126, 0.7);
  background: linear-gradient(135deg, rgba(18, 60, 54, 0.82), var(--panel));
}

.direction-reserve {
  opacity: 0.78;
}

.direction-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.direction-head h3 {
  margin: 0 0 5px;
  font-size: 20px;
}

.sub {
  color: var(--muted);
  font-size: 14px;
}

.compact-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.metric {
  min-height: 78px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0d1b39;
}

.metric strong {
  display: block;
  font-size: 26px;
}

.metric span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.status-pass {
  border-color: rgba(48, 209, 126, 0.78);
  background: linear-gradient(180deg, rgba(48, 209, 126, 0.24), rgba(13, 27, 57, 0.92));
  box-shadow: inset 0 0 0 1px rgba(48, 209, 126, 0.12);
}

.status-pass strong {
  color: #7dffb2;
}

.status-pass span {
  color: #d7ffe8;
}

.status-wait {
  border-color: rgba(255, 182, 72, 0.7);
  background: linear-gradient(180deg, rgba(255, 182, 72, 0.18), rgba(13, 27, 57, 0.92));
}

.status-wait strong {
  color: #ffd08a;
}

.status-neutral strong {
  color: #dce7ff;
}

.status-reserve {
  border-color: rgba(159, 176, 207, 0.42);
  background: rgba(13, 27, 57, 0.72);
}

.status-reserve strong {
  color: #c9d8f5;
}

.status-reserve-pass {
  opacity: 1;
}

.direction-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  color: #c9d8f5;
  font-size: 14px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: #09142e;
  display: flex;
}

.bar-track span {
  min-width: 3px;
}

.bar-real { background: var(--red); }
.bar-leave { background: var(--amber); }
.bar-wait { background: var(--blue); }
.bar-ok { background: var(--green); }

.cascade-list {
  display: grid;
  gap: 10px;
}

.cascade-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 2fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0d1b39;
}

.cascade-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-card {
  min-height: 330px;
  padding: 16px;
}

.chart-box {
  height: 260px;
  margin-top: 12px;
}

.position-table {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.position-table-head,
.position-table-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) repeat(3, minmax(96px, 120px));
  gap: 8px;
  align-items: center;
}

.position-table-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.position-table-row {
  min-height: 44px;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0d1b39;
}

.position-table-row strong {
  font-size: 13px;
  line-height: 1.2;
}

.position-table-row span {
  font-size: 18px;
  font-weight: 900;
  text-align: right;
}

.position-cascade {
  color: #7dffb2;
}

.note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.faq-block {
  margin-top: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(18, 36, 74, 0.48);
  overflow: hidden;
}

.faq-block summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 18px;
  color: #c9d8f5;
  cursor: pointer;
  font-weight: 800;
}

.faq-block summary::after {
  content: "+";
  color: var(--blue);
  font-size: 24px;
  line-height: 1;
}

.faq-block[open] summary {
  border-bottom: 1px solid rgba(111, 149, 221, 0.18);
}

.faq-block[open] summary::after {
  content: "-";
}

.faq-content {
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
}

.faq-content article {
  display: grid;
  gap: 4px;
}

.faq-block h2 {
  margin: 0;
  color: #dce7ff;
  font-size: 15px;
}

.faq-block p {
  max-width: 860px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.contact-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(111, 149, 221, 0.18);
  color: var(--muted);
  font-size: 13px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(18, 36, 74, 0.72);
  color: #fff;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.contact-link:hover {
  transform: translateY(-1px);
  border-color: #6d95dd;
  background: rgba(23, 43, 87, 0.94);
}

.contact-link svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.contact-link.telegram { color: #2aabee; }
.contact-link.max { color: #1686f5; }

@media (max-width: 980px) {
  .hero,
  .summary,
  .prediction,
  .overview-grid,
  .cascade-row {
    grid-template-columns: 1fr;
  }

  .summary-meta {
    justify-content: flex-start;
  }

  .chance-grid,
  .scenario-grid,
  .compact-metrics,
  .why-grid {
    grid-template-columns: 1fr 1fr;
  }

  .chance-head {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .shell {
    width: min(100vw - 20px, 1380px);
  }

  .hero,
  .summary,
  .card,
  .direction-card,
  .chart-card {
    padding: 14px;
  }

  .search-row,
  .chance-grid,
  .scenario-grid,
  .compact-metrics,
  .why-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }
}
