/* Slain registry — categories, relations, expandable profiles */

#all-slain {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.slain-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.slain-toolbar h2 {
  font-family: "Cinzel", serif;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.add-entry-btn {
  font-size: 0.7rem;
  padding: 0.65rem 1.25rem;
  white-space: nowrap;
}

/* ── Indicator chips ── */

.ind {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  font-family: "Cinzel", serif;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.ind-relation.rel-defeated {
  background: rgba(61, 40, 23, 0.08);
  color: var(--ink-soft);
  border-color: rgba(61, 40, 23, 0.2);
}

.ind-relation.rel-friendly {
  background: rgba(61, 133, 198, 0.12);
  color: #3d85c6;
  border-color: rgba(61, 133, 198, 0.35);
}

.ind-relation.rel-pending {
  background: rgba(249, 168, 37, 0.15);
  color: #e65100;
  border-color: rgba(249, 168, 37, 0.45);
}

.ind-relation.rel-undecided {
  background: rgba(117, 117, 117, 0.12);
  color: #616161;
  border-color: rgba(117, 117, 117, 0.3);
}

.ind-relation.rel-lost {
  background: rgba(204, 0, 0, 0.1);
  color: #cc0000;
  border-color: rgba(204, 0, 0, 0.35);
}

.ind-teammate {
  background: rgba(158, 158, 158, 0.15);
  color: #666666;
  border-color: rgba(158, 158, 158, 0.35);
}

.ind-kills {
  background: rgba(213, 166, 189, 0.25);
  color: #9e5a7a;
  border-color: rgba(213, 166, 189, 0.55);
  font-weight: 700;
}

.ind-date {
  background: rgba(139, 105, 20, 0.08);
  color: #7a5c30;
  border-color: rgba(139, 105, 20, 0.2);
}

.ind-slayer {
  background: rgba(139, 105, 20, 0.06);
  color: #7a5c30;
  border-color: rgba(139, 105, 20, 0.18);
}

.ind-slayer.is-team {
  background: rgba(21, 101, 192, 0.1);
  color: #1565c0;
  border-color: rgba(21, 101, 192, 0.3);
  font-weight: 700;
}

.ind-note {
  background: rgba(255, 255, 255, 0.5);
  color: #9a7b50;
  border: 1px dashed rgba(139, 105, 20, 0.35);
  font-style: italic;
  font-family: "Crimson Text", serif;
}

.ind-note.is-interrupt {
  background: rgba(249, 168, 37, 0.12);
  color: #e65100;
  border-style: solid;
  border-color: rgba(249, 168, 37, 0.4);
  font-style: normal;
  font-family: "Cinzel", serif;
}

.ind-rank {
  background: #1e1e1e;
  color: #55ffff;
  font-family: "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
}

.ind-team-aff {
  background: rgba(21, 101, 192, 0.1);
  color: #1565c0;
  border: 1px solid rgba(21, 101, 192, 0.25);
}

.team-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* ── Relationship row colors ── */

.slain-card.rel-friendly { border-left: 4px solid #3d85c6; }
.slain-card.rel-friendly .player-name.name-friendly { color: #3d85c6; }
.slain-card.rel-pending { border-left: 4px solid #f9a825; background: rgba(249, 168, 37, 0.03); }
.slain-card.rel-undecided { border-left: 4px solid #9e9e9e; }
.slain-card.rel-defeated { border-left: 4px solid transparent; }
.slain-card.rel-lost { border-left: 4px solid #cc0000; background: rgba(204, 0, 0, 0.03); }
.slain-card.rel-lost .player-name { color: #cc0000; }

.profile-banner.rel-friendly { background: linear-gradient(135deg, rgba(61,133,198,0.1) 0%, rgba(255,255,255,0.4) 100%); }
.profile-banner.rel-lost { background: linear-gradient(135deg, rgba(204,0,0,0.08) 0%, rgba(255,255,255,0.4) 100%); }
.profile-username.name-friendly { color: #3d85c6; }

.profile-edit-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid rgba(139, 105, 20, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.72);
  color: #9a7b50;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.profile-edit-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.95);
}

.profile-edit-btn svg {
  display: block;
}

/* ── Categories ── */

.slain-category {
  border: 1px solid rgba(139, 105, 20, 0.25);
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.75rem 1.25rem;
  border: none;
  border-bottom: 1px solid rgba(139, 105, 20, 0.2);
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: background 0.2s;
}

.category-head:hover {
  background: rgba(255, 255, 255, 0.22);
}

.category-head-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.category-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(-45deg);
  transition: transform 0.25s;
  flex-shrink: 0;
}

.slain-category.is-collapsed .category-chevron {
  transform: rotate(45deg);
}

.slain-category.is-collapsed .category-head {
  border-bottom-color: transparent;
}

.slain-category.is-collapsed > .slain-list {
  display: none;
}

.category-title {
  font-family: "Cinzel", serif;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.category-count {
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  color: var(--gold);
  padding: 0.2rem 0.6rem;
  border: 1px solid rgba(139, 105, 20, 0.35);
  background: rgba(255, 255, 255, 0.4);
  border-radius: 999px;
}

.cat-cracked .category-head { background: rgba(139, 32, 32, 0.08); }
.cat-cracked .category-title { color: #8b2020; }
.cat-high-skill .category-head { background: rgba(106, 27, 154, 0.06); }
.cat-high-skill .category-title { color: #6a1b9a; }
.cat-skilled .category-head { background: rgba(139, 105, 20, 0.1); }
.cat-skilled .category-title { color: var(--gold); }
.cat-average .category-head { background: rgba(121, 85, 72, 0.08); }
.cat-average .category-title { color: #795548; }
.cat-entry-level .category-head { background: rgba(46, 125, 50, 0.08); }
.cat-entry-level .category-title { color: #2e7d32; }

/* ── Clickable rows ── */

.slain-list {
  display: flex;
  flex-direction: column;
}

.slain-card {
  border-bottom: 1px solid rgba(139, 105, 20, 0.12);
  transition: background 0.2s;
}

.slain-card:last-child { border-bottom: none; }

.slain-card.is-open {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 2px 0 rgba(139, 105, 20, 0.08);
}

.slain-row-btn {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.75rem 1rem;
  align-items: center;
  width: 100%;
  padding: 0.85rem 1.25rem;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: background 0.2s;
}

.slain-row-btn:hover { background: rgba(255, 255, 255, 0.28); }

.slain-avatar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(139, 105, 20, 0.22);
  border-radius: 6px;
}

.slain-head {
  image-rendering: pixelated;
  width: 40px;
  height: 40px;
}

.slain-main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.player-name {
  font-family: "Cinzel", serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-soft);
  word-break: break-word;
}

.slain-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.expand-label {
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9a7b50;
  opacity: 0.85;
}

.slain-card.is-open .expand-label { color: var(--gold); }

.expand-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
  transition: transform 0.25s;
  flex-shrink: 0;
}

.slain-card.is-open .expand-chevron { transform: rotate(-135deg); }

/* ── Expanded profile ── */

.slain-expand {
  display: none;
  padding: 0 1rem 1rem;
}

.slain-card.is-open .slain-expand {
  display: block;
  animation: expandIn 0.28s ease;
}

@keyframes expandIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.slain-expand-inner {
  position: relative;
  border: 1px solid rgba(139, 105, 20, 0.2);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
}

.profile-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  border-bottom: 1px solid rgba(139, 105, 20, 0.15);
  background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.35) 100%);
}

.profile-banner.rel-pending { background: linear-gradient(135deg, rgba(249,168,37,0.1) 0%, rgba(255,255,255,0.4) 100%); }

.profile-skin-frame {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 120px;
  min-height: 160px;
  padding: 0.5rem;
  background: rgba(42, 24, 16, 0.06);
  border: 2px solid rgba(139, 105, 20, 0.25);
  border-radius: 6px;
}

.profile-body {
  image-rendering: pixelated;
  max-height: 150px;
  width: auto;
}

.profile-banner-meta {
  min-width: 0;
  padding-right: 2rem;
}

.profile-eyebrow {
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.profile-username {
  font-family: "Cinzel", serif;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.profile-username.name-friendly { color: #1565c0; }

.profile-rank { margin-bottom: 0.65rem; }

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.profile-panel {
  padding: 1rem 1.25rem;
  border-right: 1px solid rgba(139, 105, 20, 0.12);
}

.profile-panel:last-child { border-right: none; }

.profile-panel h5 {
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.profile-facts {
  display: grid;
  gap: 0.65rem;
}

.profile-facts div.full { grid-column: 1 / -1; }

.profile-facts dt {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a7b50;
  margin-bottom: 0.15rem;
}

.profile-facts dd {
  font-family: "Crimson Text", serif;
  font-size: 1rem;
  color: var(--ink-soft);
}

.profile-shots {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(139, 105, 20, 0.12);
}

.profile-shots h5 {
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.65rem;
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.65rem;
}

.shot-grid a {
  display: block;
  border: 2px solid rgba(139, 105, 20, 0.25);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.shot-grid a:hover { border-color: var(--gold); }

.shot-grid img {
  width: 100%;
  height: 90px;
  object-fit: cover;
}

/* ── Hypixel ranks ── */

.hypixel-rank {
  display: inline-block;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  background: #1e1e1e;
}

.hypixel-rank::before { content: "["; }
.hypixel-rank::after { content: "]"; }

.rank-vip .rank-base, .rank-vip.hypixel-rank { color: #55ff55; }
.rank-vip-plus .rank-base, .rank-vip-plus.hypixel-rank { color: #55ff55; }
.rank-vip-plus .rank-plus { color: #ffaa00; }
.rank-mvp .rank-base, .rank-mvp.hypixel-rank { color: #55ffff; }
.rank-mvp-plus .rank-base, .rank-mvp-plus.hypixel-rank { color: #55ffff; }
.rank-mvp-plus .rank-plus { color: #ffaa00; }
.rank-mvp-plus-plus .rank-base, .rank-mvp-plus-plus.hypixel-rank { color: #ffaa00; }
.rank-mvp-plus-plus .rank-plus-plus { color: #ff5555; }

.hypixel-name { font-weight: 700; font-family: "Segoe UI", sans-serif; }
.rank-none.hypixel-name { color: #6b6b6b; }
.rank-vip.hypixel-name, .rank-vip-plus.hypixel-name { color: #1a7a1a; }
.rank-mvp.hypixel-name, .rank-mvp-plus.hypixel-name { color: #0a6e6e; }
.rank-mvp-plus-plus.hypixel-name { color: #9a6800; }

/* ── Add entry modal ── */

.slain-modal[hidden] { display: none; }

.slain-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 24, 16, 0.65);
  backdrop-filter: blur(5px);
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  background: linear-gradient(180deg, var(--parchment) 0%, var(--parchment-deep) 100%);
  border: 3px double var(--gold);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  border-radius: 4px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(139, 105, 20, 0.25);
}

.modal-head h3 {
  font-family: "Cinzel", serif;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
}

.modal-close {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gold);
  padding: 0.25rem 0.5rem;
}

.modal-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
}

.modal-preview {
  padding: 1.25rem 1rem;
  border-right: 1px solid rgba(139, 105, 20, 0.2);
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.preview-skin-frame {
  width: 100%;
  min-height: 180px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.75rem 0.5rem 0.25rem;
  background: rgba(42, 24, 16, 0.06);
  border: 2px solid rgba(139, 105, 20, 0.25);
  border-radius: 6px;
  transition: border-color 0.25s, background 0.25s;
}

.preview-skin-frame.is-loading {
  border-color: rgba(139, 105, 20, 0.4);
  animation: pulseFrame 1.2s ease infinite;
}

.preview-skin-frame.is-valid { border-color: rgba(46, 125, 50, 0.55); background: rgba(46, 125, 50, 0.06); }
.preview-skin-frame.is-error { border-color: rgba(139, 32, 32, 0.5); background: rgba(139, 32, 32, 0.06); }

@keyframes pulseFrame {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.preview-skin-body {
  image-rendering: pixelated;
  max-height: 160px;
  width: auto;
}

.preview-skin-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  color: #9a7b50;
}

.preview-skin-placeholder[hidden] { display: none; }

.preview-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(139, 105, 20, 0.35);
  border-radius: 50%;
  font-family: "Cinzel", serif;
  font-size: 1.25rem;
  color: var(--gold);
}

.preview-skin-placeholder p {
  font-size: 0.78rem;
  line-height: 1.35;
  font-family: "Crimson Text", serif;
}

.preview-status {
  margin-top: 0.75rem;
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a7b50;
}

.preview-status.is-loading { color: var(--gold); }
.preview-status.is-valid { color: #2e7d32; }
.preview-status.is-error { color: #8b2020; }

.preview-name {
  margin-top: 0.35rem;
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-soft);
  word-break: break-all;
}

.modal-body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-section {
  border: 1px solid rgba(139, 105, 20, 0.18);
  border-radius: 4px;
  padding: 0.85rem 1rem 1rem;
  background: rgba(255, 255, 255, 0.35);
}

.form-section legend {
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0 0.35rem;
}

.form-section label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a5c30;
  margin-top: 0.65rem;
}

.form-section label:first-of-type { margin-top: 0.35rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-row label { margin-top: 0; }

.modal-body input,
.modal-body select,
.modal-body textarea {
  font-family: "Crimson Text", serif;
  font-size: 0.95rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(139, 105, 20, 0.35);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  border-radius: 3px;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.2);
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(139, 105, 20, 0.25);
}

.modal-foot .scroll-cta:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-secondary {
  font-family: "Cinzel", serif;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(139, 105, 20, 0.35);
  color: #7a5c30;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.modal-open { overflow: hidden; }

@media (max-width: 720px) {
  .slain-row-btn {
    grid-template-columns: auto 1fr auto;
  }
  .expand-label { display: none; }
  .profile-banner { grid-template-columns: 1fr; text-align: center; }
  .profile-skin-frame { margin: 0 auto; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-panel { border-right: none; border-bottom: 1px solid rgba(139, 105, 20, 0.12); }
  .modal-layout { grid-template-columns: 1fr; }
  .modal-preview { border-right: none; border-bottom: 1px solid rgba(139, 105, 20, 0.2); }
  .form-row { grid-template-columns: 1fr; }
}

.slain-page {
  margin-top: 5rem;
  max-width: 960px;
}

.conquest-details .conquered-player .player-name {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--blood);
}
