.signin-container {
    padding: 2.5rem;
}

label {
    font-size: 0.8rem;
    padding-left: 0.4rem;
}

input {
font-size: 0.8rem;
}

/* Forgot Password Specific Styles */
.step {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.step.active {
  display: block;
}

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

.success-message {
  color: #10b981;
  font-weight: 600;
  text-align: center;
  margin-top: 1rem;
  padding: 0.75rem;
  background: #f0fdf4;
  border-radius: 8px;
  border: 1px solid #bbf7d0;
  animation: slideDown 0.3s ease-out;
}

body.dark-mode .success-message {
  background: #1a2a1a;
  color: #4ade80;
  border-color: #166534;
}

.development-otp {
  background: #fef3c7;
  padding: 1rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  text-align: center;
  font-family: 'Kanit', sans-serif;
  font-size: 1.2rem;
  font-weight: bold;
  border: 2px dashed #d97706;
  animation: pulse 2s infinite;
}

body.dark-mode .development-otp {
  background: #3a2a00;
  color: #fbbf24;
  border-color: #f59e0b;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.resend-otp {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

body.dark-mode .resend-otp {
  border-top-color: #374151;
}

.resend-otp a {
  color: #000;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

body.dark-mode .resend-otp a {
  color: #e0e0e0;
}

body.dark-mode .resend-otp a:hover {
  color: #60a5fa;
}

.resend-otp a i {
  font-size: 0.9rem;
}

/* Step progress indicator */
.step-progress {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  align-items: center;
  margin-bottom: 3rem;
  position: relative;
}

.step-progress::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: #e5e7eb;
  transform: translateY(-50%);
  z-index: 1;
}

body.dark-mode .step-progress::before {
  background: #374151;
}

.step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f3f4f6;
  border: 2px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #6b7280;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

body.dark-mode .step-circle {
  background: #1f2937;
  border-color: #374151;
  color: #9ca3af;
}

.step-circle.active {
  background: #000;
  border-color: #000;
  color: #fffbf5;
}

body.dark-mode .step-circle.active {
  background: #e0e0e0;
  border-color: #e0e0e0;
  color: #000000;
}

.step-circle.completed {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

.step-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

body.dark-mode .step-label {
  color: #9ca3af;
}

.step-label.active {
  color: #000;
}

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

/* Loading states */
.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.btn-submit.loading {
  position: relative;
  color: transparent;
}

.btn-submit.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

body.dark-mode .btn-submit.loading::after {
  border: 2px solid #000000;
  border-right-color: transparent;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* OTP input specific styles */
.otp-input-group {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.otp-digit {
  width: 50px;
  height: 50px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  border: 2px solid #000;
  border-radius: 8px;
  background: #fff;
  transition: all 0.2s ease;
}

body.dark-mode .otp-digit {
  background: #1a1a1a;
  border-color: #333;
  color: #e0e0e0;
}

.otp-digit:focus {
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(66, 50, 50, 0.2);
  outline: none;
  transform: scale(1.05);
}

body.dark-mode .otp-digit:focus {
  border-color: #e0e0e0;
  box-shadow: 0 0 0 3px rgba(224, 224, 224, 0.1);
}

/* Password strength indicator */
.password-strength {
  margin-top: 0.5rem;
  height: 4px;
  border-radius: 2px;
  background: #e5e7eb;
  overflow: hidden;
}

body.dark-mode .password-strength {
  background: #374151;
}

.password-strength-bar {
  height: 100%;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.password-strength.weak .password-strength-bar {
  background: #ef4444;
  width: 33%;
}

.password-strength.medium .password-strength-bar {
  background: #f59e0b;
  width: 66%;
}

.password-strength.strong .password-strength-bar {
  background: #10b981;
  width: 100%;
}

/* Success state animations */
.success-icon {
  font-size: 4rem;
  color: #10b981;
  margin-bottom: 1rem;
  animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive design */
@media (max-width: 480px) {  
  .step-circle {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }
  
  .step-label {
    font-size: 0.7rem;
  }
  
  .otp-digit {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .development-otp {
    font-size: 1rem;
    padding: 0.75rem;
  }
  
  .success-icon {
    font-size: 3rem;
  }
}

/* Back button styles */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  margin-bottom: 1rem;
}

.back-button:hover {
  color: #000;
  transform: translateX(-2px);
}

body.dark-mode .back-button:hover {
  color: #e0e0e0;
}

/* Countdown timer */
.otp-timer {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

body.dark-mode .otp-timer {
  color: #9ca3af;
}

.otp-timer.expiring {
  color: #ef4444;
  font-weight: 600;
  animation: pulse 1s infinite;
}

body.dark-mode .otp-timer.expiring {
  color: #f87171;
}

/* Error states with icons */
.error-with-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  color: #dc2626;
  font-size: 0.875rem;
}

body.dark-mode .error-with-icon {
  color: #f87171;
}

/* Success step specific */
.success-step {
  text-align: center;
  padding: 1rem 0;
}

.success-step .icon {
  font-size: 4rem;
  color: #10b981;
  margin-bottom: 1rem;
}

.success-step h3 {
  color: #000;
  margin-bottom: 0.5rem;
}

body.dark-mode .success-step h3 {
  color: #e0e0e0;
}

.success-step p {
  color: #6b7280;
  margin-bottom: 1.5rem;
}

body.dark-mode .success-step p {
  color: #9ca3af;
}

/* Responsive design */
@media (max-width: 700px) {
  .signin-container {
    padding: 2rem;
  }
  
}

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

.extra-links:hover{
  text-decoration: underline;
}

/* hidden class */
.hidden { display: none !important; }

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

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

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

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

  .modal {
    padding: 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;
  }
}

/* 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: #e9c257;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #000;
  transition: background 0.2s ease;
}

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

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

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

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