body {
  font-family: "Open Sans", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f4f4f4;
  margin: 0;
  padding: 20px 0;
}

h1 {
  font-family: "Rubik Dirt", cursive;
  margin-bottom: 20px;
  transition: all 0.5s ease;
  font-size: 2rem;
  color: #ff4500;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

h2 {
  font-family: "Creepster", cursive;
  color: #9147ff;
}

.container {
  text-align: center;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-width: 95%;
  width: 1200px;
  border-radius: 10px;
}

.show-more-btn {
  background: #9147ff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
  font-weight: bold;
}

.show-more-btn:hover {
  background: #7a30e0;
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.5rem;
  }

  input[type="text"] {
    font-size: 16px;
  }

  .container {
    padding: 15px;
  }
}

button {
  display: inline-block;
  outline: 0;
  border: 0;
  cursor: pointer;
  background: #000000;
  color: #ffffff;
  border-radius: 8px;
  padding: 14px 24px 16px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  transition: transform 200ms, background 200ms;
}

button:hover {
  transform: translateY(-2px);
}

.hidden {
  display: none;
}

form {
  margin-top: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
}

input[type="text"] {
  font-size: 14px;
  border-radius: 6px;
  line-height: 1.5;
  padding: 5px 10px;
  transition: box-shadow 100ms ease-in, border 100ms ease-in,
    background-color 100ms ease-in;
  border: 2px solid #dee1e2;
  color: rgb(14, 14, 16);
  background: #dee1e2;
  display: block;
  height: 36px;
  width: 100%;
}

input[type="text"]:hover {
  border-color: #ccc;
}

input[type="text"]:focus {
  border-color: #9147ff;
  background: #fff;
}

#loading-spinner {
  display: none;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top: 4px solid #9147ff;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.highlight {
  color: #28a745;
  font-weight: bold;
}

@media (max-width: 600px) {
  .container {
    width: 100%;
    padding: 10px;
  }

  button {
    width: 100%;
  }
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 5px;
  color: white;
  font-weight: bold;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.5s ease-out;
}

.notification.success {
  background-color: #28a745;
}

.notification.error {
  background-color: #dc3545;
}

.notification.info {
  background-color: #17a2b8;
}

.notification.fade-out {
  animation: fadeOut 0.5s ease-in forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .notification {
    width: 80%;
    right: 10%;
    top: 10px;
  }
}

.title-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

#last-person-title {
  font-family: "Rubik Dirt", cursive;
  margin-bottom: 5px;
  font-size: 1.8rem;
  color: #ff4500;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

#last-person-name {
  font-family: "Bungee Spice", cursive;
  font-size: 2.2rem;
  margin-top: 0;
  color: #9147ff;
}

.highlight-name {
  animation: pulse 2s infinite;
}

.cumouncements-title {
  font-family: "Rubik Dirt", cursive;
  font-size: 1.8rem;
  color: #495057;
  text-align: center;
  margin: 25px 0 15px 0;
}

@media (max-width: 768px) {
  .cumouncements-title {
    font-size: 2rem;
    margin: 20px 0 15px 0;
  }
}

@media (max-width: 480px) {
  .cumouncements-title {
    font-size: 1.8rem;
    margin: 15px 0 10px 0;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.leaderboards-container {
  display: flex;
  gap: 30px;
  margin-top: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.leaderboard-section {
  flex: 1;
  min-width: 250px;
  max-width: 400px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 2px solid #dee2e6;
}

.leaderboard-section h2 {
  text-align: center;
  margin-bottom: 15px;
  color: #495057;
  font-size: 1.3rem;
  border-bottom: 2px solid #9147ff;
  padding-bottom: 8px;
}

#recent-visitors,
#frequency-leaderboard {
  list-style: none;
  padding: 0;
  margin: 0;
}

#recent-visitors li,
#frequency-leaderboard li {
  background: white;
  margin-bottom: 8px;
  padding: 10px 15px;
  border-radius: 6px;
  border-left: 4px solid #9147ff;
  font-size: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#recent-visitors li:hover,
#frequency-leaderboard li:hover {
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(145, 71, 255, 0.2);
}

.frequency-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px !important;
}

.rank {
  font-weight: bold;
  color: #9147ff;
  font-size: 16px;
  min-width: 30px;
}

.name {
  flex: 1;
  text-align: left;
  margin: 0 10px;
  font-weight: 600;
}

.count {
  background: linear-gradient(135deg, #9147ff, #7a30e0);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .leaderboards-container {
    flex-direction: column;
    gap: 20px;
  }
  
  .leaderboard-section {
    max-width: 100%;
  }
  
  .frequency-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .rank {
    align-self: flex-start;
  }
  
  .count {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .leaderboard-section {
    padding: 15px;
  }
  
  .leaderboard-section h2 {
    font-size: 1.1rem;
  }
  
  #recent-visitors li,
  #frequency-leaderboard li {
    font-size: 13px;
    padding: 8px 12px;
  }
  
  .frequency-item {
    padding: 10px 12px !important;
  }
}

#form-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 2px solid #9147ff;
}

input[type="text"] {
  width: 100%;
  padding: 16px 12px;
  margin: 10px 0;
  border: 2px solid #9147ff;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
  background: #f8f9fa;
  transition: all 0.3s ease;
}

input[type="text"]:focus {
  background: #fff;
  border-color: #7a30e0;
  outline: none;
  box-shadow: 0 0 0 3px rgba(145, 71, 255, 0.1);
}

.paypal-button {
  width: 100%;
  padding: 16px 20px;
  margin: 15px 0;
  background: linear-gradient(135deg, #0070ba, #00457c);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.paypal-button:hover {
  background: linear-gradient(135deg, #00457c, #002d5a);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.paypal-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.paypal-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
  #form-container {
    margin: 10px;
    padding: 15px;
  }
  
  input[type="text"] {
    padding: 14px 12px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .paypal-button {
    padding: 14px 20px;
    font-size: 16px;
    min-height: 48px; /* Touch-friendly size */
  }
}

@media (max-width: 480px) {
  #form-container {
    margin: 5px;
    padding: 12px;
  }
  
  input[type="text"] {
    padding: 12px 10px;
  }
  
  .paypal-button {
    padding: 12px 16px;
    min-height: 44px; /* Minimum touch target size */
  }
}

@media (max-width: 600px) {
  .container {
    width: 90%;
    padding: 15px;
  }

  #last-person-title {
    font-size: 1.5rem;
  }

  #last-person-name {
    font-size: 1.8rem;
  }

  input[type="text"] {
    font-size: 16px;
    padding: 8px;
  }
}

/* Accessibility improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for better keyboard navigation */
button:focus,
input:focus,
.paypal-button:focus {
  outline: 2px solid #9147ff;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .container {
    border: 3px solid #000;
  }
  
  .paypal-button {
    border: 2px solid #000;
  }
  
  input[type="text"] {
    border: 2px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .highlight-name {
    animation: none;
  }
  
  .notification {
    animation: slideIn 0.1s ease-out;
  }
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #9147ff;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 6px;
}
