/* style.css - UPDATED: CSS transitions removed, animations handled by JS */

/* Global variables */
:root {
  --stack-step: 32.5px;
  --main-bg-color: #3498db; /* Default intro screen color */
  --stack-base-percent: 72; /* Base overlap percentage - desktop: 72% */
}

/* Reduce overlap on mobile to maintain visual consistency with smaller tiles */
@media (max-width: 768px) {
  :root {
    --stack-base-percent: 69; /* Mobile: slightly less overlap (69%) */
  }
}

/* Global text styling: use Arial for most text */
body, h1, h3, button, #message, .slot {
  font-family: Arial, sans-serif;
  font-weight: bold;
}

/* For the letter tiles, use Big Shoulders Display (no extra smoothing/spacing) */
.letter {
  font-family: 'Big Shoulders Display', sans-serif;
  /* Prevent mobile browsers from adjusting font size */
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  /* Anti-aliasing fixes for sub-pixel rendering on mobile */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* Basic page styling */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background-color: var(--main-bg-color);
}

body {
  text-align: center;
}

/* Landscape rotation warning - hidden by default */
#rotateWarning {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  z-index: 99999;
  justify-content: center;
  align-items: center;
}

.dark-mode #rotateWarning {
  background-color: #1e1e1e;
  color: #f5f5f5;
}

.rotate-content {
  text-align: center;
  padding: 20px;
}

.rotate-content svg {
  margin-bottom: 20px;
  color: #3498db;
}

.rotate-content p {
  font-size: 1.3em;
  font-weight: bold;
  margin: 0;
}

/* Show rotation warning only on mobile devices in landscape */
@media screen and (max-width: 896px) and (orientation: landscape) {
  #rotateWarning {
    display: flex;
  }
}

/* Intro Screen styling */
#introScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  color: #3498db;
}
.dark-mode #introScreen {
  background-color: #222;
  color: #ffffff;
}
.intro-content { text-align: center; }

/* Intro title with stacking animation */
.intro-title {
  font-size: 4em;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
}

.intro-letter {
  display: inline-block;
  animation: stackDrop 0.35s ease-out forwards;
  animation-delay: calc(var(--delay) * 0.08s);
  opacity: 0;
  transform: translateY(-80px);
}

@keyframes stackDrop {
  0% {
    opacity: 0;
    transform: translateY(-80px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in date and button after letters stack */
#introScreen p {
  font-size: 1.5em;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeInUp 0.4s ease-out forwards;
  animation-delay: 0.7s;
  color: #3498db;
}

.dark-mode #introScreen p {
  color: #ffffff;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

#introScreen button {
  padding: 12px 30px;
  font-size: 1.2em;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  background: linear-gradient(45deg, #2980b9, #3498db);
  color: white;
  transition: transform 0.2s ease, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  opacity: 0;
  animation: fadeInUp 0.4s ease-out forwards;
  animation-delay: 0.85s;
}
/* Dark mode button on intro - slightly different style */
.dark-mode #introScreen button {
  background: linear-gradient(45deg, #2980b9, #3498db);
}
/* The dynamically added dark mode toggle button needs immediate visibility */
#introScreen #introDarkModeBtn {
  animation-delay: 1s;
}
#introScreen button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
#introScreen button:active {
  transform: scale(0.98);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Top Navigation Bar */
#topNav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background-color: #ffffff;
  border-bottom: 1px solid #d3d6da;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-left {
  justify-content: flex-start;
}

.nav-right {
  justify-content: flex-end;
}

.nav-center {
  flex: 0 0 auto;
}

.nav-center h1 {
  font-size: 2em;
  margin: 0;
  letter-spacing: normal;
  color: #1a1a1b;
}

.nav-icon-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #787c7e;
  transition: background-color 0.15s ease, color 0.15s ease;
  box-shadow: none;
}

.nav-icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1a1a1b;
  transform: none;
  box-shadow: none;
}

.nav-icon-btn:active {
  transform: scale(0.95);
  box-shadow: none;
}

.nav-icon-btn svg {
  width: 24px;
  height: 24px;
}

#navDivider {
  height: 1px;
  background-color: #d3d6da;
}

/* Main Game Container */
#gameContainer {
  display: flex;
  justify-content: center;
  margin: 20px auto;
  width: 90%;
  max-width: 1200px;
}

/* Letter area styling */
.letter-area {
  background-color: #ffffff;
  border-radius: 15px;
  padding: 20px;
  margin-top: 30px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  width: 500px; /* Default width - can be overridden by JS for more columns */
  max-width: 95vw; /* Don't exceed viewport width */
  min-width: 300px; /* Minimum width - prevents extreme squishing on tiny screens */
  text-align: center;
  overflow-x: auto; /* Allow horizontal scroll if needed on mobile */
}

/* Titles */
h3 { margin: 10px 0; }

/* Letter Bank */
.letter-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px;
  margin: 10px 0;
  border: 2px solid #3498db;
  border-radius: 10px;
  min-height: 80px;
}

/* Answer Area */
.answer-area {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 15px;
  margin: 10px 0;
  border: 2px solid #3498db;
  border-radius: 10px;
  min-height: 300px;
}

/* Answer Column */
.answer-column {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}

/* Each Slot (default grey; JS toggles to transparent when filled) */
.slot {
  width: 45px;
  height: 45px;
  background-color: #ecf0f1;
  border: 2px solid #bdc3c7;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  aspect-ratio: 1 / 1; /* Forces consistent square sizing across devices */
}

/* Letter tiles - NO CSS TRANSITIONS (handled by JS now) */
.letter {
  width: 45px;
  height: 45px;
  background-color: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  cursor: move;
  box-sizing: border-box;
  aspect-ratio: 1 / 1; /* Forces consistent square sizing across devices */
  /* REMOVED: transition: transform 0.8s ease; - Now handled by JS */
}

/* Buttons */
button {
  padding: 12px 25px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  background: linear-gradient(45deg, #3498db, #2980b9);
  color: white;
  font-size: 1.1em;
  transition: transform 0.2s ease, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  outline: none;
}
button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
button:active {
  transform: scale(0.98);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Clear button when disabled should look normal and still have hover effect */
#clearBtn:disabled {
  opacity: 1;
  cursor: pointer;
}

#clearBtn:disabled:hover {
  transform: scale(1.05);
}

/* Side menu items - override default button styles */
.side-menu-item {
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.side-menu-item:hover {
  transform: scale(1.02);
}

/* Controls */
.controls {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.controls button {
  flex: 0 1 150px;
  margin: 0;
}

/* Stopwatch */
#stopwatch {
  font-size: 2em;
  margin-top: 30px;
}

/* Message Area */
#message {
  margin-top: 20px;
  font-size: 1.2em;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Popup Overlays */
#popupOverlay,
#helpPopup,
#wordCheckerPopup,
#settingsOverlay,
#statsOverlay,
#sideMenuOverlay,
.ios-safe-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255,255,255,0.85) !important;
  z-index: 9999;
}

/* Dark mode: use lighter dark overlay */
.dark-mode #popupOverlay,
.dark-mode #helpPopup,
.dark-mode #wordCheckerPopup,
.dark-mode #settingsOverlay,
.dark-mode #statsOverlay,
.dark-mode #sideMenuOverlay,
.dark-mode .ios-safe-overlay {
  background-color: rgba(0,0,0,0.3) !important;
}

/* How-To-Play & Word Checker Popup */
.how-to-play-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #ffffff;
  padding: 28px 35px;
  border: 2px solid #3498db;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  text-align: center;
  width: 420px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Desktop: Larger How to Play popup */
@media (min-width: 769px) {
  .how-to-play-popup {
    width: 520px;
    padding: 35px 45px;
  }
  .how-to-play-popup h2 {
    font-size: 2em;
    margin-bottom: 20px;
  }
  .vertical-word span {
    font-size: 2.8em;
  }
}

/* Directions */
.directions p {
  margin: 8px 0;
  font-size: 1.1em;
}

/* Vertical Word example with check and x icons */
.vertical-word span {
  display: block;
  font-size: 2.5em;
  margin: 2px 0;
}

/* === Pop animation (for letter placement) === */
.letter.pop {
  animation: pop 0.18s ease-out;
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* === Topple animations (group rotation with ground constraint) === */
@keyframes fallLeft {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(-90deg); }
}

@keyframes fallRight {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(90deg); }
}

/* Mobile */
@media (max-width: 768px) {
  #gameContainer { width: 95%; }
  .letter-area { 
    min-width: 95%; 
    max-width: 95vw;
    margin-top: 20px;
    overflow-x: auto;
  }
  .letter, .slot { 
    width: 40px; 
    height: 40px; 
    font-size: 1em;
    box-sizing: border-box;
    aspect-ratio: 1 / 1;
  }
  .vertical-word span { font-size: 2em; }
  .controls button { font-size: 1em; padding: 10px 20px; }
  
  /* Mobile: smaller stats and tighter indicator spacing */
  .stats-row {
    padding: 12px 0;
    margin: 5px 0;
  }
  .progress-counter,
  .indicator-timer {
    font-size: 1.3em;
  }
  .indicator-row {
    gap: 25px; /* Tighter gap on mobile */
    padding: 5px 10px 10px 10px;
  }
  .column-indicator {
    width: 35px;
    height: 40px;
  }
  .column-check,
  .column-x {
    width: 30px;
    height: 30px;
  }
  
  /* Mobile: How to Play popup fits screen */
  .how-to-play-popup {
    width: 90vw;
    max-width: 90vw;
    max-height: 80vh;
    padding: 20px 15px;
    box-sizing: border-box;
  }
  .how-to-play-popup h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
  }
  .vertical-word span {
    font-size: 1.8em;
  }
}

/* Very small screens */
@media (max-width: 380px) {
  .how-to-play-popup {
    width: 95vw;
    max-width: 95vw;
    max-height: 75vh;
    padding: 15px 10px;
  }
  .how-to-play-popup h2 {
    font-size: 1.3em;
  }
  .vertical-word span {
    font-size: 1.5em;
  }
  .letter, .slot { 
    width: 35px; 
    height: 35px; 
    font-size: 0.9em;
    box-sizing: border-box;
    aspect-ratio: 1 / 1;
  }
}

/* Dark Mode */
html.dark-mode, .dark-mode { background-color: #1e1e1e; color: #f5f5f5; }
.dark-mode #topNav {
  background-color: #1e1e1e;
  border-bottom-color: #3a3a3c;
}
.dark-mode .nav-center h1 {
  color: #f5f5f5;
}
.dark-mode .nav-icon-btn {
  color: #818384;
}
.dark-mode .nav-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
}
.dark-mode #navDivider {
  background-color: #3a3a3c;
}
.dark-mode .letter-area { background-color: #333; border-color: white; }
.dark-mode .letter-bank,
.dark-mode .answer-area { background-color: #444; border-color: white; }
.dark-mode .letter-bank .letter,
.dark-mode .answer-area .letter { color: white; }
.dark-mode button:not(.nav-icon-btn) {
  background: linear-gradient(45deg, #555, #444);
  color: #f5f5f5;
}
.dark-mode .how-to-play-popup {
  background-color: #222;
  border-color: white;
  color: #f5f5f5;
}
.dark-mode #winPopup,
.dark-mode #helpPopup button {
  background: white;
  color: black;
}
.dark-mode .column-indicator {
  border-bottom-color: white; /* White underline in dark mode */
}
.dark-mode .progress-counter,
.dark-mode .indicator-timer,
.dark-mode .wait-indicator {
  color: white; /* White text in dark mode */
}

/* Wait indicator - shown during animations, absolutely positioned so it doesn't push other elements */
.wait-indicator {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #3498db;
  font-weight: bold;
  font-size: 1em;
  text-align: center;
}

/* On small screens, move wait indicator above the counter/timer to avoid overlap */
@media (max-width: 380px) {
  .wait-indicator {
    top: -5px;
    transform: translate(-50%, 0);
  }
  
  .stats-row {
    padding-top: 25px; /* Add room above for the wait indicator */
  }
}

/* Icon styling for inline SVG check & X (5em as requested) */
.icon {
  width: 5em;
  height: 5em;
  vertical-align: middle;
  margin-right: 0.2em;
  color: currentColor;
}
.icon-check { color: green; }
.icon-x { color: red; }

/* Shake animation for incorrect answerâ€”uses margin-left so translateY stays intact */
@keyframes shake {
  0%, 100% { margin-left: 0; }
  25%      { margin-left: -5px; }
  50%      { margin-left: 5px; }
  75%      { margin-left: -5px; }
}
.shake { animation: shake 0.3s ease-in-out; }

/* Ensure Word Checker popup always big enough */
#wordCheckerPopup .how-to-play-popup { min-height: 350px; }

/* Blue-box selection highlight */
.letter:focus, .slot:focus { outline: none; }
.letter, .slot { -webkit-tap-highlight-color: transparent; }
.letter.selected {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

/* Dragging state - subtle visual feedback */
.letter.dragging {
  opacity: 0.5;
}

/* Confetti canvas sits above everything but doesn't block clicks */
.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 3000;        /* above victory overlay (2000) */
  pointer-events: none; /* lets you click through it */
}

/* ============ Column Validation Indicators (Checkmark / X) ============ */
/* Row container for all indicators - sits below the answer area */
/* Stats row (counter and timer between letter bank and answer) */
.stats-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 15px 0;
  margin: 5px 0;
  position: relative; /* For absolute positioning of wait indicator */
}

/* Progress counter (e.g., "0/4") - positioned at 25% from left */
.progress-counter {
  font-size: 1.5em;
  font-weight: bold;
  color: #3498db;
  flex: 1;
  text-align: center;
}

/* Timer in stats row - positioned at 75% from left */
.indicator-timer {
  font-size: 1.5em;
  font-weight: bold;
  color: #3498db;
  flex: 1;
  text-align: center;
}

/* Indicator row (just the column indicators) */
.indicator-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 40px; /* Same gap as answer-area columns */
  padding: 5px 15px 15px 15px;
}

/* Individual indicator container with underline */
.column-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 45px; /* Same width as slots */
  height: 50px;
  border-bottom: 3px solid #bdc3c7; /* Underline */
  pointer-events: none;
  position: relative;
}

/* Checkmark SVG - draw-in animation */
.column-check {
  width: 40px;
  height: 40px;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.3s, transform 0.3s;
  position: absolute;
}

.column-check.visible {
  opacity: 1;
  transform: scale(1);
}

.column-check path {
  stroke: #2ecc71;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
}

.column-check.visible path {
  animation: drawCheck 0.4s ease-out 0.1s forwards;
}

@keyframes drawCheck {
  to {
    stroke-dashoffset: 0;
  }
}

/* X SVG - pop animation */
.column-x {
  width: 40px;
  height: 40px;
  opacity: 0;
  transform: scale(0);
  position: absolute;
}

.column-x.visible {
  animation: popIn 0.3s ease-out forwards;
}

.column-x.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

.column-x path {
  stroke: #e74c3c;
  stroke-width: 3;
  stroke-linecap: round;
  fill: none;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.8);
  }
}

/* Green letters for correct words */
.letter.correct {
  color: #2ecc71 !important;
  text-shadow: 0 0 2px rgba(46, 204, 113, 0.3);
}

/* Victory animation styles */
#victoryOverlay {
  overflow: hidden;
}

.victory-letter {
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

.victory-screen h1 {
  font-family: Arial, sans-serif;
}

.victory-screen p {
  font-family: Arial, sans-serif;
}

/* Hover effects for victory buttons - scale only, keep white/black colors */
.victory-share-btn:hover,
.victory-close-btn:hover {
  transform: scale(1.05);
}

/* Mobile: Shift victory content up to center it better */
@media (max-width: 768px) {
  #victoryOverlay {
    padding-bottom: 15vh;
  }
  
  .victory-screen {
    margin-top: -5vh;
  }
}

/* ============ Reveal Animation ============ */
.reveal-hidden {
  opacity: 0;
  transform: scale(0);
}

.reveal-pop {
  animation: revealPop 0.3s ease-out forwards;
}

@keyframes revealPop {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Submit button waiting pulse - shows input received but waiting */
.waiting-pulse {
  animation: waitingPulse 0.6s ease-out;
}

@keyframes waitingPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  }
  25% {
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.5);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  }
}

/* ============ Site Footer ============ */
.site-footer {
  background: transparent;
  padding: 15px 20px;
  text-align: center;
  font-size: 13px;
  color: #666;
  margin-top: 80px;
  padding-bottom: 30px;
}

.dark-mode .site-footer {
  background: transparent;
  color: #999;
}

.site-footer a {
  color: #3498db;
  text-decoration: none;
  margin: 0 10px;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-divider {
  color: #999;
}

/********************************************************************
 * HINT DISPLAY
 ********************************************************************/
.hint-display {
  text-align: center;
  padding: 10px 15px;
  margin-bottom: 5px;
  font-size: 1em;
  font-weight: bold;
  color: #3498db;
}

.hint-label {
  color: #3498db;
}

/* Dark mode */
.dark-mode .hint-display,
.dark-mode .hint-label {
  color: white;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .hint-display {
    font-size: 0.95em;
    padding: 8px 12px;
  }
}

/********************************************************************
 * HORIZONTAL WORD DISPLAY (Hangman-style)
 ********************************************************************/
.horizontal-word-display {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  padding: 10px 15px;
  margin: 10px 0;
}

.horizontal-word {
  display: flex;
  gap: 3px;
}

.word-spacer {
  width: 15px;
}

.horizontal-letter-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 22px;
}

.horizontal-letter {
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: 1.3em;
  font-weight: bold;
  height: 1.4em;
  line-height: 1.4em;
  color: white;
  text-transform: uppercase;
}

.horizontal-letter.hint {
  color: #2ecc71;
}

.horizontal-letter.correct {
  color: #2ecc71;
}

.horizontal-underline {
  width: 100%;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 1px;
}

/* Dark mode adjustments */
body.dark-mode .horizontal-letter {
  color: white;
}

body.dark-mode .horizontal-letter.hint,
body.dark-mode .horizontal-letter.correct {
  color: #2ecc71;
}

body.dark-mode .horizontal-underline {
  background-color: rgba(255, 255, 255, 0.5);
}

/* Light mode adjustments */
body:not(.dark-mode) .horizontal-letter {
  color: #333;
}

body:not(.dark-mode) .horizontal-letter.hint,
body:not(.dark-mode) .horizontal-letter.correct {
  color: #2ecc71;
}

body:not(.dark-mode) .horizontal-underline {
  background-color: rgba(0, 0, 0, 0.3);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .horizontal-word-display {
    padding: 8px 10px;
    gap: 3px;
  }
  
  .horizontal-letter-spot {
    min-width: 18px;
  }
  
  .horizontal-letter {
    font-size: 1.1em;
  }
  
  .word-spacer {
    width: 12px;
  }
  
  .horizontal-underline {
    height: 2px;
  }
}