/* =========================================================
   VERITRANS CTF — FINAL DASHBOARD TUNING
========================================================= */

/* =========================================================
   Wider left profile area
========================================================= */

.kctf-v3-grid {
  grid-template-columns:
    minmax(650px, 1.02fr)
    minmax(660px, 1.18fr) !important;

  gap: clamp(1.2rem, 1.7vw, 1.9rem) !important;
}

/* Username/image area wider */
.kctf-v3-profile-layout {
  grid-template-columns:
    minmax(310px, 1.06fr)
    minmax(270px, 0.94fr) !important;

  gap: 1.45rem !important;
}

/*
  Энэ хэсэгт одоогоор dotted username байна.
  Дараа нь image оруулахад мөн хангалттай өргөн байна.
*/
.kctf-v3-dot-user {
  width: 100% !important;
  min-width: 310px !important;
  min-height: 410px !important;

  border-radius: 16px !important;

  background:
    radial-gradient(
      circle at 50% 44%,
      rgba(22, 140, 255, 0.17),
      transparent 46%
    ),
    linear-gradient(
      180deg,
      rgba(22, 140, 255, 0.055),
      rgba(0, 0, 0, 0.5)
    ) !important;
}

#kctf-v3-user-canvas {
  width: 100% !important;
  height: 100% !important;
  min-height: 390px !important;
}

/* =========================================================
   Who am I / uname -a typography
========================================================= */

.kctf-v3-info-title {
  margin-bottom: 1.05rem !important;

  font-size: 1.42rem !important;
  line-height: 1.1 !important;
  letter-spacing: 0.02em !important;
}

.kctf-v3-info-table {
  gap: 0.78rem !important;
}

.kctf-v3-info-row {
  grid-template-columns:
    112px
    11px
    minmax(0, 1fr) !important;

  gap: 0.48rem !important;

  font-size: 0.98rem !important;
  line-height: 1.5 !important;
}

.kctf-v3-info-row strong {
  font-size: 0.98rem !important;
  line-height: 1.45 !important;
}

.kctf-v3-uname {
  margin-top: 1.35rem !important;
  padding-top: 1.15rem !important;
}

.kctf-v3-uname-title {
  margin-bottom: 0.85rem !important;

  font-size: 1.17rem !important;
  line-height: 1.1 !important;
}

/* =========================================================
   Remove Session Controls frame
========================================================= */

.kctf-v3-controls {
  padding: 0 !important;

  border: 0 !important;
  border-radius: 0 !important;

  background: transparent !important;
  box-shadow: none !important;
}

.kctf-v3-controls-title,
.kctf-v3-controls-description {
  display: none !important;
}

/*
  Admin + Logout button-уудыг navbar menu шиг болгоно.
*/
.kctf-v3-control-buttons {
  width: 100% !important;

  display: grid !important;
  grid-template-columns:
    repeat(2, minmax(0, 1fr)) !important;

  gap: 0.72rem !important;
}

/*
  Энгийн user үед Admin button устсан учраас
  ганц Logout button бүх өргөнийг эзэлнэ.
*/
.kctf-v3-control-buttons > :only-child {
  grid-column: 1 / -1 !important;
}

.kctf-v3-control-button {
  width: 100% !important;
  min-height: 54px !important;

  padding: 0.7rem 1rem !important;

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

  border-radius: 5px !important;

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

  font-size: 0.9rem !important;
  font-weight: 950 !important;
  letter-spacing: 0.04em !important;
  text-align: center !important;

  transition:
    transform 0.18s ease,
    filter 0.18s ease,
    box-shadow 0.18s ease !important;
}

/* Admin button — green хэвээр */
.kctf-v3-control-button.admin {
  color: #001307 !important;

  background:
    linear-gradient(
      135deg,
      #168cff,
      #83ffac
    ) !important;

  border: 1px solid rgba(22, 140, 255, 0.88) !important;

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

/* Logout button — red хэвээр */
.kctf-v3-control-button.logout {
  color: #ff8ca0 !important;

  background:
    linear-gradient(
      135deg,
      rgba(255, 70, 105, 0.09),
      rgba(60, 5, 15, 0.24)
    ) !important;

  border:
    1px solid rgba(255, 80, 112, 0.48) !important;

  box-shadow:
    0 0 20px rgba(255, 70, 105, 0.07) !important;
}

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

.kctf-v3-control-button.admin:hover {
  box-shadow:
    0 0 34px rgba(22, 140, 255, 0.36) !important;
}

.kctf-v3-control-button.logout:hover {
  box-shadow:
    0 0 30px rgba(255, 70, 105, 0.17) !important;
}

/* =========================================================
   Larger category text
========================================================= */

.kctf-v3-category {
  min-height: 132px !important;

  padding: 1.15rem 1.3rem !important;

  /*
    Icon/үсэг алга болсон учир зөвхөн нэг column.
  */
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows:
    auto
    1fr
    auto !important;

  row-gap: 0.45rem !important;
}

/* Category name */
.kctf-v3-category-name {
  grid-column: 1 !important;
  grid-row: 1 !important;

  margin: 0 !important;

  font-size: clamp(
    1.2rem,
    1.28vw,
    1.55rem
  ) !important;

  line-height: 1.12 !important;
  letter-spacing: 0.02em !important;

  color: #168cff !important;

  text-shadow:
    0 0 14px rgba(22, 140, 255, 0.58) !important;
}

/* Description */
.kctf-v3-category-description {
  grid-column: 1 !important;
  grid-row: 2 !important;

  max-width: none !important;

  margin: 0.45rem 0 0 !important;

  color: #a0c0aa !important;

  font-size: 0.9rem !important;
  line-height: 1.58 !important;
  letter-spacing: 0.005em !important;
}

/* ./open-challenges */
.kctf-v3-category-footer {
  grid-column: 1 !important;
  grid-row: 3 !important;

  margin-top: 0.45rem !important;

  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

.kctf-v3-category-command {
  color: #c2dfca !important;

  font-size: 0.82rem !important;
  line-height: 1.2 !important;
}

/*
  W, P, C, R, F, O, M үсгүүдийг бүрэн нуух.
*/
.kctf-v3-category-icon {
  display: none !important;
}

/* =========================================================
   Landscape cards sizing
========================================================= */

.kctf-v3-categories {
  grid-template-columns:
    repeat(2, minmax(300px, 1fr)) !important;

  grid-template-rows:
    repeat(4, minmax(132px, 1fr)) !important;

  gap: 0.9rem !important;
}

/* Last odd category full width */
.kctf-v3-categories
  > .kctf-v3-category:last-child:nth-child(odd) {
  grid-column: 1 / -1 !important;
}

/* =========================================================
   Medium screens
========================================================= */

@media (max-width: 1500px) {
  .kctf-v3-grid {
    grid-template-columns:
      minmax(570px, 0.98fr)
      minmax(610px, 1.12fr) !important;
  }

  .kctf-v3-profile-layout {
    grid-template-columns:
      minmax(280px, 1fr)
      minmax(245px, 0.92fr) !important;
  }

  .kctf-v3-dot-user {
    min-width: 280px !important;
  }

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

    font-size: 0.91rem !important;
  }

  .kctf-v3-info-row strong {
    font-size: 0.91rem !important;
  }

  .kctf-v3-category-name {
    font-size: 1.2rem !important;
  }

  .kctf-v3-category-description {
    font-size: 0.84rem !important;
  }
}

/* Stack page earlier to prevent crushing */
@media (max-width: 1200px) {
  .kctf-v3-grid {
    grid-template-columns: 1fr !important;
  }

  .kctf-v3-profile-layout {
    grid-template-columns:
      minmax(300px, 0.85fr)
      minmax(330px, 1.15fr) !important;
  }

  .kctf-v3-categories {
    grid-template-rows: auto !important;
  }
}

@media (max-width: 760px) {
  .kctf-v3-profile-layout {
    grid-template-columns: 1fr !important;
  }

  .kctf-v3-dot-user {
    min-width: 0 !important;
    min-height: 300px !important;
  }

  #kctf-v3-user-canvas {
    min-height: 280px !important;
  }

  .kctf-v3-categories {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
  }

  .kctf-v3-control-buttons {
    grid-template-columns: 1fr !important;
  }

  .kctf-v3-categories
    > .kctf-v3-category:last-child:nth-child(odd) {
    grid-column: auto !important;
  }
}
/* =========================================================
   ADMIN BUTTON VISIBILITY FIX
========================================================= */

/* Бүх хэрэглэгч дээр default-оор нуух */
#kctf-v3-admin-button {
  display: none !important;
}

/* Зөвхөн JavaScript admin гэж баталгаажуулсан үед харуулах */
body.kctf-v3-is-admin #kctf-v3-admin-button {
  display: inline-flex !important;
}