:root {
  --bg-deep: #020204;
  --bg-void: #000000;
  --surface: rgba(8, 10, 14, 0.92);
  --surface-2: rgba(14, 18, 24, 0.9);
  --surface-3: rgba(20, 24, 31, 0.88);
  --text: #f5f3ea;
  --muted: #b7b49f;
  --line: rgba(255, 213, 115, 0.26);
  --line-strong: rgba(255, 226, 145, 0.5);
  --shadow: rgba(0, 0, 0, 0.72);
  --gold-1: #fff2c7;
  --gold-2: #f3d78e;
  --gold-3: #c79c3f;
  --gold-4: #8d6622;
  --neon-1: #d2ff56;
  --neon-2: #9aff17;
  --neon-3: #5aff00;
  --danger: #ff5a76;
  --warn: #ffc66a;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Orbitron", "Rajdhani", "Eurostile", "Avenir Next", sans-serif;
  background: radial-gradient(circle at 22% 8%, rgba(182, 255, 22, 0.09), transparent 34%),
    radial-gradient(circle at 80% 14%, rgba(255, 205, 118, 0.1), transparent 30%),
    radial-gradient(circle at 40% 92%, rgba(140, 255, 0, 0.06), transparent 36%),
    linear-gradient(180deg, #050609 0%, #020204 48%, #000000 100%);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -30% -10%;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(circle at 8% 30%, rgba(255, 221, 132, 0.08), transparent 38%),
    radial-gradient(circle at 88% 75%, rgba(176, 255, 0, 0.07), transparent 42%);
  filter: blur(56px) saturate(130%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.4) 0.6px, transparent 1px);
  background-size: 4px 4px;
  opacity: 0.05;
}

.app-shell {
  width: min(1240px, 94vw);
  margin: 20px auto 34px;
  display: grid;
  gap: 14px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(145deg, rgba(10, 13, 18, 0.96), rgba(16, 20, 26, 0.94));
  border: 1px solid var(--line-strong);
  box-shadow: 0 28px 64px var(--shadow), inset 0 0 0 1px rgba(163, 255, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    120deg,
    rgba(255, 237, 185, 0.34) 0%,
    rgba(236, 186, 87, 0.22) 25%,
    rgba(105, 80, 28, 0.08) 50%,
    rgba(164, 255, 0, 0.16) 85%,
    rgba(214, 255, 95, 0.2) 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 1px;
}

.app-header h1 {
  margin: 0 0 6px;
  font-size: clamp(1.7rem, 2.8vw, 2.5rem);
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2) 30%, var(--gold-3) 58%, var(--gold-1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 22px rgba(255, 219, 129, 0.36);
}

.subtitle {
  margin: 0;
  max-width: 760px;
  color: #d6d1bc;
}

.status-stack {
  min-width: 330px;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(7, 9, 14, 0.9), rgba(14, 19, 24, 0.84));
  border: 1px solid rgba(164, 255, 0, 0.26);
  box-shadow: inset 0 0 0 1px rgba(255, 211, 107, 0.14);
}

.status-stack p {
  margin: 0;
  font-size: 0.9rem;
  color: #ecf3dc;
}

.lang-switch {
  position: relative;
  display: inline-block;
  align-self: flex-start;
  margin-left: auto;
}

.lang-menu-toggle {
  min-width: 124px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 219, 128, 0.34);
  background: rgba(8, 12, 17, 0.92);
  color: #ece7d4;
  box-shadow: none;
}

.lang-menu-toggle:hover {
  transform: none;
  box-shadow: 0 0 0 1px rgba(170, 255, 21, 0.18), 0 0 14px rgba(153, 255, 0, 0.14);
}

.lang-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 218, 126, 0.32);
  background: rgba(8, 12, 17, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.62);
}

.lang-option {
  width: 100%;
  justify-content: flex-start;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(170, 255, 22, 0.34);
  background: rgba(15, 20, 26, 0.9);
  color: #e7e2cc;
  box-shadow: none;
}

.lang-option:hover {
  box-shadow: 0 0 0 1px rgba(176, 255, 21, 0.14), 0 0 16px rgba(145, 255, 0, 0.16);
}

.lang-option.active {
  color: #1f170a;
  border-color: rgba(255, 226, 146, 0.82);
  background: linear-gradient(
    135deg,
    var(--gold-1) 0%,
    var(--gold-2) 34%,
    var(--gold-3) 68%,
    #f4e6ba 100%
  );
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 10px;
  z-index: 60;
  padding: 9px;
  border-radius: 12px;
  background: rgba(5, 7, 10, 0.86);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px var(--shadow);
  backdrop-filter: blur(8px);
}

.top-nav a {
  text-decoration: none;
  color: #e3e0cf;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 0.89rem;
  font-weight: 600;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease,
    background 0.2s ease, transform 0.2s ease;
}

.top-nav a:hover {
  border-color: rgba(176, 255, 44, 0.42);
  color: #f7f6ef;
  background: rgba(33, 42, 25, 0.38);
  box-shadow: 0 0 0 1px rgba(168, 255, 11, 0.18), 0 0 20px rgba(147, 255, 0, 0.16);
  transform: translateY(-1px);
}

.top-nav a.active {
  border-color: rgba(255, 219, 129, 0.72);
  color: #19140c;
  background: linear-gradient(
    135deg,
    var(--gold-1) 0%,
    var(--gold-2) 30%,
    var(--gold-3) 62%,
    #f6e6b4 100%
  );
  box-shadow: 0 0 0 1px rgba(255, 236, 166, 0.42), 0 10px 24px rgba(240, 170, 63, 0.25);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 0.73rem;
  font-weight: 700;
  color: #181818;
  background: linear-gradient(135deg, var(--neon-1), var(--neon-3));
}

.nav-badge.active {
  background: linear-gradient(135deg, #ffd287, #ff9f44);
}

.screens {
  display: grid;
}

.screen {
  display: none;
  gap: 12px;
}

.screen.active {
  display: grid;
}

.card {
  background: linear-gradient(155deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 16px 18px;
  box-shadow: 0 14px 30px var(--shadow), inset 0 0 0 1px rgba(170, 255, 0, 0.08);
  overflow: hidden;
  animation: card-rise 0.55s ease both;
}

.screen.active .card:nth-child(2) {
  animation-delay: 0.05s;
}

.screen.active .card:nth-child(3) {
  animation-delay: 0.1s;
}

.screen.active .card:nth-child(4) {
  animation-delay: 0.16s;
}

.card h2,
.card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #f3efde;
}

.card h2 {
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.card h3 {
  font-size: 1.03rem;
}

.note {
  color: var(--muted);
}

#join-flow-line {
  margin: 2px 0 10px;
  color: #dcf7a3;
}

body.join-only .top-nav a:not([data-route="/"]) {
  display: none;
}

body.join-only [data-screen]:not([data-screen="/"]) {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(760px, 94vw);
  border-radius: 14px;
  border: 1px solid rgba(255, 221, 131, 0.38);
  background: linear-gradient(150deg, rgba(7, 10, 14, 0.96), rgba(16, 20, 26, 0.96));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.72);
  padding: 16px;
}

.modal-card h3 {
  margin: 0 0 8px;
}

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

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

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  color: #c7c2ad;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  border-radius: 10px;
  border: 1px solid rgba(255, 216, 124, 0.28);
  background: rgba(10, 13, 18, 0.92);
  color: #f0efea;
  padding: 9px 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus {
  border-color: rgba(174, 255, 32, 0.72);
  box-shadow: 0 0 0 3px rgba(138, 255, 0, 0.16);
  background: rgba(10, 15, 18, 0.98);
}

button {
  border-radius: 10px;
  border: 1px solid rgba(170, 255, 0, 0.66);
  background: linear-gradient(140deg, var(--neon-1), var(--neon-2) 46%, var(--neon-3));
  color: #0e1303;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 8px 18px rgba(114, 255, 0, 0.24);
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 22px rgba(114, 255, 0, 0.3);
}

button.primary {
  border-color: rgba(255, 223, 126, 0.86);
  color: #1b1309;
  background: linear-gradient(
    138deg,
    var(--gold-1) 0%,
    var(--gold-2) 27%,
    var(--gold-3) 56%,
    #f7e6b5 100%
  );
  box-shadow: 0 10px 26px rgba(240, 165, 58, 0.28);
}

button.primary:hover {
  box-shadow: 0 12px 28px rgba(243, 179, 72, 0.34);
}

a {
  color: #d8ff6a;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  color: #fff7de;
  border: 1px solid rgba(255, 219, 130, 0.46);
  background: linear-gradient(145deg, rgba(23, 28, 20, 0.82), rgba(49, 40, 18, 0.66));
}

.list ul {
  margin: 0;
  padding-left: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.list li {
  line-height: 1.35;
  border: 1px solid rgba(255, 213, 116, 0.22);
  background: linear-gradient(145deg, rgba(9, 12, 17, 0.88), rgba(13, 18, 24, 0.9));
  border-radius: 10px;
  padding: 9px 10px;
  color: #e6e3d7;
  overflow-wrap: anywhere;
}

.hint-item {
  border: 1px solid rgba(255, 213, 112, 0.32);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(145deg, rgba(10, 12, 17, 0.9), rgba(16, 21, 24, 0.9));
  margin-bottom: 8px;
}

.hint-item header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hint-item.hint-unread {
  border-color: rgba(162, 255, 0, 0.7);
  box-shadow: inset 0 0 0 1px rgba(162, 255, 0, 0.18), 0 0 24px rgba(148, 255, 0, 0.12);
}

.empty {
  margin: 0;
  color: #b0ad9a;
}

details summary {
  font-weight: 700;
  cursor: pointer;
}

.snapshot-surface {
  min-height: 160px;
}

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

.insight-item {
  border: 1px solid rgba(255, 217, 129, 0.24);
  border-radius: 11px;
  padding: 10px;
  background: linear-gradient(155deg, rgba(10, 14, 19, 0.94), rgba(15, 20, 25, 0.94));
  display: grid;
  gap: 6px;
}

.insight-key {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d6cfb1;
}

.insight-value {
  margin: 0;
  font-size: 0.9rem;
  color: #f4f2e8;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.tone-ok {
  border-color: rgba(165, 255, 0, 0.52);
  box-shadow: inset 0 0 0 1px rgba(165, 255, 0, 0.14);
}

.tone-ok .insight-value {
  color: #e9ffbf;
}

.tone-warn {
  border-color: rgba(255, 200, 102, 0.52);
  box-shadow: inset 0 0 0 1px rgba(255, 205, 116, 0.16);
}

.tone-warn .insight-value {
  color: #ffe0b1;
}

.tone-bad {
  border-color: rgba(255, 116, 152, 0.58);
  box-shadow: inset 0 0 0 1px rgba(255, 116, 152, 0.18);
}

.tone-bad .insight-value {
  color: #ffc9d6;
}

.tone-note {
  border-color: rgba(255, 220, 140, 0.28);
}

.action-feed {
  display: grid;
  gap: 10px;
}

.action-entry {
  border-radius: 12px;
  border: 1px solid rgba(255, 220, 140, 0.28);
  background: linear-gradient(150deg, rgba(9, 12, 17, 0.95), rgba(16, 21, 27, 0.95));
  padding: 10px;
  display: grid;
  gap: 8px;
}

.action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.action-label {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #f7f4e8;
  overflow-wrap: anywhere;
}

.action-time {
  color: #b3af99;
  font-size: 0.76rem;
}

.action-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-pill {
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 118, 0.35);
  background: rgba(25, 28, 34, 0.8);
  padding: 4px 9px;
  font-size: 0.76rem;
  color: #f5f1de;
}

.action-pill.tone-ok {
  border-color: rgba(161, 255, 0, 0.58);
  color: #e6ffb7;
}

.action-pill.tone-warn {
  border-color: rgba(255, 198, 98, 0.58);
  color: #ffe2b8;
}

.action-pill.tone-bad {
  border-color: rgba(255, 118, 154, 0.62);
  color: #ffd0db;
}

.action-entry.tone-ok {
  border-color: rgba(163, 255, 0, 0.52);
}

.action-entry.tone-warn {
  border-color: rgba(255, 196, 82, 0.5);
}

.action-entry.tone-bad {
  border-color: rgba(255, 106, 147, 0.58);
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

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

@media (max-width: 760px) {
  body {
    padding-bottom: 24px;
  }

  .app-shell {
    width: 100%;
    margin: 0;
    padding: 8px;
    gap: 10px;
  }

  .app-header {
    flex-direction: column;
    border-radius: 12px;
    padding: 14px;
  }

  .status-stack {
    min-width: 0;
    width: 100%;
  }

  .lang-switch {
    margin-left: 0;
  }

  .top-nav {
    top: 6px;
    gap: 6px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .top-nav a {
    min-height: 40px;
    font-size: 0.78rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 7px 10px;
    white-space: nowrap;
  }

  input,
  select,
  button {
    min-height: 44px;
    font-size: 16px;
  }

  .two-col,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .modal-card {
    width: 100%;
    padding: 12px;
  }
}
