/* Box sizing + font smoothing */
* { box-sizing: border-box;}
html, body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* General layout */
body {
  font-family: 'Kanit', sans-serif;
  background: #f6f4ef;
  margin: 0;
  color: #000;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode styles - BLACK THEME */
body.dark-mode {
  background: #13141c;
  color: #e0e0e0;
}

/* Three column layout */
.three-columns {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  justify-self: center;
  gap: 1rem;
  margin: 1rem auto;
  padding: 0 1rem;
  align-items: start;
}

/* Container */
.left-container {
  grid-column: 1;
  justify-self: stretch;
  padding: 0;
  margin: 0;
  left: 0;
  background-color: transparent;
  color: inherit;
  overflow: hidden;
}

.container {
  grid-column: 2;
  width: 500px;
  padding: 1rem 2rem;
  background-color: transparent;
  justify-self: center;
  color: inherit;
}

.right-container {
  grid-column: 3;
  justify-self: stretch;
  padding: 0;
  margin: 0;
  right: 0;
  background-color: transparent;
  color: inherit;
  overflow: hidden;
}

/* Mobile ad: only center, horizontal shape */
.mobile-ad {
  display: none;
  width: 100%;
  margin: 0;
}

.mobile-ad-inner {
  padding: 10px;
}

/* Responsive logic: show only center ad on mobile */
@media (max-width: 600px) {
  .mobile-ad {
    display: flex;
    width: 100%;
    max-height: 120px;
    overflow: hidden; 
    justify-content: center; 
    align-items: center;
    position: fixed;
    bottom: 0;
    top: auto;
    z-index: 9999;
    background: rgba(233, 227, 213, 0.75)
    /* Blur effect */
    /* backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); */
  }

  body.dark-mode .mobile-ad {
    background: rgba(19, 20, 28, 0.7);
  }
}

/* ===== Header ===== */
.header-with-menu {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  position: relative;
}

.header-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  color: inherit;
}

.header-controls {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.45rem;
  border-radius: 100%;
  width: 2.5rem;
  transition: background 0.2s ease;
  color: inherit;
}

.dark-mode-toggle:hover {
  background: rgba(0, 0, 0, 0.1);
}

body.dark-mode .dark-mode-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.subtitle {
  font-size: 1rem;
  margin: 1.5rem 0 2rem 0;
  color: inherit;
  text-align: center;
}

/* Dropdown */
.dropdown {
  position: relative;
}
.menu-button {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.45rem;
  border-radius: 100%;
  width: 2.5rem;
  transition: background 0.2s ease;
  color: inherit;
}
.menu-button:hover {
  background: rgba(0, 0, 0, 0.1);
}

body.dark-mode .menu-button:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Dropdown content */
.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  margin-top: 0.5rem;
  background: #ffffff;
  border: 2px solid #000;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  min-width: 180px;
  z-index: 999;
}

body.dark-mode .dropdown-content {
  background: #2d2d44;
  border-color: #e0e0e0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.dropdown-content a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  color: #000;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
}

body.dark-mode .dropdown-content a {
  color: #e0e0e0;
}

.dropdown-content a:hover {
  background: rgba(0, 0, 0, 0.05);
}

body.dark-mode .dropdown-content a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dropdown.open .dropdown-content {
  display: block;
}

/* Disabled elements */
.disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

/* Points Toast Notification */
.points-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 4px;
  background: rgba(45, 128, 9, 0.8);
  color: #fff;
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 9999;
}

@keyframes pointsToast {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
  40% {
    transform: translate(-50%, -50%) scale(1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
}

/* Game info layout update */
.game-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: inherit;
  margin: 0;
  align-items: center;
}

.game-info span {
  flex: 1;
  text-align: center;
}

.game-info span:first-child {
  text-align: left;
}

.game-info span:last-child {
  text-align: right;
}

/* Input Section */
#input-section {
  margin: 1.5rem 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
#input-section .game-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: inherit;
  margin: 0;
}
#input-section input {
  /* width: 100%; */
  padding: 0.45rem 1rem;
  font-size: 1rem;
  border: 2px solid #000;
  border-radius: 8px;
  outline: none;
  transition: all 0.16s ease;
  background: #ffffff;
  color: #333;
}

#guessInput{
  font-weight: 700;
  font-family: 'Kanit', sans-serif;
}

#guessInput::placeholder {
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  color: #999;
}

body.dark-mode #input-section input {
  background: #2d2d44;
  color: #e0e0e0;
  border: 3px solid #e0e0e0;
}

input[disabled] {
  cursor: not-allowed;
  background-color: #f5f5f5;
  color: #999;               
}

body.dark-mode input[disabled] {
  background-color: #3a3a52;
  color: #666;               
}

.inline-warning {
  color: #000;
  font-size: 1.1rem;
  margin: 0.3rem;
}

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

/* Section Titles */
.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 1.2rem 0 0.8rem 0;
  color: inherit;
  text-align: left;
}

/* Card (used for result rows) */
.card {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 7px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
  overflow: hidden;
  margin-bottom: 0.5rem;
  padding: 0.5rem 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border 0.18s ease;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark-mode .card {
  background: #2d2d44;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.07);
}

body.dark-mode .card:hover {
  box-shadow: 0 6px 14px rgba(0,0,0,0.4);
}

/* Info card */
.info-card {
  font-weight: 500;
  display: block;
  background: #ffffff;
  border: 1.5px solid #000;
  color: #000;
  font-size: 0.96rem;
  line-height: 1.5rem;
  padding: 1.2rem 1.15rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

body.dark-mode .info-card {
  background: #2d2d44;
  border-color: #e0e0e0;
  color: #e0e0e0;
}

/* Header with icon */
.how-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.how-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: inherit;
}

/* Question mark icon */
.help-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  color: #000;
  font-size: 1.3rem;
  flex-shrink: 0;
}

body.dark-mode .help-icon {
  border-color: #e0e0e0;
  color: #e0e0e0;
}

/* List styling */
.how-list {
  margin: 0;
  padding-left: 1.25rem;
  list-style: disc;
  color: inherit;
  font-size: 0.95rem;
  line-height: 1.5rem;
}
.how-list li { margin-bottom: 0.5rem; }

/* Points System Styling in How to Play */
.points-system {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(100, 182, 171, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(100, 182, 171, 0.3);
}

body.dark-mode .points-system {
  background: rgba(100, 182, 171, 0.15);
  border-color: rgba(100, 182, 171, 0.4);
}

.points-section {
  margin-bottom: 1.2rem;
}

.points-section:last-child {
  margin-bottom: 0;
}

.points-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: #000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.dark-mode .points-section h3 {
  color: #e0e0e0;
}

.points-section ul {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
}

.points-section li {
  margin-bottom: 0.3rem;
  line-height: 1.4;
  color: #000;
}

body.dark-mode .points-section li {
  color: #e0e0e0;
}

.points-section strong {
  color: #1c9c8b;
  font-weight: 700;
}

body.dark-mode .points-section strong {
  color: #4ecdc4;
}

.points-note {
  margin-top: 1rem;
  padding: 0.8rem;
  background: rgba(233, 194, 87, 0.1);
  border-radius: 6px;
  border-left: 3px solid #e9c257;
  font-size: 0.85rem;
  line-height: 1.4;
}

body.dark-mode .points-note {
  background: rgba(233, 194, 87, 0.15);
  border-left-color: #e9c257;
}

.points-note p {
  margin: 0;
  color: #000;
}

body.dark-mode .points-note p {
  color: #e0e0e0;
}

.points-note strong {
  color: #e9c257;
}

body.dark-mode .points-note strong {
  color: #ffd700;
}

/* Bonus description styling */
.bonus-description {
  font-size: 0.85rem;
  margin: 0.5rem;
  color: #000;
  line-height: 1.3;
}

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

/* Responsive design */
@media (max-width: 600px) {
  .points-section h3 {
    font-size: 0.9rem;
  }
  
  .points-section ul {
    font-size: 0.8rem;
  }
  
  .points-note {
    font-size: 0.8rem;
    padding: 0.6rem;
  }
}

/* prevents body to scroll when modal is open */
body:has(.modal:not(.hidden)) {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Modal Styles */
.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.hidden { display: none; }

.modal-content {
  background: #f6f4ef;
  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: #3a3d52;
  border-color: #e0e0e0;
  color: #e0e0e0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}

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

body.dark-mode .close-btn,
body.dark-mode .close-hint-btn {
  color: #e0e0e0;
}

.close-btn:hover { 
  color: #666; 
}

body.dark-mode .close-btn:hover,
body.dark-mode .close-hint-btn:hover {
  color: #ffffff;
}

/* Action buttons */
.action-buttons{
  align-self: center;
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  margin-top: 0.5rem;
  padding: 0.3rem 0.3rem;
  width: 5rem;
  font-family: 'Kanit', sans-serif;
  font-size: 1rem;
  font-weight: 900;
  background: #ffffff;
  border: 1px solid #000;
  border-radius: 6px;
  cursor: pointer;
  color: #000;
}
.action-btn:hover {
  transform: scale(1.03);
  transition: none;
}

body.dark-mode .action-btn {
  background: #2d2d44;
  border: 1.2px solid #e0e0e0;
  color: #e0e0e0;
}

body.dark-mode .action-btn:hover {
  transform: scale(1.03);
  transition: none;
}

/* Horizontal separator styling */
.horizontal-separator {
  display: flex;
  align-items: center;
  text-align: center;
}

.horizontal-separator::before,
.horizontal-separator::after {
  content: "";
  flex: 1;
  margin-top: 1rem;
  border-bottom: 0.5px solid #b4b1b1;
}

/* create game and play archive buttons styling */
.bottom-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.bottom-action-btn {
  padding: 0.3rem 0.3rem;
  width: 100%;
  font-family: 'Kanit', sans-serif;
  font-size: 1rem;
  font-weight: 900;
  background: #ffffff;
  border: 1px solid #000;
  border-radius: 6px;
  cursor: pointer;
  color: #000;
  transition: all 0.2s ease;
}

.bottom-action-btn:hover {
  transform: scale(1.03);
  transition: none;
}

/* Dark mode styles for bottom buttons */
body.dark-mode .horizontal-separator::before,
body.dark-mode .horizontal-separator::after {
  border-bottom: 1.2px solid #e0e0e0;
}

body.dark-mode .separator-text {
  color: #a0a0a0;
}

body.dark-mode .bottom-action-btn {
  background: #2d2d44;
  border: 1.2px solid #e0e0e0;
  color: #e0e0e0;
}

body.dark-mode .bottom-action-btn:hover {
  transform: scale(1.03);
  transition: none;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .bottom-action-buttons {
    gap: 0.5rem;
  }
  
  .bottom-action-btn {
    padding: 0.4rem 0.3rem;
  }
}

/* Create Game Modal Styles */
.create-game-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #000;
  text-align: left;
}

body.dark-mode .create-game-header {
  border-bottom-color: #e0e0e0;
}

.create-game-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: left;
  font-family: 'Kanit', sans-serif;
}

.create-game-description {
  text-align: left;
  margin-bottom: 1.5rem;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.4;
  font-family: 'Kanit', sans-serif;
}

body.dark-mode .create-game-description {
  color: #94a3b8;
}

.create-game-form {
  width: 100%;
  margin-bottom: 1rem;
}

.form-group {
  width: 100%;
  margin-bottom: 0.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.1rem;
  margin-left: 0.3rem;
  color: #000;
  font-size: 0.9rem;
  text-align: left;
  font-family: 'Kanit', sans-serif;
}

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

.create-game-input {
  width: 100%;
  padding: 0.35rem;
  border: 2px solid #000;
  border-radius: 8px;
  font-size: 1rem;
  background-color: #fff;
  color: #000;
  transition: border-color 0.3s;
  box-sizing: border-box;
  font-family: 'Kanit', sans-serif;
}

.create-game-input:focus {
  border-color: #fff;
}

body.dark-mode .create-game-input {
  background-color: #2d2d44;
  color: #e0e0e0;
  border: 2px solid #e0e0e0;
}

/* Create Game Actions */
.create-game-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  width: 100%;
}

.create-game-submit-btn {
  width: 6.5rem;
  padding: 0.35rem 0.1rem;
  background-color: #e9c257;
  color: #000;
  border: 0px solid #e9c257;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Kanit';
}

.create-game-submit-btn:disabled {
  background-color: #e9c257;
  cursor: not-allowed;
}

.create-game-submit-btn:hover {
  background-color: #b98d25;
}

body.dark-mode .create-game-submit-btn {
  background-color: #e0e0e0;
  border: 0.1px solid #e0e0e0;
  color: #2d2d44;
}

body.dark-mode .create-game-submit-btn:hover {
  background-color: #a19e9e;
}

/* Results section - appears inline after success */
.create-game-results {
  width: 100%;
  margin-top: 0.5rem;
  font-family: 'Kanit', sans-serif;
}

/* Game link section */
.game-link-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: #000;
  font-weight: 600;
  font-family: 'Kanit', sans-serif;
}

body.dark-mode .game-link-section h3 {
  color: #e0e0e0;
}

.link-label {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0;
  font-weight: 500;
  font-family: 'Kanit', sans-serif;
}

body.dark-mode .link-label {
  color: #94a3b8;
}

.game-link-container {
  display: flex;
  background: #fff;
  border: 2px solid #000;
  border-radius: 8px;
  align-items: center;
}

body.dark-mode .game-link-container {
  background: #3a3a52;
  border: 2px solid #e0e0e0;
}

.game-link-input {
  flex: 1;
  border: none;
  background: transparent;
  color: #000;
  font-size: 0.95rem;
  padding: 0.35rem;
  outline: none;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
}

body.dark-mode .game-link-input {
  color: #e0e0e0;
}

.copy-link-btn {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 1.2rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  min-width: 80px;
}

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

/* Closest words section */
.closest-words-section {
  margin-top: 1.5rem;
}
.closest-words-title {
  margin: 0 0 0.5rem 0 !important;
  font-weight: 600;
  color: #000 !important;
  font-size: 1rem;
  font-family: 'Kanit', sans-serif;
}

body.dark-mode .closest-words-title {
  color: #e0e0e0 !important;
}

/* Create Game Modal - Closest Words Preview Styles */
.closest-word-preview-item {
  position: relative;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-family: 'Kanit';
}

.closest-word-preview-item .result-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 6px 0 0 6px;
  transition: width 0.3s ease;
}

.closest-word-preview-item .result-content {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 1rem;
  z-index: 1;
}

.closest-word-preview-item .word {
  font-weight: 600;
  color: #111827;
  font-family: 'Kanit';
  font-size: 0.9rem;
}

.closest-word-preview-item .rank {
  font-weight: 700;
  color: #111827;
  font-size: 1rem;
  font-family: 'Kanit', sans-serif;
}

/* Dark mode adjustments for closest words */
body.dark-mode .closest-word-preview-item {
  background: #2d2d44;
  border-color: #4a5568;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.dark-mode .closest-word-preview-item:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

body.dark-mode .closest-word-preview-item .word,
body.dark-mode .closest-word-preview-item .rank {
  color: #f3f4f6;
}

/* Success/Error messages */
.create-game-message {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
  box-sizing: border-box;
  margin-top: 0.5rem;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
}

.create-game-message.success {
  background-color: rgba(100, 182, 171, 0.1);
  color: #64b6ab;
  border: 1px solid rgba(100, 182, 171, 0.3);
}

.create-game-message.error {
  background-color: rgba(245, 144, 105, 0.1);
  color: #F59069;
  border: 1px solid rgba(245, 144, 105, 0.3);
}

.create-game-message.info {
  background-color: rgba(233, 194, 87, 0.1);
  color: #e9c257;
  border: 1px solid rgba(233, 194, 87, 0.3);
}

/* Scrollbars */
.closest-words-preview::-webkit-scrollbar {
  width: 6px;
}

.closest-words-preview::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.closest-words-preview::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.closest-words-preview::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

body.dark-mode .closest-words-preview::-webkit-scrollbar-thumb {
  background: rgba(224, 224, 224, 0.2);
}

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

/* Responsive design */
@media (max-width: 600px) {
  .create-game-title {
    font-size: 1.3rem;
  }
  
  .create-game-description {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }
  
  .game-link-section h3 {
    font-size: 1.1rem;
  }
  
  .closest-words-title {
    font-size: 1rem;
  }
  
  .game-link-input {
    font-size: 0.85rem;
  }
  
  .copy-link-btn {
    font-size: 0.85rem;
  }

  .closest-word-preview-item .result-content{
    padding: 0.35rem 0.8rem;
  }
  
  .closest-word-preview-item .word {
    font-size: 0.9rem;
  }
  
  .closest-word-preview-item .rank {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .create-game-title {
    font-size: 1.2rem;
  }
  
  .create-game-submit-btn {
    font-size: 0.8rem;
  }
  
  .game-link-section h3 {
    font-size: 1rem;
  }
  
  .link-label {
    font-size: 0.85rem;
  }
  
  .game-link-input {
    font-size: 0.8rem;
  }
  
  .closest-words-title {
    font-size: 0.95rem;
  }
}

/* Hint Modal */
.hint-btn {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: 'Kanit', sans-serif;
  background: #e9c257;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #000;
  transition: background 0.2s ease;
}
.hint-btn:hover {
  background: #b98d25;
}
.hint-result {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: inherit;
}

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

.logout-btn:hover {
  transform: scale(1.03);
}

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

body.dark-mode .logout-btn:hover {
  transform: scale(1.03);
}

/* Giveup Modal */
.giveup-btn {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: 'Kanit', sans-serif;
  background: #e9c257;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #000;
  transition: background 0.2s ease;
}

#giveup-yes-btn {
    margin-right: 1.5rem;
  }

.giveup-btn:hover {
  background: #b98d25;
}

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

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

/* Messages */
.message {
  padding: 0.8rem 1rem;
  font-size: 1rem;
  text-align: center;
  font-weight: 600;
}
.message.success {
  border: 2px solid #16a34a;
  color: #166534;
  background: #ffffff;
}

body.dark-mode .message.success {
  border-color: #4ade80;
  color: #bbf7d0;
  background: #2d2d44;
}

.message.error {
  border: 2px solid #dc2626;
  color: #991b1b;
  background: #ffffff;
}

body.dark-mode .message.error {
  border-color: #f87171;
  color: #fecaca;
  background: #2d2d44;
}

/* Highlight */
.highlight {
  border: 2px solid #000;
}

body.dark-mode .highlight {
  border: 2px solid #e0e0e0;
}

/* Fill effect */
.result-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  z-index: 0;
  transition: width 0.36s ease;
}

/* Card content */
.result-content {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.word {
  font-weight: 700;
  font-size: 1rem;
  color: inherit;
}

.dark-mode .word {
  color: #000
}

.rank {
  color: inherit;
  font-weight: 700;
  font-size: 0.9rem;
}

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

.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;
  margin: 0;
  color: var(--text-color, #333);
}

.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-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #e0e3e5;
  color: #000;
  min-width: 200px;
}

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

.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);
}

/* Rating Section */
.rating-section {
    text-align: center;
    background-color: #fffacd;
    padding: 2rem;
    margin-bottom: 0;
}

.rating-title {
    margin: 0;
    font-size: 1.6rem;
    color: #000;
    font-weight: 600;
}

.rating-stars {
  font-size: 3rem;
  color: #e0e0e0;
  letter-spacing: 0.5rem;
  margin: 0;
  display: flex;
  justify-content: center;
  cursor: pointer;
}

.fa-star{
  font-weight: 200;
}

.rating-stars .star {
  color: #e0e0e0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  font-family: inherit;
  user-select: none;
  cursor: pointer;
}
.rating-stars .star.selected,
.rating-stars .star.hovered {
  color: #ffc107;
}
.rating-stars .star:active {
  transform: scale(1.15);
}
body.dark-mode .rating-stars .star {
  color: #444;
}
body.dark-mode .rating-stars .star.selected,
body.dark-mode .rating-stars .star.hovered {
  color: #ffc107;
}

.rating-average {
    font-size: 1.4rem;
    color: #000;
    margin: 0.2rem;
}

#avg-rating-value {
    font-weight: 600;
}

.rating-count {
    font-size: 0.85rem;
    color: #666;
    margin: 0.2rem;
}

#rating-thankyou{
  display: none; 
  color: #388e3c; 
  font-weight: 600; 
  margin: 0.2rem;
}

body.dark-mode .rating-section {
    background-color: #1e2029;
}

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

body.dark-mode .rating-stars {
    color: #ffc107;
}

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

body.dark-mode .rating-count {
    color: #a0a0a0;
}

/* Footer */
footer {
    text-align: center;
    background-color: #facb1c;
    padding: 1rem;
    font-size: 0.85rem;
    color: #000;
}

footer p{
  margin: 0.3rem;
}

body.dark-mode footer {
    color: #94a3b8;
    background-color: #2f3247;
}

.footer-links {
    margin-top: 0.5rem;
}

.footer-links a {
    color: #000;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #000;
    text-decoration: underline;
}

body.dark-mode .footer-links a {
    color: #94a3b8;
}

body.dark-mode .footer-links a:hover {
    color: #e0e0e0;
}

.footer-links span {
    margin: 0 0.2rem;
    color: #94a3b8;
}

@media (max-width: 600px) {
  footer {
      margin-bottom: 120px;
  }
}

/* Social Links Styles */
.social-links {
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.social-links .fab {
    font-size: 1.1rem;
}

.social-links span {
    color: #000;
    font-size: 0.85rem;
}

.social-links a {
    color: #000;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.2s, transform 0.2s;
    padding: 0.2rem;
}

.social-links a:hover {
    transform: scale(1.1);
    text-decoration: none;
}

/* Instagram hover effect */
.social-links a:nth-child(2):hover {
    color: #E4405F; /* Instagram color */
}

/* Facebook hover effect */
.social-links a:nth-child(4):hover {
    color: #1877F2; /* Facebook color */
}

/* Twitter hover effect */
.social-links a:nth-child(6):hover {
    color: #1DA1F2; /* Twitter color */
}

body.dark-mode .social-links span {
    color: #94a3b8;
}

body.dark-mode .social-links a {
    color: #94a3b8;
}

body.dark-mode .social-links a:hover {
    color: #e0e0e0;
}

/* Keep brand colors in dark mode too */
.rating-stars .star i {
  color: #e0e0e0;
  transition: color 0.18s;
}

.rating-stars .star.selected i,
.rating-stars .star.hovered i {
  color: #ffc107;
}
/* Responsive Design */
@media (max-width: 480px) {
    .social-links {
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    
    .social-links span:first-child {
        margin-bottom: 0.5rem;
    }
}

.hidden { display: none !important; }

/* For mobile devices */
@media (max-width: 600px) {
  .three-columns {
    display: inline;
    gap: 0.5rem;
    padding: 0 0.5rem;
    align-items: center;
    margin: 0;
  }
  
  .container {
    grid-row: 2; /* Middle row */
    width: auto;
    padding: 0.5rem 2rem;
    justify-self: stretch; /* Take full width on mobile */
  }

  .left-container {
    display: none;
  }
  
  .right-container {
    display: none;
  }

  header h1 { 
    font-size: 1.6rem; 
  }

  .how-title { 
    font-size: 1rem; 
  }

  #input-section .game-info { 
    font-size: 0.8rem; 
    flex-direction: row; 
    gap: 0.35rem; 
    align-items: flex-start; 
  }

  .modal {
    padding: 0;
  }

  .modal-content {
    max-height: 70vh;
  }
}

/* Empty Placeholder block */
.empty-placeholder {
  height: 500px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
}

.empty-placeholder.hidden {
  display: none;
}

.loader-text {
  font-weight: 500;
  font-size: 1rem;
  color: inherit;
}

.wave-loader span {
  display: inline-block;
  animation: waviy 1.5s infinite;
  animation-delay: calc(0.05s * var(--i));
  position: relative;
  margin-right: -0.15rem;
}

#game-loader{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

@keyframes waviy {
  0%, 40%, 100% {
    transform: translateY(0);
  }
  20% {
    transform: translateY(-10px);
  }
}

.hidden {
  display: none;
}

/* 🎉 WIN SCREEN STYLE */
#win-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  background: #e0e3e5;
  z-index: 1000;
}

body.dark-mode #win-screen {
  background: #1a1a2e;
}

.win-card {
  background: #ffffff;
  border-radius: 0.5rem;
  padding: 2.5rem 2rem;
  max-width: 450px;
  width: 100%;
  text-align: center;
  animation: fadeInScale 0.4s ease forwards;
  border: 2px solid #000;
}

body.dark-mode .win-card {
  background: #2f3247;
  border-color: #e0e0e0;
}

.win-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: inherit;
}

.win-card p {
  font-size: 1rem;
  margin: 0.6rem 0;
  color: inherit;
  font-weight: 400;
  line-height: 1.5;
}

.win-card strong {
  font-weight: 700;
  color: inherit;
}

.play-again-section {
  text-align: center;
  margin-top: 1.5rem;
  padding: 0 1rem;
}

.wins-new-game-btn {
  font-family: 'Kanit', sans-serif;
  padding: 0.45rem 1rem;
  background: #fff;
  color: #000;
  border: 2px solid #000;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

.wins-new-game-btn:hover {
  transform: scale(1.03);
  transition: none;
}

.wins-new-game-btn i {
  margin-right: 0.5rem;
}

/* Dark mode support */
body.dark-mode .wins-new-game-btn {
  background: #e0e0e0;
  color: #2d2d44;
  border: 2px solid #2d2d44;
}

body.dark-mode .wins-new-game-btn:hover {
  transform: scale(1.03);
  transition: none;
}

/* Responsive design */
@media (max-width: 768px) {
  .wins-new-game-btn {
    padding: 0.65rem 1.2rem;
    font-size: 0.95rem;
  }
}


/* Secret Word Bold Styling */
.secret-word-bold {
    font-weight: 700 !important;
    font-size: 1em !important;
    text-transform: uppercase;
}

/* Share Results Section */
.share-results {
    padding: 1rem;
    background: rgba(100, 116, 139, 0.05);
    border-radius: 8px;
    border: 1px solid #000;
}

.share-text {
    margin: 0 0 0.8rem 0;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.share-buttons {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: 1px solid #64748b;
    border-radius: 6px;
    background: white;
    color: #64748b;
    font-family: 'Kanit', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-btn .fab {
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

.share-insta:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
    border-color: transparent;
}

.share-fb:hover {
    background: #1877f2;
    color: white;
    border-color: transparent;
}

.share-twitter:hover {
    background: #1da1f2;
    color: white;
    border-color: transparent;
}

/* Dark Mode Styles */
body.dark-mode .share-results {
    background: rgba(148, 163, 184, 0.08);
    border-color: #fff;
}

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

body.dark-mode .share-btn {
    background: #e0e0e0;
    border-color: #334155;
    color: #13141c;
}

body.dark-mode .share-insta:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
    border-color: transparent;
}

body.dark-mode .share-fb:hover {
    background: #1877f2;
    color: white;
    border-color: transparent;
}

body.dark-mode .share-twitter:hover {
    background: #1da1f2;
    color: white;
    border-color: transparent;
}

/* Responsive Design */
@media (max-width: 480px) {
    .share-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .share-btn {
        justify-content: center;
        padding: 0.7rem 1rem;
    }
}

/* Simplified Points Earned Section */
.points-earned-section {
  text-align: center;
}

.points-earned {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #495057;
}

body.dark-mode .points-earned {
  color: #e2e8f0;
}

.points-earned i {
  color: #e9c257;
  font-size: 1.2rem;
}

.points-earned strong {
  color: #d4a017;
  font-size: 1.1rem;
  font-weight: 700;
}

body.dark-mode .points-earned strong {
  color: #e9c257;
}

/* Badge variant (alternative minimal style) */
.points-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #fff9db 0%, #fff3bf 100%);
  border: 1px solid #ffd43b;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: #5c3c00;
}

body.dark-mode .points-badge {
  background: linear-gradient(135deg, #44403c 0%, #57534e 100%);
  border-color: #d97706;
  color: #fef3c7;
}

/* Responsive design */
@media (max-width: 480px) {
  .points-earned {
    font-size: 0.9rem;
    gap: 0.5rem;
  }
  
  .points-earned i {
    font-size: 1rem;
  }
  
  .points-earned strong {
    font-size: 1rem;
  }
}

/* Guess distribution */
.guess-distribution {
    margin: 0.5rem 30%;
    padding: 1rem;
}

.distribution-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 200px;
    margin: 0 auto;
}

.distribution-row {
    display: flex;
    width: 100%;
}

.distribution-boxes {
    display: flex;
    gap: 0.5rem;
}

.distribution-box {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.green-box {
    background-color: #64b6ab;
}

.yellow-box {
    background-color: #e9c257;
}

.orange-box {
    background-color: #F59069;
}

.dark-mode .green-box {
    background-color: #64b6ab;
    border-color: #64b6ab;
}

.dark-mode .yellow-box {
    background-color: #e9c257;
    border-color: #e9c257;
}

.dark-mode .orange-box {
    background-color: #F59069;
    border-color: #F59069;
}

.distribution-count {
    font-size: 0.9rem;
    font-weight: 600;
    align-self: center;
    min-width: 30px;
    color: #374151;
}

.dark-mode .distribution-count {
    color: #d1d5db;
}

@media (max-width: 768px) {
  .guess-distribution {
    margin: 0.5rem 25%;
  }
}

/* Next game timer */
.next-game-timer {
  text-align: center;
  margin: 0.5rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border: 1px solid #000;
}

body.dark-mode .next-game-timer {
  background: rgba(45, 45, 68, 0.3);
  border-color: #fff;
}

.timer-title {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: #666;
  font-weight: 600;
}

.timer-display {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  font-weight: bold;
  color: #64b6ab;
  letter-spacing: 2px;
}

.dark-mode .timer-display {
  color: #4ecdc4;
}

.dark-mode .timer-title {
  color: #ccc;
}

.next-game-timer.hidden {
  display: none;
}

/* 🎬 animation */
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* Closest Words Modal Text Styling */
.closest-word-text {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 0 1rem;
}

.closest-word-text p {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: #000;
  line-height: 1.4;
}

body.dark-mode .closest-word-text p {
  color: #e0e0e0;
}

.closest-game-number {
  color: #000;
  font-weight: 800;
}

body.dark-mode .closest-game-number {
  color: #e0e0e0;
}

.closest-secret-word {
  color: #64b6ab;
  font-weight: 800;
  margin-left: 0.3rem;
}

body.dark-mode .closest-secret-word {
  color: #4a9c91;
}

.closest-word-text div {
  font-size: 0.95rem;
  color: #6b7280;
  font-weight: 600;
  margin-top: 0.5rem;
}

body.dark-mode .closest-word-text div {
  color: #94a3b8;
}

.closest-word-item {
  margin-bottom: 0.5rem;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  transition: transform 0.2s ease;
}

/* Closest Words Button Styling */
#closest-words-section {
  text-align: center;
  margin: 1.5rem 0;
  padding: 0 1rem;
}

.closest-words-btn {
  font-family: 'Kanit', sans-serif;
  padding: 0.45rem 1rem;
  background: #fff;
  color: #000;
  border: 2px solid #000;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

.closest-words-btn:hover {
  transform: scale(1.03);
  transition: none;
}

.closest-words-btn i {
  margin-right: 0.5rem;
}

/* Dark mode support */
body.dark-mode .closest-words-btn {
  background: #e0e0e0;
  color: #2d2d44;
  border: 2px solid #2d2d44;
}

body.dark-mode .closest-words-btn:hover {
  transform: scale(1.03);
  transition: none;
}

/* Responsive design */
@media (max-width: 768px) {
  .closest-words-btn {
    padding: 0.65rem 1.2rem;
    font-size: 0.95rem;
  }
  
  .closest-word-text p {
    font-size: 1rem;
  }
  
  .closest-word-text div {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .closest-word-text {
    padding: 0 0.5rem;
  }
  
  .closest-word-text p {
    font-size: 0.95rem;
  }
  
  .closest-word-text div {
    font-size: 0.85rem;
  }
}

/* Previous game modal */
.previous-modal-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.3rem;
  color: inherit;
}

.previous-game-item {
  background: #fff;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin-bottom: 0.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-weight: 600;
  transition: background 0.25s ease, transform 0.15s ease;
  border: 2px solid #000;
}

.previous-game-item:hover {
  background: #e9c257;
}

body.dark-mode .previous-game-item {
  background: #3a3a52;
  border-color: #e0e0e0;
}

body.dark-mode .previous-game-item:hover {
  background: #6a6a82;
}

.previous-game-date {
  flex: 1;
  font-size: 0.85rem;
  color: #000;
  font-weight: 600;
  text-align: left;
}

body.dark-mode .previous-game-date {
  color: #e0e0e0;
}

.previous-game-word {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  color: #000;
  text-align: center;
}

body.dark-mode .previous-game-word {
  color: #e0e0e0;
}

.previous-game-status {
  flex: 1;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
}

.previous-game-status span {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #000;
}

body.dark-mode .previous-game-status span {
  color: #e0e0e0;
}

/* Responsive previous games modal */
@media (max-width: 600px) {
  .previous-game-date {
  font-size: 0.7rem;
}
  
.previous-game-word {
  font-size: 0.8rem;
}

.previous-game-status span{
  font-size: 0.7rem;
}
}

/* STATS modal - Clean Design */
.stats-modal-title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: inherit;
}

.stats-grid-modal {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0.6rem;
  margin: 0 auto;
}

.stat-box {
  border-radius: 8px;
  /* padding: 0.8rem 0.3rem; */
  border: 2px solid #000;
  text-align: center;
  color: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  min-height: 70px;
}

.stat-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.stat-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.dark-mode .stat-box {
  background: #2d2d44;
  color: #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid #fff;
}

body.dark-mode .stat-box:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stat-box h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.2rem;
}

.stat-box p {
  margin: 0;
  font-size: 0.7rem;
  color: #000;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

body.dark-mode .stat-box p {
  color: #a0a0a0;
}

/* Stats summary section */
.stats-summary {
  margin-top: 1rem;
  padding: 1rem;
  background: #ffffff;
  border-radius: 8px;
  text-align: center;
  border: 2px solid #000;
}

body.dark-mode .stats-summary {
  background: #2d2d44;
  border: 1px solid #fff;
}

.stats-summary h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 900;
  color: #000;
}

body.dark-mode .stats-summary h4 {
  color: #e0e0e0;
}

.stats-summary p {
  margin: 0.3rem 0;
  font-size: 0.75rem;
  color: #000;
  font-weight: 500;
}

body.dark-mode .stats-summary p {
  color: #a0a0a0;
}

.win-rate {
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: #64b6ab !important;
}

.giveup-rate {
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: #b67764 !important;
}

body.dark-mode .win-rate {
  color: #4ade80 !important;
}

/* Stats Sign-in Prompt Styles */
.stats-signin-prompt {
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
}

.signin-icon {
  font-size: 3rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

body.dark-mode .signin-icon {
  color: #9ca3af;
}

.stats-signin-prompt h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 1rem;
}

body.dark-mode .stats-signin-prompt h3 {
  color: #e0e0e0;
}

.stats-signin-prompt p {
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

body.dark-mode .stats-signin-prompt p {
  color: #9ca3af;
}

.stats-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #e9c257;
  color: #000;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
  margin-bottom: 1.5rem;
}

body.dark-mode .stats-signin-btn {
  background: #e0e0e0;
  color: #1a1a2e;
}

.stats-signin-btn:hover {
  background: #b69949;
}

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

.signin-note {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0;
}

body.dark-mode .signin-note {
  color: #9ca3af;
}

.signup-link {
  color: #000;
  text-decoration: underline;
  font-weight: 600;
}

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

.signup-link:hover {
  color: #333;
}

body.dark-mode .signup-link:hover {
  color: #a19e9e;
}

/* Stats Error Styles */
.stats-error {
  text-align: center;
  padding: 2rem;
  color: #b91c1c;
}

body.dark-mode .stats-error {
  color: #fca5a5;
}

.stats-error i {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.stats-error h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.stats-error p {
  color: #6b7280;
}

body.dark-mode .stats-error p {
  color: #9ca3af;
}

@media (max-width: 600px) {
  .stats-grid-modal { 
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 0.5rem;
  }
  
  .stat-box {
    padding: 0.6rem 0.2rem;
    min-height: 60px;
  }
  
  .stat-box h3 {
    font-size: 1rem;
  }
  
  .stats-modal-title {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
  }
  
  .stats-summary {
    padding: 0.8rem;
    margin-top: 0.8rem;
  }
  
  .stats-summary h4 {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
  }
  
  .stats-summary p {
    font-size: 0.7rem;
    margin: 0.2rem 0;
  }
}

/* leaderboard modal */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.65rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

body.dark-mode .leaderboard-table {
  box-shadow: 0 1px 3px rgba(255, 255, 255, 0.1);
}

.leaderboard-table thead {
  background-color: #facb1c;
  border-bottom: 2px solid #e2e8f0;
}

body.dark-mode .leaderboard-table thead {
  background-color: #2f3247;
  border-bottom-color: #333;
}

.leaderboard-table th {
  padding: 1rem 0.75rem;
  text-align: center;
  font-weight: 600;
  color: #374151;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.leaderboard-table td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.2s ease;
  font-size: 0.85rem;
  text-align: center;
}

body.dark-mode .leaderboard-table td {
  border-bottom-color: #333;
}

.leaderboard-table tbody tr:hover {
  background-color: #f8fafc;
}

body.dark-mode .leaderboard-table tbody tr:hover {
  background-color: #2f3247;
}

.leaderboard-table tbody tr:last-child td {
  border-bottom: none;
}

/* Loading and error states */
.leaderboard-loading {
  text-align: center;
  padding: 3rem;
  color: #6b7280;
  font-style: italic;
}

body.dark-mode .leaderboard-loading {
  color: #888;
}

.leaderboard-error {
  text-align: center;
  padding: 3rem;
  color: #dc2626;
  background-color: #fef2f2;
  border-radius: 8px;
  margin: 1rem 0;
}

body.dark-mode .leaderboard-error {
  color: #f87171;
  background-color: #3a3a52;
}

.leaderboard-empty {
  text-align: center;
  padding: 3rem;
  color: #6b7280;
  background-color: #f9fafb;
  border-radius: 8px;
  margin: 1rem 0;
}

body.dark-mode .leaderboard-empty {
  color: #888;
  background-color: #2d2d44;
}

/* Responsive design */
@media (max-width: 600px) {
  .leaderboard-table {
    font-size: 0.8rem;
  }
  
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* FAQ Section */
.faq-section {
  margin-top: 2rem;
}
.faq-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: inherit;
}
.faq-item {
  margin-bottom: 0.5rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid #000;
}

body.dark-mode .faq-item {
  border-color: #d1d5db;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 0.8rem 1rem;
  background: #fff;
  border: none;
  outline: none;
  font-size: 0.95rem;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  color: inherit;
}

body.dark-mode .faq-question {
  background: #2f3247;
}

.faq-question.active { 
  background: #e9c257; 
}

body.dark-mode .faq-question.active { 
  background-color: #7c81a7;
}

.faq-question:hover { 
  background: #e9c257; 
}

body.dark-mode .faq-question:hover { 
  background-color: #7c81a7;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 1rem;
  background: #ffffff;
  font-size: 0.9rem;
  line-height: 1.4rem;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: inherit;
}

body.dark-mode .faq-answer {
  background: #2d2d44;
}

.faq-answer.open {
  padding: 0.5rem 1rem 0.8rem 1rem;
  max-height: 500px;
}

/* 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;
}

/* info block */
.info-block {
  width: 100%;
  background-color: #f7e79a; 
  color: #000;
  padding: 1.5rem 1rem;
  margin: 0;
  box-sizing: border-box;
  text-align: center;
}

.info-block-content {
  max-width: 1200px;
  margin: 0 auto;
}

.info-block-header {
  font-family: 'Kanit', sans-serif;
  font-size: 1.8rem;
  margin: 0.2rem;
  color: #000;
}

.info-block-rules {
  font-size: 1rem;
  line-height: 1.6;
  color: #000;
  max-width: 70%;
  margin: 0 auto;
}

.info-block-rules p {
  margin: 0rem;
}

/* Dark mode support */
.dark-mode .info-block {
  background-color: #2d2d44;
}

.dark-mode .info-block-header {
  color: #cbd5e0;
}

.dark-mode .info-block-rules {
  color: #cbd5e0;
}

/* Responsive design */
@media (max-width: 768px) {
  .info-block {
    padding: 1rem 1rem;
  }

  .info-block-header {
    font-size: 1.5rem;
  }
  
  .info-block-rules {
    font-size: 1rem;
    padding: 0 1rem;
    max-width: 100%;
  }
}

/* How to Play Section */
.how-to-play-section {
  width: 100%;
  background-color: #f6f4ef;
  padding: 1rem 1rem;
  margin: 0;
  box-sizing: border-box;
}

.dark-mode .how-to-play-section {
  background-color: #13141c;
}

.how-to-play-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #000;
  font-family: 'Kanit', sans-serif;
}

.dark-mode .how-to-play-title {
  color: #ffffff;
}

.how-to-play-subtitle {
  text-align: center;
  font-size: 0.95rem;
  color: #000;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.dark-mode .how-to-play-subtitle {
  color: #a0aec0;
}

.play-step {
  max-width: 800px;
  margin: 0 auto 2.5rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.step-text h3 {
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  margin: 0 0 0.8rem 0;
  color: #000;
  font-family: 'Kanit', sans-serif;
}

.dark-mode .step-text h3 {
  color: #ffffff;
}

.step-text p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #000;
  margin: 0;
  max-width: 600px;
}

.dark-mode .step-text p {
  color: #cbd5e0;
}

.step-image {
  width: 100%;
  display: flex;
  justify-content: center;
}

.step-screenshot {
  max-width: 500px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  object-fit: contain;
}

.dark-mode .step-screenshot {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Responsive design for How to Play */
@media (max-width: 768px) {
  .how-to-play-section {
    padding: 1rem 2rem;
  }

  .how-to-play-title {
    font-size: 1.6rem;
    margin-bottom: 2rem;
  }

  .play-step {
    margin-bottom: 2rem;
  }

  .step-text h3 {
    font-size: 1.2rem;
  }

  .step-text p {
    font-size: 0.95rem;
  }

  .step-screenshot {
    max-width: 100%;
  }
}

/* Wins poppers */
/* Win Modal Celebration Styles */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10000;
}

/* Optional: Add a subtle glow animation to the win card during celebration */
@keyframes winCardGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
    border-color: rgba(255, 215, 0, 0.6);
  }
}

.win-card.celebrating {
  animation: winCardGlow 0.8s ease-in-out 2;
}

/* Screen shake animation */
@keyframes winScreenShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.container.shake {
  animation: winScreenShake 0.5s ease-in-out;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .confetti-canvas {
    display: none;
  }
  .win-card.celebrating {
    animation: none;
  }
  .container.shake {
    animation: none;
  }
}