:root {
  --bg: #070b18;
  --bg-soft: #0d1426;
  --panel: rgba(17, 26, 48, 0.86);
  --panel-solid: #111a30;
  --line: rgba(141, 168, 214, 0.16);
  --line-strong: rgba(141, 168, 214, 0.32);
  --text: #eaf1ff;
  --muted: #94a6c4;
  --accent: #66f2c0;
  --accent-2: #7fa8ff;
  --warn: #ffcf70;
  --danger: #ff8197;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(102, 242, 192, 0.12), transparent 34rem),
    radial-gradient(circle at 92% 18%, rgba(127, 168, 255, 0.14), transparent 36rem),
    linear-gradient(180deg, #070b18 0%, #0a1122 55%, #070b18 100%);
  font-family: "Segoe UI", "Inter", "Roboto", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

a {
  color: inherit;
}

.app-shell {
  position: relative;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 40px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(102, 242, 192, 0.55);
  border-radius: 13px;
  color: var(--accent);
  font-size: 26px;
  box-shadow: inset 0 0 22px rgba(102, 242, 192, 0.12);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  letter-spacing: 0.08em;
  font-size: 15px;
}

.brand-text strong span {
  color: var(--accent);
}

.brand-text small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  align-items: center;
  gap: 40px;
  padding: 70px 0 58px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(102, 242, 192, 0.55);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 12px rgba(102, 242, 192, 0); }
  100% { box-shadow: 0 0 0 0 rgba(102, 242, 192, 0); }
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.02em;
}

h1 {
  max-width: 720px;
  font-size: clamp(40px, 6.2vw, 70px);
  line-height: 1.02;
}

h1 span {
  color: var(--accent);
}

.lead {
  max-width: 650px;
  margin: 22px 0 26px;
  color: #b9c7df;
  font-size: 17px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge-idle { color: var(--muted); }
.badge-running { color: var(--warn); border-color: rgba(255, 207, 112, 0.35); }
.badge-done { color: var(--accent); border-color: rgba(102, 242, 192, 0.4); }

.hero-facts {
  display: flex;
  gap: 28px;
  margin-top: 34px;
}

.hero-facts div {
  display: flex;
  flex-direction: column;
}

.hero-facts strong {
  font-size: 24px;
  color: var(--text);
}

.hero-facts span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.hero-art {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(102, 242, 192, 0.13), transparent 62%);
}

.orbit {
  position: absolute;
  border: 1px solid rgba(127, 168, 255, 0.24);
  border-radius: 50%;
}

.orbit-1 {
  inset: 8%;
  animation: spin 22s linear infinite;
}

.orbit-2 {
  inset: 23%;
  border-color: rgba(102, 242, 192, 0.24);
  animation: spin 16s linear infinite reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.core {
  position: absolute;
  inset: 38%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #07101e;
  font-size: 30px;
  font-weight: 800;
  box-shadow: 0 0 46px rgba(102, 242, 192, 0.35);
}

.satellite {
  position: absolute;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--panel-solid);
  color: var(--accent-2);
  font-weight: 700;
}

.sat-1 { top: 6%; left: 44%; }
.sat-2 { right: 5%; top: 54%; color: var(--warn); }
.sat-3 { bottom: 8%; left: 18%; color: var(--accent); }

.panel {
  margin: 0 0 34px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.panel-head h2 {
  font-size: 28px;
}

.panel-note {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.attempt-area {
  min-height: 220px;
}

.start-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr);
  gap: 30px;
  align-items: center;
}

.start-copy h3 {
  margin-bottom: 10px;
  font-size: 24px;
}

.start-copy p {
  margin: 0 0 18px;
  color: var(--muted);
}

.step-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #c4d1e8;
  font-size: 14px;
}

.step-list b {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(102, 242, 192, 0.12);
  color: var(--accent);
  font-size: 12px;
}

.start-card,
.question-card,
.finish-card,
.result-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(23, 35, 64, 0.95), rgba(13, 20, 38, 0.95));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.field label {
  color: #c9d6ec;
  font-size: 13px;
  font-weight: 600;
}

.field small {
  color: var(--muted);
  font-size: 11px;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  background: rgba(6, 11, 23, 0.7);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
  resize: vertical;
  min-height: 108px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102, 242, 192, 0.12);
}

select option {
  background: var(--panel-solid);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s, background 0.2s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #4bd6b0);
  color: #06131c;
  box-shadow: 0 12px 30px rgba(102, 242, 192, 0.18);
}

.btn-ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.btn-danger {
  border-color: rgba(255, 129, 151, 0.4);
  background: rgba(255, 129, 151, 0.12);
  color: var(--danger);
}

.btn-wide {
  width: 100%;
}

.round-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.round-number {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.round-score {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}

.round-score strong {
  color: var(--text);
  font-size: 16px;
}

.timer {
  height: 6px;
  margin-bottom: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.timer-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s linear;
}

.timer-fill.low {
  background: linear-gradient(90deg, var(--warn), var(--danger));
}

.question-text {
  margin: 0 0 20px;
  font-size: 21px;
  font-weight: 650;
  line-height: 1.4;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(7, 13, 27, 0.55);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.15s;
}

.option:hover:not(:disabled) {
  border-color: rgba(102, 242, 192, 0.55);
  background: rgba(102, 242, 192, 0.07);
  transform: translateX(3px);
}

.option:disabled {
  cursor: wait;
  opacity: 0.65;
}

.option-key {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
}

.progress-dots {
  display: flex;
  gap: 7px;
  margin-top: 22px;
}

.dot {
  width: 28px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.dot.done { background: var(--accent); }
.dot.current { background: var(--warn); }

.feedback {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 12px 15px;
  border: 1px solid rgba(127, 168, 255, 0.28);
  border-radius: 12px;
  background: rgba(127, 168, 255, 0.08);
  color: #c9d9f8;
  font-size: 13px;
}

.feedback strong { color: var(--accent-2); }

.feedback.correct { border-color: rgba(102, 242, 192, 0.3); background: rgba(102, 242, 192, 0.07); }
.feedback.correct strong { color: var(--accent); }

.notice {
  margin: 0 0 18px;
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: #c4d2e9;
  font-size: 13px;
}

.notice.info { border-color: rgba(127, 168, 255, 0.3); background: rgba(127, 168, 255, 0.08); }
.notice.warn { border-color: rgba(255, 207, 112, 0.35); background: rgba(255, 207, 112, 0.08); color: #ffe0a6; }
.notice.error { border-color: rgba(255, 129, 151, 0.4); background: rgba(255, 129, 151, 0.09); color: #ffb8c6; }
.notice.success { border-color: rgba(102, 242, 192, 0.4); background: rgba(102, 242, 192, 0.09); color: #b8ffe4; }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(102, 242, 192, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 8px;
}

.finish-card { text-align: center; }
.finish-card h3 { margin-bottom: 8px; font-size: 24px; }
.finish-card p { margin: 0 0 20px; color: var(--muted); }

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.result-cell {
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 13, 27, 0.5);
}

.result-cell strong {
  display: block;
  color: var(--accent);
  font-size: 28px;
  line-height: 1.2;
}

.result-cell span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

tbody tr.is-current {
  background: rgba(102, 242, 192, 0.07);
}

.rank {
  color: var(--accent);
  font-weight: 700;
}

.rank-1 { color: var(--warn); }
.rank-2 { color: #d8e4ff; }
.rank-3 { color: #e0a17b; }

.score-cell {
  color: var(--accent);
  font-weight: 700;
}

.empty-state {
  padding: 34px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
  gap: 30px;
}

.review-form {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 13, 27, 0.42);
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.rating-field { margin-bottom: 16px; }

.form-message {
  min-height: 24px;
  margin-top: 14px;
  font-size: 13px;
}

.form-message.success { color: var(--accent); }
.form-message.error { color: var(--danger); }

.review-side h3 {
  margin: 24px 0 14px;
  font-size: 18px;
}

.score-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.summary-cell {
  padding: 16px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 13, 27, 0.5);
  text-align: center;
}

.summary-cell strong {
  display: block;
  color: var(--accent);
  font-size: 24px;
}

.summary-cell span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reviews-area {
  display: grid;
  gap: 12px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
}

.review-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 13, 27, 0.45);
}

.review-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.review-author { font-weight: 700; }

.review-date {
  color: var(--muted);
  font-size: 11px;
}

.review-stars {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--warn);
  font-size: 12px;
}

.review-stars span { color: var(--muted); }
.review-stars b { color: #ffe0a6; }

.review-comment {
  margin: 0;
  color: #c2cfe6;
  font-size: 13px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 4px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .hero,
  .start-grid,
  .review-layout {
    grid-template-columns: 1fr;
  }

  .hero-art {
    display: none;
  }

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

  .panel-note {
    text-align: left;
  }

  .review-layout {
    gap: 22px;
  }
}

@media (max-width: 600px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 0;
  }

  .hero {
    padding: 44px 0 36px;
  }

  .hero-facts {
    flex-wrap: wrap;
    gap: 18px;
  }

  .panel {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .start-card,
  .question-card,
  .finish-card,
  .result-card,
  .review-form {
    padding: 18px;
  }

  .rating-grid,
  .result-grid,
  .score-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer {
    flex-direction: column;
  }
}
