/* style.css — The Primo Overseer: Dark Gothic War Edition */

@import url("https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&family=Cinzel:wght@400;600&family=IM+Fell+English:ital@0;1&display=swap");

:root {
  --blood-red: #8b0000;
  --blood-bright: #c0392b;
  --blood-glow: rgba(139, 0, 0, 0.6);
  --crimson: #dc143c;
  --gold: #c9a84c;
  --gold-light: #f0d080;
  --ash: #1a1512;
  --charcoal: #0d0b09;
  --stone: #2a2420;
  --bone: #d4c5a9;
  --ghost: rgba(212, 197, 169, 0.08);
  --glass-border: rgba(139, 0, 0, 0.25);
  --text-primary: #e8dcc8;
  --text-secondary: #a09280;
  --accent-online: #2ecc71;
  --accent-offline: #444;
}

/* ===== GLOBAL ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--charcoal);
  background-image:
    radial-gradient(
      ellipse 80% 60% at 50% 0%,
      rgba(100, 0, 0, 0.35) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 60% 40% at 20% 80%,
      rgba(80, 0, 0, 0.2) 0%,
      transparent 60%
    ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: "IM Fell English", Georgia, serif;
  min-height: 100vh;
  padding-bottom: 80px;
  overflow-x: hidden;
  cursor: crosshair;
}

/* ===== BLOOD DRIP CANVAS ===== */
#bloodCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ===== RUNE BORDER TOP ===== */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--blood-red) 20%,
    var(--crimson) 50%,
    var(--blood-red) 80%,
    transparent 100%
  );
  box-shadow:
    0 0 20px var(--blood-glow),
    0 0 60px rgba(139, 0, 0, 0.3);
  z-index: 9999;
  animation: runeFlicker 4s ease-in-out infinite;
}

@keyframes runeFlicker {
  0%,
  100% {
    opacity: 1;
    box-shadow:
      0 0 20px var(--blood-glow),
      0 0 60px rgba(139, 0, 0, 0.3);
  }
  50% {
    opacity: 0.7;
    box-shadow:
      0 0 40px var(--blood-glow),
      0 0 100px rgba(139, 0, 0, 0.5);
  }
}

/* ===== SCROLL BARS ===== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--charcoal);
}
::-webkit-scrollbar-thumb {
  background: var(--blood-red);
  border-radius: 3px;
}

/* ===== BLOOD DRIP DECORATORS ===== */
.blood-drip-top {
  position: relative;
  overflow: visible;
}
.blood-drip-top::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 0;
  background: linear-gradient(
    180deg,
    var(--crimson) 0%,
    var(--blood-red) 60%,
    transparent 100%
  );
  border-radius: 0 0 50% 50%;
  animation: bloodDrip 5s ease-in-out 2s infinite;
}

@keyframes bloodDrip {
  0% {
    height: 0;
    opacity: 1;
  }
  60% {
    height: 80px;
    opacity: 1;
  }
  100% {
    height: 80px;
    opacity: 0;
    top: 200%;
  }
}

/* ===== MAIN HEADER ===== */
.site-header {
  position: relative;
  text-align: center;
  padding: 70px 20px 50px;
  z-index: 10;
}

.skull-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.skull-divider::before,
.skull-divider::after {
  content: "";
  flex: 1;
  max-width: 200px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--blood-red),
    transparent
  );
}

.skull-icon {
  color: var(--blood-red);
  font-size: 1.4rem;
  animation: skullPulse 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px var(--blood-glow));
}

@keyframes skullPulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 8px var(--blood-glow));
  }
  50% {
    transform: scale(1.15);
    filter: drop-shadow(0 0 20px var(--blood-glow));
  }
}

h1.site-title {
  font-family: "Cinzel Decorative", serif;
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 4rem);
  letter-spacing: 4px;
  text-transform: uppercase;
  line-height: 1.1;
  background: linear-gradient(
    180deg,
    var(--gold-light) 0%,
    var(--gold) 40%,
    #8a6a20 70%,
    var(--blood-red) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
  position: relative;
}

h1.site-title::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  font-family: "Cinzel Decorative", serif;
  font-weight: 900;
  -webkit-text-fill-color: transparent;
  background: linear-gradient(180deg, rgba(200, 0, 0, 0.3), transparent);
  -webkit-background-clip: text;
  background-clip: text;
  filter: blur(12px);
  z-index: -1;
}

.site-subtitle {
  font-family: "Cinzel", serif;
  font-size: 0.75rem;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 12px;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 10;
}

/* ===== PLAYER GRID ===== */
#playerGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  align-items: start;
  padding: 20px 0;
}

/* ===== PLAYER CARD ===== */
.player-card {
  position: relative;
  background: linear-gradient(
    160deg,
    rgba(26, 21, 18, 0.95) 0%,
    rgba(15, 10, 8, 0.98) 100%
  );
  border: 1px solid rgba(139, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
    border-color 0.3s ease,
    box-shadow 0.4s ease;
  transform-style: preserve-3d;
  cursor: pointer;
}

/* Corner ornaments */
.player-card::before,
.player-card::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--blood-red);
  border-style: solid;
  opacity: 0.6;
  transition:
    opacity 0.3s,
    width 0.3s,
    height 0.3s;
  z-index: 5;
}
.player-card::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}
.player-card::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

.player-card:hover::before,
.player-card:hover::after {
  opacity: 1;
  width: 28px;
  height: 28px;
}

/* Blood smear background effect */
.card-blood-smear {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(139, 0, 0, 0.08) 100%
  );
  transition: left 0.5s ease;
  pointer-events: none;
  z-index: 1;
}

.player-card:hover .card-blood-smear {
  left: 0;
}

/* Online card glow */
.player-card.is-online {
  border-color: rgba(139, 0, 0, 0.5);
}

.player-card.is-online:hover {
  border-color: var(--blood-bright);
  box-shadow:
    0 0 20px rgba(139, 0, 0, 0.3),
    0 0 60px rgba(139, 0, 0, 0.15),
    0 30px 50px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(139, 0, 0, 0.2);
  transform: translateY(-8px) scale(1.01);
}

.player-card.is-offline:hover {
  border-color: rgba(80, 70, 60, 0.8);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(-6px);
}

/* Card inner */
.card-body {
  padding: 24px 20px 20px;
  text-align: center;
  position: relative;
  z-index: 2;
}

/* ===== STATUS BADGE TOP ===== */
.status-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 10;
}

.status-banner.online {
  background: linear-gradient(
    90deg,
    transparent,
    var(--crimson),
    var(--blood-red),
    var(--crimson),
    transparent
  );
  box-shadow: 0 0 12px var(--blood-glow);
  animation: bannerPulse 2s ease-in-out infinite;
}

.status-banner.offline {
  background: rgba(60, 50, 40, 0.5);
}

@keyframes bannerPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ===== AVATAR ===== */
.avatar-container {
  position: relative;
  display: inline-block;
  padding: 14px;
  margin-top: 10px;
}

.career-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  background: #111;
  padding: 4px;
  border: 2px solid rgba(139, 0, 0, 0.4);
  transition:
    border-color 0.3s,
    filter 0.3s;
}

.player-card:hover .career-icon {
  border-color: var(--crimson);
  filter: drop-shadow(0 0 8px var(--blood-glow));
}

/* Status ring */
.status-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 1;
  mask: radial-gradient(transparent 63%, black 64%);
  -webkit-mask: radial-gradient(transparent 63%, black 64%);
}

.status-online {
  background: conic-gradient(
    var(--crimson) 0deg,
    var(--blood-red) 60deg,
    transparent 120deg,
    var(--blood-red) 200deg,
    var(--crimson) 280deg,
    transparent 320deg,
    var(--crimson) 360deg
  );
  animation: spinRune 4s linear infinite;
  filter: drop-shadow(0 0 6px var(--blood-glow));
}

.status-offline {
  background: repeating-conic-gradient(#333 0deg 30deg, #222 30deg 60deg);
  opacity: 0.4;
}

@keyframes spinRune {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== CARD TITLE ===== */
.card-title {
  margin-top: 14px;
  margin-bottom: 0;
}

.card-title a {
  font-family: "Cinzel", serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--bone);
  text-decoration: none;
  letter-spacing: 1px;
  transition:
    color 0.3s,
    text-shadow 0.3s;
  display: block;
}

.card-title a:hover {
  color: var(--gold-light);
  text-shadow: 0 0 12px rgba(200, 168, 80, 0.5);
}

/* ===== LOCATION BADGE ===== */
.location-badge {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(139, 0, 0, 0.15);
  border-radius: 4px;
  padding: 12px;
  font-size: 0.82rem;
  line-height: 1.7;
  transition:
    border-color 0.3s,
    background 0.3s;
}

.player-card:hover .location-badge {
  border-color: rgba(139, 0, 0, 0.3);
  background: rgba(0, 0, 0, 0.6);
}

.location-badge .text-muted {
  font-size: 0.7rem;
  color: var(--text-secondary) !important;
  font-style: italic;
  margin-top: 4px;
}

.text-info {
  color: var(--blood-bright) !important;
}

/* ===== BLOOD PARTICLE BUTTON ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.92);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* ===== LAST UPDATED FOOTER ===== */
.last-updated {
  margin-top: 70px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-family: "Cinzel", serif;
  position: relative;
  display: inline-block;
}

.last-updated::before,
.last-updated::after {
  content: "✦";
  color: var(--blood-red);
  margin: 0 12px;
  font-size: 0.6rem;
  vertical-align: middle;
  opacity: 0.6;
}

/* ===== EMPTY STATE ===== */
.alert-dark {
  background: rgba(139, 0, 0, 0.05) !important;
  border: 1px solid rgba(139, 0, 0, 0.2) !important;
  color: var(--text-secondary) !important;
  border-radius: 4px !important;
  font-family: "Cinzel", serif;
  letter-spacing: 2px;
  font-size: 0.8rem;
  text-transform: uppercase;
}

/* ===== COUNT BADGES ===== */
.player-count {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  margin: 0 auto 40px;
  padding: 10px 30px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(139, 0, 0, 0.2);
  border-radius: 2px;
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.count-online {
  color: var(--accent-online);
}
.count-offline {
  color: var(--text-secondary);
}
.count-sep {
  color: rgba(139, 0, 0, 0.4);
}

/* ===== PROFILE PAGE ===== */
.profile-page .profile-header {
  padding: 60px 0 40px;
  position: relative;
  z-index: 10;
}

.profile-page .profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(139, 0, 0, 0.5);
  position: relative;
  z-index: 2;
  transition:
    border-color 0.3s,
    filter 0.3s;
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.avatar-wrapper:hover .profile-avatar {
  border-color: var(--crimson);
  filter: drop-shadow(0 0 15px var(--blood-glow));
}

.avatar-wrapper .status-ring {
  mask: radial-gradient(transparent 66%, black 67%);
  -webkit-mask: radial-gradient(transparent 66%, black 67%);
}

/* ===== PROFILE CARD ===== */
.profile-card {
  background: linear-gradient(
    160deg,
    rgba(22, 17, 14, 0.97) 0%,
    rgba(12, 8, 6, 0.99) 100%
  );
  border: 1px solid rgba(139, 0, 0, 0.2);
  border-radius: 4px;
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--blood-red),
    transparent
  );
  opacity: 0.5;
}

/* ===== INTEL ROWS ===== */
.intel-row {
  padding: 14px 0;
  border-bottom: 1px solid rgba(139, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
  margin: 0 -10px;
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 2px;
}

.intel-row:hover {
  background: rgba(139, 0, 0, 0.05);
}

.intel-row:last-child {
  border-bottom: none;
}

.intel-row .label {
  color: var(--text-secondary);
  font-size: 0.82rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: "Cinzel", serif;
}

.intel-row .value {
  font-weight: 600;
  color: var(--bone);
  font-family: "IM Fell English", serif;
  font-size: 1rem;
}

/* ===== STAT PILLS ===== */
.stat-pill {
  padding: 12px 20px;
  border-radius: 3px;
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(139, 0, 0, 0.15);
  transition:
    border-color 0.3s,
    transform 0.2s;
}

.stat-pill:hover {
  border-color: rgba(139, 0, 0, 0.4);
  transform: translateY(-3px);
}

.stat-pill small {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.stat-pill div {
  font-size: 1.6rem;
  font-family: "Cinzel Decorative", serif;
  line-height: 1.2;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(200, 168, 80, 0.3);
}

/* ===== ARMORY GRID ===== */
.armory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.armory-item {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(139, 0, 0, 0.12);
  padding: 12px 14px;
  border-radius: 3px;
  transition: all 0.25s ease;
  opacity: 0;
  position: relative;
  overflow: hidden;
}

.armory-item::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--blood-red);
  opacity: 0;
  transition: opacity 0.3s;
}

.armory-item:hover {
  background: rgba(139, 0, 0, 0.08);
  border-color: rgba(139, 0, 0, 0.3);
  transform: translateX(4px);
}

.armory-item:hover::after {
  opacity: 1;
}

.slot-icon img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  margin-right: 14px;
  border: 1px solid rgba(139, 0, 0, 0.2);
  object-fit: cover;
  flex-shrink: 0;
}

.item-name {
  display: block;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.92rem;
  font-family: "Cinzel", serif;
  letter-spacing: 0.5px;
}

.item-meta {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 2px;
}

.talisman-stat {
  display: inline-block;
  font-size: 0.7rem;
  background: rgba(139, 0, 0, 0.12);
  color: #ff8080;
  padding: 2px 7px;
  border-radius: 2px;
  margin-top: 4px;
  margin-right: 4px;
  border: 1px solid rgba(139, 0, 0, 0.2);
  font-family: "Cinzel", serif;
  letter-spacing: 0.5px;
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-family: "Cinzel", serif;
  font-size: 0.7rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--blood-red);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(139, 0, 0, 0.4), transparent);
}

/* ===== BACK BUTTON ===== */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid rgba(139, 0, 0, 0.2);
  border-radius: 2px;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.3);
  margin-bottom: 30px;
}

.btn-back:hover {
  color: var(--bone);
  border-color: rgba(139, 0, 0, 0.5);
  background: rgba(139, 0, 0, 0.1);
  text-decoration: none;
}

/* ===== BLOOD SPLATTER ON CLICK ===== */
.blood-splat {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    var(--crimson) 0%,
    var(--blood-red) 40%,
    transparent 70%
  );
  transform: scale(0);
  animation: splatAnim 0.6s ease-out forwards;
  z-index: 9998;
}

@keyframes splatAnim {
  0% {
    transform: scale(0);
    opacity: 0.9;
  }
  50% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  h1.site-title {
    font-size: 1.8rem;
    letter-spacing: 2px;
  }
  .profile-card {
    padding: 20px;
  }
  .armory-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== MISC UTILITIES ===== */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0;
}
.row.g-4 {
  gap: 24px;
}
.text-center {
  text-align: center;
}
.mt-3 {
  margin-top: 12px;
}
.me-1 {
  margin-right: 4px;
}
.me-2 {
  margin-right: 8px;
}
.me-3 {
  margin-right: 16px;
}
.small {
  font-size: 0.85em;
}

/* Online / offline text */
.badge-online {
  display: inline-block;
  background: rgba(46, 204, 113, 0.1);
  color: var(--accent-online);
  border: 1px solid rgba(46, 204, 113, 0.25);
  padding: 2px 10px;
  border-radius: 2px;
  font-family: "Cinzel", serif;
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.badge-offline {
  display: inline-block;
  background: rgba(80, 70, 60, 0.2);
  color: var(--text-secondary);
  border: 1px solid rgba(80, 70, 60, 0.3);
  padding: 2px 10px;
  border-radius: 2px;
  font-family: "Cinzel", serif;
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}
