:root {
  --ink: #070d0b;
  --panel: #101a16;
  --panel-2: #15221c;
  --line: rgba(210, 232, 216, 0.12);
  --text: #e8f2eb;
  --muted: #9bb5a4;
  --green: #0f7c05;
  --green-2: #1aa30c;
  --red: #750505;
  --red-2: #a10d0d;
  --cream: #d8e6db;
  --glow: rgba(15, 124, 5, 0.35);
  --radius: 18px;
  --font-display: "Syne", sans-serif;
  --font-body: "Manrope", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(15, 124, 5, 0.22), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(117, 5, 5, 0.18), transparent 50%),
    linear-gradient(180deg, #0a1210 0%, #070d0b 48%, #0b1511 100%);
  overflow-x: hidden;
}

.noise,
.candles {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
}

.noise {
  opacity: 0.05;
  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='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.candles {
  opacity: 0.12;
  background-image:
    linear-gradient(90deg, transparent 0 8%, rgba(26, 163, 12, 0.55) 8% 10%, transparent 10% 22%, rgba(117, 5, 5, 0.5) 22% 24%, transparent 24% 38%, rgba(26, 163, 12, 0.45) 38% 40%, transparent 40% 58%, rgba(117, 5, 5, 0.4) 58% 60%, transparent 60% 78%, rgba(26, 163, 12, 0.35) 78% 80%, transparent 80%),
    linear-gradient(180deg, transparent 0 30%, rgba(26, 163, 12, 0.25) 30% 58%, transparent 58%),
    linear-gradient(180deg, transparent 0 42%, rgba(117, 5, 5, 0.22) 42% 70%, transparent 70%);
  background-size: 220px 100%, 220px 180px, 220px 180px;
  background-position: 0 0, 18px 120px, 128px 220px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 78%);
}

.top,
main,
.foot {
  position: relative;
  z-index: 1;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 4vw, 3rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.7rem;
  background:
    linear-gradient(145deg, var(--green-2), var(--green) 55%, #0a4f04);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 30px var(--glow);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 28% 22% 30% 22%;
  border-top: 2px solid #f3fff5;
  border-right: 2px solid #f3fff5;
  transform: rotate(45deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand-text em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-nav a {
  color: var(--cream);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-cta {
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: rgba(15, 124, 5, 0.18);
  border: 1px solid rgba(15, 124, 5, 0.45);
}

.hero {
  min-height: calc(100vh - 5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem clamp(1.2rem, 4vw, 3rem) 4rem;
  animation: rise 0.9s ease both;
}

.hero-kicker {
  margin: 0 0 1rem;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 10vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.hero-brand span {
  color: var(--green-2);
  text-shadow: 0 0 40px var(--glow);
}

.hero-copy {
  max-width: 34rem;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.9rem 1.25rem;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #f5fff6;
  background: linear-gradient(135deg, var(--green-2), var(--green));
  box-shadow: 0 12px 30px var(--glow);
}

.btn-ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
}

.btn-danger {
  color: #fff5f5;
  background: linear-gradient(135deg, var(--red-2), var(--red));
}

.strategy,
.desk {
  padding: 4rem clamp(1.2rem, 4vw, 3rem);
}

.section-head {
  max-width: 40rem;
  margin-bottom: 1.8rem;
  animation: rise 0.8s ease both;
  animation-delay: 0.08s;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.rules article {
  padding: 1.35rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21, 34, 28, 0.85), rgba(16, 26, 22, 0.7));
  animation: rise 0.85s ease both;
}

.rules article:nth-child(2) { animation-delay: 0.08s; }
.rules article:nth-child(3) { animation-delay: 0.16s; }

.rules h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.rules p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.96rem;
}

.profile-panel {
  margin-bottom: 1rem;
}

.profile-grid {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.profile-grid div {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: rgba(7, 13, 11, 0.55);
  border: 1px solid var(--line);
}

.profile-grid dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-grid dd {
  margin: 0.3rem 0 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.platform-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.platform-card {
  appearance: none;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.95rem;
  align-items: center;
  padding: 1.15rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(21, 34, 28, 0.95), rgba(10, 18, 15, 0.88));
  color: inherit;
  font: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.platform-card:hover,
.platform-card[aria-pressed="true"] {
  transform: translateY(-2px);
  border-color: rgba(15, 124, 5, 0.55);
  box-shadow: 0 14px 34px rgba(15, 124, 5, 0.18);
}

.platform-card[data-platform="delta"]:hover,
.platform-card[data-platform="delta"][aria-pressed="true"] {
  border-color: rgba(64, 140, 255, 0.55);
  box-shadow: 0 14px 34px rgba(64, 140, 255, 0.16);
}

.platform-badge {
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
}

.platform-badge.angel {
  background: linear-gradient(145deg, #1aa30c, #0f7c05);
  color: #f4fff5;
}

.platform-badge.delta {
  background: linear-gradient(145deg, #4d97ff, #1f5fd6);
  color: #f4f8ff;
}

.platform-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.platform-body strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.platform-body em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.9rem;
}

.platform-meta {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b8f0b2;
}

.platform-card[data-platform="delta"] .platform-meta {
  color: #b7d0ff;
}

.platform-go {
  font-weight: 700;
  color: var(--cream);
  white-space: nowrap;
}

.workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.workspace-bar p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.is-hidden {
  display: none !important;
}

.desk-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 1rem;
}

input[readonly] {
  opacity: 0.9;
  color: #d5f5d2;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(21, 34, 28, 0.92), rgba(10, 18, 15, 0.88));
  padding: 1.2rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.panel-title h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.mode-pill {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 124, 5, 0.18);
  color: #b8f0b2;
  border: 1px solid rgba(15, 124, 5, 0.35);
}

.mode-pill.live {
  background: rgba(117, 5, 5, 0.22);
  color: #ffc9c9;
  border-color: rgba(117, 5, 5, 0.45);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.field-row.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 13, 11, 0.75);
  color: var(--text);
  padding: 0.75rem 0.85rem;
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}

input:focus {
  border-color: rgba(15, 124, 5, 0.7);
  box-shadow: 0 0 0 3px rgba(15, 124, 5, 0.18);
}

.toggle-row,
.actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.toggle-row {
  justify-content: space-between;
  margin: 0.4rem 0 1.1rem;
}

.switch {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-size: 0.92rem;
}

.switch input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--green);
}

.linkish {
  background: none;
  border: 0;
  color: var(--cream);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

.stats {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.stats div {
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  background: rgba(7, 13, 11, 0.55);
  border: 1px solid var(--line);
}

.stats dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats dd {
  margin: 0.25rem 0 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #667a6d;
  box-shadow: 0 0 0 4px rgba(102, 122, 109, 0.18);
}

.dot[data-state="running"] {
  background: var(--green-2);
  box-shadow: 0 0 0 4px rgba(26, 163, 12, 0.2);
  animation: pulse 1.4s ease infinite;
}

.dot[data-state="stopped"] {
  background: var(--red-2);
  box-shadow: 0 0 0 4px rgba(161, 13, 13, 0.2);
}

.log-panel {
  margin-top: 1rem;
}

#log {
  margin: 0;
  min-height: 220px;
  max-height: 340px;
  overflow: auto;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(4, 8, 7, 0.8);
  border: 1px solid var(--line);
  color: #b7d0c0;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.foot {
  padding: 2rem clamp(1.2rem, 4vw, 3rem) 3rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.foot p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.foot strong {
  color: var(--text);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@media (max-width: 920px) {
  .rules,
  .desk-grid,
  .field-row.four,
  .platform-cards,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 3.5rem;
    padding-bottom: 3rem;
  }
}

@media (max-width: 640px) {
  .top-nav a:not(.nav-cta) {
    display: none;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }
}
