/* RESET & GLOBALS */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  /* Keep a dark "night mode" background */
  background-color: #121212;
  color: #cccccc;
  font-family: 'Inter', sans-serif;
  font-optical-sizing: auto;
  font-weight: 450;
  font-style: normal;
  min-height: 100vh;
  margin: 0;
}

/* NAVBAR */
.top-nav {
  background-color: #1f1f1f;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
}

.nav-title {
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .nav-links a {
    font-size: 0.8rem;  /* Make them smaller so they fit */
    margin-left: 0;     /* Remove extra margin so they stay in one line */
  }
  /* If needed, reduce .nav-title font size, too */
  .nav-title {
    font-size: 1rem;
  }
}

.nav-links a {
  color: #ffffff;
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.nav-links a:hover {
  opacity: 0.7;
}

/* HERO SECTION */
/* Use a more vibrant teal/blue gradient for contrast */
.home-hero-section {
  background: linear-gradient(135deg, #0F2027 0%, #203A43 50%, #2C5364 100%);
  padding: 5rem 2rem;
  text-align: center;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #ffffff;
}

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.5;
  max-width: 600px;
  margin: 0 auto 2rem auto;
  color: #ececec;
}

.hero-button {
  background-color: #ffda79;
  color: #333;
  border: none;
  border-radius: 40px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.hero-button:hover {
  background-color: #ffcf50;
  transform: scale(1.02);
}

.hero-button:focus {
  outline: none;
}

/* INFO SECTION */
.info-section {
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
  padding: 2rem 1rem;
}

.info-container {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  max-width: 750px;
  margin: 0 auto;
  padding: 2rem;
  line-height: 1.6;
  text-align: left;
}


.info-container h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #ffffff;
  text-align: left;
}

.info-text {
  font-size: 1.2rem;
  color: #cccccc;
  margin-bottom: 1.5rem;
  line-height: 1.4;
  font-family: 'Inter', sans-serif;
  /* font-family: 'Roboto Slab', serif; */
  /* font-family: 'Poppins', sans-serif; */
  font-weight: 200;
  font-style: normal;
  /* color: white; */
}

.info-text strong {
  color: #ffffff;
  font-weight: 400;
}

.info-text a {
  color: #3298dc;
  text-decoration: none;
}

.info-text a:hover {
  text-decoration: underline;
}

/* .info-text em {
  color: #bbbbbb;
} */

/* GAME CONTAINER */
#game-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* PROMPT & TASK SCREEN */
.screen {
  display: block;
  background-color: transparent;
}

/* PROMPT CONTAINER */
.task-instructions-container {
  /* Slightly lighter background “card” for instructions */
  background: #1f1f1f;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  margin-bottom: 1rem;
  margin-top: 1.2rem;
}


.task-steps {
  border-left: 4px solid #3298dc;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #cccccc;
  padding: 0.5rem 1rem;
  background-color: #2a2a2a;
}

.task-steps h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: #ffffff;
}

.task-steps p {
  margin-bottom: 10px;
}

.task-steps ol {
  list-style: none;
  padding-left: 0;
  counter-reset: step;
}

.task-steps ol li {
  position: relative;
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
}

.task-steps ol li::before {
  counter-increment: step;
  content: counter(step) ".";
  position: absolute;
  left: 0;
  top: 0.1rem;
  color: #3298dc;
  font-weight: 600;
}

/* Attempts Indicator */
.attempt-indicator-container {
  margin: 1rem 0;
  text-align: center;
}

.attempt-indicator-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.attempt-progress-bar-container {
  width: 100%;
  background-color: #333333;
  height: 8px;
  border-radius: 4px;
  position: relative;
  max-width: 400px;
  margin: 0 auto;
}

.attempt-progress-bar {
  height: 100%;
  width: 0%;
  background-color: #3298dc;
  border-radius: 4px;
  transition: width 0.3s ease-in-out;
}

/* Prompt Grid */
.prompt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 1rem;
}

.left-column,
.right-column {
  background: #1f1f1f;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  padding: 1rem;
  text-align: center;
}

.left-column h3,
.right-column h3 {
  color: #ffffff;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  border-bottom: 1px solid #333333;
  padding-bottom: 0.5rem;
}

.goal-image-container {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.goal-image-container img {
  width: 70%;
  max-width: 300px;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.generated-image-section {
  text-align: center;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.generated-image-section img {
  width: 70%;
  max-width: 300px;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.right-column {
  visibility: hidden;
}

/* Prompt + Button */
.prompt-container {
  background: #1f1f1f;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  margin-bottom: 1.5rem;
  margin-top: 1rem;
}

.prompt-container textarea {
  width: 100%;
  min-height: 70px;
  max-height: 220px;
  padding: 0.75rem;
  font-size: 14px;
  border: 2px solid #333333;
  border-radius: 6px;
  margin-bottom: 0.6rem;
  resize: none;
  outline: none;
  background-color: #2a2a2a;
  color: #ffffff;
}

.prompt-container textarea:focus {
  border-color: #3298dc;
  box-shadow: 0 0 0 2px rgba(50,152,220, 0.2);
}

.prompt-container textarea:disabled {
  color: #777777;
  background-color: #2a2a2a;
  cursor: not-allowed;
}

.gen-button {
  background-color: #3298dc;
  color: #ffffff;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.gen-button:hover:enabled {
  background-color: #2787c8;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.gen-button:disabled {
  background-color: #555555;
  cursor: not-allowed;
  opacity: 0.7;
}

/* LOADING SPINNER */
.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
}

.loading-text {
  margin-top: 0.5rem;
  font-style: italic;
  text-align: center;
  color: #cccccc;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #3a3a3a;
  border-top: 3px solid #3298dc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* COMPARISON MODAL */
.modal-overlay {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: #1f1f1f;
  padding: 2rem;
  border-radius: 6px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  text-align: center;
  /* color: #cccccc; */
  /* box-shadow: 0 4px 15px rgba(0,0,0,0.4); */
}

.comparison-instructions {
  margin-top: 1rem;
  padding: 1rem;
  background: #383838;
  text-align: left;
  font-size: 1rem;
  line-height: 1.5;
  color: #cccccc;
}

.thank-you-message h3 {
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.thank-you-message p {
  margin-bottom: 1rem;
  color: #cccccc;
}

/* COMPARISON GRID & CARDS */
.comparison-grid {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.pair-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1rem 0;
}

.pair-heading {
  text-align: center;
  margin-bottom: 0.5rem;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
}

.compare-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  border: 2px solid #333333;
  border-radius: 6px;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
  max-width: 370px;
  background-color: #2a2a2a;
}

.compare-card.selected {
  border-color: #3298dc;
  box-shadow: 0 0 10px rgba(50,152,220,0.4);
}

.small-img {
  max-width: 150px;
  height: auto;
  border-radius: 4px;
  margin: 0 0.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ACTION BUTTON */
.action-button {
  background-color: #3298dc;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  font-weight: 600;
  margin-top: 8px; 
}

.action-button:hover:enabled {
  background-color: #2787c8;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.action-button:disabled {
  background-color: #555555;
  cursor: not-allowed;
  opacity: 0.7;
}

/* LEADERBOARD */
.leaderboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
  text-align: left;
  color: #cccccc;
}

.leaderboard-col p {
  margin-bottom: 0.5rem;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background-color: #1f1f1f;
  color: #cccccc;
}

.leaderboard-table th,
.leaderboard-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #333333;
}

.leaderboard-table tbody tr:hover {
  background-color: #2a2a2a;
}

.leaderboard-container {
  background-color: #1f1f1f;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.leaderboard-container h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #ffffff;
}

.leaderboard-container a {
  color: #3298dc;
}

.close-modal-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  color: #cccccc;
  font-size: 24px;
  border: none;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.close-modal-btn:hover {
  opacity: 1;
}

.close-modal-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}


/* Tooltip container */
.hover-tooltip-container {
  position: relative;
  /* Use block or inline-block depending on how you want it laid out. 
     Block ensures it takes the full width and aligns to the left, 
     while inline-block can still be left-aligned if its parent isn’t centering it. */
  display: block;  
  cursor: pointer;
  color: #3298dc;
  font-weight: 500;
  text-decoration: underline;
  margin-top: 0rem;

  /* If your parent container is center-aligned, override it: */
  text-align: left;
  font-size: 0.8rem;
}

/* The hidden tooltip popup */
.hover-tooltip-container .hover-tooltip-popup {
  font-size: 0.85rem;  /* smaller font size */
  visibility: hidden;
  opacity: 0;
  background-color: #333333;
  color: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  position: absolute;
  z-index: 1;
  bottom: 125%; 
  left: 0; 
  transform: none;
  transition: visibility 0.2s, opacity 0.2s;
  max-width: 250px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

/* A small arrow at the bottom of the tooltip */
.hover-tooltip-container .hover-tooltip-popup::after {
  content: "";
  position: absolute;
  top: 100%;        /* place the arrow below the tooltip box */
  left: 10px;       /* slightly in from the left edge */
  border-width: 6px;
  border-style: solid;
  border-color: #333333 transparent transparent transparent;
}

/* Show the tooltip on hover */
.hover-tooltip-container:hover .hover-tooltip-popup {
  visibility: visible;
  opacity: 1;
}

/* Toast container: fixed at top, center-aligned */
.toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Individual toast message styling */
.toast-message {
  background-color: #333;
  color: #fff;
  padding: 0.75rem 1.25rem;
  margin-top: 0.5rem;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  opacity: 0;       /* Start hidden; fade in via transition */
  transition: opacity 0.4s ease;
}
.toast-message.show {
  opacity: 0.95;
}

.share-button {
  margin-left: 1rem;
  background-color: #ff5678; /* or any color */
  /* etc. */
}

#scoreChart {
  display: none;
  margin-bottom: 0.0rem; /* or 0, if you want it flush */
}
