/* =======================================================
   🎨 CONTEXTO STYLES (NAMESPACED)
   ======================================================= */
  :root {
    --max-container-height: 240px; /* Default: 5 rows * 48px */
  }
  
  .contexto * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    color: #423232;
  }

  body {
    background-color: #121213;
    margin: 0;
    padding: 0;
    min-height: 100vh;
  }

  .contexto {
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    min-height: 100vh;
  }

  /* Dark mode container */
  .contexto-dark {
    background-color: #15202b !important;
  }
  .contexto-dark * {
    color: #ffffff !important;
  }
  .contexto-dark .subtitle {
    color: #ffffff !important;
  }
  
  .contexto .container {
    max-width: 500px;
    width: 100%;
    margin-top: 30px;
  }
  
  .contexto .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
  }
  
  .contexto .title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }
  
  .contexto .unlimited-img {
    height: 60px;
    width: auto;
  }

  .interactive-logo {
    height: 29px;
    width: auto;
    margin-right: 8px;
    margin-bottom: 3px;
  }
  
  .contexto .title {
    font-size: 30px;
    font-weight: bold;
    color: #3b302a;
  }
  
  .contexto .subtitle {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #3b302a;
    margin-top: 10px;
    margin-bottom: 5px;
  }
  
  .contexto .menu-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #3b302a;
  }
  
  .contexto .game-info {
    margin-bottom: 15px;
    font-size: 12px;
    color: #3b302a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  
  .contexto .game-info .label {
    font-weight: 700;
  }

  
  .contexto .spellcheck-toggle {
    cursor: pointer;
    vertical-align: bottom;
    margin-left: 5px;
    height: 24px;
    display: none;
  }
  
  .contexto .input-container {
    position: relative;
    margin-bottom: 5px;
    margin-top: 10px;
  }
  
  .contexto .word-input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    outline: none;
    caret-color: transparent;
    transition: opacity 0.5s ease-in-out;
  }

  /* Persistent blinking cursor effect */
  .contexto .input-container::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 20px;
    background-color: #423232;
    animation: blink-cursor 1s step-end infinite;
    pointer-events: none;
  }

  .contexto-dark .input-container::after {
    background-color: #ffffff;
  }

  /* Hide the fake cursor when input has text */
  .contexto .input-container.has-text::after {
    display: none;
  }

  /* Blink animation */
  @keyframes blink-cursor {
    0%, 50% {
      opacity: 1;
    }
    51%, 100% {
      opacity: 0;
    }
  }

  .contexto .custom-placeholder {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #999;
    pointer-events: none;
    white-space: nowrap;
  }

  .contexto .custom-placeholder.hidden {
    display: none;
  }

  .contexto .custom-placeholder .boundary-word-text {
    color: #D2606D !important;
  }

  .contexto-dark .custom-placeholder {
    color: #888;
  }

  .contexto-dark .custom-placeholder .boundary-word-text {
    color: #D2606D !important;
  }
  
  .contexto .guesses-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
    height: var(--max-container-height);
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #c0bdb8 transparent;
  }

  .contexto .before-container {
    position: relative;
  }
  
  .contexto .before-container::before {
    content: '';
    flex-grow: 1;
    min-height: 0;
  }
  .contexto .guesses-container::-webkit-scrollbar {
    width: 8px;
  }
  
  .contexto .guesses-container::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .contexto .guesses-container::-webkit-scrollbar-thumb {
    background-color: #c0bdb8;
    border-radius: 4px;
  }
  
  .contexto-dark .guesses-container {
    scrollbar-color: #4a5568 transparent;
  }
  
  .contexto-dark .guesses-container::-webkit-scrollbar-thumb {
    background-color: #4a5568;
  }
  
  .contexto .guess-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 15px;
    border-radius: 5px;
    font-size: 18px;
    position: relative;
    overflow: hidden;
    color: #333;
    z-index: 0;
    min-height: 43px;
    background-color: #ebe8e0;
  }

  /* Letter styling for matches */
  .contexto .guess-word-center .letter {
    display: inline-block;
    transition: color 0.3s ease;
  }

  .contexto .guess-word-center .letter-correct {
    color: #538d4e !important;
    font-weight: 900;
  }

  .contexto-dark .guess-word-center .letter-correct {
    color: #6aaa64 !important;
  }

  /* Correct letter count badge (green) - HIDDEN */
  .contexto .correct-count {
    display: none;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: #538d4e;
    color: white;
    font-size: 16px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 12px;
    min-width: 28px;
    text-align: center;
  }

  .contexto-dark .correct-count {
    background: #6aaa64;
  }

  /* First letter distance badge (red) - HIDDEN */
  .contexto .distance-count {
    display: none;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: #d32f2f;
    color: white;
    font-size: 16px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 12px;
    min-width: 28px;
    text-align: center;
  }

  .contexto-dark .distance-count {
    background: #f44336;
  }


  /* Only the most recent guess has a border; others have none */
  .contexto-dark .guess-recent { border-color: #ffffff; }
  /* Attribution on left side of guess item */
  .contexto .guess-attrib {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 700;
    color: #333;
  }
  .contexto .guess-attrib-photo {
    width: 43px;
    height: 43px;
    object-fit: cover;
  }
  .contexto .guess-attrib-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Word centered in the guess item */
  .contexto .guess-word-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #333;
  }

  .contexto .guess-recent {
    border: 3px solid #423232;
    border-radius: 8px;
  }
  /* Ensure recent guess has white border in dark mode */
  .contexto-dark .guess-recent {
    border: 3px solid #ffffff;
  }
  
  .contexto-dark .guess-item {
    background-color: #1a2634;
  }

  /* Hint display - matches guess-item structure but with distinct styling */
  .contexto .hint-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 15px;
    border-radius: 5px;
    font-size: 18px;
    position: relative;
    overflow: hidden;
    z-index: 0;
    min-height: 43px;
    margin-top: 5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  }

  .contexto-dark .hint-display {
    background: linear-gradient(135deg, #4a5fd9 0%, #5a3a8a 100%);
    box-shadow: 0 4px 15px rgba(74, 95, 217, 0.6);
  }

  .contexto .hint-display .hint-icon {
    font-size: 24px;
    margin-right: 8px;
  }

  .contexto .hint-attrib {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
  }

  .contexto .hint-attrib-photo {
    width: 43px;
    height: 43px;
    object-fit: cover;
  }

  .contexto .hint-attrib-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ffffff;
  }

  .contexto .hint-text {
    flex: 1;
    text-align: right;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    padding-right: 10px;
    line-height: 1.3;
  }

  .contexto-dark .hint-text,
  .contexto-dark .hint-attrib-name {
    color: #ffffff !important;
  }
  
  .contexto .progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: -1;
    border-radius: 5px;
  }
  
  .contexto .blue-bg .progress-bar { background-color: #b6e0d8; }
  .contexto .yellow-bg .progress-bar { background-color: #f6e4a1; }
  .contexto .red-bg .progress-bar { background-color: #f2c4c4; }

  /* Dark mode guess tier colors */
  .contexto-dark .blue-bg .progress-bar { background-color: #00ba7c; }
  .contexto-dark .yellow-bg .progress-bar { background-color: #ef7d31; }
  .contexto-dark .red-bg .progress-bar { background-color: #f91880; }

  .contexto-dark .word-input {
    background: #0f1620;
    color: #ffffff;
    border-color: #22303c;
  }
  .contexto-dark .error { color: #ffb3b3; }
  
  /* Overlays specific to CONTEXTO (renamed to prevent collision) */
  .contexto-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }
  
  .contexto-modal {
    background-color: #f8f4ed;
    border-radius: 10px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    max-height: 500px;
    overflow-y: auto;
    position: absolute;
    top: 10%;
  }

  /* Apply dark mode palette to contexto-modal */
  .contexto-dark .contexto-modal {
    background-color: #15202b;
    color: #ffffff;
  }
  
  .contexto .menu-option {
    display: flex;
    align-items: center;
    padding: 12px 0;
    cursor: pointer;
    border-bottom: 1px solid #eee;
  }
  
  .contexto .menu-option:last-child { border-bottom: none; }
  .contexto .menu-option i { margin-right: 10px; width: 24px; text-align: center; }

  .icon-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
  }

  .icon-item img {
    width: 40px;
    height: 40px;
    margin-right: 15px;
  }
  
  .contexto .close-modal {
    position: absolute;
    top: 10px; right: 10px;
    background: none; border: none;
    font-size: 20px; cursor: pointer;
  }
  
  /* Congrats Modal */
  .contexto .congrats-content {
    padding: 25px;
    text-align: center;
    line-height: 1.6;
  }
  .contexto .congrats-content p { margin-bottom: 15px; font-size: 18px; }
  .contexto .congrats-content strong { font-weight: 900; }
  .contexto .promo-text { margin-top: 20px; font-size: 16px; }
  .contexto .website-link {
    background-color: #3b302a;
    color: #f8f4ed;
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: 800;
    font-size: 20px;
    display: inline-block;
  }
  .contexto #playAgain {
    display:block;
    margin-top:50px;
    cursor:pointer;
    color: #b6e0d8;
  }
  
  /* Misc subcomponents */
  .contexto .random-button,
  .contexto .continue-btn,
  .contexto .custom-game-input button {
    background-color: #b6e0d8;
    color: #3b302a;
    border: none;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
  }
  .contexto .back-btn {
    background-color: #f2c4c4;
    color: #3b302a;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    padding: 10px;
  }
  
  /* Spinner */
  .contexto .spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid #b6e0d8;
    width: 20px; height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* =======================================================
     🖤 EXISTING TEMPLATE STYLES (UNMODIFIED)
     ======================================================= */  

body.dark-mode .floating-leaderboard {
  background: #1a1a1a;
  border-color: #444;
}

body.dark-mode .floating-leaderboard-header {
  background: #2d2d2d;
  border-bottom-color: #444;
}

body.dark-mode .leaderboard-item {
  background: #2d2d2d;
}

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

body.dark-mode .leaderboard-rank {
  color: #b0b0b0;
}

body.dark-mode .leaderboard-page-info {
  color: #b0b0b0;
}

body.dark-mode .leaderboard-nav-btn:hover:not(:disabled) {
  background: #444;
}

body.dark-mode .leaderboard-empty {
  color: #b0b0b0;
}


/* Winning Modal Styles (aligned with wordle/style.css) */
.winning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.484);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* position modal from top */
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  .winning-overlay.show {
    opacity: 1;
    visibility: visible;
  }
  
  /* Modal box */
  .winning-modal {
    background: #2c2c2c; /* leaderboard background */
    border: 1px solid #444;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    max-width: 420px;
    width: 92%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.92);
    transition: transform 0.3s ease;
    font-family: 'Nunito', Arial, sans-serif; /* match leaderboard font */
  }
  .winning-modal * { font-family: inherit; }
  .winning-overlay.show .winning-modal {
    transform: scale(1);
  }
  /* Position winning modal 20% from top of the screen */
  .winning-overlay .winning-modal { margin-top: 15vh; }
  .winning-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
  }
  
  /* Single winner */
  .single-winner {
    display: none;
    flex-direction: column;
    align-items: center;
  }
  .winner-photo {
    width: 80%;
    /* height: 220px; */
    border-radius: 8px; /* square-ish corners */
    border: 2px solid #fff;
    margin-bottom: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    object-position: center;
  }
  .winner-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-top: 6px;
  }

  .winning-site {
    margin-top: 12px;
    color: #fff;
    font-size: 20px; /* match request */
    opacity: 0.9;
    font-weight: 600;
    color: #f7be57;
    background-color: #6b6562;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 5px;
    margin: 12px auto 6px auto;
  }
  
  /* Multiple winners (mapped from wordle group-winners) */
  .multiple-winners {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
  }
  .multi-winner {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 80px;
  }
  .multi-winner-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-bottom: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    object-fit: cover;
  }
  .multi-winner-name {
    font-size: 0.9em;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    text-align: center;
    word-break: break-word;
  }
  @media (max-width: 600px) {
    .winning-modal { padding: 30px 20px; }
    .winning-title { font-size: 2em; }
    .winner-photo { width: 120px; height: 120px; }
    .multi-winner-photo { width: 50px; height: 50px; }
    .multiple-winners { gap: 12px; }
    .multi-winner { padding: 10px; min-width: 70px; }
    .multi-winner-name { font-size: 0.8em; }
  }
  



  


/* Instruction Popup (aligned with wordle/style.css) */
.instruction-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 350px;
  z-index: 999;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0;
}
.instruction-popup.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.instruction-popup.slide-out {
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
}
.instruction-popup-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
}
.instruction-popup-text {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 15px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}
.instruction-popup-gif {
  width: 100%;
  max-width: 300px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Settings Panel Styles (from wordle/style.css) */
.settings-panel {
  position: fixed;
  font-family: 'Segoe UI', Arial, sans-serif;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background-color: #1c1c1c;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
  transition: right 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
}

.settings-panel.open {
  right: 0;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #3a3a3c;
}

.settings-header h2 {
  margin: 0;
  color: #ffffff;
  font-size: 24px;
}

.close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.close-btn:hover {
  background-color: #3a3a3c;
}

.settings-section {
  border-bottom: 1px solid #3a3a3c;
}

.settings-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.settings-section-header:hover {
  background-color: #2a2a2c;
}

.settings-section-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 18px;
}

.arrow {
  color: #ffffff;
  transition: transform 0.2s ease;
}

.settings-section-header.collapsed .arrow {
  transform: rotate(0deg);
}

.settings-section-header:not(.collapsed) .arrow {
  transform: rotate(180deg);
}

.settings-section-content {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.settings-section-header:not(.collapsed) + .settings-section-content {
  padding: 15px 20px;
  max-height: none; /* allow full Game Settings (automated list, etc.); fixed cap was clipping */
}

.settings-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #1c1c1c;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, background-color 0.2s ease;
  z-index: 999;
}

.settings-toggle:hover {
  background-color: #2a2a2c;
  transform: scale(1.1);
}

.settings-toggle svg {
  width: 24px;
  height: 24px;
}

.settings-toggle.simulate-active {
  background-color: #2ecc40 !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(46,204,64,0.3);
}

.setting-item {
  margin: 15px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-item label {
  color: #ffffff;
  font-size: 16px;
}

.setting-select {
  background-color: #2a2a2c;
  color: #ffffff;
  border: 1px solid #3a3a3c;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.setting-select:hover {
  border-color: #4a4a4c;
}

.setting-select:focus {
  outline: none;
  border-color: #538d4e;
}

.number-input-container {
  display: flex;
  align-items: center;
  background-color: #2a2a2c;
  border: 1px solid #3a3a3c;
  border-radius: 4px;
  overflow: hidden;
}

.number-input-btn {
  background-color: #3a3a3c;
  color: #ffffff;
  border: none;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.number-input-btn:hover {
  background-color: #4a4a4c;
}

.setting-input {
  background-color: #2a2a2c;
  color: #ffffff;
  border: none;
  width: 50px;
  height: 32px;
  text-align: center;
  font-size: 14px;
  appearance: textfield;
  -moz-appearance: textfield;
}

.setting-input::-webkit-outer-spin-button,
.setting-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.setting-input-wide {
  background-color: #2a2a2c;
  color: #ffffff;
  border: 1px solid #3a3a3c;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.setting-input-wide:hover {
  border-color: #4a4a4c;
}

.setting-input-wide:focus {
  outline: none;
  border-color: #538d4e;
}

.test-btn {
  background-color: #b59f3b;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.2s ease;
  width: 100%;
}

.test-btn:hover {
  background-color: #a08f35;
}

.test-btn:active {
  transform: translateY(1px);
}

.setting-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #538d4e;
  cursor: pointer;
}

.setting-checkbox:hover {
  transform: scale(1.1);
}

.setting-textarea {
  background-color: #2a2a2c;
  color: #ffffff;
  border: 1px solid #3a3a3c;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
  resize: vertical;
  font-family: inherit;
}

.setting-textarea:hover {
  border-color: #4a4a4c;
}

.setting-textarea:focus {
  outline: none;
  border-color: #538d4e;
}

  /* Settings Panel — Custom Game Creator overrides */
  .settings-panel .select-game-header {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
  }
  .settings-panel .custom-game-input {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .settings-panel .password-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  #wordInput {
    height:40px;
    
  }

  .settings-panel #customWordInput {
    background-color: #2a2a2c;
    color: #ffffff;
    border: 1px solid #3a3a3c;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    flex: 1;
  }
  .settings-panel #customWordInput::placeholder {
    color: #b0b0b0;
  }
  .settings-panel #createCustomGame,
  .settings-panel #continueToGame,
  .settings-panel #acceptSimilarWord,
  .settings-panel #startAutomatedList {
    background-color: #538d4e;
    color: #ffffff;
    border: none;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
  }
  .settings-panel #randomGame,
  .settings-panel #backToInput {
    background-color: #3a3a3c;
    color: #ffffff;
    border: 1px solid #4a4a4c;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
  }
  .settings-panel #createCustomGame:hover,
  .settings-panel #continueToGame:hover,
  .settings-panel #acceptSimilarWord:hover,
  .settings-panel #startAutomatedList:hover {
    background-color: #4a7a44;
  }
  .settings-panel #randomGame:hover,
  .settings-panel #backToInput:hover {
    background-color: #4a4a4c;
  }
  .settings-panel #loadingGame {
    color: #ffffff;
  }
  .settings-panel .error-text {
    color: #f2c4c4;
    background: #3a1f1f;
    border: 1px solid #803333;
    border-radius: 4px;
    padding: 8px 10px;
    margin-top: 10px;
    font-size: 14px;
  }
  .settings-panel #wordCheckUI p {
    color: #ffffff;
    margin-bottom: 10px;
  }
  .settings-panel .word-check-buttons {
    display: flex;
    gap: 10px;
  }


  .settings-panel .success-message {
    color: #ffffff;
  }

  #gameCreationUI {
    display: block;
  }


/* Floating Leaderboard */
.floating-leaderboard {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 280px;
  background: #2c2c2c;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 3000;
  font-family: 'Nunito', Arial, sans-serif;
  cursor: move;
  user-select: none;
}

.floating-leaderboard.opacity-50 {
  opacity: 0.8;
}

.floating-leaderboard-header {
  background: #333;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid #444;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: move;
}

.floating-leaderboard-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-leaderboard-toggle:hover {
  background: #444;
  border-radius: 3px;
}

.floating-leaderboard-body {
  padding: 8px;
  max-height: 290px;
  overflow-y: auto;
  display: block;
}

.leaderboard-height-toggle {
  position: sticky;
  bottom: 4px;
  left: 220px;
  background: transparent;
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  margin-top: 10px;
  margin-left: 210px;
}

.floating-leaderboard-body.collapsed {
  display: none;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #3a3a3a;
  border-radius: 4px;
  padding: 6px 10px;
  height: 36px;
}

.leaderboard-user {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.leaderboard-rank {
  color: #aaa;
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 18px;
  text-align: right;
  flex-shrink: 0;
}

.leaderboard-img {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  object-fit: cover;
  background: #555;
  flex-shrink: 0;
}

.leaderboard-username {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.leaderboard-points {
  color: #4285f4;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}

.leaderboard-empty {
  color: #888;
  font-size: 0.8rem;
  text-align: center;
  padding: 20px;
  font-style: italic;
}

.leaderboard-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.leaderboard-nav-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: background 0.2s;
}

.leaderboard-nav-btn:hover:not(:disabled) {
  background: #444;
}

.leaderboard-nav-btn:disabled {
  color: #666;
  cursor: not-allowed;
}

.leaderboard-page-info {
  color: #ccc;
  font-size: 16px;
  min-width: 24px;
  text-align: center;
  margin: 0 2px;
}

/* =======================================================
   🎓 TUTORIAL STYLES
   ======================================================= */

/* Tutorial Overlay - Transparent (no dimming) */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent;
  z-index: 9000;
  pointer-events: none;
}

/* Tutorial Spotlight - Highlighted area around target element */
.tutorial-spotlight {
  position: absolute;
  border: 3px solid #4CAF50;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
  z-index: 9001;
  pointer-events: none;
  animation: pulse-spotlight 2s infinite;
}

@keyframes pulse-spotlight {
  0%, 100% {
    border-color: #4CAF50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
  }
  50% {
    border-color: #66BB6A;
    box-shadow: 0 0 30px rgba(102, 187, 106, 1);
  }
}

/* Tutorial Header Modal */
.tutorial-header-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 9002;
  max-width: 500px;
  width: 90%;
  animation: slideIn 0.3s ease-out;
  pointer-events: auto;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.tutorial-header-content {
  padding: 30px;
  font-family: 'Nunito', sans-serif;
}

.tutorial-header-content h2 {
  font-size: 24px;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  color: #423232;
  margin-bottom: 15px;
  text-align: center;
}

.tutorial-header-content p {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  color: #666;
  margin-bottom: 25px;
  text-align: center;
  line-height: 1.5;
}

/* Tutorial Tooltip */
.tutorial-tooltip {
  position: absolute;
  background: white;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  z-index: 9002;
  min-width: 250px;
  max-width: 400px;
  animation: fadeIn 0.3s ease-out;
  pointer-events: auto;
}

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

.tutorial-tooltip-content {
  padding: 20px;
  font-family: 'Nunito', sans-serif;
}

.tutorial-tooltip-content p {
  font-size: 15px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  color: #423232;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Tutorial Buttons */
.tutorial-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.tutorial-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Nunito', sans-serif;
}

.tutorial-btn-primary {
  background-color: #4CAF50;
  color: white;
}

.tutorial-btn-primary:hover {
  background-color: #45a049;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.tutorial-btn-secondary {
  background-color: #e0e0e0;
  color: #423232;
}

.tutorial-btn-secondary:hover {
  background-color: #d0d0d0;
  transform: translateY(-1px);
}

/* Dark mode support for tutorial */
.contexto-dark .tutorial-header-modal,
.contexto-dark .tutorial-tooltip {
  background-color: #1e2732 !important;
}

.contexto-dark .tutorial-header-content h2,
.contexto-dark .tutorial-tooltip-content p {
  color: #ffffff !important;
}

.contexto-dark .tutorial-header-content p {
  color: #b0b0b0 !important;
}

.contexto-dark .tutorial-btn-secondary {
  background-color: #2a3a4a;
  color: #ffffff;
}

.contexto-dark .tutorial-btn-secondary:hover {
  background-color: #344556;
}