@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@500;700&family=Inter:wght@400;500;700;900&family=Caveat:wght@600&display=swap");

:root {
  --bg: #090b09;
  --panel: #11140f;
  --paper: #e4d6bd;
  --paper-light: #f2ead8;
  --ink: #15120d;
  --text: #eee3cf;
  --muted: #a99b84;
  --line: rgba(228, 214, 189, 0.18);
  --gold: #d7902f;
  --gold2: #ffb84a;
  --danger: #ff6b57;
}

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  background:
    radial-gradient(
      circle at 18% 10%,
      rgba(215, 144, 47, 0.13),
      transparent 28rem
    ),
    radial-gradient(
      circle at 86% 18%,
      rgba(228, 214, 189, 0.08),
      transparent 24rem
    ),
    linear-gradient(180deg, #090b09 0%, #0e100d 58%, #080908 100%);
}

main {
  position: relative;
  z-index: 1;
  flex: 1;
}

button,
input,
textarea {
  font: inherit;
}

img,
svg {
  max-width: 100%;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.hidden,
.hidden-protocol {
  display: none !important;
}

.topbar {
  min-height: 72px;
  padding: 0 clamp(18px, 4vw, 54px);
  display: flex;
  align-items: center;
  gap: 42px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 7, 6, 0.62);
  backdrop-filter: blur(12px);
}

.brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: Oswald, sans-serif;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

nav {
  display: flex;
  gap: 36px;
  margin-left: 28px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font:
    700 17px Oswald,
    sans-serif;
  letter-spacing: 0.06em;
  transition:
    color 0.18s ease,
    transform 0.18s ease;
}

nav a.active,
nav a:hover {
  color: var(--gold2);
}

nav a:hover {
  transform: translateY(-1px);
}

.badge {
  margin-left: auto;
  flex-shrink: 0;
  padding: 7px 15px;
  border: 1px solid rgba(228, 214, 189, 0.4);
  border-radius: 6px;
  color: var(--paper);
  font:
    700 12px Oswald,
    sans-serif;
  letter-spacing: 0.12em;
}

footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 26px clamp(22px, 7vw, 110px);
  display: flex;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

footer b {
  color: var(--paper);
  font-family: Oswald, sans-serif;
  font-size: 22px;
}

.kicker {
  margin: 0 0 14px;
  color: var(--gold);
  font:
    700 13px Oswald,
    sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--paper);
  font-family: Oswald, sans-serif;
  font-size: clamp(56px, 9vw, 122px);
  line-height: 0.96;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

h1 span {
  color: var(--gold2);
  font-family: Caveat, cursive;
  font-size: 0.7em;
  font-weight: 600;
  text-transform: none;
}

.lead,
.sub,
.hint,
.admin-muted {
  color: var(--muted);
  line-height: 1.6;
}

.lead {
  max-width: 620px;
  font-size: 18px;
  line-height: 1.7;
}

.btn {
  min-height: 52px;
  padding: 17px 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  font:
    900 17px Inter,
    sans-serif;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  border-color: transparent;
  color: var(--ink);
  background: var(--paper);
}

.btn.primary:hover {
  background: #f0dec0;
}

.btn.ghost {
  background: rgba(228, 214, 189, 0.04);
}

.btn.full {
  width: 100%;
  margin-top: 16px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #0b0d0a;
  outline: none;
}

.input {
  padding: 16px 18px;
  font-size: 16px;
}

.input:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(215, 144, 47, 0.12);
}

.input.code {
  text-align: center;
  text-transform: uppercase;
  font:
    800 20px Inter,
    sans-serif;
  letter-spacing: 0.12em;
}

textarea {
  height: 170px;
  margin: 14px 0;
  padding: 14px;
  color: var(--paper);
  background: #090a08;
  font-family: monospace;
  font-size: 13px;
}

.result-backup {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.result-backup h3 {
  margin: 0 0 8px;
  color: var(--gold2);
  font-size: 18px;
}

.result-backup textarea {
  min-height: 150px;
  font-size: 12px;
  line-height: 1.5;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(2, 3, 2, 0.72);
  backdrop-filter: blur(8px);
}

.manual-modal {
  width: min(680px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  padding: 26px;
  display: flex;
  flex-direction: column;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(215, 144, 47, 0.12),
      transparent 20rem
    ),
    #10120e;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.modal-head h2 {
  margin: 0;
  color: var(--paper);
  font-family: Oswald, sans-serif;
  font-size: 38px;
  line-height: 1;
  text-transform: uppercase;
}

.modal-close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.manual-modal textarea {
  min-height: 260px;
  max-height: 42vh;
  font-size: 12px;
  line-height: 1.5;
}

.manual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.result-actions .btn {
  flex: 1 1 220px;
  margin-top: 0;
}

.manual-actions .btn {
  flex: 1 1 180px;
}

.label {
  display: block;
  margin-bottom: 9px;
  color: var(--paper);
  font-weight: 800;
}

.error {
  color: var(--danger);
  font-weight: 800;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gold2);
  animation: statusBlink 1.6s ease-in-out infinite;
}

.hero {
  min-height: calc(100vh - 150px);
  padding: 70px clamp(22px, 10vw, 160px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(460px, 0.8fr);
  align-items: center;
  gap: 70px;
}

.hero-text {
  max-width: 1000px;
}

.actions {
  display: flex;
  gap: 14px;
  margin-top: 30px;
}

.countdown-card,
.rules-preview,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.055),
    rgba(255, 255, 255, 0.018)
  );
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.countdown-card {
  position: relative;
  overflow: hidden;
  padding: 42px 38px;
}

.countdown-card::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -100px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(221, 177, 88, 0.16);
  border-radius: 50%;
}

.countdown {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  margin: 42px 0 32px;
}

.countdown-unit {
  min-width: 105px;
  text-align: center;
}

.countdown-unit strong {
  display: block;
  color: var(--paper);
  font-size: clamp(52px, 6vw, 82px);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.06em;
}

.countdown-unit span {
  display: block;
  margin-top: 15px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.countdown-divider {
  padding-top: 4px;
  color: var(--gold2);
  font-size: 54px;
  line-height: 0.8;
  opacity: 0.55;
}

.countdown-note {
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.countdown-status,
.results-status,
.rules-state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.countdown-status {
  width: 100%;
  justify-content: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.event-place {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.small-label {
  font-size: 12px;
  letter-spacing: 0.15em;
  opacity: 0.7;
}

.place-text {
  margin: 10px 0 18px;
}

.place-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 10px;
  color: #171511;
  background: #e5b24c;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: 0.2s ease;
}

.place-button:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.page {
  min-height: calc(100vh - 150px);
  padding: 70px clamp(18px, 7vw, 110px) 80px;
}

.test-page,
.peak-page {
  width: 100%;
}

.peak-body {
  min-height: 100vh;
}

.page.narrow {
  max-width: 900px;
  margin: auto;
}

.intro,
.peak-hero {
  max-width: 900px;
  margin: 0 auto 32px;
}

.test-card,
.lock-card,
.mission,
.paper {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(23, 26, 20, 0.86),
    rgba(9, 11, 9, 0.84)
  );
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.28);
}

.test-card,
.lock-card,
.mission {
  max-width: 860px;
  margin: auto;
  padding: 34px;
}

.lock-card {
  max-width: 540px;
  text-align: center;
}

.lock-icon {
  font-size: 44px;
}

.question-top {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--gold);
  font:
    700 15px Oswald,
    sans-serif;
  letter-spacing: 0.08em;
}

.progress {
  height: 6px;
  flex: 1;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(228, 214, 189, 0.18);
}

.progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold2);
  transition: 0.25s ease;
}

#questionText {
  margin: 28px 0 8px;
  font-size: 32px;
}

.options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.option {
  min-height: 138px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  text-align: left;
  transition: 0.18s ease;
}

.option:hover,
.option.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(215, 144, 47, 0.12);
  transform: translateY(-1px);
}

.option strong {
  display: block;
  margin-bottom: 7px;
  font-size: 17px;
}

.option span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.option .emoji {
  margin-bottom: 12px;
  font-size: 34px;
}

.question-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.peak-hero h1 {
  font-size: clamp(72px, 13vw, 150px);
}

.mission-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.mission-head h2 {
  margin: 0;
  font-family: Oswald, sans-serif;
  font-size: 52px;
  text-transform: uppercase;
}

.mission-biome {
  margin: 10px 0 0;
  color: var(--gold2);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stamp {
  flex-shrink: 0;
  padding: 8px 15px;
  border: 2px solid var(--gold);
  border-radius: 6px;
  color: var(--gold);
  font:
    800 18px Oswald,
    sans-serif;
  transform: rotate(-7deg);
}

.paper {
  padding: 34px;
  border: 0;
  border-radius: 2px;
  color: var(--ink);
  background: var(--paper);
}

.paper h2 {
  margin-top: 0;
  font-family: Oswald, sans-serif;
  font-size: 36px;
}

.paper p,
.paper li {
  line-height: 1.75;
}

.mission-paper p {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.45;
}

.mission-paper small {
  color: #514735;
  font-weight: 800;
}

.results-page {
  min-height: calc(100vh - 150px);
  padding: 80px 24px;
  display: grid;
  place-items: center;
}

.results-empty {
  width: min(720px, 100%);
  text-align: center;
}

.results-mark {
  margin: 28px 0 18px;
  color: var(--gold2);
  font-size: 52px;
  animation: resultPulse 2.4s ease-in-out infinite;
}

.results-empty h1 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(46px, 7vw, 88px);
  line-height: 0.95;
}

.results-empty .lead {
  max-width: 600px;
  margin: 28px auto;
}

.results-status {
  margin-top: 20px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}

.rules-page {
  min-height: calc(100vh - 150px);
  padding: 80px 7vw;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(420px, 1fr);
  align-items: center;
  gap: 80px;
}

.rules-intro h1 {
  margin: 14px 0 26px;
  color: var(--paper);
  font-size: clamp(58px, 7vw, 108px);
  line-height: 0.88;
  letter-spacing: -0.055em;
}

.rules-intro h1 span {
  color: var(--gold2);
}

.rules-content {
  margin-top: 50px;
}

.protocol-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 35px;
}

.protocol-tab {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
}

.protocol-tab span {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.15em;
  opacity: 0.6;
}

.protocol-tab.active {
  border-color: rgba(212, 160, 50, 0.7);
  color: #d4a032;
  background: rgba(212, 160, 50, 0.08);
}

.protocol-card {
  max-width: 900px;
  padding: 45px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.protocol-card h2 {
  margin: 0 0 25px;
  font-size: 42px;
}

.protocol-card h3 {
  margin-top: 35px;
  font-size: 22px;
}

.protocol-card p {
  line-height: 1.7;
  opacity: 0.85;
}

.protocol-number {
  font-size: 12px;
  letter-spacing: 0.2em;
  opacity: 0.6;
}

.rules-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 35px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.participants-page {
  padding: 0 50px 70px;
}

.host-section {
  margin-bottom: 35px;
  padding-top: 35px;
  text-align: center;
}

.section-big-title {
  margin: 0 0 25px;
  color: var(--paper-light);
  text-align: center;
  font-size: clamp(35px, 3vw, 55px);
  line-height: 0.9;
}

.host-card,
.participant-card {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.host-card {
  width: 220px;
  margin: auto;
  padding: 18px;
  border-color: rgba(212, 160, 50, 0.4);
  border-radius: 16px;
}

.participants-header {
  margin-bottom: 30px;
}

.participants-header h1 {
  margin: 10px 0 25px;
  font-size: clamp(50px, 5vw, 75px);
}

.participants-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}

.participant-card {
  min-height: 220px;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 14px;
}

.participant-number {
  margin-bottom: 15px;
  font-size: 14px;
  opacity: 0.7;
}

.avatar,
.avatar-placeholder {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  display: block;
  border-radius: 50%;
}

.avatar {
  object-fit: cover;
  border: 1px solid rgba(212, 160, 50, 0.4);
}

.avatar-placeholder {
  background: radial-gradient(
    circle,
    rgba(212, 160, 50, 0.35),
    rgba(255, 255, 255, 0.05)
  );
}

.host-card .avatar {
  width: 80px;
  height: 80px;
}

.participant-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.participant-card p {
  margin-bottom: 15px;
  font-size: 13px;
  opacity: 0.7;
}

.participant-card a,
.host-card a {
  color: #d4a032;
  font-weight: 700;
  text-decoration: none;
}

.participant-links {
  margin-top: auto;
}

.participant-card a:hover,
.host-card a:hover {
  opacity: 0.8;
}

.admin-screen {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  place-items: center;
}

.admin-dashboard {
  width: min(1180px, 100%);
  height: min(780px, calc(100vh - 56px));
  padding: 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(
      circle at 80% 0%,
      rgba(215, 144, 47, 0.12),
      transparent 22rem
    ),
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.06),
      rgba(255, 255, 255, 0.02)
    );
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.34);
}

.admin-dashboard-head,
.admin-toolbar,
.source-toggle,
.game-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-dashboard-head {
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-shrink: 0;
}

.admin-dashboard-head h1 {
  margin: 0;
  color: var(--paper);
  font-size: 42px;
  line-height: 0.9;
}

.admin-toolbar {
  justify-content: center;
  margin: 20px 0;
  flex-shrink: 0;
}

.source-btn,
.game-tab {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.source-btn.active,
.game-tab.active,
.game-tab:hover {
  color: var(--ink);
  background: var(--paper);
}

.admin-workspace {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
}

.admin-left,
.admin-right {
  position: relative;
  min-height: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--paper);
}

.panel-title span,
.compact-chip span,
.admin-number,
.admin-chip span {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  color: var(--gold2);
  background: rgba(215, 144, 47, 0.16);
  font-weight: 900;
}

.panel-title span {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.compact-block {
  margin-top: 14px;
}

.compact-block h3 {
  margin: 0 0 10px;
  color: var(--gold2);
  font-size: 18px;
}

.compact-list,
.compact-groups,
.admin-grid,
.admin-list,
.admin-mini-grid,
.pairs-compact-list,
.pairs-show-list {
  display: grid;
  gap: 10px;
}

.compact-list,
.admin-grid,
.admin-two-cols,
.compact-groups {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-chip,
.admin-chip,
.admin-item,
.pair-compact-card,
.pair-round,
.group-box,
.admin-message {
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.035);
}

.compact-chip {
  min-height: 46px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.compact-chip span {
  width: 20px;
  height: 20px;
  font-size: 10px;
}

.compact-groups h4 {
  margin: 0 0 8px;
  color: var(--muted);
  text-align: center;
}

.compact-groups .compact-chip {
  margin-bottom: 7px;
}

#createGroupsBtn {
  margin-top: auto;
}

.game-tabs {
  justify-content: center;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.game-panel {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.admin-loader,
.inline-loader {
  display: grid;
  place-items: center;
  gap: 14px;
  color: var(--gold2);
  text-align: center;
}

.admin-loader {
  margin: 20px auto;
}

.inline-loader {
  min-height: 150px;
}

.admin-loader p,
.inline-loader p {
  margin: 0;
  color: var(--gold2);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.inline-loader-text {
  min-height: 1.4em;
}

.loader-ring {
  width: 54px;
  height: 54px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--gold2);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-progress {
  width: min(260px, 80%);
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.loader-progress-bar {
  width: 0%;
  height: 100%;
  background: var(--gold2);
  transition: width 0.7s ease;
}

#pairsBox {
  min-height: 0;
  flex: 1;
  display: grid;
  align-content: center;
}

.pair-compact-card {
  padding: 16px;
  display: grid;
  grid-template-columns: 70px 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.pair-compact-card span,
.pair-show-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.pair-compact-card em,
.pair-show-card em {
  color: var(--gold2);
  font-style: normal;
  font-weight: 900;
}

#generatePairsBtn {
  flex-shrink: 0;
  margin-top: 16px;
}

.gold-sparks {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.gold-spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold2);
  opacity: 0;
  animation: sparkFly 0.75s ease-out forwards;
}

.reveal-card {
  opacity: 0;
  transform: translateY(14px);
  animation: revealCard 0.55s ease forwards;
}

@keyframes resultPulse {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes statusBlink {
  0%,
  100% {
    opacity: 0.25;
  }

  50% {
    opacity: 1;
  }
}

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

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

@keyframes sparkFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(0.3);
  }
}

@media (max-width: 1200px) {
  .participants-page {
    padding: 0 30px 60px;
  }
}

@media (max-width: 1180px) {
  .admin-screen {
    padding: 18px;
  }

  .admin-dashboard {
    width: 100%;
    height: auto;
    min-height: calc(100vh - 36px);
    padding: 22px;
  }

  .admin-dashboard-head h1 {
    font-size: 34px;
  }

  .admin-toolbar {
    margin: 14px 0;
  }

  .admin-workspace {
    gap: 14px;
  }

  .admin-left,
  .admin-right {
    padding: 18px;
  }

  .compact-chip {
    min-height: 40px;
    font-size: 13px;
  }

  .pair-compact-card {
    padding: 13px;
  }
}

@media (max-width: 1100px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 56px 24px 42px;
  }

  .hero-text {
    max-width: 760px;
  }

  .hero h1 {
    width: auto;
    max-width: 100%;
    font-size: clamp(48px, 12vw, 88px);
  }

  .hero h1 span {
    margin-left: 0;
    white-space: normal;
  }

  .lead {
    font-size: 16px;
  }

  .countdown-card {
    width: 100%;
    max-width: 720px;
  }
}

@media (max-width: 900px) {
  .topbar {
    padding: 16px 22px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  nav {
    margin-left: 0;
    flex-wrap: wrap;
    gap: 20px;
  }

  nav a {
    font-size: 15px;
  }

  .brand {
    font-size: 24px;
  }

  .rules-page {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 52px 24px;
  }

  .rules-intro h1 {
    font-size: clamp(48px, 14vw, 78px);
  }

  .results-page {
    min-height: auto;
    padding: 70px 22px;
  }

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

  .admin-dashboard {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

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

  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .admin-left,
  .admin-right {
    overflow: visible;
  }

  .compact-list,
  .compact-groups {
    grid-template-columns: 1fr;
  }

  .pair-compact-card {
    grid-template-columns: 1fr;
  }

  .admin-toolbar {
    flex-direction: column;
  }

  .source-toggle,
  .game-tabs {
    width: 100%;
  }

  .source-btn,
  .game-tab {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 800px) {
  .badge {
    display: none;
  }

  .options,
  .protocol-tabs {
    grid-template-columns: 1fr;
  }

  .question-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .progress {
    width: 100%;
    flex: auto;
  }
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto;
    gap: 36px;
    padding: 42px 30px 34px;
  }

  .hero > section,
  .hero-text,
  .countdown-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .countdown-card {
    grid-column: 1;
    grid-row: 2;
  }

  .page {
    min-height: auto;
    padding: 46px 18px 60px;
  }

  .test-card,
  .lock-card,
  .mission {
    padding: 24px 18px;
  }

  #questionText {
    font-size: 25px;
  }

  .option {
    min-height: auto;
    padding: 16px;
  }

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

  .mission-head h2 {
    font-size: 38px;
  }

  .paper {
    padding: 24px 20px;
  }

  .mission-paper p {
    font-size: 20px;
  }

  .stamp {
    align-self: flex-start;
  }
}

@media (max-width: 600px) {
  .participants-page {
    padding: 0 20px 40px;
  }

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

@media (max-width: 560px) {
  .hero {
    padding: 42px 18px 34px;
  }

  .hero h1 {
    font-size: clamp(42px, 15vw, 64px);
    line-height: 0.92;
  }

  .hero h1 span {
    display: block;
    margin-top: 10px;
    font-size: 0.72em;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    padding: 15px 20px;
    font-size: 15px;
  }

  .countdown-card {
    padding: 34px 20px;
  }

  .countdown {
    gap: 6px;
    margin: 32px 0 24px;
  }

  .countdown-unit {
    min-width: 0;
    flex: 1;
  }

  .countdown-unit strong {
    font-size: clamp(38px, 15vw, 58px);
  }

  .countdown-divider {
    font-size: 32px;
  }

  .countdown-status,
  .results-status,
  .rules-state {
    align-items: flex-start;
    border-radius: 16px;
    line-height: 1.5;
    text-align: left;
  }

  .rules-page {
    padding: 42px 18px;
  }

  .protocol-card {
    padding: 25px;
  }

  .protocol-card h2 {
    font-size: 30px;
  }

  .results-empty h1 {
    font-size: clamp(42px, 14vw, 64px);
  }
}
/* =========================
   ФИНАЛЬНЫЕ ПАРЫ — ДЕНЬ 3
========================= */

.final-admin {
  height: min(780px, calc(100vh - 56px));
}

.final-admin .final-animation {
  min-height: 0;
  flex: 1;

  display: flex;
  flex-direction: column;
  justify-content: center;

  width: 100%;
}

.final-admin #pairsBox.final-pairs-box {
  width: 100%;
  max-width: 1080px;

  min-height: 0;
  margin: 0 auto;

  flex: none;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-content: stretch;
}

.final-admin .final-pair-card {
  min-height: 260px;
  margin: 0;
  padding: 34px 24px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(228, 214, 189, 0.25);
  border-radius: 18px;

  text-align: center;

  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(215, 144, 47, 0.1),
      transparent 13rem
    ),
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.06),
      rgba(255, 255, 255, 0.018)
    );

  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.final-admin .final-pair-number {
  margin-bottom: 27px;

  color: var(--gold2);

  font-family: Oswald, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.final-admin .final-player {
  color: var(--paper);

  font-family: Oswald, sans-serif;
  font-size: clamp(28px, 2.5vw, 38px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.final-admin .final-plus {
  margin: 17px 0;

  color: var(--gold2);

  font-family: Oswald, sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 900px) {
  .final-admin {
    height: auto;
    min-height: calc(100vh - 36px);
  }

  .final-admin .final-animation {
    justify-content: flex-start;
  }

  .final-admin #pairsBox.final-pairs-box {
    grid-template-columns: 1fr;
  }

  .final-admin .final-pair-card {
    min-height: 220px;
  }
}

.social-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.social-icons a {
  width: 46px;
  height: 46px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 1px solid rgba(212, 160, 50, 0.55);
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.02);

  line-height: 0;
  text-decoration: none;

  box-sizing: border-box;

  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.social-icons a:hover {
  transform: translateY(-2px);
  border-color: #d4a032;
  background: rgba(212, 160, 50, 0.08);
}

.social-icons svg {
  display: block;
  flex: none;
  fill: #d4a032;
}

.social-icons .twitch svg {
  width: 25px;
  height: 25px;
  transform: translate(-0.5px, 1px);
}

.social-icons .telegram svg {
  width: 25px;
  height: 25px;
  transform: translate(-2px, 0.5px);
}

.social-icons .discord svg {
  width: 26px;
  height: 26px;
  transform: translate(3px, 1px);
}
