/* ============================================
   DOCTOR TALOS'S TRAVELING SHOW
   Adventure Styles — CYOA Gauges & Effects
   ============================================ */

/* --- Adventure Layout --- */
.adventure-container {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 2rem;
  align-items: start;
}

/* --- Story Panel --- */
.story-panel {
  min-height: 400px;
}

.story-text {
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
}

.story-text p {
  margin-bottom: 1em;
  text-align: justify;
  hyphens: auto;
}

.story-text .drop-cap::first-letter {
  float: left;
  font-size: 3.2em;
  line-height: 0.8;
  padding-right: 0.1em;
  color: var(--burgundy);
  font-weight: bold;
}

/* --- Choices --- */
.choices {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.choices li {
  margin: 0.75rem 0;
}

.choices button {
  display: block;
  width: 100%;
  padding: 0.8rem 1.2rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  color: var(--burgundy);
  background: rgba(240, 230, 208, 0.6);
  border: 1px solid var(--gold-dim);
  cursor: pointer;
  text-align: left;
  transition: all 0.3s ease;
  letter-spacing: 0.03em;
  line-height: 1.5;
}

.choices button:hover {
  background: var(--burgundy);
  color: var(--parchment);
  border-color: var(--burgundy);
  transform: translateX(5px);
  box-shadow: -3px 3px 0 var(--gold-dim);
}

.choices button::before {
  content: '▸ ';
  color: var(--gold);
}

.choices button:hover::before {
  color: var(--gold);
}

/* --- Side Panel (Gauges) --- */
.side-panel {
  position: sticky;
  top: 2rem;
}

.gauge {
  margin-bottom: 1.5rem;
  text-align: center;
}

.gauge-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--burgundy-deep);
  margin-bottom: 0.4rem;
  font-variant: small-caps;
}

.gauge-track {
  width: 100%;
  height: 18px;
  background: var(--shadow);
  border: 1px solid var(--gold-dim);
  position: relative;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  transition: width 0.8s ease, background-color 0.8s ease;
  position: relative;
}

/* Sun gauge — gold to red */
.gauge-sun .gauge-fill {
  background: linear-gradient(90deg, var(--blood), #cc6600, var(--gold));
}

.gauge-sun .gauge-fill.low {
  background: linear-gradient(90deg, #330000, var(--blood));
}

.gauge-sun .gauge-fill.critical {
  background: var(--blood);
  animation: sun-flicker 1s ease-in-out infinite;
}

@keyframes sun-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Sanity gauge — teal to unstable */
.gauge-sanity .gauge-fill {
  background: linear-gradient(90deg, var(--teal), var(--teal-glow));
}

.gauge-sanity .gauge-fill.low {
  background: linear-gradient(90deg, #1a4a4a, var(--teal));
  animation: sanity-pulse 2s ease-in-out infinite;
}

.gauge-sanity .gauge-fill.critical {
  background: var(--teal-glow);
  animation: sanity-glitch 0.5s ease-in-out infinite;
}

@keyframes sanity-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes sanity-glitch {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.gauge-value {
  font-size: 0.75rem;
  color: var(--gold-dim);
  margin-top: 0.2rem;
}

/* --- Death Counter --- */
.death-counter {
  text-align: center;
  font-size: 0.75rem;
  color: var(--gold-dim);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gold-dim);
  font-variant: small-caps;
  letter-spacing: 0.08em;
}

.death-counter .count {
  color: var(--blood);
  font-size: 1.1rem;
  font-weight: bold;
}

/* --- Ending Screen --- */
.ending-screen {
  text-align: center;
  padding: 2rem;
}

.ending-screen h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--burgundy);
}

.ending-screen .ending-type {
  font-variant: small-caps;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.ending-screen .ending-text {
  font-style: italic;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.play-again-btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  color: var(--parchment);
  background: var(--burgundy);
  border: 1px solid var(--gold);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
}

.play-again-btn:hover {
  background: var(--burgundy-deep);
  box-shadow: 0 0 15px rgba(196, 162, 62, 0.3);
}

/* --- Sanity Distortion Effects --- */
.sanity-low .story-text {
  animation: text-wobble 8s ease-in-out infinite;
}

.sanity-critical .story-text {
  animation: text-melt 3s ease-in-out infinite;
  color: var(--burgundy-deep);
}

.sanity-critical .story-text::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 3px,
    rgba(46, 139, 139, 0.03) 3px,
    rgba(46, 139, 139, 0.03) 4px
  );
  pointer-events: none;
  animation: scanlines 0.1s linear infinite;
}

@keyframes text-wobble {
  0%, 100% { transform: none; }
  25% { transform: skewX(0.3deg); }
  50% { transform: skewX(-0.2deg) translateX(1px); }
  75% { transform: skewX(0.1deg); }
}

@keyframes text-melt {
  0%, 100% { transform: none; filter: none; }
  30% { transform: skewX(1deg) skewY(0.3deg); filter: hue-rotate(10deg); }
  60% { transform: skewX(-0.5deg) translateY(1px); filter: hue-rotate(-5deg); }
}

@keyframes scanlines {
  from { background-position: 0 0; }
  to { background-position: 0 4px; }
}

/* --- Returning Player Notice --- */
.returning-notice {
  font-style: italic;
  text-align: center;
  color: var(--teal);
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: 1px dashed var(--teal);
  background: rgba(46, 139, 139, 0.05);
  font-size: 0.95rem;
}

/* --- Responsive --- */
@media (max-width: 700px) {
  .adventure-container {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gold-dim);
    margin-bottom: 1rem;
  }

  .gauge {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
    margin-bottom: 0;
  }

  .death-counter {
    flex-basis: 100%;
    margin-top: 0;
    padding-top: 0.5rem;
    border-top: none;
  }
}
