/* cysec-theme: scoreboards, team, user profile, settings and notifications
   (19d). Loaded after cysec.css on those pages only.
   Decisions 5 and 10 of the handoff: Top 3 podium (first place in the
   gradient), table below, the viewer's row highlighted, count-ups. Team page
   with a stats row, members with share-of-team-points bars, captain-only
   invite, recent solves. No cards, pills, badges, status dots, side strips or
   eyebrows. Hairlines and grids hold the data. */

/* ---------- page ---------- */
.cy-pg {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--gutter) 96px;
}
.cy-pg.cy-narrow-read {
  max-width: 800px;
}
.cy-pg.cy-narrow {
  max-width: 640px;
}
.cy-pg-head h1 {
  margin: 40px 0 6px;
  font-size: 44px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}
.cy-pg-sub {
  margin: 0 0 28px;
  color: var(--mid);
  font-size: 16px;
  line-height: 1.5;
}
.cy-pg-sub a {
  color: var(--fg);
}
.cy-pg h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.cy-sect {
  margin-top: 40px;
}
.cy-break {
  overflow-wrap: anywhere;
}
.cy-empty {
  margin: 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--mid);
}
.cy-pg a {
  text-underline-offset: 3px;
}

/* CTFd's info and error lines: plain lines on hairlines, not boxes. */
.cy-pg .alert {
  margin: 0 0 24px;
  padding: 12px 40px 12px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  color: var(--mid);
  font-weight: 600;
  text-align: left !important;
}
.cy-pg .alert a {
  color: var(--fg);
}
.cy-pg .alert-danger {
  color: var(--bad);
}
.cy-pg .alert-success {
  color: var(--acc);
}
.cy-pg .alert .btn-close {
  padding: 14px 0;
  filter: invert(1) grayscale(1);
}

/* ---------- tabs (scoreboards, settings) ---------- */
.cy-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
  margin: 0 0 28px;
  border-bottom: 1px solid var(--line);
}
.cy-tabs a,
.cy-tabs button {
  position: relative;
  padding: 0 0 12px;
  border: 0;
  background: none;
  color: var(--mid);
  font: 700 16px var(--font);
  text-decoration: none;
  cursor: pointer;
}
.cy-tabs a:hover,
.cy-tabs button:hover {
  color: var(--fg);
}
.cy-tabs a.on,
.cy-tabs button.active {
  color: var(--fg);
}
.cy-tabs a.on::after,
.cy-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--grad);
}

.cy-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: -12px 0 24px;
  font-size: 14px;
}
.cy-filters a {
  color: var(--mid);
  font-weight: 600;
  text-decoration: none;
}
.cy-filters a:hover {
  color: var(--fg);
}
.cy-filters a.on {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--acc);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ---------- scoreboard ---------- */
.cy-sb-me {
  margin: 0 0 24px;
  color: var(--mid);
}
.cy-sb-me b {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.cy-you {
  margin-left: 6px;
  color: var(--acc);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.cy-pod {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: stretch;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line2);
}
.cy-pod.n2 {
  grid-template-columns: 1fr 1.15fr;
}
.cy-pod.n1 {
  grid-template-columns: minmax(0, 1fr);
}
/* Every place is as tall as the row (so the hairlines between them are),
   with its content at the bottom: first place stands higher. */
.cy-pod li {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  padding: 16px 18px 18px;
  text-align: center;
}
.cy-pod .p1 {
  order: 2;
  padding-bottom: 30px;
}
.cy-pod .p2 {
  order: 1;
}
.cy-pod .p3 {
  order: 3;
}
.cy-pod.n2 .p1,
.cy-pod.n3 .p1,
.cy-pod .p3 {
  border-left: 1px solid var(--line);
}
.cy-pod li.me {
  background: rgba(110, 155, 255, .08);
}
.cy-pod-place {
  display: block;
  color: var(--dim);
  font-weight: 700;
}
.cy-pod-name {
  display: block;
  margin: 6px 0 2px;
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.cy-pod-name a,
.cy-sb-table td.n a,
.cy-members td.n a {
  color: inherit;
  text-decoration: none;
}
.cy-pod-name a:hover,
.cy-sb-table td.n a:hover,
.cy-members td.n a:hover {
  text-decoration: underline;
}
.cy-pod-sub {
  display: block;
  color: var(--dim);
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.cy-pod .cy-you {
  margin: 0;
}
.cy-pod-pts {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.cy-pod-pts small {
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}
.cy-pod .p1 .cy-pod-pts {
  font-size: 40px;
}
.cy-pod .p1 .cy-pod-pts [data-count] {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Wide tables scroll inside their own box, never the page. */
.cy-tablewrap {
  max-width: 100%;
  overflow-x: auto;
}

.cy-sb-table,
.cy-members,
.cy-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.cy-sb-table th,
.cy-members th,
.cy-list th {
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--line2);
  color: var(--mid);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.cy-sb-table td,
.cy-members td,
.cy-list td {
  padding: 13px 12px 13px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.cy-sb-table .r {
  width: 64px;
  padding-left: 10px;
  color: var(--dim);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cy-sb-table td.n,
.cy-members td.n {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.cy-sb-table td.n small,
.cy-members td.n small {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 500;
}
.cy-sb-table .s,
.cy-members .s,
.cy-list .s {
  width: 110px;
  padding-right: 0;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cy-sb-table tr.me td,
.cy-members tr.me td {
  background: rgba(110, 155, 255, .08);
}
.cy-members th:first-child,
.cy-members td:first-child {
  padding-left: 10px;
}
.cy-members th:last-child,
.cy-members td:last-child {
  padding-right: 10px;
}

/* ---------- stats row (team and profile) ---------- */
.cy-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 36px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cy-stats.n3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cy-stats > div {
  min-width: 0;
  padding: 18px 20px;
  border-left: 1px solid var(--line);
}
.cy-stats > div:first-child {
  padding-left: 0;
  border-left: 0;
}
.cy-stats b {
  display: block;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.cy-stats b small {
  color: var(--dim);
  font-size: 18px;
  font-weight: 700;
}
.cy-stats > div > span {
  color: var(--mid);
  font-size: 14px;
}
.cy-stats + .cy-pg-note {
  margin: -24px 0 36px;
  color: var(--warn);
  font-size: 14px;
}

/* ---------- team members ---------- */
.cy-cap {
  margin-left: 6px;
  color: var(--acc);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.cy-members .cls {
  color: var(--mid);
}
.cy-share {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}
.cy-share .bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--track);
  overflow: hidden;
}
.cy-share .bar i {
  display: block;
  height: 100%;
  background: var(--grad);
  transform: scaleX(var(--share, 0));
  transform-origin: left;
  transition: transform 1s var(--ease);
}
.cy-share > span {
  width: 40px;
  color: var(--dim);
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- captain: invite and team actions ---------- */
.cy-invite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.cy-invite > div:first-child {
  flex: 1 1 320px;
}
.cy-invite h2 {
  margin-bottom: 4px;
}
.cy-invite p {
  max-width: 52ch;
  margin: 0;
  color: var(--mid);
}
.cy-invite-out {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
}
.cy-invite-out[hidden] {
  display: none;
}
.cy-invite-link {
  min-width: 0;
  flex: 1 1 260px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  overflow-wrap: anywhere;
  word-break: break-all;
}
.cy-invite-msg {
  flex: 1 1 100%;
  min-height: 1.5em;
  margin: 0;
  color: var(--mid);
  font-size: 14px;
}
.cy-invite-msg:empty {
  display: none;
}
.cy-invite-msg.bad {
  color: var(--bad);
}
.cy-invite-msg.ok {
  color: var(--acc);
}

.cy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 20px;
}
.cy-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--mid);
  font: 600 15px var(--font);
  text-decoration: underline;
  text-decoration-color: var(--line2);
  text-underline-offset: 4px;
  cursor: pointer;
}
.cy-link:hover {
  color: var(--fg);
  text-decoration-color: var(--fg);
}
.cy-link.bad:hover {
  color: var(--bad);
  text-decoration-color: var(--bad);
}
.cy-btn.q {
  padding: 10px 14px;
  background: var(--track);
  color: var(--fg);
  font-size: 14px;
}
.cy-btn.q:hover {
  background: var(--line);
}
.cy-btn[disabled] {
  opacity: .6;
  cursor: default;
}

/* ---------- recent solves ---------- */
.cy-recent {
  margin: 0;
  padding: 0;
  list-style: none;
}
.cy-recent li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--mid);
}
.cy-recent li > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.cy-recent b {
  color: var(--fg);
}
.cy-recent time,
.cy-recent .cy-when {
  flex: none;
  color: var(--dim);
  font-size: 14px;
  white-space: nowrap;
}

.cy-list td.n {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.cy-list .cat {
  color: var(--mid);
}
.cy-list .when {
  width: 130px;
  padding-left: 12px;
  padding-right: 0;
  color: var(--dim);
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}
.cy-list .s {
  width: 90px;
}

/* ---------- facts list (profile details, awards) ---------- */
.cy-facts-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  margin: 0 0 36px;
}
.cy-facts-list dt,
.cy-facts-list dd {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.cy-facts-list dt {
  padding-right: 28px;
  color: var(--mid);
  font-weight: 600;
}
.cy-facts-list dd {
  color: var(--fg);
  overflow-wrap: anywhere;
}

/* ---------- forms (settings, team edit, join, create) ---------- */
.cy-pg form .mb-3,
.cy-modal form .mb-3,
.cy-pg form .mb-2,
.cy-modal form .mb-2 {
  margin-bottom: 18px !important;
}
.cy-pg .form-label,
.cy-modal .form-label,
.cy-pg form b > label,
.cy-modal form b > label {
  display: block;
  margin: 0 0 6px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
}
.cy-pg .form-control,
.cy-pg .form-select,
.cy-modal .form-control,
.cy-modal .form-select {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background-color: var(--track);
  color: var(--fg);
  font: 500 16px var(--font);
  line-height: 1.4;
  box-shadow: none;
}
.cy-pg .form-select,
.cy-modal .form-select {
  padding-right: 36px;
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23b3bad8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
.cy-pg .form-control:focus,
.cy-pg .form-select:focus,
.cy-modal .form-control:focus,
.cy-modal .form-select:focus {
  outline: 2px solid var(--acc);
  outline-offset: 1px;
  border-color: transparent;
  box-shadow: none;
}
.cy-pg .form-control[readonly],
.cy-modal .form-control[readonly] {
  font-family: var(--mono);
  font-size: 14px;
}
.cy-pg .form-text,
.cy-modal .form-text,
.cy-pg .text-muted,
.cy-modal .text-muted {
  display: block;
  margin-top: 6px;
  color: var(--dim) !important;
  font-size: 13px;
}
.cy-pg .text-danger,
.cy-modal .text-danger {
  color: var(--bad) !important;
}
.cy-pg form hr,
.cy-modal form hr {
  margin: 28px 0;
  border: 0;
  border-top: 1px solid var(--line);
  opacity: 1;
}
.cy-pg .border,
.cy-modal .border {
  border-color: var(--line) !important;
  border-radius: 0;
}
.cy-form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 24px;
}
.cy-form-foot p {
  flex: 1 1 260px;
  margin: 0;
  color: var(--mid);
  font-size: 14px;
}

/* ---------- settings ---------- */
.cy-settings .tab-pane {
  max-width: 640px;
}
.cy-settings .tab-content > .tab-pane:not(.active) {
  display: none;
}
.cy-pg .cy-tokens td {
  font-size: 14px;
}
.cy-pg .cy-tokens .cy-link {
  font-size: 14px;
}

/* ---------- notifications ---------- */
.cy-notes {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.cy-notes > li {
  padding: 20px 0 22px;
  border-bottom: 1px solid var(--line);
}
.cy-notes h2 {
  margin: 0 0 6px;
  font-size: 20px;
  overflow-wrap: anywhere;
}
.cy-note-body {
  color: var(--mid);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.cy-note-body > :last-child {
  margin-bottom: 0;
}
.cy-notes time {
  display: block;
  margin-top: 8px;
  color: var(--dim);
  font-size: 13px;
}

/* ---------- team modals (edit, captain, disband) ---------- */
.cy-modal .modal-content {
  border: 1px solid var(--line2);
}
.cy-modal .modal-header {
  padding: 18px 22px;
}
.cy-modal .modal-header h2,
.cy-modal .modal-header .modal-title {
  margin: 0;
  color: var(--fg);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-align: left !important;
}
.cy-modal .modal-body {
  padding: 22px;
}
.cy-modal .modal-footer {
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 22px;
}
.cy-modal .btn-close {
  filter: invert(1) grayscale(1);
}
.cy-modal .alert {
  margin: 0 0 16px;
  padding: 10px 36px 10px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  color: var(--bad);
  font-weight: 600;
}
.cy-modal .alert-success {
  color: var(--acc);
}
.cy-modal .alert .btn-close {
  padding: 12px 0;
}

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .cy-pg-head h1 {
    margin-top: 28px;
    font-size: 34px;
  }
  .cy-tabs {
    gap: 0 22px;
  }

  /* Podium: one row per place, first place first. */
  .cy-pod,
  .cy-pod.n2,
  .cy-pod.n1 {
    grid-template-columns: minmax(0, 1fr);
  }
  .cy-pod li,
  .cy-pod .p1 {
    order: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas:
      "place name pts"
      "place sub pts"
      "place you pts";
    align-items: center;
    column-gap: 12px;
    padding: 14px 10px;
    border-left: 0 !important;
    border-top: 1px solid var(--line);
    text-align: left;
  }
  .cy-pod li:first-child {
    border-top: 0;
  }
  .cy-pod-place {
    grid-area: place;
  }
  .cy-pod-name {
    grid-area: name;
    margin: 0;
    font-size: 17px;
  }
  .cy-pod-sub {
    grid-area: sub;
  }
  .cy-pod .cy-you {
    grid-area: you;
  }
  .cy-pod-pts {
    grid-area: pts;
    margin: 0;
    font-size: 22px;
    text-align: right;
  }
  .cy-pod .p1 .cy-pod-pts {
    font-size: 28px;
  }
  .cy-pod-pts small {
    display: block;
    font-size: 12px;
  }

  .cy-sb-table .r {
    width: 40px;
  }
  .cy-sb-table .s,
  .cy-members .s {
    width: 72px;
  }
  .cy-share {
    min-width: 90px;
  }
  .cy-members .cls,
  .cy-list .cat {
    display: none;
  }
  .cy-list .s {
    width: 60px;
  }
  .cy-list .when {
    width: 96px;
  }

  .cy-stats,
  .cy-stats.n3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cy-stats > div:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }
  .cy-stats > div:nth-child(n+3) {
    border-top: 1px solid var(--line);
  }
  .cy-stats b {
    font-size: 26px;
  }
  .cy-facts-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .cy-facts-list dt {
    padding-bottom: 0;
    border-bottom: 0;
  }
}

@media (max-width: 400px) {
  .cy-share {
    min-width: 64px;
  }
  .cy-share > span {
    width: 34px;
  }
  .cy-recent li {
    flex-direction: column;
    gap: 2px;
  }
}

/* ---------- reduced motion: nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  .cy-share .bar i {
    transition: none;
  }
}

/* ---------- team and user lists (19f) ---------- */
.cy-search {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  margin: 0 0 28px;
}
.cy-pg .cy-search .form-select,
.cy-pg .cy-search .form-control {
  width: 100%;
}
.cy-list td.n small {
  margin-left: 8px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 500;
}
.cy-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: 24px;
  color: var(--mid);
  font-size: 14px;
}
.cy-pager a {
  color: var(--fg);
  font-weight: 600;
}
@media (max-width: 760px) {
  .cy-search {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .cy-search .form-select {
    grid-column: 1 / -1;
  }
  .cy-list .wide {
    display: none;
  }
}

/* ---------- organiser pages (CTFd Pages, 19f) ---------- */
.cy-page {
  padding-top: 40px;
  color: var(--mid);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.cy-page h1,
.cy-page h2,
.cy-page h3 {
  color: var(--fg);
  font-weight: 700;
  letter-spacing: -.01em;
}
.cy-page h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
}
.cy-page a {
  color: var(--fg);
}
.cy-page img {
  max-width: 100%;
  height: auto;
}
