/* Custom app styles for The Cthulhu Compendium */

:root {
  --color-dark: #0d0d0d;
  --color-darker: #080808;
  --color-card: #111111;
  --color-border: #2a2a2a;
  --color-gold: #c9a84c;
  --color-gold-light: #e0c06a;
  --color-text: #d1c5a8;
  --color-muted: #6b7280;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Glow effect for gold elements */
.gold-glow {
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.3);
}

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Investigator gallery cards */
.investigator-card {
  display: grid;
  grid-template-columns: minmax(190px, 38%) minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
}

.investigator-card-portrait {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-right: 1px solid rgba(201, 168, 76, 0.16);
  background:
    radial-gradient(circle at 50% 32%, rgba(201, 168, 76, 0.12), transparent 58%),
    #090a09;
}

.investigator-card-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.34);
}

.investigator-card-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.45s ease, filter 0.45s ease;
}

.investigator-card:hover .investigator-card-portrait img {
  transform: scale(1.015);
  filter: saturate(1.04) contrast(1.02);
}

.investigator-card-body {
  align-self: center;
  min-width: 0;
  padding: 1.5rem;
}

.investigator-card--no-portrait {
  grid-template-columns: 1fr;
}

@media (max-width: 639px) {
  .investigator-card {
    grid-template-columns: 1fr;
  }

  .investigator-card-portrait {
    border-right: 0;
    border-bottom: 1px solid rgba(201, 168, 76, 0.16);
  }
}

/* Investigator dossier */
.investigator-sheet {
  position: relative;
}

.sheet-hero {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 76, 0.32);
  border-radius: 18px;
  background:
    radial-gradient(circle at 78% 12%, rgba(201, 168, 76, 0.14), transparent 32%),
    linear-gradient(135deg, #15130e 0%, #0c1011 58%, #101715 100%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.sheet-portrait {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background: #080a0a;
}

.sheet-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 68%, rgba(12, 16, 17, 0.82) 100%),
    linear-gradient(0deg, rgba(8, 8, 8, 0.62), transparent 34%);
}

.sheet-portrait img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.9) contrast(1.04);
  transition: transform 0.6s ease, filter 0.6s ease;
}

.sheet-hero:hover .sheet-portrait img {
  transform: scale(1.018);
  filter: saturate(1) contrast(1.05);
}

.sheet-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4.5rem);
}

.dossier-kicker {
  color: var(--color-gold);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.dossier-rule {
  width: 72px;
  height: 2px;
  margin: 1.25rem 0;
  background: linear-gradient(90deg, var(--color-gold), transparent);
}

.dossier-fact {
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(201, 168, 76, 0.16);
  border-radius: 10px;
  background: rgba(5, 7, 7, 0.44);
}

.dossier-fact-label {
  color: #6b7280;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dossier-fact-value {
  margin-top: 0.2rem;
  color: #d1c5a8;
  font-size: 0.86rem;
  line-height: 1.25;
}

.sheet-section {
  border: 1px solid rgba(201, 168, 76, 0.13);
  background: linear-gradient(145deg, rgba(20, 20, 18, 0.98), rgba(13, 16, 16, 0.98));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

.sheet-section-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sheet-section-heading::before {
  content: "";
  width: 3px;
  height: 1.4rem;
  border-radius: 999px;
  background: var(--color-gold);
  box-shadow: 0 0 14px rgba(201, 168, 76, 0.32);
}

.stat-roll-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #292820;
  background: linear-gradient(155deg, #1a1a18, #111413);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.stat-roll-card::after {
  content: "ROLL";
  position: absolute;
  right: 0.35rem;
  top: 0.25rem;
  color: rgba(201, 168, 76, 0);
  font-size: 0.48rem;
  letter-spacing: 0.14em;
  transition: color 0.2s ease;
}

.stat-roll-card:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 168, 76, 0.7) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3), 0 0 18px rgba(201, 168, 76, 0.08);
}

.stat-roll-card:hover::after {
  color: rgba(201, 168, 76, 0.68);
}

.derived-stat-card {
  border: 1px solid rgba(201, 168, 76, 0.12);
  background: linear-gradient(145deg, #151513, #0e1111);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

.skill-roll-row {
  border: 1px solid #24241f;
  border-radius: 9px;
  background: rgba(12, 14, 14, 0.62);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.skill-roll-row:hover {
  transform: translateY(-1px);
  border-color: rgba(201, 168, 76, 0.42);
  background: rgba(32, 28, 18, 0.78);
}

@media (max-width: 850px) {
  .sheet-hero {
    grid-template-columns: 1fr;
  }

  .sheet-portrait,
  .sheet-portrait img {
    min-height: 520px;
    max-height: 680px;
  }

  .sheet-portrait::after {
    background: linear-gradient(0deg, rgba(12, 16, 17, 0.92), transparent 38%);
  }
}

@media (max-width: 520px) {
  .sheet-portrait,
  .sheet-portrait img {
    min-height: 430px;
  }

  .sheet-hero-copy {
    padding: 1.5rem;
  }
}
