*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #12151A;
  --card: #1C222B;
  --card-2: #232A34;
  --line: #2E3642;
  --text: #F5F7FA;
  --muted: #9AA3AE;
  --accent: #C6F04D;
  --accent-ink: #14180A;
  --ok: #3DDC84;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

html, body { max-width: 100%; overflow-x: hidden; }

body {
  font-family: Manrope, system-ui, sans-serif;
  background:
    radial-gradient(900px 480px at 50% 20%, rgba(198, 240, 77, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100dvh;
  min-height: 100svh;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
button { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.bar, .wrap, footer, .legal {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.bar {
  display: flex;
  align-items: center;
  padding-top: calc(14px + env(safe-area-inset-top));
  padding-bottom: 12px;
}

body[data-stage="hero"] .bar,
body[data-stage="match"] .bar,
body[data-stage="picked"] .bar {
  position: absolute;
  left: 0;
  right: 0;
  justify-content: center;
  z-index: 2;
  width: 100%;
  max-width: none;
}

body[data-stage="catalog"] .bar {
  justify-content: center;
}

body[data-stage="hero"] footer,
body[data-stage="match"] footer,
body[data-stage="picked"] footer {
  display: none !important;
}

.bar strong {
  letter-spacing: -0.045em;
  font-size: 1.42rem;
}

.bar strong span {
  display: inline-block;
  margin-left: 7px;
  padding: 5px 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.84rem;
  border-radius: 8px;
  vertical-align: 3px;
}

body[data-stage="hero"] .bar strong {
  font-size: 1.55rem;
}

body[data-stage="hero"] .bar strong span {
  font-size: 0.9rem;
  padding: 6px 11px;
  margin-left: 8px;
}

.hero,
.match,
.picked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  padding: calc(76px + env(safe-area-inset-top)) 4px calc(28px + env(safe-area-inset-bottom));
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.hero.is-on,
.match.is-on,
.picked.is-on,
.catalog.is-on {
  opacity: 1;
  transform: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(198, 240, 77, 0.12);
  border: 1px solid rgba(198, 240, 77, 0.28);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

h1 {
  font-size: clamp(1.55rem, 6.4vw, 2.5rem);
  letter-spacing: -0.045em;
  line-height: 1.15;
  margin-bottom: 8px;
  max-width: 16ch;
}

h2 {
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  letter-spacing: -0.03em;
}

.lead, .hint, footer { color: var(--muted); }

.lead {
  margin-bottom: 14px;
  max-width: 32em;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin-bottom: 16px;
}

.stats li {
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-art {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 2px 0 18px;
}

.hero-art .char {
  width: 56px;
  height: 56px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.btn:active { transform: scale(0.98); }

.primary-cta { max-width: 360px; }

.hint {
  margin-top: 12px;
  font-size: 0.88rem;
  text-align: center;
  max-width: 28em;
}

.loader-ring {
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.progress {
  width: min(280px, 100%);
  height: 8px;
  margin: 14px auto 8px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.55s ease;
}

.progress-pct {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 16px;
}

.match-steps {
  list-style: none;
  width: min(340px, 100%);
  text-align: left;
}

.match-steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0;
  color: var(--muted);
  opacity: 0.4;
  transition: opacity 0.25s ease;
}

.match-steps li.is-run,
.match-steps li.is-done { opacity: 1; color: var(--text); }

.mark {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 2px solid var(--line);
  border-radius: 50%;
}

.is-run .mark {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(198, 240, 77, 0.12);
}

.is-done .mark {
  border-color: var(--ok);
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2312151A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5 6.5 11.5 12.5 4.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.match-done {
  margin-top: 16px;
  font-weight: 800;
  color: var(--accent);
}

.catalog {
  padding: 8px 0 32px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.catalog > h2,
.catalog > .lead {
  text-align: center;
}

.catalog > .lead {
  margin-left: auto;
  margin-right: auto;
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin: 12px 0 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filters::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.filters button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.filters button.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

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

.job-card {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  animation: cardIn 0.4s ease forwards;
}

.job-icon .char,
.picked-icon .char {
  width: 64px;
  height: 64px;
  display: block;
}

.picked-icon .char { width: 80px; height: 80px; margin: 8px auto 4px; }

.job-card h3 {
  margin: 8px 0 2px;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.salary {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.chips span {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--card-2);
  border: 1px solid var(--line);
}

.chips span.ok {
  background: rgba(198, 240, 77, 0.14);
  border-color: transparent;
  color: var(--accent);
}

.slots {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  padding: 5px 10px 5px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
}

.slots-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.slots-critical {
  background: rgba(180, 36, 36, 0.22);
  border: 1px solid rgba(255, 92, 92, 0.5);
  color: #FF6B6B;
  animation: slotsPulse 1.8s ease-in-out infinite;
}

.slots-critical .slots-dot {
  background: #FF5A5A;
  box-shadow: 0 0 6px rgba(255, 90, 90, 0.7);
}

.slots-warning {
  background: rgba(180, 120, 20, 0.18);
  border: 1px solid rgba(240, 180, 70, 0.42);
  color: #F0C14A;
  box-shadow: 0 0 10px rgba(240, 193, 74, 0.12);
}

.slots-warning .slots-dot {
  background: #F0C14A;
  box-shadow: 0 0 6px rgba(240, 193, 74, 0.55);
}

.slots-available {
  background: rgba(34, 140, 82, 0.16);
  border: 1px solid rgba(61, 220, 132, 0.38);
  color: #3DDC84;
}

.slots-available .slots-dot {
  background: #3DDC84;
  box-shadow: 0 0 6px rgba(61, 220, 132, 0.45);
}

@keyframes slotsPulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(255, 90, 90, 0.12);
  }
  50% {
    opacity: 0.84;
    box-shadow: 0 0 12px 1px rgba(255, 90, 90, 0.28);
  }
}

.job-card .desc {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.job-card .btn {
  text-transform: none;
  letter-spacing: 0;
  min-height: 46px;
  font-size: 0.95rem;
  max-width: none;
}

.picked h2 {
  text-transform: uppercase;
  margin: 8px 0 4px;
}

.picked-meta { color: var(--muted); margin-bottom: 10px; }

.picked .lead { margin-bottom: 18px; }

.link-back {
  margin-top: 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 700;
  min-height: 44px;
  cursor: pointer;
}

.empty {
  color: var(--muted);
  padding: 18px 4px;
}

footer {
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
}

footer strong { color: var(--text); }

footer nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
}

.legal { padding-top: 8px; }
.legal h1 { font-size: 1.45rem; margin-bottom: 8px; }
.paper {
  margin: 12px 0 28px;
  padding: 18px 16px;
  background: var(--card);
  border-radius: 16px;
  border-top: 3px solid var(--accent);
}
.paper h2 { margin: 16px 0 8px; color: var(--accent); }
.paper p, .paper li { color: var(--muted); }
.paper ul { padding-left: 18px; margin-top: 8px; }
.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-weight: 700;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

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

@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero-art .char { width: 64px; height: 64px; }
}

@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .job-card:hover {
    border-color: rgba(198, 240, 77, 0.45);
    box-shadow: 0 14px 36px rgba(198, 240, 77, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-ring { animation: none; border-top-color: var(--accent); }
  .hero, .match, .picked, .catalog { transition: none; }
  .job-card { opacity: 1; transform: none; animation: none; }
  .slots-critical { animation: none; }
}
