@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=Cinzel+Decorative:wght@700;900&display=swap");

:root {
  color-scheme: light;
  --bg: #f7f1df;
  --panel: #fffaf0;
  --panel-strong: #fff7e6;
  --ink: #23170f;
  --muted: #715f4f;
  --line: #d9c8a8;
  --accent: #b86516;
  --accent-dark: #8d4812;
  --accent-2: #1f6b68;
  --gold: #f5b21f;
  --danger: #9f2f1d;
  --success: #27734d;
  --shadow: 0 18px 50px rgba(55, 34, 16, 0.16);
  --display-font: "Cinzel", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --text-font: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(247, 241, 223, .92), rgba(247, 241, 223, .92)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath fill='%23d2b47a' fill-opacity='.22' d='M0 0h120v120H0z'/%3E%3Cpath fill='none' stroke='%238c6b3f' stroke-opacity='.22' d='M0 18h120M0 54h120M0 92h120M20 0v120M61 0v120M101 0v120'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--text-font);
  font-size: 14px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3,
.button,
.pill,
.theme-badge,
.quest-kicker {
  font-family: var(--display-font);
}

h1 {
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

h3 {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: .04em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.brand-title {
  background: linear-gradient(180deg, #fff0a0 0%, #f0b334 34%, #9c4c12 68%, #f5c94e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #ffd86a;
  display: inline-block;
  font-family: "Cinzel Decorative", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-weight: 900;
  line-height: .98;
  position: relative;
  text-transform: uppercase;
  transform: scaleX(1.04);
  transform-origin: left center;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px #1b466e;
  text-shadow:
    0 1px 0 #fff0ad,
    0 2px 0 #b36a16,
    0 3px 0 #5c2a10,
    0 0 12px rgba(70, 160, 220, .44),
    0 5px 10px rgba(0, 0, 0, .42);
}

.brand-title::after {
  background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0) 38%);
  content: attr(data-shine);
  inset: 0;
  overflow: hidden;
  position: absolute;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  pointer-events: none;
  opacity: .34;
}

.hero-wordmark {
  font-size: clamp(2.3rem, 7vw, 4.2rem);
  -webkit-text-stroke-width: 1.7px;
}

.quest-kicker {
  color: var(--accent);
  display: block;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .04em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(1120px, 100%);
  background: linear-gradient(90deg, rgba(255,250,240,.97) 0%, rgba(255,250,240,.97) 72%, rgba(57,35,21,.97) 72%, rgba(57,35,21,.97) 100%);
  border: 1px solid #6b4526;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 340px) minmax(260px, 340px);
  gap: 18px;
  overflow: hidden;
  padding: 28px;
  position: relative;
}

.login-copy {
  align-self: center;
  position: relative;
  z-index: 1;
}

.login-copy p {
  color: #6b4b32;
  font-size: 1.06rem;
  line-height: 1.5;
  margin-top: 12px;
}

.theme-ribbon,
.theme-badge {
  align-items: center;
  background: #4a2e18;
  border: 1px solid #7c512d;
  border-radius: 999px;
  color: #ffe4a3;
  display: inline-flex;
  gap: 8px;
  font-weight: 900;
  margin-top: 18px;
  padding: 8px 12px;
  text-transform: uppercase;
}

.quest-marker-card {
  align-items: center;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  width: 28%;
}

.quest-marker-card img {
  display: block;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .34)) drop-shadow(0 0 18px rgba(255, 181, 32, .2));
  height: 150px;
  width: auto;
}

.quest-marker-card span {
  color: #ffe4a3;
  font-weight: 900;
  margin-top: 4px;
  text-shadow: 0 2px 8px rgba(0,0,0,.45);
  text-transform: uppercase;
}

.login-form,
.user-form {
  background: rgba(255, 250, 240, .96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(55, 34, 16, .12);
  display: grid;
  gap: 12px;
  padding: 18px;
  position: relative;
  z-index: 1;
}

.register-form {
  margin-right: 8px;
}

.resume-panel {
  align-self: center;
  margin-right: 8px;
}

.resume-card {
  background: #fff2c9;
  border: 1px solid var(--gold);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 14px;
}

.resume-card span {
  color: var(--muted);
}

label {
  color: var(--muted);
  display: grid;
  font-weight: 700;
  gap: 6px;
}

input,
select {
  width: 100%;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 10px 11px;
}

input[type="checkbox"] {
  width: auto;
}

.domain-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.domain-input input {
  border-radius: 6px 0 0 6px;
}

.domain-input span {
  align-items: center;
  background: #eadcc0;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  color: var(--accent-dark);
  display: flex;
  font-weight: 800;
  padding: 0 10px;
  white-space: nowrap;
}

.form-note,
.error-text,
.success-text {
  font-size: 12px;
  line-height: 1.35;
}

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

.error-text {
  color: var(--danger);
}

.success-text {
  color: #216e45;
  font-weight: 800;
}

.checkbox-line {
  align-items: center;
  display: flex;
  gap: 8px;
}

.topbar {
  align-items: center;
  background: rgba(35, 23, 15, .96);
  border-bottom: 1px solid #5c3b20;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  min-height: 70px;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .brand-title {
  font-size: 1.28rem;
  -webkit-text-stroke-width: .7px;
}

.topbar p {
  color: #e6d4ad;
  margin-top: 3px;
}

.top-actions,
.button-row,
.target-actions,
.artifact-actions,
.user-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button {
  appearance: none;
  background: #d97819;
  border: 1px solid #f0a63a;
  border-radius: 6px;
  color: #fffaf0;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  min-height: 36px;
  padding: 9px 12px;
  text-decoration: none;
}

.button.secondary {
  background: #eadcc0;
  border-color: #d7bd8b;
  color: var(--ink);
}

.button:disabled {
  background: #efe4cf;
  border-color: var(--line);
  color: var(--muted);
  cursor: default;
}

.button:focus,
input:focus,
select:focus {
  outline: 2px solid #f5b21f;
  outline-offset: 2px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(340px, 1fr);
  gap: 16px;
  margin: 0 auto;
  padding: 18px;
  width: min(1280px, 100%);
}

.view-section {
  display: contents;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
  padding: 18px;
}

.panel-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.status-panel,
.topology-panel,
.jump-panel,
.admin-panel,
.permissions-panel,
.events-panel {
  grid-column: 1 / -1;
}

.muted,
.target-meta,
.artifact-meta,
.flow {
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.kpi {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.kpi span {
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.kpi strong {
  display: block;
  font-family: var(--display-font);
  font-size: 1.9rem;
  line-height: 1;
}

.service-list,
.artifact-list,
.target-list,
.user-list {
  display: grid;
  gap: 10px;
}

.service-item,
.artifact-item,
.target-item,
.user-row {
  align-items: center;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  padding: 12px;
}

.target-item.locked-target {
  background: #f6ecd7;
  border-style: dashed;
}

.user-row.pending {
  border-color: #d79a29;
  box-shadow: inset 4px 0 0 #d79a29;
}

.user-row.denied,
.user-row.suspended {
  background: #f7eee8;
  border-color: #cc8b74;
  box-shadow: inset 4px 0 0 #b94d2d;
}

.target-name,
.artifact-name {
  align-items: center;
  display: flex;
  font-weight: 900;
  gap: 8px;
}

.pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
  min-width: 76px;
  padding: 6px 9px;
  text-transform: uppercase;
}

.online,
.verified,
.good {
  background: #dceedd;
  color: var(--success);
}

.offline,
.bad {
  background: #f4d8cf;
  color: var(--danger);
}

.neutral {
  background: #dcebea;
  color: var(--accent-2);
}

.warn {
  background: #fff0c2;
  color: #8a5b0a;
}

.purpose-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.target-map {
  display: grid;
  gap: 14px;
}

.network-diagram {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, .96), rgba(255, 247, 230, .98)),
    radial-gradient(circle at 50% 0%, rgba(245, 178, 31, .18), transparent 42%);
  border: 1px solid #cfa86a;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 18px;
}

.map-row {
  align-items: center;
  display: flex;
  justify-content: center;
}

.map-backbone {
  min-width: 980px;
}

.map-center {
  min-width: 980px;
}

.map-trunk {
  background: #6d8fb6;
  height: 28px;
  justify-self: center;
  position: relative;
  width: 2px;
}

.map-link {
  background: #6d8fb6;
  height: 2px;
  min-width: 48px;
}

.map-branches {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(420px, 1fr));
  min-width: 980px;
}

.map-cluster {
  background: rgba(255, 253, 248, .82);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  position: relative;
}

.map-cluster::before {
  background: #6d8fb6;
  content: "";
  height: 22px;
  left: 50%;
  position: absolute;
  top: -22px;
  width: 2px;
}

.map-cluster h3 {
  text-align: center;
}

.map-node-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.map-node {
  appearance: none;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: default;
  display: grid;
  gap: 5px;
  justify-items: center;
  min-height: 126px;
  padding: 12px 10px;
  text-align: center;
  text-decoration: none;
}

button.map-node,
a.map-node {
  cursor: pointer;
}

button.map-node:hover,
a.map-node:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 178, 31, .18);
  transform: translateY(-1px);
}

.map-node.locked {
  background: #f6ecd7;
  border-style: dashed;
  opacity: .78;
}

.map-node.planned {
  background: #efe4cf;
}

.map-node.first-jump {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px rgba(245, 178, 31, .24);
}

.map-node.infrastructure {
  background: #eef7f6;
}

.map-node.security-node {
  background: #fff3e5;
  border-color: #e5a557;
}

.map-node.honeypot-node {
  background: #fff6d8;
  border-color: #d7a62a;
}

.map-node b {
  font-family: var(--display-font);
  line-height: 1.15;
}

.map-node small,
.map-node em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.map-node em {
  font-weight: 900;
  text-transform: uppercase;
}

.map-icon {
  align-items: center;
  background: #efe2c9;
  border: 1px solid #d2b47a;
  border-radius: 999px;
  display: inline-flex;
  height: 46px;
  justify-content: center;
  position: relative;
  width: 46px;
}

.map-icon::before {
  color: var(--accent-dark);
  font-family: var(--display-font);
  font-size: 13px;
  font-weight: 900;
}

.map-icon.internet::before { content: "NET"; }
.map-icon.vpn::before { content: "VPN"; }
.map-icon.firewall::before { content: "FW"; }
.map-icon.router::before { content: "RTR"; }
.map-icon.server::before { content: "SRV"; }
.map-icon.client::before { content: "CLI"; }
.map-icon.honeypot::before { content: "CB"; }

.zone {
  background: linear-gradient(180deg, #fff7e6, #fffaf0);
  border: 1px solid #cfa86a;
  border-radius: 8px;
  padding: 14px;
}

.docker-zone,
.core-zone {
  border-left: 5px solid var(--accent-2);
}

.vmware-zone {
  border-left: 5px solid var(--accent);
}

.future-zone {
  border-left: 5px dashed #8a5b0a;
}

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

.node {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 96px;
  padding: 12px;
  position: relative;
}

.node::after {
  background: var(--muted);
  border-radius: 50%;
  content: "";
  height: 9px;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 9px;
}

.node.online::after {
  background: var(--success);
}

.node.locked {
  opacity: .78;
}

.node.locked::after {
  background: var(--danger);
}

.node.first-jump {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px rgba(245, 178, 31, .3);
}

.node small {
  color: var(--muted);
  font-weight: 800;
}

.traffic-control {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr 48px;
}

.traffic-control input {
  accent-color: var(--accent);
  width: 100%;
}

.traffic-control output {
  font-weight: 900;
  text-align: right;
}

.traffic-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
}

.admin-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 380px) 1fr;
}

.user-row {
  cursor: pointer;
}

.user-row.selected {
  background: #fff2c9;
  border-color: var(--gold);
}

.user-row span {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.user-actions {
  justify-content: flex-end;
}

.status-pill {
  border-radius: 999px;
  display: inline-flex !important;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  margin-top: 8px !important;
  padding: 4px 8px;
  text-transform: uppercase;
}

.status-pill.approved {
  background: #dcefdc;
  color: #1f6b35;
}

.status-pill.pending {
  background: #fff2c9;
  color: #8a5600;
}

.status-pill.denied,
.status-pill.suspended {
  background: #f2d4ca;
  color: #842f1c;
}

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

.permission-item {
  align-items: start;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: auto 1fr;
  padding: 10px;
}

.permission-item small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.event-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

.event-table {
  border-collapse: collapse;
  min-width: 860px;
  width: 100%;
}

.event-table th,
.event-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.event-table th {
  background: #efe2c9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.event-message {
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-overlay {
  align-items: center;
  background: rgba(24, 16, 9, .72);
  display: grid;
  inset: 0;
  padding: 20px;
  position: fixed;
  z-index: 50;
}

.terminal-panel {
  background: #17120d;
  border: 1px solid #6b4526;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
  color: #f7f1df;
  display: grid;
  grid-template-rows: auto minmax(320px, 68vh) auto;
  margin: 0 auto;
  max-width: 1120px;
  overflow: hidden;
  width: min(100%, 1120px);
}

.terminal-header {
  align-items: center;
  background: #2a1a0d;
  border-bottom: 1px solid #5c3b20;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px 16px;
}

.terminal-header h2 {
  color: #ffe4a3;
}

.terminal-screen {
  background: #070b10;
  color: #d7f5d0;
  font-family: Consolas, "Cascadia Mono", "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.42;
  margin: 0;
  overflow: auto;
  padding: 16px;
  white-space: pre-wrap;
}

.terminal-screen:focus {
  outline: inset 2px #f5b21f;
}

.terminal-help {
  background: #20150d;
  border-top: 1px solid #5c3b20;
  color: #e6d4ad;
  font-size: 12px;
  line-height: 1.35;
  padding: 10px 16px;
}

.toast {
  background: #23170f;
  border: 1px solid #5c3b20;
  border-radius: 8px;
  bottom: 18px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.25);
  color: #ffe4a3;
  max-width: 420px;
  padding: 12px 14px;
  position: fixed;
  right: 18px;
}

code {
  background: #eadcc0;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  padding: 2px 4px;
}

@media (max-width: 1040px) {
  .login-panel {
    background: var(--panel);
    grid-template-columns: 1fr;
  }

  .quest-marker-card {
    display: none;
  }

  .register-form {
    margin-right: 0;
  }

  .topbar {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .map-backbone,
  .map-center,
  .map-branches {
    min-width: 760px;
  }

  .map-branches {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 940px) {
  .layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .kpi-grid,
  .service-item,
  .artifact-item,
  .target-item,
  .user-row {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .traffic-control,
  .domain-input {
    grid-template-columns: 1fr;
  }

  .domain-input input,
  .domain-input span {
    border: 1px solid var(--line);
    border-radius: 6px;
  }

  .terminal-overlay {
    padding: 8px;
  }

  .terminal-panel {
    grid-template-rows: auto minmax(280px, 70vh) auto;
  }

  .terminal-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
