/* Knights roster overlay — wooden RPG equipment-window skin. */
@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=MedievalSharp&display=swap");

.kc-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kc-overlay.hidden { display: none; }
.kc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 4, 2, 0.8);
  backdrop-filter: blur(2px);
}

/* --- Panel: dark oak planks in a riveted steel frame --- */
.kc-panel {
  position: relative;
  width: min(92vw, 920px);
  min-height: 82vh;
  max-height: 92vh;
  overflow-y: auto;
  padding: 26px 24px 28px;
  color: #ecd9b0;
  font-family: "Cinzel", Georgia, serif;
  border: 4px solid #20140a;
  border-radius: 7px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(60, 40, 20, 0.25), rgba(0, 0, 0, 0) 60%),
    linear-gradient(180deg, rgba(22, 14, 7, 0.76), rgba(14, 9, 4, 0.82)),
    url("assets/panel/wooden_panel.png") center / cover;
  box-shadow:
    0 0 0 2px #0d0805,
    0 0 0 8px #838a93,
    0 0 0 10px #4b4e52,
    0 20px 55px rgba(0, 0, 0, 0.65),
    inset 0 0 60px rgba(0, 0, 0, 0.6);
}
.kc-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 30px; height: 30px;
  border: 2px solid #838a93;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #6c7079, #2e3136);
  color: #ecd9b0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.35), 0 2px 4px rgba(0, 0, 0, 0.5);
}
.kc-close:hover { color: #fff; filter: brightness(1.15); }

/* --- Section headers: carved gold with flanking rules --- */
.kc-section { margin-bottom: 6px; }
.kc-section h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 2px 12px;
  font-size: 17px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e6c778;
  text-shadow: 0 1px 0 #000, 0 0 8px rgba(201, 162, 75, 0.35);
}
.kc-section h2::before,
.kc-section h2::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, #8a6a2e, transparent);
}

/* --- Roster card: aged leather plaque with brass trim, clickable --- */
/* responsive roster grid: 2 columns when wide, 1 when narrow; scrolls on overflow */
.kc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.kc-grid .kc-divider,
.kc-grid .kc-empty { grid-column: 1 / -1; }

.kc-card {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 10px 14px;
  border: 1px solid rgba(201, 162, 75, 0.32);
  border-radius: 6px;
  color: inherit;
  font-family: inherit;
  /* recessed slot cut into the panel wood */
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.2));
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.55),
    inset 0 -1px 0 rgba(255, 235, 190, 0.06),
    0 1px 0 rgba(255, 240, 205, 0.05);
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.kc-card:hover {
  border-color: rgba(240, 210, 130, 0.75);
  background: linear-gradient(180deg, rgba(70, 48, 22, 0.4), rgba(0, 0, 0, 0.22));
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.45),
    0 0 12px rgba(201, 162, 75, 0.22);
}
.kc-card:active { box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.6); }

/* --- Portrait: painted-steel ornate frame overlaid on a round crop --- */
.kc-portrait {
  position: relative;
  flex-shrink: 0;
  display: inline-block;
}
.kc-portrait-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 61.5%;
  height: 61.5%;
  border-radius: 50%;
  object-fit: cover;
}
.kc-portrait-frame {
  position: absolute;
  inset: 0;
  background: url("assets/panel/portrait_border.png") center / contain no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}
.kc-portrait-sm { width: 74px; height: 74px; }
.kc-silhouette { opacity: 0.5; }

.kc-body { display: flex; flex-direction: column; min-width: 0; }
.kc-name {
  font-size: 19px;
  font-weight: 700;
  color: #f3e4bd;
  text-shadow: 0 1px 1px #000;
}
.kc-titles {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #e6c778;
  margin-top: 2px;
}
.kc-meta { font-size: 12.5px; color: #cbb891; margin-top: 3px; line-height: 1.3; }

.kc-empty {
  color: #b8a684;
  font-style: italic;
  padding: 4px 2px;
}

/* --- Founding-cast divider: engraved rule with centered label --- */
.kc-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 2px 12px;
  color: #c9a24b;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.kc-divider::before,
.kc-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 75, 0.55), transparent);
}

/* --- Detail (single clicked profile) --- */
.kc-back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  padding: 6px 14px;
  cursor: pointer;
  color: #ecd9b0;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.2));
  border: 1px solid rgba(201, 162, 75, 0.4);
  border-radius: 5px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
}
.kc-back:hover { border-color: rgba(240, 210, 130, 0.8); background: linear-gradient(180deg, rgba(70, 48, 22, 0.4), rgba(0, 0, 0, 0.22)); }
.kc-detail { text-align: center; padding: 4px 8px 6px; }
.kc-detail .kc-portrait-lg {
  display: block;
  width: 168px;
  height: 168px;
  margin: 0 auto 14px;
}
.kc-detail-name {
  margin: 0;
  font-size: 26px;
  color: #f3e4bd;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px #000;
}
.kc-detail-titles {
  margin: 6px 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: #e6c778;
}
.kc-detail-row {
  margin: 5px 0;
  font-size: 14px;
  color: #d8c6a0;
}

/* Wooden scrollbar */
.kc-panel::-webkit-scrollbar { width: 12px; }
.kc-panel::-webkit-scrollbar-track { background: #241608; }
.kc-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6c7079, #3d4046);
  border: 2px solid #241608;
  border-radius: 6px;
}

/* Dark niche disc behind the portrait (matches the Telegram card ring backing). */
.kc-portrait::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68%;
  height: 68%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #140d07;
  z-index: 0;
}
.kc-portrait-img { z-index: 1; }
.kc-portrait-frame { z-index: 2; }
