@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=IM+Fell+English:ital@0;1&display=swap');

html {
  background-color: #0d0400;
  min-height: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'IM Fell English', Georgia, 'Times New Roman', serif;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(92, 45, 10, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 85%, rgba(61, 28, 2, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(40, 15, 0, 0.1) 0%, transparent 70%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 3px,
      rgba(26, 8, 0, 0.025) 3px,
      rgba(26, 8, 0, 0.025) 6px
    ),
    linear-gradient(155deg, #2a1500 0%, #1a0900 45%, #0d0400 100%);
  min-height: 100vh;
  color: #e8d5a3;
  margin: 0;
  padding: 0;
  animation: pageLoad 1.3s ease-out forwards;
}

@keyframes pageLoad {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

svg.lucide {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  stroke-width: 2;
  display: inline-block;
  position: relative;
  top: -1px;
}

.nav-link svg.lucide {
  width: 13px;
  height: 13px;
}

.source-link svg.lucide {
  width: 12px;
  height: 12px;
}

#muteBtn svg.lucide {
  width: 20px;
  height: 20px;
  top: 0;
}

.card-tri svg.lucide {
  width: 32px;
  height: 32px;
  top: 0;
  color: #c8a45a;
}

.card-open svg.lucide {
  width: 12px;
  height: 12px;
}

.close-btn svg.lucide {
  width: 13px;
  height: 13px;
}

#sandCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

#muteBtn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid #c8a45a;
  background: linear-gradient(145deg, #4a2008, #2a1000);
  color: #e8c875;
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(200, 164, 90, 0.35), inset 0 1px 0 rgba(232, 200, 117, 0.1);
  transition: transform 0.2s, box-shadow 0.25s, background 0.2s, border-color 0.2s;
  line-height: 1;
  font-family: inherit;
}

#muteBtn:hover {
  transform: scale(1.12);
  box-shadow: 0 0 26px rgba(200, 164, 90, 0.65), inset 0 1px 0 rgba(232, 200, 117, 0.2);
  background: linear-gradient(145deg, #5c2d0a, #3d1c02);
}

#muteBtn.muted {
  border-color: #4a2808;
  color: #6a4015;
  box-shadow: 0 0 6px rgba(200, 164, 90, 0.1);
}

#mainNav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 500;
  background: linear-gradient(180deg, #170700 0%, rgba(11, 4, 0, 0.97) 100%);
  border-bottom: 2px solid #c8a45a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
}

.nav-brand {
  font-family: 'Cinzel', Georgia, serif;
  color: #e8c875;
  font-size: 1rem;
  letter-spacing: 4px;
  text-shadow: 0 0 14px rgba(232, 200, 117, 0.45);
  user-select: none;
}

.nav-links {
  display: flex;
  gap: 6px;
}

.nav-link {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: #a07840;
  text-decoration: none;
  padding: 7px 18px;
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s, text-shadow 0.2s;
  display: inline-block;
}

.nav-link:hover {
  color: #e8c875;
  border-color: rgba(200, 164, 90, 0.45);
  background: rgba(200, 164, 90, 0.06);
  text-shadow: 0 0 8px rgba(232, 200, 117, 0.4);
}

.nav-link.active {
  color: #e8c875;
  border-color: #c8a45a;
  background: rgba(200, 164, 90, 0.1);
  text-shadow: 0 0 10px rgba(232, 200, 117, 0.55);
}

.tab-section {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-top: 64px;
}

.tab-section.visible {
  display: block;
  animation: tabIn 0.45s ease-out;
}

@keyframes tabIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.home-inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
  padding: 58px 24px 80px;
}

.hiero-bar {
  font-size: 1.3rem;
  color: #c8a45a;
  letter-spacing: 10px;
  margin: 22px 0;
  text-shadow: 0 0 10px rgba(200, 164, 90, 0.3);
  user-select: none;
}

.main-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 3.1rem;
  font-weight: 900;
  color: #e8c875;
  letter-spacing: 5px;
  line-height: 1.25;
  text-shadow: 0 0 28px rgba(232, 200, 117, 0.5), 2px 3px 8px rgba(0, 0, 0, 0.85);
  margin: 16px 0 12px;
}

.subtitle-small {
  display: block;
  font-size: 1.4rem;
  font-weight: 400;
  color: #c8a45a;
  letter-spacing: 9px;
  margin-top: 10px;
  text-shadow: 0 0 14px rgba(200, 164, 90, 0.4);
}

.pyramid-shape {
  width: 200px;
  height: 168px;
  margin: 36px auto 20px;
  background: linear-gradient(to bottom, #f0d485 0%, #c8a45a 45%, #8a6028 100%);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  filter: drop-shadow(0 0 18px rgba(200, 164, 90, 0.45));
  animation: pyramidGlow 3.5s ease-in-out infinite;
}

@keyframes pyramidGlow {
  0%, 100% {
    filter: drop-shadow(0 0 14px rgba(200, 164, 90, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 32px rgba(200, 164, 90, 0.85)) drop-shadow(0 0 55px rgba(232, 200, 117, 0.3));
  }
}

.home-credit {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: #e8c875;
  text-align: center;
  margin: 0 0 32px;
  text-shadow: 0 0 18px rgba(232, 200, 117, 0.6), 0 2px 6px rgba(0, 0, 0, 0.7);
}

.home-credit-sub {
  display: block;
  font-size: 0.88rem;
  font-weight: 400;
  color: #c8a45a;
  letter-spacing: 5px;
  margin-top: 7px;
  text-shadow: 0 0 12px rgba(200, 164, 90, 0.5);
}

.home-desc {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: #dbc48a;
  line-height: 1.9;
  max-width: 580px;
  margin: 22px auto;
  padding: 22px 30px;
  background: linear-gradient(
    135deg,
    rgba(92, 45, 10, 0.22) 0%,
    rgba(42, 18, 0, 0.18) 50%,
    rgba(61, 28, 2, 0.2) 100%
  );
  border-left: 3px solid #c8a45a;
  border-right: 3px solid #c8a45a;
  position: relative;
}

.home-desc::before {
  content: '𓆑';
  position: absolute;
  top: 7px;
  left: 10px;
  color: #c8a45a;
  font-size: 1.1rem;
  opacity: 0.55;
}

.home-desc::after {
  content: '𓆑';
  position: absolute;
  bottom: 7px;
  right: 10px;
  color: #c8a45a;
  font-size: 1.1rem;
  opacity: 0.55;
}

.enter-btn {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.9rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #1a0800;
  background: linear-gradient(135deg, #e8c875 0%, #c8a45a 55%, #a07830 100%);
  border: none;
  padding: 15px 42px;
  cursor: pointer;
  margin-top: 34px;
  box-shadow: 0 4px 20px rgba(200, 164, 90, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.25s, box-shadow 0.25s;
}

.enter-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(200, 164, 90, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.enter-btn:active {
  transform: translateY(-1px);
}

.pyramids-header {
  text-align: center;
  padding: 32px 20px 8px;
}

.pyramids-header h2 {
  font-family: 'Cinzel', Georgia, serif;
  color: #e8c875;
  font-size: 1.65rem;
  letter-spacing: 6px;
  text-shadow: 0 0 16px rgba(232, 200, 117, 0.4);
  margin: 0 0 6px;
}

.pyramids-header p {
  color: #a07840;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 0.88rem;
  margin: 0;
}

.pyramids-credit {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.75rem;
  letter-spacing: 3px;
  color: #c8a45a;
  margin: 8px 0 0;
  font-style: normal;
}

.pyramid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 18px;
  padding: 24px 30px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.pyramid-card {
  background: linear-gradient(155deg, #3a1a04 0%, #221000 60%, #160900 100%);
  border: 1px solid #3a1a02;
  border-top: 3px solid #c8a45a;
  padding: 20px 18px 15px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.22s;
}

.pyramid-card::after {
  content: '▲';
  position: absolute;
  bottom: -10px;
  right: 8px;
  font-size: 56px;
  color: rgba(200, 164, 90, 0.055);
  pointer-events: none;
  line-height: 1;
}

.pyramid-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 22px rgba(200, 164, 90, 0.14);
  border-color: #c8a45a;
  border-top-color: #e8c875;
}

.card-tri {
  display: block;
  font-size: 2rem;
  color: #c8a45a;
  text-align: center;
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(200, 164, 90, 0.3);
}

.card-name {
  font-family: 'Cinzel', Georgia, serif;
  color: #e8c875;
  font-size: 0.95rem;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 5px;
  line-height: 1.35;
}

.card-location {
  color: #d4aa65;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 0.88rem;
}

.card-tagline {
  color: #a07848;
  font-size: 0.84rem;
  font-family: 'IM Fell English', Georgia, serif;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #2a1000;
  line-height: 1.45;
}

.card-open {
  color: #4a2808;
  font-size: 0.72rem;
  font-family: 'Cinzel', Georgia, serif;
  text-align: right;
  margin-top: 10px;
  letter-spacing: 1px;
  transition: color 0.2s;
}

.pyramid-card:hover .card-open {
  color: #c8a45a;
}

.detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 600;
}

.detail-overlay.open {
  display: block;
  animation: overlayFadeIn 0.3s ease-out;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(680px, 94vw);
  height: 100vh;
  z-index: 700;
  background:
    radial-gradient(ellipse at 30% 10%, rgba(92, 45, 10, 0.2) 0%, transparent 50%),
    linear-gradient(160deg, #2c1400 0%, #180900 40%, #0c0400 100%);
  border-left: 3px solid #c8a45a;
  overflow-y: scroll;
  overscroll-behavior: contain;
  visibility: hidden;
  transform: translateX(110%);
  transition: transform 0.42s cubic-bezier(0.22, 0.61, 0.36, 1),
              visibility 0s linear 0.42s;
  box-shadow: -16px 0 55px rgba(0, 0, 0, 0.85);
}

.detail-panel.open {
  visibility: visible;
  transform: translateX(0);
  transition: transform 0.42s cubic-bezier(0.22, 0.61, 0.36, 1),
              visibility 0s;
}

.detail-panel::-webkit-scrollbar {
  width: 5px;
}

.detail-panel::-webkit-scrollbar-track {
  background: #0c0400;
}

.detail-panel::-webkit-scrollbar-thumb {
  background: #4a2808;
  border-radius: 3px;
}

.detail-inner {
  padding: 36px 32px 65px;
}

.close-btn {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.78rem;
  letter-spacing: 2px;
  color: #906030;
  background: transparent;
  border: 1px solid #3a1800;
  padding: 8px 20px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  margin-bottom: 22px;
  display: inline-block;
}

.close-btn:hover {
  color: #e8c875;
  border-color: #c8a45a;
  background: rgba(200, 164, 90, 0.08);
}

.detail-hiero {
  text-align: center;
  color: #c8a45a;
  font-size: 1rem;
  letter-spacing: 7px;
  opacity: 0.55;
  margin: 16px 0;
  user-select: none;
}

#detailTitle {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 900;
  color: #e8c875;
  letter-spacing: 2px;
  line-height: 1.3;
  text-shadow: 0 0 18px rgba(232, 200, 117, 0.4);
  margin: 10px 0 8px;
}

.detail-meta {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  color: #d4aa65;
  font-size: 1rem;
  margin-bottom: 12px;
}

.detail-badge {
  display: inline-block;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.68rem;
  letter-spacing: 3px;
  color: #e8c875;
  background: linear-gradient(135deg, #4a2008, #2a1000);
  border: 1px solid #c8a45a;
  padding: 5px 14px;
  margin-bottom: 20px;
}

.section-label {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.72rem;
  letter-spacing: 3px;
  color: #7a5025;
  text-transform: uppercase;
  margin-bottom: 8px;
  margin-top: 22px;
}

.bullet-list {
  list-style: none;
  padding: 16px 16px 16px 14px;
  margin: 0 0 8px;
  background: linear-gradient(145deg, rgba(92, 45, 10, 0.17), rgba(42, 18, 0, 0.14));
  border: 1px solid #2d1200;
  border-left: 4px solid #c8a45a;
  min-height: 100px;
}

.bullet-list li {
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 1.05rem;
  color: #eedda0;
  padding: 7px 0 7px 26px;
  position: relative;
  line-height: 1.85;
  outline: none;
  border-bottom: 1px solid rgba(61, 28, 2, 0.5);
}

.bullet-list li::before {
  content: '𓆑';
  position: absolute;
  left: 2px;
  top: 5px;
  color: #c8a45a;
  font-size: 0.88rem;
}

.meme-section {
  text-align: center;
  margin: 22px 0 10px;
  padding: 14px;
  background: rgba(200, 164, 90, 0.06);
  border: 1px dashed #c8a45a;
}

.meme-img {
  max-width: 220px;
  width: 80%;
  display: block;
  margin: 0 auto 10px;
  animation: memeBounce 0.7s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 12px rgba(200, 164, 90, 0.5));
}

@keyframes memeBounce {
  from { transform: rotate(-4deg) scale(1); }
  to   { transform: rotate(4deg) scale(1.06); }
}

.meme-caption {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: #e8c875;
  letter-spacing: 3px;
  text-shadow: 0 0 18px rgba(232, 200, 117, 0.8);
}

.meme-sub {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 0.85rem;
  color: #a07848;
  margin-top: 6px;
}

.editable-hint {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  color: #4a2808;
  font-size: 0.77rem;
  text-align: right;
  margin: 0 0 22px;
}

.sources-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 38px 28px 90px;
}

.sources-inner h2 {
  font-family: 'Cinzel', Georgia, serif;
  color: #e8c875;
  font-size: 1.65rem;
  letter-spacing: 4px;
  text-align: center;
  text-shadow: 0 0 16px rgba(232, 200, 117, 0.4);
  margin-bottom: 8px;
}

.sources-list {
  list-style: none;
  padding: 0;
  margin: 28px 0 12px;
  outline: none;
  cursor: text;
}

.sources-list:focus {
  outline: 1px dashed #3a1800;
}

.sources-list li {
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 1rem;
  color: #eedda0;
  padding: 14px 16px 14px 46px;
  border-bottom: 1px solid rgba(61, 28, 2, 0.65);
  position: relative;
  transition: background 0.2s;
  line-height: 1.7;
}

.sources-list li:hover {
  background: rgba(200, 164, 90, 0.04);
}

.sources-list li::before {
  content: '𓏛';
  position: absolute;
  left: 14px;
  top: 13px;
  color: #c8a45a;
  font-size: 0.9rem;
}

.sources-list em {
  color: #c8a45a;
  font-style: italic;
}

.source-link {
  display: inline-block;
  margin-left: 10px;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: #c8a45a;
  text-decoration: none;
  border-bottom: 1px solid rgba(200, 164, 90, 0.35);
  transition: color 0.2s, border-color 0.2s;
}

.source-link:hover {
  color: #e8c875;
  border-bottom-color: #e8c875;
}

@media (max-width: 620px) {
  .main-title {
    font-size: 1.9rem;
    letter-spacing: 3px;
  }

  .subtitle-small {
    font-size: 0.95rem;
    letter-spacing: 4px;
  }

  .home-inner {
    padding: 36px 16px 60px;
  }

  .pyramid-shape {
    width: 140px;
    height: 118px;
    margin: 24px auto 16px;
  }

  .home-credit {
    font-size: 0.95rem;
    letter-spacing: 2px;
    margin: 0 0 22px;
  }

  .home-credit-sub {
    font-size: 0.78rem;
    letter-spacing: 3px;
  }

  .home-desc {
    font-size: 0.95rem;
    padding: 16px 18px;
  }

  .enter-btn {
    font-size: 0.8rem;
    padding: 13px 28px;
    letter-spacing: 3px;
  }

  .hiero-bar {
    font-size: 0.95rem;
    letter-spacing: 5px;
  }

  #mainNav {
    padding: 0 14px;
  }

  .nav-brand {
    font-size: 0.72rem;
    letter-spacing: 2px;
  }

  .nav-link {
    font-size: 0.68rem;
    padding: 6px 9px;
    letter-spacing: 1px;
  }

  .pyramid-grid {
    padding: 14px 12px 80px;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .detail-panel {
    width: 88vw;
    border-left: 3px solid #c8a45a;
    border-top: none;
  }

  .detail-inner {
    padding: 22px 16px 55px;
  }

  #detailTitle {
    font-size: 1.2rem;
  }

  .bullet-list li {
    font-size: 0.95rem;
  }

  #muteBtn {
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    right: 16px;
    width: 46px;
    height: 46px;
  }
}
