/* ============================================ */
/* VARIABLES & RESET */
/* ============================================ */
:root {
  --nyt-green: #6aaa64;
  --nyt-gray: #787c7e;
  --nyt-light-gray: #d3d6da;
  --nyt-dark: #121213;
  --nyt-white: #f7f7f7;
  --border-light: #e0e0e0;
  --box-bg-light: #3498db;
  --bg-light: #f7f7f7;
  --text-dark: #121213;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --error-bg: #f8d7da;
  --error-text: #842029;
  --available-key-bg: #666;
  --coffee-light: #f4ede2;
  --coffee-dark: #423232;
  --coffee-accent: #8B7355;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg-light);
  margin: 0;
  padding: 0;
  color: var(--text-dark);
  transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
  background: #18181a;
  color: var(--nyt-white);
}

.about-wrapper {
  max-width: 800px;
  margin: 80px auto;
  padding: 0 20px;
}

.about-wrapper h1 {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #000;
  transition: color 0.3s ease;
}

body.dark-mode .about-wrapper h1 {
  color: #e0e0e0;
}

.about-wrapper h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 2.2rem;
  margin-bottom: 0.75rem;
  color: #000;
  transition: color 0.3s ease;
}

body.dark-mode .about-wrapper h2 {
  color: #e0e0e0;
}

.about-wrapper p,
.about-wrapper ul {
  font-size: 1rem;
  line-height: 1.65;
  color: #403f3f;
  margin: 0.5rem 0 1rem;
  transition: color 0.3s ease;
}

body.dark-mode .about-wrapper p,
body.dark-mode .about-wrapper ul {
  color: #d0d0d0;
}

.about-wrapper ul {
  list-style: disc;
  padding-left: 1.5rem;
}

.about-wrapper ul li {
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

body.dark-mode .about-wrapper ul li {
  color: #d0d0d0;
}

.intro {
  font-size: 1.05rem;
  text-align: center;
  margin-bottom: 2rem;
  color: #3a3a3a;
  transition: color 0.3s ease;
}

body.dark-mode .intro {
  color: #e0e0e0;
}

/* ============================================ */
/* HOW TO PLAY MODAL - TUTORIAL STYLES */
/* ============================================ */

/* Modal Base */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; 
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  font-size: 0.96rem;
  line-height: 1.5rem;
  padding: 1.2rem 1.15rem;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #e3e6e9;
  color: #000;
  padding: 1.5rem;
  border-radius: 15px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  position: relative;
}

body.dark-mode .modal-content {
  background: #1e1e1e;
  color: #e0e0e0;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1.5px solid #000;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #000;
  margin: 0;
}

body.dark-mode .modal-title {
  color: var(--coffee-light);
}

.modal-close-btn, .modal-close-hint-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  background: transparent;
  border: none;
}

.modal-intro {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #000;
}

body.dark-mode .modal-intro {
  color: var(--coffee-light);
}

/* Tutorial Steps & Dividers */
.tutorial-step {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
}

.tutorial-divider {
  border: 0;
  height: 1px;
  background: var(--coffee-light);
}

body.dark-mode .tutorial-divider {
  background: #333;
}

.step-content {
  flex: 1;
}

.step-title {
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: #000;
  line-height: 1.4;
}

body.dark-mode .step-title {
  color: var(--coffee-light);
}

.step-note {
  font-size: 0.85rem;
  margin-top: 0.8rem;
  color: #000;
  line-height: 1.5;
}

body.dark-mode .step-note {
  color: #aaa;
}

.step-description {
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  color: #000;
  line-height: 1.5;
}

body.dark-mode .step-description {
  color: #bbb;
}

/* Orange Dot Indicators */
.orange-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: #e67e22;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.orange-dot-inline {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #e67e22;
  border-radius: 50%;
}

/* Modal Footer */
.modal-footer {
  padding: 0.5rem;
  display: flex;
  justify-content: center;
}

.got-it-btn {
  background: #e67e22;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.got-it-btn:hover {
  background: #d35400;
}

/* ============================================ */
/* DEMO GAME UI - MATCHES MAIN GAME */
/* ============================================ */

.demo-game-ui {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  width: 50%;
  margin: 15px auto;
}

/* Distance Side Line and Bubbles */
.demo-distance-side {
  position: relative;
  width: 50px;
  height: 150px;
  flex-shrink: 0;
}

.demo-distance-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 100%;
  background: #3498db; /* Default UI track line */
  border-radius: 2px;
}

.demo-distance-bubble {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 32px;
  background: #2ecc71; /* Matched game colors */
  background: #3498db;
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.top-bubble { top: -5px; }
.bottom-bubble { bottom: -5px; }

.demo-indicator-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: #e67e22;
  border: 2px solid white;
  border-radius: 50%;
  transition: top 0.3s;
}

/* Words Side Rows */
.demo-words-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-word-row, .demo-guess-row {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.demo-game-box {
  width: 42px;
  height: 42px;
  background: #3498db;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
}

.demo-guess-input {
  width: 42px;
  height: 42px;
  background: #f3f3f3;
  border: 2px solid #bdc3c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  color: #2c3e50;
}

body.dark-mode .demo-guess-input {
  background: #2a2a2a;
  border-color: #555;
  color: #e0e0e0;
}

/* Specific Step Styling Modifications */
.demo-updated {
  background: #3498db !important;
}

.demo-flash {
  background: #e67e22 !important;
  color: white !important;
  border-color: #e67e22 !important;
}

.demo-winner {
  background: #2ecc71 !important;
  color: white !important;
  border-color: #2ecc71 !important;
}

/* Responsive Handling */
@media (max-width: 550px) {
  .demo-game-ui {
    gap: 8px;
  }
  .demo-game-box, .demo-guess-input {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .demo-distance-bubble {
    width: 32px;
    height: 26px;
    font-size: 0.75rem;
  }
  .demo-distance-side {
    width: 36px;
    height: 115px;
  }
}

/* profile modal logout button */
.logout-btn {
  padding: 0.5rem 0.7rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
  background: #adb5bd;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #000;
  transition: background 0.2s ease;
}

.logout-btn:hover {
  background: #62676c;
}

body.dark-mode .logout-btn {
  background: #e0e0e0;
  color: #2d2d44;
}

body.dark-mode .logout-btn:hover {
  background: #a19e9e;
}

/* ---------------------------------------------- */
/* Feedback Modal Styles */
.feedback-content {
  padding: 5px;
}

.feedback-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #b3bcc2;
}

.feedback-icon {
  background-color: #e0e3e5;
  color: #000;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 1.1rem;
}

.feedback-title {
  font-size: 1.4rem;
  font-weight: 900;
  margin: 0;
  color: #000;
}

.feedback-body {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 15px;
}

.feedback-options {
  margin: 15px 0;
  background-color: var(--bg-light, #f8f9fa);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid var(--border-color, #e0e0e0);
}

.feedback-option {
  display: flex;
  align-items: flex-start;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.05));
}

.feedback-option:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.feedback-option i {
  color: #000;
  margin-right: 10px;
  margin-top: 2px;
  font-size: 1.1rem;
  min-width: 20px;
}

.feedback-option p {
  margin: 0;
  font-size: 0.9rem;
}

.feedback-note {
  background-color: #e0e3e5;
  padding: 10px;
  border-radius: 6px;
  margin: 15px 0;
  border-left: 3px solid #000;
  font-size: 0.9rem;
}

.feedback-actions {
  display: flex;
  justify-content: center;
  margin: 20px 0 10px;
}

.feedback-btn {
  padding: 12px 30px;
  border: 2px solid #000;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #adb5bd;
  color: #000;
  min-width: 200px;
}

.feedback-btn:hover {
  background-color: #62676c;
}

.feedback-btn:active {
  transform: translateY(0);
}

/* Dark mode specific styles */
.dark-mode .feedback-title {
  color: var(--text-color-dark, #f0f0f0);
}

.dark-mode .feedback-icon {
  background-color: #fff;
  color: #2d2d44;
}

.dark-mode .feedback-icon i{
  color: #2d2d44;
}

.dark-mode .feedback-option i{
  color: #fff;
}

.dark-mode .feedback-options {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--border-dark, #4a5568);
}

.dark-mode .feedback-option {
  border-bottom-color: var(--border-dark-light, rgba(255,255,255,0.05));
}

.dark-mode .feedback-note {
  background-color: rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary-color-dark, #4299e1);
}

.dark-mode .feedback-btn {
  background-color: #2d2d44;
  border: 2px solid #fff;
  color: #fff;
}

.dark-mode .feedback-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}


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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

body.dark-mode ::-webkit-scrollbar-thumb {
  background: rgba(224, 224, 224, 0.3);
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: rgba(224, 224, 224, 0.5);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

body.dark-mode * {
  scrollbar-color: rgba(224, 224, 224, 0.3) transparent;
}