* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
  height: 100%;
  width: 100%;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #1a1d2e;
  color: #e6f3ff;
  overflow: hidden;
}

.container {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #1a1d2e;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Dark mode warning */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
}

/* Respect the hidden attribute: some browsers' default hides can be overridden by author CSS; ensure hidden truly hides */
.modal-overlay[hidden] {
  display: none !important;
}

/* Fade-out animation for when modal closes */
.modal-overlay {
  opacity: 1;
  transition: opacity 320ms cubic-bezier(.22,.9,.35,1), transform 320ms cubic-bezier(.22,.9,.35,1);
}
.modal-overlay.modal-closing {
  opacity: 0;
  transform: scale(0.995);
  pointer-events: none;
}

.modal-card {
  background: #252a3d;
  border: 1px solid #3a4157;
  color: #e6e6e6;
  padding: 22px 26px;
  border-radius: 8px;
  min-width: 320px;
  max-width: 520px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  text-align: left;
}

.modal-card h2 {
  margin-bottom: 8px;
  font-size: 1.1rem;
  color: #fff;
}

.modal-card p {
  font-size: 0.95rem;
  line-height: 1.4;
  color: #d4d4d9;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.grim-btn {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #3a4157;
  background: #2d3548;
  color: #e6e6e6;
  cursor: pointer;
  font-weight: 500;
}

.grim-btn.yes {
  background: #a8d5f2;
  color: #2d3748;
  border-color: #7fb3d6;
}

.grim-btn.no {
  background: #d4c5f9;
  color: #2d3748;
  border-color: #b8a3e8;
}

.grim-btn:focus { outline: 2px solid #a8d5f2; outline-offset: 2px; }

/* When modal is visible, slightly dim and blur the main content behind it */
body.modal-open .container,
body.modal-open .connection-line,
body.modal-open .glass-window {
  filter: blur(6px) brightness(0.6);
  pointer-events: none;
}

/* Hidden redirect link (not visible in DOM until triggered) */
.hidden-redirect { display: none; }

/* Center circular glass window */
.glass-window {
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(37, 42, 61, 0.4);
  border: 2px solid #3a4157;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  position: relative;
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.inner-space {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: inherit;
}

.glass-reflection {
  position: absolute;
  top: 10%;
  left: 15%;
  width: 30%;
  height: 40%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.6;
}

.glass-highlight {
  position: absolute;
  top: 20%;
  right: 20%;
  width: 15%;
  height: 20%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0.5;
}

@keyframes glassShimmer {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.7; }
}

.seeker-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(37, 42, 61, 0.95);
  border: 2px solid #3a4157;
  border-radius: 12px;
  padding: 20px 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  width: 350px;
  max-width: 350px;
  max-height: 300px;
  min-height: 100px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  z-index: 10;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.seeker-card.flipping {
  animation: cardFade 1.2s ease-in-out;
}

.seeker-card.fading-out {
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.seeker-card.fading-in {
  opacity: 1;
  transition: opacity 0.6s ease-in-out;
}

@keyframes cardFade {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.seeker-card.visible {
  opacity: 1;
}

.quote-mark {
  font-size: 2.5rem;
  color: #a8d5f2;
  font-weight: bold;
  position: absolute;
  line-height: 0.8;
}

.quote-mark.left {
  top: 8px;
  left: 12px;
}

.quote-mark.right {
  bottom: 8px;
  right: 12px;
  transform: rotate(180deg);
}

.dialogue-text {
  font-size: 1rem;
  color: #f0f4f8;
  line-height: 1.3; 
  margin: 15px 0; 
  padding: 5px 10px;
  letter-spacing: 0.3px; 
  transition: all 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-height: 220px; 
  overflow-y: auto; 
  flex: 1; 
  display: block;
  text-align: center;
}

/* Dialogue mood animations and effects */
.dialogue-text.shaking {
  animation: shake 0.5s ease-in-out infinite;
}

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

/* Special dialogue text effects for different moods */
.dialogue-text[style*="panicked"] {
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.dialogue-text[style*="dramatic"] {
  animation: dramaticPulse 2s ease-in-out infinite;
}

@keyframes dramaticPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.options-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.6s ease-in-out;
}

.options-container.fading-out {
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.options-container.fading-in {
  opacity: 1;
  transition: opacity 0.6s ease-in-out;
}

.option-btn {
  position: absolute;
  background: #a8d5f2;
  color: #2d3748;
  border: 1px solid #7fb3d6;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(5px);
  pointer-events: auto;
  white-space: nowrap;
  min-width: 100px;
  transform-origin: center;
}

.option-btn:hover,
.option-btn.highlighted {
    transform: scale(1.03);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

/* Option button tone-based styling */
.option-btn.encouraging {
  background: #b8e6c9;
  border-color: #8fcba6;
}

.option-btn.encouraging:hover {
  background: #a3ddb5;
}

.option-btn.discouraging {
  background: #f5c4c8;
  border-color: #e89fa5;
}

.option-btn.discouraging:hover {
  background: #f0adb3;
}

.option-btn.mysterious {
  background: #d4c5f9;
  border-color: #b8a3e8;
}

.option-btn.mysterious:hover {
  background: #c5b3f0;
}

.option-btn.wise {
  background: #a8d5f2;
  border-color: #7fb3d6;
}

.option-btn.wise:hover {
  background: #93c9ed;
}

.option-btn.chaotic {
  background: #f9d4f4;
  border-color: #ecb3e3;
}

.option-btn.chaotic:hover {
  background: #f5c4ef;
}

.option-btn.practical {
  background: #ffd4a3;
  border-color: #f0b87a;
}

.option-btn.practical:hover {
  background: #ffc78f;
}

.option-btn.grounding {
  background: #c4d9f2;
  border-color: #a3bfe8;
}

.option-btn.grounding:hover {
  background: #b3cded;
}

.option-btn.absurd {
  background: #fff4c4;
  border-color: #f5e8a3;
}

.option-btn.absurd:hover {
  background: #ffefb3;
}

.option-btn.dark {
  background: #d4d4d9;
  border-color: #b3b3ba;
  color: #4a5568;
}

.option-btn.dark:hover {
  background: #c4c4cc;
  color: #2d3748;
}

.option-btn.dreamy {
  background: #ffd4cc;
  border-color: #f5b8ad;
}

.option-btn.dreamy:hover {
  background: #ffc4ba;
}

.option-btn.modern {
  background: #b8f2e6;
  border-color: #8fe6d4;
}

.option-btn.modern:hover {
  background: #a3eddb;
}

.option-btn.responsible {
  background: #c4c9f9;
  border-color: #a3abed;
}

.option-btn.responsible:hover {
  background: #b3bdf5;
}

/* Special ending button styles */
.option-btn.restart {
  background: #b8f2f2;
  border-color: #8fe6e6;
}

.option-btn.restart:hover {
  background: #a3eded;
}

.option-btn.summary {
  background: #fff4c4;
  border-color: #f5e8a3;
}

.option-btn.summary:hover {
  background: #ffefb3;
}

/* Tone styles for expanded dialogue options */
.option-btn.helpful {
  background: #c4d9f2;
  border-color: #a3bfe8;
}

.option-btn.helpful:hover {
  background: #b3cded;
}

.option-btn.understanding {
  background: #d9c4f2;
  border-color: #c4a3e8;
}

.option-btn.understanding:hover {
  background: #cdb3ed;
}

.option-btn.comedic {
  background: #ffe6c4;
  border-color: #f5d4a3;
}

.option-btn.comedic:hover {
  background: #ffddb3;
}

.option-btn.curious {
  background: #f9c4d9;
  border-color: #efa3c4;
}

.option-btn.curious:hover {
  background: #f5b3cd;
}

.option-btn.creative {
  background: #e6d4f9;
  border-color: #d4b8f0;
}

.option-btn.creative:hover {
  background: #dbc4f5;
}

.option-btn.brave {
  background: #ffccc4;
  border-color: #f5ada3;
}

.option-btn.brave:hover {
  background: #ffbab3;
}

.option-btn.scientific {
  background: #c4c9f9;
  border-color: #a3abed;
}

.option-btn.scientific:hover {
  background: #b3bdf5;
}

.option-btn.entrepreneurial {
  background: #c4f2d4;
  border-color: #a3e8b8;
}

.option-btn.entrepreneurial:hover {
  background: #b3edc4;
}

.option-btn.clever {
  background: #b8f2e6;
  border-color: #8fe6d4;
}

.option-btn.clever:hover {
  background: #a3eddb;
}

.option-btn.artistic {
  background: #f9c4d9;
  border-color: #efa3c4;
}

.option-btn.artistic:hover {
  background: #f5b3cd;
}

.option-btn.motivational {
  background: #ffd9c4;
  border-color: #f5c4a3;
}

.option-btn.motivational:hover {
  background: #ffcdb3;
}.connection-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

#connection-path {
    fill: none;
    stroke: #a8d5f2;
    stroke-width: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes connectionFlow {
    0%, 100% { 
        stroke-opacity: 0.6;
        stroke-width: 2;
    }
    50% { 
        stroke-opacity: 0.8;
        stroke-width: 2.5;
    }
}

@media (max-width: 768px) {
  .glass-window {
    width: 90vw;
    height: 90vh;
  }
  
  .seeker-card {
    width: 280px;
    max-width: 280px;
    max-height: 250px;
    padding: 15px 20px;
  }
  
  .dialogue-text {
    font-size: 0.9rem;
    line-height: 1.2;
    margin: 10px 0;
  }
  
  .quote-mark {
    font-size: 2rem;
  }
  
  .option-btn {
    font-size: 0.9rem;
    padding: 10px 16px;
    min-width: 100px;
  }
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(58, 65, 87, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(168, 213, 242, 0.4);
  border-radius: 3px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 213, 242, 0.6);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 213, 242, 0.4) rgba(58, 65, 87, 0.3);
}