/* Word Bee Wordle - Daily 5-Letter Word Game Styles - OPTIMIZED FOR ELDERLY & CHILDREN */

/* Override body background for clean white look */
body.wordle-page {
  background: #ffffff !important;
}

body.wordle-page::before {
  display: none !important;
}

/* Hide SEO content from visual display while keeping it in HTML for search engines */
.seo-content,
.seo-expansion,
.seo-columns,
.seo-responsive-grid,
.seo-faq,
footer {
  display: none !important;
}

.wordle-container {
  max-width: 1200px; /* Increased for better desktop layout */
  margin: 0 auto;
  padding: 0.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 80px); /* Account for header */
}

.game-board-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: none;
  border-radius: 12px;
  padding: 1.5rem;
  background: #ffffff;
}

.keyboard-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1.5rem;
  border: none;
  border-radius: 12px;
  padding: 1.5rem;
  background: #ffffff;
}

.game-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Tablet layout - vertical stack but optimized */
@media (min-width: 768px) and (max-width: 899px) {
  .game-content {
    max-width: 500px;
    margin: 0 auto;
    gap: 1.5rem;
  }

  .game-board {
    margin: 62px 0 0 0;
  }

  .keyboard {
    margin: 0;
  }

  .keyboard-section {
    margin-top: 0;
  }
}

/* Desktop layout - side by side */
@media (min-width: 900px) {
  .game-content {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    align-items: flex-start;
    justify-content: center;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
  }

  .game-board-section {
    flex: 0 0 auto;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
  }

  .keyboard-section {
    flex: 0 0 auto;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-top: 0;
    margin-left: 0;
  }

  /* Ensure game board doesn't get too much space */
  .game-board {
    margin: 62px 0 0 0;
  }
}

/* Game Controls styles removed - no longer needed */

.share-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #d3d6da;
  background: white;
  color: #2c3e50;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.help-button:hover, .share-button:hover {
  border-color: #2c3e50;
  background: #f8f9fa;
}

.share-button {
  background: #ffeb3b;
  border-color: #f9d71c;
  color: #2c3e50;
}

.share-button:hover {
  background: #f9d71c;
}

/* Game Board */
.game-board {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 4px;
  margin: 62px 0 0 0;
  justify-content: center;
  flex-shrink: 0;
}

.word-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  justify-content: center;
}

.letter-box {
  width: 62px;
  height: 62px;
  border: 2px solid #d3d6da;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: bold;
  text-transform: uppercase;
  background: white;
  color: #2c3e50;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.letter-box.filled {
  border-color: #878a8c;
  background: #f8f9fa;
}

.letter-box.correct {
  background: #6aaa64;
  border-color: #6aaa64;
  color: white;
}

.letter-box.present {
  background: #c9b458;
  border-color: #c9b458;
  color: white;
}

.letter-box.absent {
  background: #787c7e;
  border-color: #787c7e;
  color: white;
}

.letter-box.flip {
  animation: flip 0.6s ease-in-out;
}

@keyframes flip {
  0% {
    transform: rotateX(0);
  }
  50% {
    transform: rotateX(-90deg);
  }
  100% {
    transform: rotateX(0);
  }
}

/* Game Messages */
.game-messages {
  text-align: center;
  margin: 0;
  height: 0;
  flex-shrink: 0;
  position: absolute;
  top: -30px;
  left: 0;
  right: 0;
}

/* Desktop message positioning */
@media (min-width: 900px) {
  .game-messages {
    margin: 0;
    height: 0;
    top: -30px;
  }
}

.message {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: bold;
  display: inline-block;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.message.show {
  opacity: 1;
}

.message.success {
  background: #6aaa64;
  color: white;
}

.message.error {
  background: #e74c3c;
  color: white;
}

.message.info {
  background: #3498db;
  color: white;
}

/* Keyboard */
.keyboard {
  margin: 0;
  flex-shrink: 0;
  width: 100%;
}

/* Ensure keyboard is fully visible on desktop */
@media (min-width: 900px) {
  .keyboard {
    margin: 0;
    padding: 0;
  }
}

.keyboard-row {
  display: flex;
  justify-content: center;
  margin-bottom: 3px; /* Reduced space between rows */
  gap: 6px; /* More space between keys */
}

.key {
  min-width: 65px; /* Larger for easier tapping */
  height: 75px; /* Taller for better accessibility */
  border-radius: 8px;
  border: 2px solid #b0b3b6; /* Add border for better definition */
  background: #d3d6da;
  color: #2c3e50;
  font-size: 1.2rem; /* Larger font for better readability */
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
  touch-action: manipulation;
  margin: 2px; /* Add margin for better separation */
}

.key:hover {
  background: #bbbfc2;
  transform: translateY(-1px);
}

.help-key {
  background: #3498db;
  color: white;
  border-color: #2980b9;
}

.help-key:hover {
  background: #2980b9;
  border-color: #2471a3;
}

.key:active {
  transform: translateY(0);
  background: #a8abae;
}

.key.key-large {
  min-width: 95px; /* Larger for important keys like ENTER and BACKSPACE */
  font-size: 1.1rem;
  font-weight: 800; /* Extra bold for important keys */
}

.key.correct {
  background: #6aaa64;
  color: white;
}

.key.present {
  background: #c9b458;
  color: white;
}

.key.absent {
  background: #787c7e;
  color: white;
}

.key:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Game Stats Modal */
.game-stats {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.stats-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.stats-content h3 {
  margin: 0 0 1.5rem;
  color: #2c3e50;
  font-size: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #2c3e50;
}

.stat-label {
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
}

.guess-distribution h4 {
  margin: 0 0 1rem;
  color: #2c3e50;
}

.distribution-chart {
  text-align: left;
}

.distribution-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.distribution-label {
  min-width: 20px;
  margin-right: 0.5rem;
  font-weight: bold;
}

.distribution-bar {
  background: #c9b458;
  height: 20px;
  min-width: 20px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
}

.distribution-bar.current {
  background: #6aaa64;
}

.stats-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.stats-button {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 4px;
  background: #ffeb3b;
  color: #2c3e50;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
}

.stats-button:hover {
  background: #f9d71c;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  overflow: hidden;
}

.modal-header {
  background: #ffeb3b;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  color: #2c3e50;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #2c3e50;
}

.modal-body {
  padding: 1.5rem;
  text-align: center;
}

.word-reveal {
  font-size: 2rem;
  font-weight: bold;
  color: #2c3e50;
  margin: 1rem 0;
  letter-spacing: 0.2rem;
  text-transform: uppercase;
}

.modal-actions {
  padding: 1rem 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  background: #f8f9fa;
}

.modal-button {
  padding: 0.8rem 1.2rem;
  border: none;
  border-radius: 4px;
  background: #ffeb3b;
  color: #2c3e50;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
}

.modal-button:hover {
  background: #f9d71c;
}


/* SEO Content Section */
.seo-content {
  background: #f8f9fa;
  padding: 3rem 0;
  margin-top: 2rem;
}

.content-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

.about-wordle h2 {
  color: #2c3e50;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-align: center;
}

.about-wordle h3 {
  color: #2c3e50;
  font-size: 1.3rem;
  margin: 2rem 0 1rem 0;
}

.about-wordle p {
  color: #555;
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.about-wordle ul {
  margin: 1rem 0;
  padding-left: 2rem;
}

.about-wordle li {
  color: #555;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.promo-content h3 {
  margin: 0 0 0.25rem;
  color: #2c3e50;
  font-size: 1.1rem;
}

.promo-content p {
  margin: 0 0 0.5rem;
  color: #666;
  font-size: 0.9rem;
}

.promo-button {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: #ffeb3b;
  color: #2c3e50;
  text-decoration: none;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.promo-button:hover {
  background: #f9d71c;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 215, 28, 0.3);
}

/* Rules Modal */
.rules-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.rules-content {
  background: white;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  padding: 2rem;
}

.rules-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: #666;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
}

.rules-close:hover {
  color: #333;
}

.rules-header {
  margin-bottom: 1.5rem;
}

.rules-header h2 {
  margin: 0 0 0.5rem 0;
  color: #2c3e50;
  font-size: 2rem;
  font-weight: bold;
}

.rules-subtitle {
  margin: 0;
  color: #666;
  font-size: 1rem;
}

.rules-body {
  padding: 0;
}

.rules-list {
  padding-left: 1.2rem;
  margin: 0 0 2rem 0;
}

.rules-list li {
  color: #333;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.rules-examples {
  margin-top: 1.5rem;
}

.rules-examples h4 {
  color: #2c3e50;
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: bold;
}

.example-row {
  margin-bottom: 1.5rem;
}

.example-boxes {
  display: flex;
  gap: 5px;
  margin-bottom: 0.5rem;
}

.example-row p {
  color: #333;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  margin: 1rem 0;
  justify-content: center;
  max-width: 200px;
}

.example-box {
  width: 35px;
  height: 35px;
  border: 2px solid #d3d6da;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  background: white;
  color: #2c3e50;
}

.example-box.correct {
  background: #6aaa64;
  border-color: #6aaa64;
  color: white;
}

.example-box.present {
  background: #c9b458;
  border-color: #c9b458;
  color: white;
}

.example-box.absent {
  background: #787c7e;
  border-color: #787c7e;
  color: white;
}

/* Rules actions removed - using X button instead */

/* Mobile Responsive */
@media (max-width: 768px) {
  .wordle-container {
    padding: 0.25rem;
    min-height: calc(100vh - 60px);
  }

  .game-board-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
  }

  .keyboard-section {
    padding: 0.5rem;
    margin-top: 0.5rem;
  }

  .letter-box {
    width: 58px;
    height: 58px;
    font-size: 1.6rem;
    border-width: 2px;
  }

  .key {
    min-width: 28px;
    height: 58px;
    font-size: 0.95rem;
    margin: 1px;
    padding: 0 4px;
  }

  .key.key-large {
    min-width: 48px;
    font-size: 0.85rem;
  }

  .game-board {
    margin: 0.5rem auto;
    gap: 4px;
  }

  .word-row {
    gap: 4px;
  }

  .keyboard {
    margin: 0.5rem 0;
    width: 100%;
    max-width: 100%;
  }

  .keyboard-row {
    margin-bottom: 4px;
    gap: 4px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .modal-actions {
    flex-direction: column;
  }

  .rules-content {
    max-width: 95%;
  }

  .rules-header {
    padding: 1rem;
  }

  .rules-body {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .wordle-container {
    padding: 0.2rem;
  }

  .game-board-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.25rem;
  }

  .keyboard-section {
    padding: 0.25rem;
    margin-top: 0.25rem;
  }

  .letter-box {
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
    border-width: 2px;
  }

  .game-board {
    gap: 3px;
    margin: 0.5rem auto;
  }

  .word-row {
    gap: 3px;
  }

  .key {
    min-width: 24px;
    height: 54px;
    font-size: 0.85rem;
    margin: 1px;
    padding: 0 2px;
  }

  .key.key-large {
    min-width: 42px;
    font-size: 0.75rem;
  }

  .keyboard {
    margin: 0.5rem 0;
    width: 100%;
    max-width: 100%;
  }

  .keyboard-row {
    margin-bottom: 3px;
    gap: 3px;
  }

}

.seo-expansion {
  background: rgba(12, 51, 91, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 18px;
  padding: 2.5rem;
  margin: 3rem auto;
  max-width: 960px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.seo-expansion h2 {
  font-size: 2rem;
  color: #0f172a;
  margin-bottom: 1rem;
}

.seo-expansion p {
  color: #1e293b;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.seo-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.seo-column {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.seo-column h3 {
  font-size: 1.15rem;
  color: #1d4ed8;
  margin-bottom: 0.75rem;
}

.seo-column ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.seo-column li {
  margin: 0.45rem 0;
  color: #334155;
  font-size: 0.98rem;
}

.seo-responsive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
  margin-top: 2rem;
}

.seo-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(56, 189, 248, 0.12));
  border-radius: 16px;
  padding: 1.8rem;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.seo-card h3 {
  color: #1d4ed8;
  margin-bottom: 0.75rem;
}

.seo-card p,
.seo-card li {
  color: #334155;
}

.seo-faq details {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.95);
}

.seo-faq summary {
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
}

.seo-faq p {
  margin-top: 0.75rem;
  color: #1f2937;
}

@media (max-width: 768px) {
  .seo-expansion {
    padding: 1.75rem;
  }

  .seo-expansion h2 {
    font-size: 1.6rem;
  }

  .seo-card {
    padding: 1.4rem;
  }
}

/* Completion Message Overlay */
.completion-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.completion-box {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.completion-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 0.6s ease;
}

.completion-title {
  font-size: 2rem;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.completion-subtitle {
  font-size: 1.1rem;
  color: #52525b;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.completion-subtitle strong {
  color: #10b981;
  font-weight: 700;
}

.completion-share-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.completion-share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

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

/* Shake animation for invalid words */
.word-row.shake {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
  20%, 40%, 60%, 80% { transform: translateX(8px); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-20px); }
  60% { transform: translateY(-10px); }
}

@media (max-width: 768px) {
  .completion-box {
    padding: 2rem 1.5rem;
    max-width: 90%;
  }

  .completion-emoji {
    font-size: 3rem;
  }

  .completion-title {
    font-size: 1.6rem;
  }

  .completion-subtitle {
    font-size: 1rem;
  }
}
