/* =========================================================
   VERITRANS CTF — OPERATOR HOME V3
   Authenticated full-screen dashboard
========================================================= */

:root {
  --k3-green: #168cff;
  --k3-green-soft: #29c7ff;
  --k3-cyan: #00eaff;
  --k3-red: #ff5577;

  --k3-bg: #000402;
  --k3-panel: rgba(0, 10, 5, 0.88);
  --k3-panel-soft: rgba(4, 19, 11, 0.88);

  --k3-text: #ebfff1;
  --k3-muted: #86a891;

  --k3-border: rgba(22, 140, 255, 0.38);
}

/* =========================
   Page base
========================= */

body.kctf-v3-home {
  min-height: 100vh !important;
  overflow-x: hidden;

  color: var(--k3-text) !important;

  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(22, 140, 255, 0.13),
      transparent 29%
    ),
    radial-gradient(
      circle at 86% 78%,
      rgba(0, 234, 255, 0.07),
      transparent 33%
    ),
    linear-gradient(
      135deg,
      #000201 0%,
      #021008 48%,
      #000503 100%
    ) !important;
}

/* Binary background */
body.kctf-v3-home::before {
  content:
    "010101 110010 001101 010010 111000 010101 100011 011010 010101 "
    "110100 001010 101010 010011 110001 001101 010101 101100 001011 "
    "010101 111000 010101 001101 101010 010101 110010 001101 010010 "
    "111000 010101 100011 011010 010101 110100 001010 101010 010011 "
    "110001 001101 010101 101100 001011 010101 111000 010101 001101 "
    "101010 010101 110010 001101 010010 111000 010101 100011 011010 "
    "010101 110100 001010 101010 010011 110001 001101 010101 101100";

  position: fixed;
  inset: -18%;

  z-index: -3;
  pointer-events: none;
  overflow: hidden;

  color: rgba(22, 140, 255, 0.045);

  font-family:
    "Share Tech Mono",
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;

  font-size: clamp(20px, 2vw, 38px);
  line-height: 1.9;
  letter-spacing: 0.17em;
  word-spacing: 0.65em;

  transform: rotate(-6deg) scale(1.2);
}

/* Grid and scan lines */
body.kctf-v3-home::after {
  content: "";
  position: fixed;
  inset: 0;

  z-index: -2;
  pointer-events: none;

  background:
    linear-gradient(
      rgba(22, 140, 255, 0.024) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(22, 140, 255, 0.024) 1px,
      transparent 1px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 4px,
      rgba(22, 140, 255, 0.022) 5px
    );

  background-size:
    44px 44px,
    44px 44px,
    auto;

  opacity: 0.75;
}

/* Hide default navbar/footer on operator homepage */
body.kctf-v3-home nav.navbar,
body.kctf-v3-home .khan-navbar,
body.kctf-v3-home .cdc-navbar,
body.kctf-v3-home footer {
  display: none !important;
}

body.kctf-v3-home main {
  width: 100% !important;
  max-width: none !important;
  min-height: 100vh !important;

  margin: 0 !important;
  padding: 0 !important;
}

/* =========================
   Full-page frame
========================= */

.kctf-v3-page {
  width: 100%;
  min-height: 100vh;

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

  padding: 12px;
}

/* Almost full screen */
.kctf-v3-frame {
  width: min(2200px, 97vw);
  min-height: calc(100vh - 24px);

  position: relative;
  padding: 1px;

  clip-path: polygon(
    28px 0,
    calc(100% - 28px) 0,
    100% 28px,
    100% calc(100% - 28px),
    calc(100% - 28px) 100%,
    28px 100%,
    0 calc(100% - 28px),
    0 28px
  );

  background:
    linear-gradient(
      135deg,
      rgba(22, 140, 255, 0.82),
      rgba(22, 140, 255, 0.13) 32%,
      rgba(0, 234, 255, 0.17) 68%,
      rgba(22, 140, 255, 0.72)
    );

  box-shadow:
    0 0 85px rgba(22, 140, 255, 0.13),
    0 0 180px rgba(22, 140, 255, 0.06),
    0 55px 150px rgba(0, 0, 0, 0.72);
}

.kctf-v3-inner {
  min-height: calc(100vh - 26px);

  position: relative;
  overflow: hidden;

  padding: clamp(2rem, 2.8vw, 4rem);

  clip-path: polygon(
    28px 0,
    calc(100% - 28px) 0,
    100% 28px,
    100% calc(100% - 28px),
    calc(100% - 28px) 100%,
    28px 100%,
    0 calc(100% - 28px),
    0 28px
  );

  background:
    radial-gradient(
      circle at 18% 10%,
      rgba(22, 140, 255, 0.11),
      transparent 30%
    ),
    radial-gradient(
      circle at 88% 88%,
      rgba(0, 234, 255, 0.055),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      rgba(0, 5, 3, 0.99),
      rgba(2, 14, 8, 0.985)
    );
}

.kctf-v3-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  background-image:
    linear-gradient(
      rgba(22, 140, 255, 0.032) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(22, 140, 255, 0.032) 1px,
      transparent 1px
    );

  background-size: 38px 38px;
  mask-image: radial-gradient(
    circle at center,
    black,
    transparent 94%
  );
}

.kctf-v3-content {
  min-height: calc(100vh - 105px);

  position: relative;
  z-index: 2;

  display: flex;
  flex-direction: column;
}

/* =========================
   Header
========================= */

.kctf-v3-header {
  flex: 0 0 auto;

  margin-bottom: clamp(1.5rem, 2.5vw, 2.7rem);
  text-align: center;
}

.kctf-v3-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;

  margin-bottom: 0.9rem;
  padding: 0.42rem 0.82rem;

  color: var(--k3-green);
  background: rgba(22, 140, 255, 0.05);
  border: 1px solid rgba(22, 140, 255, 0.27);
  border-radius: 999px;

  font-family:
    "Share Tech Mono",
    ui-monospace,
    monospace;

  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kctf-v3-status-dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;
  background: var(--k3-green);

  box-shadow:
    0 0 0 5px rgba(22, 140, 255, 0.07),
    0 0 18px rgba(22, 140, 255, 0.95);

  animation: kctfV3Pulse 1.6s ease-in-out infinite;
}

/* White smaller Welcome to */
.kctf-v3-welcome {
  margin: 0 0 0.3rem;

  color: #ffffff !important;

  font-size: clamp(1.35rem, 2.1vw, 2.65rem);
  line-height: 1;
  font-weight: 850;
  letter-spacing: -0.035em;
}

/* Main title never wraps */
.kctf-v3-title {
  width: 100%;
  margin: 0;

  color: transparent !important;

  background:
    linear-gradient(
      100deg,
      var(--k3-green) 0%,
      #00ffc8 47%,
      var(--k3-cyan) 76%,
      var(--k3-green-soft) 100%
    );

  -webkit-background-clip: text;
  background-clip: text;

  font-size: clamp(1.7rem, 4.25vw, 5.6rem);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.058em;

  text-align: center;
  white-space: nowrap;
}

.kctf-v3-subtitle {
  max-width: 900px;

  margin: 0.85rem auto 0;

  color: var(--k3-muted) !important;

  font-family:
    "Share Tech Mono",
    ui-monospace,
    monospace;

  font-size: clamp(0.76rem, 0.85vw, 0.95rem);
  line-height: 1.65;
}

/* =========================
   Main content grid
========================= */

.kctf-v3-grid {
  flex: 1 1 auto;

  display: grid;
  grid-template-columns:
    minmax(390px, 0.72fr)
    minmax(680px, 1.58fr);

  gap: clamp(1.1rem, 1.8vw, 2rem);
  align-items: stretch;
}

.kctf-v3-panel {
  border: 1px solid var(--k3-border);
  border-radius: 18px;

  background:
    linear-gradient(
      135deg,
      rgba(22, 140, 255, 0.032),
      rgba(0, 0, 0, 0.24)
    ),
    var(--k3-panel);

  box-shadow:
    0 0 34px rgba(22, 140, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.024);
}

.kctf-v3-panel-label {
  width: fit-content;
  min-height: 32px;

  display: inline-flex;
  align-items: center;

  margin: -1px 0 0 1.1rem;
  padding: 0 0.9rem;

  color: var(--k3-cyan);
  background: rgba(0, 9, 5, 0.98);

  border:
    1px solid rgba(22, 140, 255, 0.4);
  border-top: 0;
  border-radius: 0 0 10px 10px;

  font-family:
    "Share Tech Mono",
    ui-monospace,
    monospace;

  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* =========================
   Left side
========================= */

.kctf-v3-left {
  height: 100%;

  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.kctf-v3-profile {
  flex: 1 1 auto;

  display: flex;
  flex-direction: column;

  padding: 1rem;
}

.kctf-v3-profile-layout {
  flex: 1 1 auto;

  display: grid;
  grid-template-columns:
    minmax(175px, 0.74fr)
    minmax(220px, 1.26fr);

  gap: 1.2rem;

  padding-top: 0.55rem;
}

/* Username dot canvas */
.kctf-v3-dot-user {
  min-height: 350px;

  position: relative;
  overflow: hidden;

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

  border: 1px solid rgba(22, 140, 255, 0.22);
  border-radius: 14px;

  background:
    radial-gradient(
      circle at center,
      rgba(22, 140, 255, 0.14),
      transparent 45%
    ),
    linear-gradient(
      180deg,
      rgba(22, 140, 255, 0.045),
      rgba(0, 0, 0, 0.4)
    );
}

.kctf-v3-dot-user::before {
  content: "";
  position: absolute;
  inset: 0;

  background-image:
    radial-gradient(
      circle,
      rgba(22, 140, 255, 0.1) 1px,
      transparent 1.5px
    );

  background-size: 14px 14px;
  opacity: 0.35;
}

#kctf-v3-user-canvas {
  width: 100%;
  height: 100%;
  min-height: 330px;

  position: relative;
  z-index: 2;
}

.kctf-v3-info-title {
  margin: 0 0 0.9rem;

  color: var(--k3-green) !important;

  font-size: 1.18rem;
  font-weight: 950;
  text-transform: uppercase;
}

.kctf-v3-info-table {
  display: grid;
  gap: 0.67rem;

  font-family:
    "Share Tech Mono",
    ui-monospace,
    monospace;
}

.kctf-v3-info-row {
  display: grid;
  grid-template-columns:
    104px
    10px
    minmax(0, 1fr);

  gap: 0.42rem;

  color: #8dab96;

  font-size: 0.87rem;
  line-height: 1.42;
}

.kctf-v3-info-row strong {
  color: var(--k3-green);

  font-weight: 850;
  overflow-wrap: anywhere;
}

.kctf-v3-uname {
  margin-top: 1.2rem;
  padding-top: 1rem;

  border-top: 1px solid rgba(22, 140, 255, 0.13);
}

.kctf-v3-uname-title {
  margin-bottom: 0.72rem;

  color: var(--k3-green);

  font-size: 1rem;
  font-weight: 950;
}

/* Session controls */
.kctf-v3-controls {
  flex: 0 0 auto;

  padding: 1.15rem;
}

.kctf-v3-controls-title {
  margin-bottom: 0.75rem;

  color: #ffffff;

  font-size: 1.02rem;
  font-weight: 900;
}

.kctf-v3-controls-description {
  margin: 0 0 1rem;

  color: var(--k3-muted) !important;

  font-size: 0.84rem;
  line-height: 1.55;
}

.kctf-v3-control-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.72rem;
}

.kctf-v3-control-button {
  min-height: 44px;
  padding: 0 1.15rem;

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

  border-radius: 10px;

  font-family:
    "Share Tech Mono",
    ui-monospace,
    monospace;

  font-size: 0.84rem;
  font-weight: 950;

  transition: 0.18s ease;
}

.kctf-v3-control-button.admin {
  display: none;

  color: #001307 !important;

  background:
    linear-gradient(
      135deg,
      var(--k3-green),
      var(--k3-green-soft)
    );

  box-shadow:
    0 0 26px rgba(22, 140, 255, 0.24);
}

.kctf-v3-control-button.logout {
  color: #ff8297 !important;

  background: rgba(255, 85, 119, 0.055);
  border: 1px solid rgba(255, 85, 119, 0.38);
}

.kctf-v3-control-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

/* =========================
   Right side
========================= */

.kctf-v3-right {
  height: 100%;

  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Navigation */
.kctf-v3-menu {
  flex: 0 0 auto;

  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.72rem;
}

.kctf-v3-menu-item {
  min-height: 54px;
  padding: 0.65rem;

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

  color: var(--k3-green) !important;

  background:
    linear-gradient(
      135deg,
      rgba(22, 140, 255, 0.07),
      rgba(0, 0, 0, 0.25)
    );

  border: 1px solid rgba(22, 140, 255, 0.42);
  border-radius: 5px;

  font-family:
    "Share Tech Mono",
    ui-monospace,
    monospace;

  font-size: clamp(0.72rem, 0.8vw, 0.9rem);
  font-weight: 900;
  text-align: center;

  transition: 0.18s ease;
}

.kctf-v3-menu-item:hover {
  color: #001307 !important;

  background:
    linear-gradient(
      135deg,
      var(--k3-green),
      var(--k3-green-soft)
    );

  transform: translateY(-2px);

  box-shadow:
    0 0 25px rgba(22, 140, 255, 0.27),
    0 12px 30px rgba(0, 0, 0, 0.32);
}

/* Categories container fills remaining height */
.kctf-v3-category-panel {
  flex: 1 1 auto;

  display: flex;
  flex-direction: column;

  min-height: 0;
  padding: 1.25rem;
}

.kctf-v3-category-header {
  flex: 0 0 auto;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;

  margin-bottom: 1.1rem;
}

.kctf-v3-category-header h2 {
  margin: 0;

  color: var(--k3-green) !important;

  font-size: 1.22rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kctf-v3-category-header span {
  color: #678975;

  font-family:
    "Share Tech Mono",
    ui-monospace,
    monospace;

  font-size: 0.76rem;
}

/*
   Eight category cards:
   4 columns x 2 rows on wide screens
*/
.kctf-v3-categories {
  flex: 1 1 auto;

  display: grid;
  grid-template-columns: repeat(4, minmax(155px, 1fr));
  grid-template-rows: repeat(2, minmax(175px, 1fr));

  gap: 1rem;
}

/* Category card */
.kctf-v3-category {
  --accent: #168cff;

  min-height: 175px;

  position: relative;
  overflow: hidden;

  padding: 1.35rem;

  display: flex;
  flex-direction: column;

  color: var(--k3-text) !important;

  background:
    radial-gradient(
      circle at 100% 100%,
      rgba(22, 140, 255, 0.08),
      transparent 45%
    ),
    linear-gradient(
      145deg,
      rgba(12, 29, 20, 0.94),
      rgba(0, 8, 4, 0.96)
    );

  border: 1px solid var(--accent);
  border-radius: 6px;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    0 0 22px rgba(22, 140, 255, 0.04);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.kctf-v3-category::before {
  content: "";
  position: absolute;

  left: 0;
  top: 0;

  width: 100%;
  height: 2px;

  background:
    linear-gradient(
      90deg,
      transparent,
      var(--accent),
      transparent
    );

  opacity: 0.85;
}

.kctf-v3-category::after {
  content: "";

  position: absolute;
  right: -42px;
  bottom: -42px;

  width: 115px;
  height: 115px;

  border-radius: 50%;

  background: var(--accent);
  filter: blur(62px);
  opacity: 0.12;
}

.kctf-v3-category:hover {
  color: #ffffff !important;

  transform: translateY(-5px);
  filter: brightness(1.1);

  box-shadow:
    0 0 30px rgba(22, 140, 255, 0.13),
    0 20px 42px rgba(0, 0, 0, 0.36);
}

.kctf-v3-category-name {
  position: relative;
  z-index: 2;

  margin-bottom: auto;

  color: var(--accent);

  font-size: clamp(1rem, 1.15vw, 1.38rem);
  font-weight: 950;
  letter-spacing: 0.025em;
  text-transform: uppercase;

  text-shadow: 0 0 15px var(--accent);
}

.kctf-v3-category-description {
  position: relative;
  z-index: 2;

  max-width: 250px;
  margin-top: 1rem;

  color: #8da897 !important;

  font-size: 0.79rem;
  line-height: 1.55;
}

.kctf-v3-category-footer {
  position: relative;
  z-index: 2;

  margin-top: 1rem;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.kctf-v3-category-command {
  color: #c9e8d2;

  font-family:
    "Share Tech Mono",
    ui-monospace,
    monospace;

  font-size: 0.74rem;
}

.kctf-v3-category-icon {
  width: 36px;
  height: 36px;

  flex: 0 0 36px;

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

  color: #001307;
  background: var(--accent);

  border-radius: 50%;

  font-size: 0.82rem;
  font-weight: 950;

  box-shadow:
    0 0 12px var(--accent),
    0 0 30px var(--accent);
}

.kctf-v3-build {
  flex: 0 0 auto;

  color: rgba(22, 140, 255, 0.5);

  font-family:
    "Share Tech Mono",
    ui-monospace,
    monospace;

  font-size: 0.7rem;
  text-align: right;
}

/* =========================
   Responsive
========================= */

@media (max-width: 1450px) {
  .kctf-v3-grid {
    grid-template-columns:
      minmax(355px, 0.78fr)
      minmax(580px, 1.42fr);
  }

  .kctf-v3-categories {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    grid-template-rows: repeat(3, minmax(155px, 1fr));
  }
}

@media (max-width: 1080px) {
  .kctf-v3-grid {
    grid-template-columns: 1fr;
  }

  .kctf-v3-frame,
  .kctf-v3-inner,
  .kctf-v3-content {
    min-height: auto;
  }

  .kctf-v3-profile-layout {
    grid-template-columns:
      minmax(220px, 0.65fr)
      minmax(300px, 1.35fr);
  }

  .kctf-v3-categories {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
    grid-template-rows: auto;
  }
}

@media (max-width: 720px) {
  .kctf-v3-page {
    padding: 10px;
  }

  .kctf-v3-frame {
    width: 100%;

    clip-path: none;
    border-radius: 22px;
  }

  .kctf-v3-inner {
    padding: 1.25rem;

    clip-path: none;
    border-radius: 21px;
  }

  .kctf-v3-welcome {
    font-size: 1.15rem;
  }

  .kctf-v3-title {
    font-size: clamp(0.92rem, 4.5vw, 1.55rem);
    letter-spacing: -0.035em;
  }

  .kctf-v3-profile-layout {
    grid-template-columns: 1fr;
  }

  .kctf-v3-dot-user {
    min-height: 230px;
  }

  #kctf-v3-user-canvas {
    min-height: 220px;
  }

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

  .kctf-v3-categories {
    grid-template-columns: 1fr;
  }

  .kctf-v3-info-row {
    grid-template-columns:
      88px
      8px
      minmax(0, 1fr);
  }
}

/* =========================
   Animations
========================= */

@keyframes kctfV3Pulse {
  0%,
  100% {
    transform: scale(0.82);
    opacity: 0.6;
  }

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