@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400;500;600&display=swap');

:root {
    --bg-color: #000;
    --text-color: #f0f0f0;
    --accent-color: #666;
    --highlight-color: #ffffff;
    --highlight-bg: rgba(255, 255, 255, 0.07);
    --box-size: 40px;
    --grid-gap: 4px;
    --glow-color: rgba(255, 255, 255, 0.1);
    --accent-pink: #FF69B4;
    --accent-pink-light: rgba(255, 105, 180, 0.5);
  }
  
  body {
    margin: 0;
    padding: 0;
    font-family: "Work Sans", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
  }
  
  .main-container {
    display: flex;
    width: 100%;
  }
  
  .sidebar {
    width: 80px;
    background-color: var(--bg-color);
    /*! padding: 20px 10px; */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    left: 0;
    height: 100vh;
  }
  
  .entry-link {
    padding: 12px;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 1px;
    border-radius: 50%;
    height: 20px;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Space Mono", monospace;
  }
  
  .sidebar .entry-link {
    color: var(--accent-color);
    transition: all 0.3s ease;
    position: relative;
  }
  
  .sidebar .entry-link.completed {
    color: #4CAF50;
  }
  
  .sidebar .entry-link:hover {
    color: #fff;
    background-color: var(--highlight-bg);
    transform: translateY(-5px);
  }
  
  .entry-link:active {
    transform: scale(0.95) translateY(-2px);
  }
  
  .content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  
  .grid-container {
    position: relative;
    display: grid;
    grid-template-columns: repeat(7, var(--box-size));
    grid-template-rows: repeat(7, var(--box-size));
    gap: var(--grid-gap);
    border: 1px solid var(--accent-color);
    padding: 5px;
    margin-bottom: 30px;
    transition: transform 0.3s ease;
  }
  
  .grid-container:hover {
    transform: scale(1.02);
  }
  
  .row-number {
    position: absolute;
    left: -30px;
    width: 20px;
    height: var(--box-size);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Space Mono", monospace;
    color: var(--accent-color);
  }
  
  .grid-cell {
    width: var(--box-size);
    height: var(--box-size);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
  }
  
  .grid-cell:hover {
    border-color: var(--highlight-color);
  }
  
  .grid-cell input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--text-color);
    text-align: center;
    font-size: 20px;
    font-family: "Space Mono", monospace;
    text-transform: uppercase;
    outline: none;
    transition: color 0.3s ease, background-color 0.3s ease;
  }
  
  .grid-cell input:focus {
    background-color: rgba(255, 255, 255, 0.05);
  }
  
  .check-button {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    letter-spacing: 1px;
    margin-top: 20px;
    border-radius: 30px;
  }
  
  .check-button:hover {
    color: var(--text-color);
    border-color: var(--highlight-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
  }
  
  .check-button:active {
    transform: translateY(0);
  }
  
  /* Sections container - now for popup */
  .sections-container {
    max-width: 600px;
    margin-top: 20px;
  }
  
  .entry-section {
    display: none; /* Hide all sections by default */
    padding: 25px;
    background-color: rgba(42, 42, 42, 0.5);
    border-radius: 8px;
    text-align: left;
    line-height: 1.6;
    animation: fadeIn 0.4s ease-out;
    margin-top: 20px;
  }
  
  .entry-section.active {
    display: block; /* Show only the active section */
  }
  
  .entry-section h3 {
    font-family: "Space Mono", monospace;
    margin-top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    margin-bottom: 15px;
  }
  
  .entry-section p {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
  }
  
  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    flex-direction: column;
    padding: 0 20px;
  }
  
  .overlay.active {
    opacity: 1;
    pointer-events: all;
    animation: fadeIn 0.4s ease;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  .close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    z-index: 10;
  }
  
  .close-modal:hover {
    opacity: 1;
    transform: scale(1.2);
  }
  
  .entry-number {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 16px;
    font-family: "Space Mono", monospace;
    opacity: 0.6;
  }
  
  .modal-content {
    margin-bottom: 20px;
    animation: slideUp 0.4s ease;
    max-width: 600px;
    width: 100%;
  }
  
  @keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  
  .hints-container {
    margin-top: 20px;
    width: 100%;
  }
  
  .hint {
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
  }
  
  .hint:hover {
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
  }
  
  .solution-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
  
  canvas {
    position: absolute;
    top: 0;
    left: 0;
  }
  
  .success-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.97);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
  }
  
  .success-message.active {
    opacity: 1;
    pointer-events: all;
  }
  
  .success-message h2 {
    animation: pulse 2s infinite;
  }
  
  @keyframes pulse {
    0% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.7; transform: scale(1); }
  }
  
  .final-phrase {
    font-size: 28px;
    margin: 30px 0;
    letter-spacing: 3px;
    font-family: "Space Mono", monospace;
    text-align: center;
    position: relative;
    animation: fadeIn 1s ease-out;
  }
  
  .final-phrase::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 1px;
    background-color: var(--highlight-color);
    box-shadow: 0 0 10px var(--glow-color);
  }
  
  .selected-letters {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.8;
    font-family: "Work sans", sans-serif;
    font-weight: 300;
    animation: slideUp 0.5s ease-out 0.5s both;
  }
  
  /* Numbered cells */
  .grid-cell-number {
    position: absolute;
    top: -20px;
    left: -10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-family: "Space Mono", monospace;
  }
  
  /* Correct and incorrect animations */
  .correct-animation {
    animation: correctAnimation 0.5s forwards;
  }
  
  .incorrect-animation {
    animation: incorrectAnimation 0.5s forwards;
  }
  
  @keyframes correctAnimation {
    0% {
      color: var(--text-color);
    }
    50% {
      color: #4caf50;
      text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    }
    100% {
      color: var(--text-color);
    }
  }
  
  @keyframes incorrectAnimation {
    0% {
      color: var(--text-color);
    }
    50% {
      color: #f44336;
      text-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
    }
    100% {
      color: var(--text-color);
    }
  }
  
  /* Top popup notification */
  .popup-notification {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background-color: rgba(20, 20, 20, 0.9);
    color: #fff;
    padding: 15px 30px;
    border-radius: 0 0 15px 15px;
    font-family: "Space Mono", monospace;
    z-index: 1000;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }
  
  .popup-notification.show {
    transform: translateX(-50%) translateY(0);
  }
  
  /* Cell focus effect */
  .grid-cell.focused {
    border: 1px solid var(--highlight-color);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    animation: focusPulse 1.5s infinite;
  }
  
  @keyframes focusPulse {
    0% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.1); }
    50% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
    100% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.1); }
  }
  
  @media (max-width: 768px) {
    .main-container {
      flex-direction: column;
    }
  
    .sidebar {
      width: 100%;
      flex-direction: row;
      justify-content: center;
      flex-wrap: wrap;
      position: fixed;
      top: auto;
      bottom: 0;
      left: 0;
      height: auto;
      margin: 0;
      z-index: 50;
      background-color: rgba(0, 0, 0, 0.9);
      box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    }
    
    .entry-link {
      margin: 0 5px;
      padding: 10px;
      font-size: 16px;
    }
  
    :root {
      --box-size: 30px;
      --grid-gap: 3px;
    }
  
    .content {
      padding: 20px;
      margin-bottom: 70px;
    }
    
    .popup-notification {
      width: 80%;
      font-size: 14px;
    }
  }

  /* Riddle content styles */
.riddle-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  min-height: 300px;
}

.page {
  animation: fadeIn 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

blockquote {
    color: crimson;
    padding: 5px 25px;
  text-align: left;
    margin: 20px 0;
font-weight: 300;
font-size: 1.5rem;    
font-style: italic;
    border-radius: 4px;
  width: auto;
}

blockquote::before {
    content: '“';
    position: absolute;
    left: 0px;
    top: 0px;
font-size: 3rem;
    color: crimson;
    font-family: Georgia, serif;
}

.page img {
  max-width: 100%;
  max-height: 80vh;
}

/* Page navigation */
.page-navigation {
}

.page-nav-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 20px;
}

.page-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  margin: 0 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-dot:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

.page-dot.active {
  background-color: var(--text-color);
  transform: scale(1.2);
}

.page-nav-arrow {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-color);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-nav-arrow:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.page-nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.hint-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.hint-button {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.hint-button:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.2);
}

.hint-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint-content {
  margin-top: 15px;
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  animation: fadeIn 0.4s ease;
}

/* Loading indicator */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: rgba(255, 255, 255, 0.7);
}

.loading:after {
  content: ".";
  animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
  0%, 20% { content: "."; }
  40% { content: ".."; }
  60% { content: "..."; }
  80%, 100% { content: ""; }
}

/* Error message */
.error {
  padding: 20px;
  background-color: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  border-radius: 4px;
  color: #f44336;
  text-align: center;
}



/* Modify completed entries to use pink instead of green */
.sidebar .entry-link.completed {
  color: var(--accent-pink);
}

/* Update animations to use pink color */
@keyframes correctAnimation {
  0% {
      color: var(--text-color);
  }
  50% {
      color: var(--accent-pink);
      text-shadow: 0 0 10px var(--accent-pink-light);
  }
  100% {
      color: var(--text-color);
  }
}

/* Hint section centered at the top */
.hint-section {
  text-align: center;
  width: auto;
  position: fixed;
  right: 51px;
  top: 5px;
}

.hint-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.hint-button {
  background-color: rgba(255, 255, 255, 0);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-color);
  padding: 6px 10px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.3s ease;
}

.hint-button:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.2);
}

.hint-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Page navigation centered at bottom */
.page-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  left: 50%;
  bottom: 0;
  padding-bottom: 1rem;
  transform: translateX(-50%);
}

/* Success message below grid instead of fullscreen */
.success-container {
  margin-top: 30px;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  text-align: center;
  max-width: 100%;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.selected-letters {
  font-size: 18px;
  margin-bottom: 15px;
  color: var(--accent-pink);
  font-weight: 600;
}

.word-template {
  font-size: 24px;
  font-family: "Space Mono", monospace;
  letter-spacing: 2px;
  color: var(--text-color);
  margin-top: 10px;
}