/* ====================== */
/*  BASE STYLES           */
/* ====================== */
body {
  margin: 0;
  padding: 0;
  background-color: #000;
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  color: white;
  overflow-x: hidden;
  touch-action: pan-y;
  min-height: 300vh; /* Allows scrolling 2-3 pages down */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
body::-webkit-scrollbar {
  width: 10px;
  background-color: transparent;
}

body::-webkit-scrollbar-thumb {
  background-color: #333;
  border-radius: 5px;
  transition: opacity 0.3s ease;
}

body::-webkit-scrollbar-thumb:hover {
  background-color: #444;
}

body.scrollbar-hidden::-webkit-scrollbar-thumb {
  opacity: 0;
}

/* ====================== */
/*  CANVAS STYLES         */
/* ====================== */
#drawing-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;   /* CSS size */
  height: 300vh;  /* CSS size for tall page */
  z-index: 1;
  pointer-events: auto;
  opacity: 0.9;
  /* IMPORTANT: remove GPU pre-transform to keep pointer math exact */
  /* was: will-change: transform; */
}

/* ====================== */
/*  UI ELEMENT STYLES     */
/* ====================== */
#elo-display,
#email-display {
  position: fixed;
  z-index: 100;
  pointer-events: none;
}

#elo-display {
  top: 10px;
  left: 20px;
  color: #aaa;
  font-size: 1rem;
}

#email-display {
  top: 10px;
  right: 20px;
  color: #aaa;
  font-size: 1rem;
}

/* Toggle button - FIXED POSITION so it stays visible */
#toggle-question-btn {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #121212;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  z-index: 102;
  pointer-events: auto;
  transition: all 0.2s ease;
}

#toggle-question-btn:hover {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Question container - FIXED with minimal top padding */
#question-container {
  position: fixed;
  top: 110px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 0 24px;
  z-index: 101;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none; /* draw through the question box */
}

.question-box {
  background-color: rgba(18, 18, 18, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px 28px;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  text-align: center;
  word-wrap: break-word;
  white-space: pre-line;
  user-select: none;
  font-size: 1.25rem;
  line-height: 1.7;
  pointer-events: none;
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Answer container at bottom */
.answer-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  z-index: 100;
  pointer-events: auto;
}

#answer-box {
  background: #121212;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px 18px;
  width: 180px;
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  pointer-events: auto;
  transition: border-color 0.2s ease;
}

#answer-box:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
}

#submit-btn,
#change-elo-btn,
#clear-drawing-btn {
  background: #121212;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  pointer-events: auto;
  transition: all 0.2s ease;
}

#submit-btn:hover,
#change-elo-btn:hover,
#clear-drawing-btn:hover {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

#result {
  position: fixed;
  bottom: 80px;
  right: 24px;
  color: #4CAF50;
  font-size: 1rem;
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  font-weight: 500;
  z-index: 100;
  pointer-events: none;
}

/* ====================== */
/*  MOBILE OPTIMIZATIONS  */
/* ====================== */
@media (max-width: 768px) {
  .top-nav {
    top: 16px;
    left: 16px;
  }

  .top-nav a {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  #toggle-question-btn {
    top: 65px;
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  #question-container {
    top: 100px;
  }

  .question-box {
    padding: 10px;
    font-size: 1rem;
  }

  .answer-container {
    flex-direction: column;
    align-items: flex-end;
    bottom: 10px;
    right: 10px;
  }

  #answer-box {
    width: 120px;
    padding: 10px;
  }

  #result {
    bottom: 150px;
    right: 10px;
  }
}

/* ====================== */
/* COLOR PICKER STYLES */
/* ====================== */
#color-picker-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 110;
}

#color-picker-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #121212;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

#color-picker-btn:hover {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

#current-color-preview {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid #555;
  background: white;
}

#color-dropdown {
  position: absolute;      /* absolute inside container */
  bottom: 50px;            /* place ABOVE the button */
  left: 0;
  display: flex;
  gap: 8px;
  background: #111;
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  flex-wrap: wrap;         /* optional, wrap colors if many */
}

#color-dropdown.hidden {
  display: none;
}

.color-option {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.color-option:hover {
  transform: scale(1.2);
}
