/* ============================================================
   mavhp.ru — hidden «Правда или действие»
   Design baseline: VARIANCE 8 · MOTION 6 · DENSITY 4
   ============================================================ */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --ink: #18181b;
  --ink-soft: #3f3f46;
  --muted: #71717a;
  --line: #e4e4e7;
  --line-soft: #f4f4f5;

  --accent: #e11d48;
  --accent-strong: #be123c;
  --accent-soft: #fff1f2;
  --accent-shadow: rgba(225, 29, 72, 0.22);

  --radius-lg: 28px;
  --radius-xl: 40px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "SFMono-Regular", ui-monospace, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.site {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.main {
  flex: 1 0 auto;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

svg {
  display: block;
}

/* ---------- View routing ---------- */
.view[hidden] {
  display: none;
}

[hidden] {
  display: none !important;
}

.view {
  animation: viewIn 0.5s var(--ease) both;
}

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

/* ---------- Reveal / stagger ---------- */
.reveal {
  animation: fadeUp 0.7s var(--ease) both;
  animation-delay: var(--d, 0s);
}

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

/* ---------- Typography ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.display {
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--ink);
}

.display-dot {
  color: var(--accent);
}

.lead {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.7;
  margin-top: 1.5rem;
}

.hint {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 2rem;
  max-width: 44ch;
}

/* ---------- Landing ---------- */
.hero {
  min-height: calc(100dvh - 4rem);
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 7vh, 5rem);
}

.domain-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: clamp(1.75rem, 3.5vw, 2.75rem);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 24px 48px -24px rgba(24, 24, 27, 0.12);
}

.card-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.domain-address {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-top: 0.75rem;
  margin-bottom: 1.75rem;
}

.card-divider {
  height: 1px;
  background: var(--line-soft);
  margin-bottom: 1rem;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.92rem;
}

.meta-row:last-child {
  border-bottom: none;
}

.meta-key {
  color: var(--muted);
}

.meta-value {
  font-weight: 500;
  color: var(--ink);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex: none;
}

.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #22c55e;
  animation: breathe 2.4s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.45;
  }
  50% {
    transform: scale(2.6);
    opacity: 0;
  }
}

.status-text {
  color: var(--ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 1.6rem;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  will-change: transform;
}

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

.btn .icon {
  width: 17px;
  height: 17px;
  transition: transform 0.3s var(--ease);
}

.btn:hover .icon {
  transform: translateX(2px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px -12px var(--accent-shadow);
}

.btn-primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
  margin-top: 1.75rem;
}

/* ---------- Password panel ---------- */
.panel-grid {
  min-height: calc(100dvh - 4rem);
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 7vh, 5rem);
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: 0 24px 48px -28px rgba(24, 24, 27, 0.14);
}

.form-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.75rem;
}

.form-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  flex: none;
}

.form-icon svg {
  width: 22px;
  height: 22px;
}

.form-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.form-note {
  font-size: 0.85rem;
  color: var(--muted);
}

.code-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.code-input {
  width: 100%;
  aspect-ratio: 1 / 1.05;
  text-align: center;
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.code-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.code-input.filled {
  border-color: var(--ink-soft);
}

.error-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  margin: 0.9rem 0 1rem;
}

/* ---------- Spinner inside submit button ---------- */
.btn .spinner {
  display: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .label {
  opacity: 0;
}

.btn.is-loading .spinner {
  display: inline-block;
}

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

/* ---------- Shake (error) ---------- */
.shake {
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(5px);
  }
}

/* ---------- Game mode ---------- */
.game {
  min-height: calc(100dvh - 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(3rem, 8vh, 6rem);
}

.game-head {
  max-width: 720px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 3rem;
}

.mode-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.85rem;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  will-change: transform;
}

.mode-btn:hover {
  transform: translateY(-3px);
  border-color: var(--ink-soft);
  box-shadow: 0 24px 48px -28px rgba(24, 24, 27, 0.16);
}

.mode-btn:active {
  transform: translateY(1px) scale(0.99);
}

.mode-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
}

.mode-icon svg {
  width: 24px;
  height: 24px;
}

.mode-btn-hot .mode-icon {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 16%, transparent);
}

.mode-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.mode-desc {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 40ch;
}

.mode-arrow {
  position: absolute;
  top: clamp(1.75rem, 3vw, 2.5rem);
  right: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--muted);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

.mode-arrow svg {
  width: 18px;
  height: 18px;
}

.mode-btn:hover .mode-arrow {
  transform: translateX(3px);
  color: var(--ink);
}

.badge-18 {
  position: absolute;
  top: clamp(1.75rem, 3vw, 2.5rem);
  right: clamp(1.75rem, 3vw, 2.5rem);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  background: var(--accent-soft);
}

.mode-btn-hot .mode-arrow {
  display: none;
}

/* ---------- Players (names) ---------- */
.players {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding-top: 2.5rem;
}

.players-head {
  max-width: 560px;
}

.players-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.players-note {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.field-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  outline: none;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}

.field-input::placeholder {
  color: var(--muted);
}

.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: var(--surface);
}

/* ---------- Game play ---------- */
.game-play {
  padding-block: clamp(1.5rem, 5vh, 3rem);
}

.play-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.play-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}

.skip-panel {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.skip-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.85rem;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.skip-item.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.skip-name {
  color: var(--ink);
  font-weight: 500;
}

.skip-count {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  min-width: 1.4em;
  text-align: center;
}

.turn {
  margin-top: 2.5rem;
}

.turn-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.turn-name {
  display: block;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-top: 0.4rem;
  color: var(--ink);
}

.phase {
  margin-top: 2rem;
}

.phase-hint {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  max-width: 640px;
}

.choice-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  will-change: transform;
}

.choice-btn:hover {
  transform: translateY(-3px);
  border-color: var(--ink-soft);
  box-shadow: 0 24px 48px -28px rgba(24, 24, 27, 0.16);
}

.choice-btn:active {
  transform: translateY(1px) scale(0.99);
}

.choice-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.choice-sub {
  font-size: 0.9rem;
  color: var(--muted);
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 5vw, 3.5rem);
  max-width: 720px;
  box-shadow: 0 24px 48px -24px rgba(24, 24, 27, 0.12);
}

.task-type {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  background: var(--accent-soft);
}

.task-text {
  font-size: clamp(1.35rem, 3.5vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
  margin-top: 1.25rem;
}

.task-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.skip-left {
  font-family: var(--font-mono);
  font-weight: 600;
}

.play-exit {
  margin-top: 2.5rem;
}

/* ---------- 404 ---------- */
.nf {
  min-height: calc(100dvh - 4rem);
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 7vh, 5rem);
}

.nf-code {
  font-size: clamp(6rem, 20vw, 15rem);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 0.85;
  color: var(--line);
  user-select: none;
}

.nf-copy {
  max-width: 560px;
}

.cta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  max-width: 1200px;
  margin-inline: auto;
  padding: 1.5rem clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-inner .mono {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero,
  .panel-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    min-height: auto;
    padding-block: 3rem 4rem;
  }

  .nf {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    min-height: auto;
    padding-block: 3rem 4rem;
  }

  .nf-code {
    font-size: clamp(5rem, 28vw, 9rem);
  }
}

@media (max-width: 640px) {
  .mode-grid {
    grid-template-columns: 1fr;
  }

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

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

  .task-actions .btn {
    width: 100%;
  }

  .code-row {
    gap: 0.6rem;
  }

  .cta-row .btn {
    width: 100%;
  }

  .domain-address {
    font-size: 1.9rem;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
