/* Alignment Grid */
.alignment-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.alignment-title {
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: 1.5rem;
  color: #3a1e0e;
  letter-spacing: 0.05em;
}

.alignment-toggle {
  display: flex;
  background: linear-gradient(to bottom, #faf5e8 0%, #f3ead8 100%);
  border: 2px solid #8b7355;
  border-radius: 6px;
  overflow: hidden;
}

.alignment-toggle-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  color: #4a3827;
  font-family: "IM Fell English", Georgia, serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-right: 1px solid #8b7355;
}

.alignment-toggle-btn:last-child {
  border-right: none;
}

.alignment-toggle-btn:hover {
  background: rgba(139, 115, 85, 0.1);
}

.alignment-toggle-btn.active {
  background: rgba(139, 0, 0, 0.15);
  color: #8b0000;
  font-weight: bold;
}

.alignment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
  max-width: 900px;
}

.alignment-square {
  background: linear-gradient(to bottom, #faf5e8 0%, #f3ead8 100%);
  border: 3px solid #8b7355;
  border-radius: 8px;
  padding: 1.5rem;
  min-height: 200px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.alignment-square:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Border colors based on alignment */
.alignment-square.good {
  border-top-color: #d4af37;
  border-top-width: 5px;
}

.alignment-square.neutral-good-evil {
  border-top-color: #c0c0c0;
  border-top-width: 5px;
}

.alignment-square.evil {
  border-top-color: #8b0000;
  border-top-width: 5px;
}

.alignment-square.lawful {
  border-left-color: #1e3a8a;
  border-right-color: #1e3a8a;
  border-left-width: 5px;
  border-right-width: 5px;
}

.alignment-square.neutral-lawful-chaotic {
  border-left-color: #6b7280;
  border-right-color: #6b7280;
  border-left-width: 5px;
  border-right-width: 5px;
}

.alignment-square.chaotic {
  border-left-color: #c2410c;
  border-right-color: #c2410c;
  border-left-width: 5px;
  border-right-width: 5px;
}

.alignment-name {
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: 1.1rem;
  color: #3a1e0e;
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.alignment-gods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.god-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #8b7355;
  overflow: hidden;
  background: linear-gradient(135deg, #e8dcc8 0%, #d4c4a8 100%);
  transition: transform 0.2s ease;
}

.god-circle:hover {
  transform: scale(1.2);
  border-color: #d4af37;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

.god-circle.highlight {
  transform: scale(1.2);
  border-color: #d4af37;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.9);
  z-index: 10;
}

.god-circle.highlight.main-alignment {
  transform: scale(1.4);
  border-width: 3px;
  z-index: 15;
}

.alignment-square.dimmed {
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.god-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.god-circle.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #8b7355;
  font-weight: bold;
}

/* Zoomed view */
.zoomed-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 280px;
  right: 0;
  bottom: 0;
  background: #f9f4e8;
  z-index: 100;
  padding: 2rem;
  overflow-y: auto;
}

.zoomed-overlay.visible {
  display: block;
}

.zoomed-content {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.zoomed-close {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background: rgba(139, 0, 0, 0.9);
  border: 3px solid #8b0000;
  border-radius: 50%;
  color: #f9f4e8;
  font-size: 1.8rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 110;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.zoomed-close:hover {
  background: rgba(139, 0, 0, 1);
  transform: scale(1.15);
}

.zoomed-title {
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: 2rem;
  color: #3a1e0e;
  text-align: center;
  margin: 0 0 2rem 0;
  padding-bottom: 0.8rem;
  border-bottom: 3px double #8b7355;
  letter-spacing: 0.05em;
}

.zoomed-gods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1.5rem;
  justify-items: center;
}

.zoomed-god {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.zoomed-god:hover {
  transform: scale(1.05);
}

.zoomed-god-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #8b7355;
  overflow: hidden;
  background: linear-gradient(135deg, #e8dcc8 0%, #d4c4a8 100%);
  margin-bottom: 0.5rem;
  transition: border-color 0.2s ease;
}

.zoomed-god:hover .zoomed-god-circle {
  border-color: #d4af37;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.8);
}

.zoomed-god-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.zoomed-god-circle.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #8b7355;
  font-weight: bold;
}

.zoomed-god-name {
  font-size: 0.9rem;
  color: #3a1e0e;
  text-align: center;
  font-weight: bold;
}

/* God detail page */
.god-detail {
  display: none;
}

.god-detail.visible {
  display: block;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  padding: 0.5rem 1rem;
  background: rgba(139, 115, 85, 0.1);
  border: 1px solid rgba(139, 115, 85, 0.3);
  border-radius: 4px;
  color: #3a1e0e;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.back-link:hover {
  background: rgba(139, 115, 85, 0.2);
  border-color: #8b7355;
  transform: translateX(-4px);
}

.back-link::before {
  content: '← ';
}

.god-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.god-image-container {
  grid-column: 1;
  grid-row: 1;
}

.god-image {
  width: 100%;
  height: auto;
  border: 3px solid #8b7355;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #e8dcc8 0%, #d4c4a8 100%);
}

.god-image.placeholder {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: #8b7355;
  opacity: 0.5;
}

.god-info-container {
  grid-column: 2;
  grid-row: 1;
}

.god-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.god-info-item {
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  color: #4a3827;
}

.god-info-label {
  font-weight: bold;
  color: #3a1e0e;
}

.alignment-value {
  display: inline;
}

.alignment-value .main {
  font-weight: bold;
}

.god-description {
  grid-column: 1 / -1;
  grid-row: 2;
  background: linear-gradient(to bottom, #faf5e8 0%, #f3ead8 100%);
  border: 2px solid #8b7355;
  border-radius: 8px;
  padding: 1.5rem;
  font-size: 1rem;
  line-height: 1.7;
  color: #4a3827;
  white-space: pre-line;
  text-align: justify;
  hyphens: auto;
}

.god-section {
  grid-column: 1;
  background: linear-gradient(to bottom, #faf5e8 0%, #f3ead8 100%);
  border: 2px solid #8b7355;
  border-radius: 8px;
  padding: 1.5rem;
}

.god-section:nth-of-type(4) {
  grid-row: 3;
}

.god-section:nth-of-type(5) {
  grid-column: 2;
  grid-row: 3;
}

.god-cleric-spells {
  grid-column: 1 / -1;
  grid-row: 4;
  background: rgba(139, 115, 85, 0.1);
  border: 2px solid #8b7355;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 2rem;
}

.cleric-spell-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
}

.cleric-spell-rank {
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: 1.5rem;
  font-weight: bold;
  color: #3a1e0e;
  text-align: center;
  line-height: 1.2;
}

.cleric-spell-rank .suffix {
  font-size: 0.7rem;
  vertical-align: super;
}

.cleric-spell-name {
  font-size: 1rem;
  color: #4a3827;
  text-align: center;
}

.cleric-spell-info {
  font-size: 1rem;
  color: #4a3827;
  text-align: center;
  font-style: italic;
  line-height: 1.6;
}

.god-section-title {
  font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
  font-size: 1.2rem;
  color: #3a1e0e;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #8b7355;
  letter-spacing: 0.05em;
}

.god-section-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.god-section-list li {
  margin-bottom: 0.6rem;
  padding-left: 1.2rem;
  position: relative;
  font-size: 0.95rem;
  color: #4a3827;
  line-height: 1.5;
}

.god-section-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #8b7355;
  font-weight: bold;
}

/* Tooltips */
.alignment-tooltip,
.god-tooltip {
  position: fixed;
  background: linear-gradient(to bottom, #f9f4e8 0%, #f0e6d8 100%);
  border: 2px solid #8b7355;
  border-radius: 4px;
  padding: 0.8rem 1rem;
  pointer-events: none;
  z-index: 1500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  display: none;
  max-width: 250px;
}

.alignment-tooltip.visible,
.god-tooltip.visible {
  display: block;
}

.alignment-tooltip-title,
.god-tooltip-title {
  font-size: 1rem;
  color: #3a1e0e;
  font-weight: bold;
  margin-bottom: 0.5rem;
  text-align: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #b89655;
}

.alignment-tooltip-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.alignment-tooltip-list li {
  margin-bottom: 0.3rem;
  padding-left: 1rem;
  position: relative;
  font-size: 0.9rem;
  color: #4a3827;
}

.alignment-tooltip-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #8b7355;
}

.alignment-tooltip-list li.highlighted {
  font-weight: bold;
  color: #8b0000;
}

.alignment-tooltip-list li.highlighted::before {
  color: #d4af37;
  font-size: 1.1rem;
}

.god-tooltip-info {
  font-size: 0.85rem;
  color: #5d4a33;
  line-height: 1.5;
}

.god-tooltip-label {
  font-weight: bold;
  color: #3a1e0e;
}

/* Sidebar modifications */
.sidebar-god-link {
  display: block;
  padding: 0.6rem 0.8rem;
  color: #d4c4a8;
  text-decoration: none;
  background: rgba(139, 115, 85, 0.1);
  border: 1px solid rgba(139, 115, 85, 0.3);
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.sidebar-god-link:hover {
  background: rgba(139, 115, 85, 0.2);
  border-color: #8b7355;
  transform: translateX(4px);
}

.sidebar-god-link.active {
  background: rgba(139, 0, 0, 0.2);
  border-color: #8b0000;
  color: #f9f4e8;
}

.sidebar-god-link.dimmed {
  opacity: 0.4;
  font-size: 0.85rem;
}

.sidebar-god-link.highlighted {
  background: rgba(212, 175, 55, 0.2);
  border-color: #d4af37;
  transform: translateX(4px);
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding-left: 0;
  }

  .zoomed-overlay {
    left: 0;
  }

  .alignment-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .god-sheet {
    grid-template-columns: 1fr;
  }

  .god-image-container {
    grid-row: 1;
  }

  .god-info-container {
    grid-column: 1;
    grid-row: 2;
  }

  .god-description {
    grid-row: 3;
  }

  .god-section:nth-of-type(4) {
    grid-row: 4;
  }

  .god-section:nth-of-type(5) {
    grid-column: 1;
    grid-row: 5;
  }

  .zoomed-gods {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .zoomed-god-circle {
    width: 64px;
    height: 64px;
  }
}