@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Unbounded:wght@500;600;700&display=swap");

:root {
  --bg: #06171f;
  --panel: #092433;
  --panel-soft: #0d3246;
  --line: rgba(130, 209, 242, 0.2);
  --text: #f4fcff;
  --text-soft: rgba(224, 244, 250, 0.8);
  --accent: #38d6c4;
  --accent-2: #4da0ff;
  --danger: #ff7272;
  --warning: #ffc56f;
  --max: #a8ff82;
  --telegram: #7bd1ff;
  --shadow: 0 22px 55px rgba(2, 12, 17, 0.48);
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-head: "Unbounded", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 15% 10%, #11405a 0%, transparent 30%),
    radial-gradient(circle at 85% 80%, #133f2d 0%, transparent 38%),
    linear-gradient(160deg, #030d14 0%, #071a27 45%, #051017 100%);
  color: var(--text);
  font-family: var(--font-body);
  animation: pageFade 0.5s ease-out;
}

.layout {
  width: min(1120px, 92vw);
  margin: 30px auto 90px;
  position: relative;
  z-index: 2;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0.5;
  pointer-events: none;
}

.bg-shape-1 {
  width: 290px;
  height: 290px;
  background: rgba(69, 202, 255, 0.28);
  left: 2%;
  top: 12%;
  animation: floatShapeA 14s ease-in-out infinite;
}

.bg-shape-2 {
  width: 360px;
  height: 360px;
  background: rgba(82, 255, 171, 0.21);
  right: 0;
  bottom: 10%;
  animation: floatShapeB 18s ease-in-out infinite;
}

.hero {
  background: linear-gradient(135deg, rgba(16, 60, 85, 0.64), rgba(9, 28, 40, 0.75));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 3.7vw, 42px);
  animation: riseIn 0.55s ease-out;
}

.overline {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.74rem;
  color: rgba(159, 230, 255, 0.84);
}

h1 {
  margin: 12px 0 10px;
  font-family: var(--font-head);
  line-height: 1.15;
  font-size: clamp(1.65rem, 3.4vw, 2.7rem);
}

.lead {
  margin: 0;
  color: var(--text-soft);
  max-width: 74ch;
}

.query-form {
  margin-top: 24px;
}

.query-form label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  color: rgba(209, 236, 245, 0.9);
}

.query-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

.query-row input {
  border-radius: 14px;
  border: 1px solid rgba(115, 208, 245, 0.3);
  background: rgba(4, 23, 32, 0.85);
  color: var(--text);
  font-size: 1rem;
  padding: 14px 15px;
  outline: none;
}

.query-row input:focus {
  border-color: rgba(142, 244, 226, 0.8);
  box-shadow: 0 0 0 4px rgba(56, 214, 196, 0.2);
}

button {
  border: none;
  border-radius: 14px;
  cursor: pointer;
  color: #022327;
  font-size: 0.96rem;
  font-weight: 800;
  background: linear-gradient(120deg, var(--accent), #8af3b4);
  padding: 0 20px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

button:disabled {
  cursor: progress;
  transform: none;
  opacity: 0.7;
}

#analyzeButton {
  position: relative;
  overflow: hidden;
  color: #032228;
  background: linear-gradient(120deg, #3ce9cf, #8ff46f, #58bdff, #3ce9cf);
  background-size: 260% 260%;
  box-shadow: 0 0 0 1px rgba(166, 248, 229, 0.36), 0 8px 26px rgba(49, 222, 200, 0.35);
  animation: analyzeShift 4.8s ease-in-out infinite;
}

#analyzeButton::after {
  content: "";
  position: absolute;
  top: 0;
  left: -42%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.58), transparent);
  transform: skewX(-18deg);
  animation: analyzeShine 2.2s ease-in-out infinite;
}

#analyzeButton:hover {
  transform: translateY(-2px) scale(1.01);
  filter: brightness(1.05);
  box-shadow: 0 0 0 1px rgba(171, 255, 232, 0.52), 0 12px 30px rgba(65, 229, 208, 0.42);
}

#analyzeButton:disabled {
  animation: none;
  background: linear-gradient(120deg, #5fb7ad, #79b59a);
  box-shadow: none;
}

#analyzeButton:disabled::after {
  animation: none;
}

.hint {
  margin: 8px 2px 0;
  color: rgba(190, 224, 235, 0.72);
  font-size: 0.84rem;
}

.status-panel {
  margin-top: 16px;
  background: rgba(6, 38, 53, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 15px;
  color: var(--text-soft);
  animation: slideDown 0.25s ease-out;
}

.status-panel.error {
  border-color: rgba(255, 116, 116, 0.45);
  color: #ffd6d6;
}

.share-panel {
  margin-top: 10px;
  background: rgba(6, 38, 53, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  animation: slideDown 0.3s ease-out;
}

.share-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

.share-row input {
  border-radius: 10px;
  border: 1px solid rgba(121, 201, 235, 0.25);
  background: rgba(4, 23, 32, 0.82);
  color: var(--text);
  padding: 10px 11px;
  font-size: 0.86rem;
}

.share-btn,
.copy-btn {
  border: 1px solid rgba(116, 201, 233, 0.32);
  border-radius: 10px;
  background: rgba(8, 37, 51, 0.75);
  color: #dff6ff;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 0;
}

.results {
  margin-top: 18px;
  display: grid;
  gap: 15px;
}

.panel {
  background: linear-gradient(180deg, rgba(13, 46, 64, 0.68), rgba(8, 29, 42, 0.74));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(15px, 2.7vw, 23px);
  box-shadow: 0 12px 34px rgba(0, 10, 17, 0.35);
  transform-origin: 50% 12%;
}

.results.revealed > .panel {
  animation: cardIn 0.45s ease-out both;
}

.results.revealed > .panel:nth-child(1) {
  animation-delay: 0.04s;
}

.results.revealed > .panel:nth-child(2) {
  animation-delay: 0.08s;
}

.results.revealed > .panel:nth-child(3) {
  animation-delay: 0.12s;
}

.results.revealed > .panel:nth-child(4) {
  animation-delay: 0.16s;
}

.results.revealed > .panel:nth-child(5) {
  animation-delay: 0.2s;
}

.results.revealed > .panel:nth-child(6) {
  animation-delay: 0.24s;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(1.01rem, 2vw, 1.38rem);
}

.tag {
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.tg-tag {
  color: #d4f3ff;
  border-color: rgba(127, 212, 255, 0.4);
  background: rgba(42, 124, 163, 0.35);
}

.max-tag {
  color: #e5ffe2;
  border-color: rgba(170, 255, 133, 0.4);
  background: rgba(88, 147, 64, 0.34);
}

.neutral-tag {
  color: #d8efff;
  border-color: rgba(177, 218, 255, 0.32);
  background: rgba(47, 79, 110, 0.36);
}

.winner-tg {
  border-color: rgba(123, 209, 255, 0.6);
  background: rgba(64, 151, 192, 0.37);
}

.winner-max {
  border-color: rgba(148, 255, 132, 0.62);
  background: rgba(82, 148, 56, 0.4);
}

.kpi-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.overview-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.overview-card {
  border-radius: 14px;
  border: 1px solid rgba(134, 206, 237, 0.22);
  background: rgba(5, 29, 41, 0.8);
  padding: 12px;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.overview-card:hover {
  transform: translateY(-2px);
  border-color: rgba(156, 225, 255, 0.42);
  box-shadow: 0 10px 20px rgba(0, 13, 20, 0.3);
}

.overview-head {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
}

.overview-avatar {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(140, 210, 235, 0.35);
}

.overview-platform {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(175, 224, 242, 0.82);
}

.overview-card h3 {
  margin: 3px 0 4px;
  font-family: var(--font-head);
  font-size: 1.02rem;
}

.overview-link {
  color: #9de7ff;
  font-size: 0.84rem;
  text-decoration: none;
}

.overview-link:hover {
  text-decoration: underline;
}

.overview-desc {
  margin: 10px 0 10px;
  color: rgba(212, 237, 246, 0.88);
  font-size: 0.91rem;
  line-height: 1.4;
}

.overview-metrics {
  display: grid;
  gap: 4px;
  color: rgba(202, 232, 243, 0.82);
  font-size: 0.86rem;
}

.kpi-card {
  border-radius: 12px;
  border: 1px solid rgba(129, 200, 237, 0.22);
  background: rgba(5, 29, 41, 0.8);
  padding: 12px;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.kpi-card:hover {
  transform: translateY(-1px);
  border-color: rgba(156, 220, 250, 0.38);
}

.kpi-title {
  display: block;
  font-size: 0.78rem;
  color: rgba(189, 228, 242, 0.8);
}

.kpi-value {
  display: block;
  margin-top: 8px;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.kpi-note {
  margin-top: 5px;
  font-size: 0.76rem;
  color: rgba(180, 211, 223, 0.78);
}

.missing-box {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 197, 111, 0.5);
  background: rgba(80, 51, 9, 0.25);
  padding: 12px;
  color: #ffdba5;
  font-size: 0.92rem;
}

.comparison-summary {
  margin: 0 0 12px;
  color: rgba(215, 240, 248, 0.86);
}

.comparison-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.comparison-card {
  border-radius: 12px;
  border: 1px solid rgba(127, 201, 234, 0.22);
  background: rgba(5, 31, 44, 0.78);
  padding: 12px;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.comparison-card:hover {
  transform: translateY(-1px);
  border-color: rgba(150, 217, 247, 0.35);
}

.comparison-card .title {
  font-size: 0.78rem;
  color: rgba(183, 222, 235, 0.8);
}

.comparison-card .value {
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 800;
}

canvas {
  width: 100%;
  max-height: 430px;
  border-radius: 10px;
  background: rgba(3, 22, 31, 0.65);
  border: 1px solid rgba(105, 182, 220, 0.2);
}

.hidden {
  display: none;
}

.site-footer {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(10, 35, 49, 0.75), rgba(6, 25, 35, 0.78));
  padding: clamp(15px, 2.7vw, 23px);
}

.site-footer h2 {
  margin: 0 0 12px;
  font-size: clamp(1.01rem, 2vw, 1.3rem);
}

.faq-list {
  display: grid;
  gap: 9px;
}

.faq-item {
  border: 1px solid rgba(128, 198, 230, 0.24);
  background: rgba(4, 26, 37, 0.72);
  border-radius: 12px;
  padding: 10px 12px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.faq-item[open] {
  border-color: rgba(154, 228, 255, 0.45);
  background: rgba(8, 36, 50, 0.82);
}

.faq-item summary {
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 700;
  color: #def5ff;
}

.faq-item p {
  margin: 10px 0 2px;
  color: rgba(214, 236, 245, 0.86);
  line-height: 1.45;
  animation: fadeInSoft 0.22s ease-out;
}

.chart-tooltip {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  border-radius: 10px;
  border: 1px solid rgba(136, 206, 236, 0.35);
  background: rgba(4, 24, 34, 0.94);
  color: #e8f8ff;
  padding: 8px 10px;
  box-shadow: 0 10px 24px rgba(1, 9, 13, 0.42);
  min-width: 120px;
}

.chart-tooltip .tt-title {
  font-size: 0.75rem;
  color: rgba(170, 225, 245, 0.86);
}

.chart-tooltip .tt-value {
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 800;
}

@keyframes pageFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeInSoft {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes floatShapeA {
  0% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-18px) translateX(8px);
  }
  100% {
    transform: translateY(0) translateX(0);
  }
}

@keyframes floatShapeB {
  0% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(14px) translateX(-10px);
  }
  100% {
    transform: translateY(0) translateX(0);
  }
}

@keyframes analyzeShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes analyzeShine {
  0% {
    left: -45%;
    opacity: 0;
  }
  20% {
    opacity: 0.9;
  }
  60% {
    left: 115%;
    opacity: 0;
  }
  100% {
    left: 115%;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 860px) {
  .query-row {
    grid-template-columns: 1fr;
  }

  button {
    height: 48px;
  }

  .share-row {
    grid-template-columns: 1fr;
  }
}
