/* Cybox — dark terminal aesthetic */

:root {
  --bg: #05070a;
  --panel: #0b0f14;
  --panel-2: #0e141b;
  --line: #1c2430;
  --text: #c9d4e0;
  --muted: #5c6b7a;
  --accent: #39ff88;
  --accent-dim: rgba(57, 255, 136, .14);
  --cyan: #59d6ff;
  --red: #ff5c6c;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(57,255,136,.07), transparent),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(255,255,255,.008) 3px, rgba(255,255,255,.008) 4px);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- topbar */

#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(5,7,10,.85);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.brand {
  color: var(--text);
  font-weight: 800;
  letter-spacing: .35em;
  font-size: 15px;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand .x { color: var(--accent); }

.caret {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

#nav { display: flex; gap: 12px; align-items: center; }
.navlink {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 3px;
}
.navlink:hover { color: var(--accent); border-color: var(--line); }

#view { flex: 1; display: flex; flex-direction: column; }

#foot {
  padding: 14px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
}

/* ------------------------------------------------------------------ hero */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  gap: 26px;
}

.hero .eyebrow {
  color: var(--muted);
  letter-spacing: .45em;
  font-size: 12px;
  text-transform: uppercase;
}

.hero .wordmark {
  font-size: clamp(64px, 14vw, 150px);
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--text);
  text-shadow: 0 0 40px rgba(57,255,136,.25);
  margin-right: -.18em; /* balance tracking */
}

.hero .wordmark .x { color: var(--accent); }

.hero .tag {
  color: var(--muted);
  max-width: 560px;
  font-size: 14px;
}

.hero .tag b { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------- buttons */

.btn {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
  padding: 14px 34px;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(57,255,136,.45);
  border-radius: 3px;
  cursor: pointer;
  transition: all .18s ease;
}
.btn:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 24px rgba(57,255,136,.25);
}
.btn:disabled { opacity: .35; cursor: wait; }

.btn.ghost {
  color: var(--muted);
  border-color: var(--line);
}
.btn.ghost:hover { color: var(--cyan); box-shadow: none; background: rgba(89,214,255,.06); }

.btn.wide { width: 100%; }

.btn.small { padding: 8px 18px; font-size: 11px; }

/* ------------------------------------------------------------------ forms */

input[type="text"], input[type="password"] {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 13px 14px;
  width: 100%;
  outline: none;
  transition: border-color .15s ease;
}
input:focus { border-color: rgba(57,255,136,.5); }

.err { color: var(--red); font-size: 13px; min-height: 1.4em; }

/* ---------------------------------------------------------------- panels */

.page {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 50px 20px;
}

.panel {
  width: 100%;
  max-width: 760px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 40px;
}

.panel h2 {
  font-size: 14px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
  font-weight: 700;
}

.panel p { color: var(--muted); margin-bottom: 14px; font-size: 14px; }
.panel p b, .panel p strong { color: var(--text); }
.panel code {
  color: var(--cyan);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 13px;
}

.rule { border: none; border-top: 1px solid var(--line); margin: 26px 0; }

/* -------------------------------------------------------------- uid reveal */

.uidbox {
  border: 1px dashed rgba(57,255,136,.4);
  background: var(--bg);
  padding: 26px;
  text-align: center;
  border-radius: 4px;
  margin: 18px 0;
}
.uidbox .label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .35em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.uidbox .uid {
  font-size: clamp(24px, 5vw, 40px);
  color: var(--accent);
  letter-spacing: .14em;
  word-break: break-all;
  text-shadow: 0 0 22px rgba(57,255,136,.3);
}

/* ------------------------------------------------------------------ boxes */

.boxes { flex: 1; padding: 50px 28px; max-width: 980px; margin: 0 auto; width: 100%; }
.boxeshead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  gap: 14px;
}
.boxeshead h1 {
  font-size: 14px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.boxes .empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 40px;
  text-align: center;
}

.boxgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

.boxcard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
  cursor: pointer;
  transition: all .16s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.boxcard:hover {
  border-color: rgba(57,255,136,.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.boxcard .head { display: flex; justify-content: space-between; align-items: center; }
.boxcard .name { color: var(--text); font-weight: 700; letter-spacing: .06em; }
.chip {
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 2px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.chip.done { color: var(--accent); border-color: rgba(57,255,136,.5); background: var(--accent-dim); }
.boxcard .tagline { color: var(--muted); font-size: 13px; flex: 1; }

/* the "your box could be here" slot */
.boxcard.ideacard {
  border-style: dashed;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  min-height: 160px;
  gap: 8px;
}
.boxcard.ideacard .mini { font-size: 11px; letter-spacing: .06em; opacity: .8; }
.boxcard.ideacard .plus {
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
  color: var(--muted);
}
.boxcard.ideacard:hover {
  border-color: rgba(89, 214, 255, .55);
  color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
.boxcard.ideacard:hover .plus { color: var(--cyan); }

/* ------------------------------------------------- red vs blue arena gate */

@property --rvba { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

.rvbwrap { grid-column: 1 / -1; }

.rvbcard {
  padding: 2px;
  border-radius: 10px;
  cursor: pointer;
  background: conic-gradient(from var(--rvba),
              #59d6ff, rgba(11,15,20,.4) 22%, #ff5c6c 50%,
              rgba(11,15,20,.4) 72%, #59d6ff);
  animation: rvbspin 3.2s linear infinite;
  box-shadow: 0 0 22px rgba(89,214,255,.16), 0 0 22px rgba(255,92,108,.16);
  transition: transform .15s ease;
}
.rvbcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 34px rgba(89,214,255,.34), 0 0 34px rgba(255,92,108,.34);
}
@keyframes rvbspin { to { --rvba: 360deg; } }

.rvbinner {
  background: var(--panel);
  border-radius: 8px;
  padding: 30px 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.rvbtitle {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .18em;
}
.rvbtitle.big { font-size: clamp(30px, 6vw, 46px); text-align: center; margin-bottom: 18px; }
.rvbtitle .r { color: var(--red); text-shadow: 0 0 18px rgba(255,92,108,.5); }
.rvbtitle .b { color: var(--cyan); text-shadow: 0 0 18px rgba(89,214,255,.5); }
.rvbtitle .vs { color: var(--muted); font-weight: 400; font-size: .6em; }

.rvbsub { color: var(--muted); font-size: 13px; margin-top: 6px; letter-spacing: .04em; }

.rvbcta {
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 20px;
  font-size: 12px;
  letter-spacing: .2em;
  white-space: nowrap;
  background: linear-gradient(90deg, rgba(255,92,108,.08), rgba(89,214,255,.08));
}

/* gear checklist on the rvb page */
.gear {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 14px;
  background: var(--panel-2);
}
.gear.ok { border-color: rgba(57,255,136,.45); }
.gearhead { display: flex; align-items: center; gap: 12px; }
.gearnum {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted); font-size: 12px;
}
.gear.ok .gearnum { color: var(--accent); border-color: rgba(57,255,136,.5); }
.gearstate { margin-left: auto; font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); }
.gear.ok .gearstate { color: var(--accent); }
.gearbody { margin-top: 12px; }

.appfile {
  display: flex; align-items: center; gap: 10px;
  border: 1px dashed var(--line); border-radius: 4px;
  padding: 12px 14px;
}
.appfile .btn { margin-left: auto; }

.rvbgo { padding: 18px; letter-spacing: .28em; }

.sectable { width: 100%; border-collapse: collapse; margin: 14px 0; }
.sectable th, .sectable td {
  text-align: left; vertical-align: top; padding: 10px 12px;
  border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.sectable th { color: var(--text); white-space: nowrap; width: 1%; }

/* -------------------------------------------------------------- challenge */

.challenge {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: calc(100vh - 130px);
}

.termwrap {
  position: relative;
  background: #000;
  border-right: 1px solid var(--line);
  padding: 10px;
  overflow: hidden;
}
.termwrap .idlecursor {
  position: absolute;
  top: 12px; left: 14px;
  color: #2a3440;
  animation: blink 1.1s steps(1) infinite;
  font-size: 15px;
  pointer-events: none;
}

.sidebar {
  background: var(--panel);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.statline {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
}
.dot.deploying { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: blink 1s steps(1) infinite; }
.dot.ready { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.dot.error { background: var(--red); box-shadow: 0 0 10px var(--red); }

.countdown {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
}
.countdown.warn { color: var(--cyan); border-color: rgba(89, 214, 255, .5); }
.countdown.crit {
  color: var(--red); border-color: rgba(255, 92, 108, .6);
  animation: blink 1.2s steps(1) infinite;
}

.errbanner {
  color: var(--red);
  border: 1px solid rgba(255, 92, 108, .5);
  background: rgba(255, 92, 108, .07);
  border-radius: 3px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}

#termfallback {
  position: absolute;
  inset: 10px;
  overflow-y: auto;
  font-family: var(--mono);
}

.sidebar .mini { color: var(--muted); font-size: 12px; }
.sidebar label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------- overlay */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,7,10,.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 100;
  animation: fadein .25s ease;
}
.overlay .big {
  color: var(--accent);
  font-size: clamp(28px, 6vw, 54px);
  letter-spacing: .2em;
  font-weight: 800;
  text-shadow: 0 0 40px rgba(57,255,136,.5);
}
.overlay .sub { color: var(--muted); letter-spacing: .25em; text-transform: uppercase; font-size: 12px; }
@keyframes fadein { from { opacity: 0; } }

/* -------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .challenge { grid-template-columns: 1fr; grid-template-rows: 60vh auto; }
  .termwrap { border-right: none; border-bottom: 1px solid var(--line); }
}
