/* === Gravity Falls Journal 3 Theme === */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: "Patrick Hand", cursive, Georgia, serif;
  background: #5c3a1e;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 20px,
      rgba(0,0,0,0.03) 20px,
      rgba(0,0,0,0.03) 40px
    );
  margin: 0;
  padding: 1.5rem 1rem;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

/* -- Journal outer cover -- */
.journal-cover {
  max-width: 760px;
  width: 100%;
  background: #8b1a1a;
  border-radius: 4px 12px 12px 4px;
  padding: 6px 6px 6px 0;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.5),
    inset 0 0 30px rgba(0,0,0,0.3);
  position: relative;
  display: flex;
}

/* -- Spine -- */
.journal-spine {
  width: 28px;
  flex-shrink: 0;
  background: #6b1414;
  border-radius: 4px 0 0 4px;
  background-image:
    linear-gradient(
      to right,
      rgba(0,0,0,0.3) 0%,
      transparent 40%,
      transparent 60%,
      rgba(0,0,0,0.15) 100%
    );
  box-shadow: inset -2px 0 4px rgba(0,0,0,0.2);
}

/* -- Journal page (parchment) -- */
.journal-page {
  flex: 1;
  background: #f4e4c1;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(210,180,130,0.3) 0%, transparent 70%),
    radial-gradient(ellipse at 80% 20%, rgba(180,150,100,0.2) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  border-radius: 0 10px 10px 0;
  padding: 2rem 2.5rem 2rem 2rem;
  color: #3a2a1a;
  position: relative;
  box-shadow: inset 3px 0 8px rgba(0,0,0,0.08);
  min-height: 80vh;
}

/* Aged edge staining */
.journal-page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 0 10px 10px 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 60px rgba(160,120,60,0.15),
    inset 0 0 120px rgba(120,80,30,0.08);
}

/* -- Header / Title -- */
header {
  text-align: center;
  padding: 0 0 0.5rem;
  position: relative;
}

.journal-number {
  font-family: "Griffy", cursive, serif;
  font-size: 4rem;
  color: #c9a44a;
  text-shadow:
    1px 1px 0 #8b6914,
    2px 2px 4px rgba(0,0,0,0.15);
  line-height: 1;
  margin-bottom: 0.15rem;
}

header h1 {
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 1.6rem;
  color: #3a2a1a;
  margin: 0 0 0.2rem;
  letter-spacing: 0.02em;
}

.subtitle {
  font-family: "Patrick Hand", cursive;
  font-size: 1.05rem;
  color: #7a6a5a;
  margin: 0;
  font-style: italic;
}

.header-rule {
  margin: 1rem auto 0;
  width: 60%;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent,
    #c9a44a 20%,
    #c9a44a 80%,
    transparent
  );
  opacity: 0.5;
}

/* -- Story text -- */
main {
  max-width: 100%;
  padding: 1rem 0 2rem;
}

#story-text p {
  font-size: 1.15rem;
  line-height: 1.75;
  margin: 0 0 1rem;
  color: #2e1e0e;
}

/* Simulate ink on parchment: first letter of first paragraph */
#story-text p:first-child::first-letter {
  font-family: "Griffy", cursive, serif;
  font-size: 2.4em;
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.1em 0 0;
  color: #8b1a1a;
}

/* -- Choice buttons (journal-style) -- */
#choices {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.choice-btn {
  background: rgba(201, 164, 74, 0.12);
  color: #3a2a1a;
  border: 2px solid #c9a44a;
  border-left: 5px solid #8b1a1a;
  padding: 0.8rem 1.1rem;
  font-size: 1.05rem;
  font-family: "Patrick Hand", cursive;
  border-radius: 2px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-left-color 0.15s, transform 0.1s;
  position: relative;
}

.choice-btn::before {
  content: "\27A4";
  margin-right: 0.5rem;
  color: #8b1a1a;
  font-size: 0.85em;
}

.choice-btn:hover {
  background: rgba(201, 164, 74, 0.25);
  border-left-color: #c9a44a;
  transform: translateX(4px);
}

.choice-btn:active {
  transform: translateX(2px);
  background: rgba(201, 164, 74, 0.35);
}

/* -- Restart button -- */
.restart-btn {
  text-align: center;
  border-color: #8b1a1a;
  border-left: 2px solid #8b1a1a;
  color: #8b1a1a;
  font-weight: bold;
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.restart-btn::before {
  content: "\21BB";
  color: #8b1a1a;
}

.restart-btn:hover {
  background: rgba(139, 26, 26, 0.1);
  border-left-color: #8b1a1a;
}

/* -- Ending badge -- */
.ending-badge {
  text-align: center;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 1.6rem;
  color: #8b1a1a;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  position: relative;
}

.ending-badge::before,
.ending-badge::after {
  content: "";
  display: inline-block;
  width: 40px;
  height: 2px;
  background: #c9a44a;
  vertical-align: middle;
  margin: 0 0.75rem;
}

/* -- Path tracker -- */
#path-tracker {
  padding: 0;
  margin-top: 1rem;
  border-top: 1px dashed rgba(160,120,60,0.3);
  padding-top: 1rem;
}

#path-tracker h3 {
  font-family: "Special Elite", "Courier New", monospace;
  color: #9a8a6a;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0 0 0.4rem;
}

#path-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.4rem;
  font-size: 0.78rem;
  color: #a09080;
  font-family: "Patrick Hand", cursive;
}

#path-list li::after {
  content: " \2192";
  color: #c9a44a;
}

#path-list li:last-child::after {
  content: "";
}

#path-list li.current {
  color: #8b1a1a;
  font-weight: bold;
}

/* -- Fan fiction disclaimer -- */
.header-rule::after {
  content: "Fan fiction — not affiliated with Disney or Gravity Falls";
  display: block;
  margin-top: 0.75rem;
  font-family: "Patrick Hand", cursive;
  font-size: 0.85rem;
  color: #5a4a3a;
  text-align: center;
  font-style: italic;
  letter-spacing: 0.03em;
}

/* -- Responsive -- */
@media (max-width: 600px) {
  body {
    padding: 0.5rem;
  }
  .journal-page {
    padding: 1.5rem 1.25rem 1.5rem 1rem;
  }
  .journal-spine {
    width: 16px;
  }
  .journal-number {
    font-size: 3rem;
  }
  header h1 {
    font-size: 1.3rem;
  }
}
