
body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f0f8ff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden; /* Prevent scrolling */
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 100%;
  max-height: 100%;
  border: none;
  box-shadow: none;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0 auto;
}

/* Overlay used for start screen and game over messages */
#overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000; /* Black background for portrait image letterboxing */
  color: #fff;
  display: none;
  text-align: center;
  box-sizing: border-box;
}

#overlay.show {
  display: flex;
}

/* Main menu overlay styling - same as overlay */
.overlay-style {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 20, 40, 1);
  color: #fff;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
}

.overlay-style.show {
  display: flex;
}

/* Logo styling */
.logo {
  max-width: 300px;
  max-height: 100px;
  margin: 5px 0;
  object-fit: contain;
}

/* Landing image styling - fit to screen, portrait orientation */
.landing-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  z-index: 1;
}

/* Continue button container - overlay in center */
.continue-button-container {
  position: absolute;
  top: 54%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  justify-content: center;
}

/* Continue Button - Large and prominent with strong visibility */
.continue-btn {
  background: linear-gradient(135deg, #9a7b4f, #ab772c);
  font-size: 1.5rem !important;
  font-family: 'Amatic SC';
  padding: 10px 35px !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 100px !important;
  border-radius: 12px;
  font-weight: bold;
  color: #fff;
  border: 3px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(2px);
}

.continue-btn:hover {
  background: linear-gradient(135deg, #9a7b4f, #ab772c);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Subtitle styling */
.subtitle {
  font-size: 0.8rem;
  line-height: 1.3;
  margin: 8px 0 12px 0;
  max-width: 650px;
  color: #e6f3ff;
}

/* Controls text styling */
.controls {
  font-size: 0.75rem;
  margin: 8px 0;
  color: #ccc;
}

/* Credits styling */
.credits {
  font-size: 0.7rem;
  margin-top: 8px;
  color: #aaa;
}

/* Button row container */
.button-row {
  display: flex;
  gap: 6px;
  margin: 10px 0;
  justify-content: center;
  flex-wrap: wrap;
}

.all-buttons-row {
  margin: 12px 0;
}

/* Base button styling */
#overlay button {
  padding: 6px 10px;
  font-size: 0.7rem;
  font-weight: bold;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  min-width: 70px;
}

/* Start Game Button - Green */
.start-btn {
  background: #b5e7a0;
  font-size: 0.8rem;
  padding: 8px 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  min-width: 90px;
}

.start-btn:hover {
  background: #b5e7a0;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Main Menu Buttons - Blue */
.main-btn {
  background: #a7c7e7;
  padding: 6px 8px;
  font-size: 0.65rem;
  min-width: 75px;
}

.main-btn:hover {
  background: #a7c7e7;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* Utility Buttons - Purple */
.utility-btn {
  background: #cba6e3;
  padding: 6px 8px;
  font-size: 0.65rem;
  min-width: 65px;
}

.utility-btn:hover {
  background: #cba6e3;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

#finalScore {
  margin-top: 10px;
  font-size: 1.2rem;
}

#finalScore.hidden {
  display: none;
}

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



/* === Touch Controls === */
#touch-controls {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  z-index: 9999;
  pointer-events: none;
}

.touch-btn {
  pointer-events: all;
  width: 80px;
  height: 80px;
  position: fixed;
  z-index: 9999;
  opacity: 0.85;
  user-select: none;
  touch-action: none;
}

.duck-btn {
  left: 20px;
  bottom: 20px;
}

.jump-btn {
  right: 20px;
  bottom: 20px;
}

.touch-btn {
  pointer-events: all;
  width: 80px;
  height: 80px;
  position: fixed;
  z-index: 9999;
  opacity: 0.85;
  user-select: none;
  touch-action: none;
  border: none;
  background-color: transparent;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.duck-btn {
  left: 20px;
  bottom: 20px;
  background-image: url("assets/sprites/duckbutton.png");
}

.jump-btn {
  right: 20px;
  bottom: 20px;
  background-image: url("assets/sprites/jumpbutton.png");
}

#rotate-warning {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  width: 100vw;
  height: 100vh;
  background: black;
  color: white;
  font-size: 2rem;
  padding: 20px;
  text-align: center;

  /* Center content */
  display: flex;             /* make it a flex container */
  justify-content: center;   /* center horizontally */
  align-items: center;       /* center vertically */
  flex-direction: column;    /* stack multiple lines vertically */
  box-sizing: border-box;    /* include padding in width/height */
}

/* Responsive font scaling for smaller screens */
@media (max-width: 480px) {
  #rotate-warning {
    font-size: 1.4rem; /* smaller text on small devices */
    padding: 15px;
  }
}

/* Hat Selection Styles */
.hat-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 20, 40, 1);
  color: #fff;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 5px;
  box-sizing: border-box;
  z-index: 1000;
  overflow-y: auto;
}

.hat-overlay.show {
  display: flex !important;
}

/* Thank You Screen - Center content */
#thankYouOverlay {
  justify-content: center;
  padding: 20px;
}

#thankYouOverlay h1 {
  margin-bottom: 20px;
  font-size: 2.5rem;
}

#thankYouOverlay p {
  margin: 10px 0;
  font-size: 1.2rem;
}

#thankYouOverlay .subtitle {
  font-size: 1rem;
  opacity: 0.8;
  margin-top: 20px;
}

.character-buttons {
  display: flex;
  gap: 20px;
  margin: 20px 0;
}

.character-btn {
  padding: 15px 30px;
  font-size: 1.2rem;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.character-btn:hover {
  background: #45a049;
}

.hat-instruction {
  font-style: italic;
  color: #ccc;
  margin: 5px 0;
  font-size: 0.8rem;
}

.hat-customize-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 15px;
  max-width: 780px;
  margin: 5px auto;
  flex: 1;
  min-height: 0;
}

/* iOS device styling */
body.ios-device #game-container {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  overflow: hidden;
}

body.ios-device #gameCanvas {
  width: auto;
  height: 85%; /* Reduced from 90% to make it fit better */
  max-width: 90%;
  object-fit: contain;
  margin: 0 auto;
  display: block;
  position: relative;
  top: -5%; /* Move up more to ensure ground is visible */
}

@media screen and (max-width: 812px) and (-webkit-min-device-pixel-ratio: 2) {
  #game-container {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0; /* Remove padding */
  }
  
  #gameCanvas {
    width: auto; /* Change from 100% to auto */
    height: 95%; /* Slightly reduce height to ensure ground is visible */
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto;
  }
}

/* iOS fullscreen mode styling */
body.ios-fullscreen {
  position: fixed;
  width: 100%;
  height: 100%;
  overflow: hidden;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

body.ios-fullscreen #game-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
}

/* Hide Safari UI in fullscreen mode */
body.ios-fullscreen #touch-controls {
  bottom: env(safe-area-inset-bottom, 10px);
}




.hat-selection-area {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.character-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

#characterPreviewCanvas {
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.hat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0;
  max-width: 480px;
}

.hat-description {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  max-width: 220px;
  min-height: 120px;
}

.hat-description h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #4CAF50;
  font-size: 1.1rem;
  text-align: center;
}

.hat-description p {
  margin: 0;
  line-height: 1.4;
  font-size: 0.9rem;
  color: #ddd;
}

.hat-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  border: 2px solid #666;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.1);
}

.hat-option:hover {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.2);
}

.hat-option.selected {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.3);
}

.hat-option.locked {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #333;
}

.hat-option.locked:hover {
  border-color: #333;
  background: rgba(255, 255, 255, 0.1);
}

.hat-preview {
  width: 40px;
  height: 40px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: 1px solid #999;
  border-radius: 4px;
  margin-bottom: 4px;
  background-color: rgba(255, 255, 255, 0.1);
}

.hat-preview.no-hat {
  background-image: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #ccc;
}

.hat-option span {
  font-size: 0.8rem;
}

.hat-overlay h1 {
  margin: 5px 0;
  font-size: 1.5rem;
}

.back-btn {
  padding: 8px 16px;
  font-size: 0.9rem;
  background: #f44336;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
  position: relative;
  z-index: 1001;
}

.back-btn:hover {
  background: #da190b;
}

/* Ensure back button is always visible on mobile overlays */
@media (max-width: 900px), (pointer: coarse) {
  .hat-overlay .back-btn {
    position: fixed; /* keep visible even when content scrolls */
    left: max(10px, env(safe-area-inset-left));
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 10001; /* above touch controls */
  }
  /* Add space so content doesn't sit under the fixed Back button */
  .hat-overlay { padding-bottom: 80px; }
}

/* Achievement Styles */
.achievements-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 600px;
  margin: 20px auto;
  background-color: #001428;

  overflow-y: auto;
}

.achievement-item {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  gap: 15px;
  transition: all 0.3s ease;
}

.achievement-item.unlocked {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.2);
}

.achievement-icon {
  font-size: 2rem;
  min-width: 50px;
  text-align: center;
}

.achievement-info {
  flex: 1;
}

.achievement-info h3 {
  margin: 0 0 5px 0;
  color: #fff;
  font-size: 1.1rem;
}

.achievement-info p {
  margin: 0 0 10px 0;
  color: #ccc;
  font-size: 0.9rem;
}

.achievement-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #45a049);
  width: 0%;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: #ddd;
  min-width: 80px;
  text-align: right;
}

.achievement-status {
  font-size: 1.5rem;
  min-width: 30px;
  text-align: center;
}

/* Mini-games Styles - Compact Layout */
.minigames-header {
  text-align: center;
  margin-bottom: 15px;
}

.minigames-header h1 {
  margin: 10px 0 5px 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.minigames-header p {
  margin: 0 0 10px 0;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  opacity: 0.9;
}

.minigames-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.minigame-item {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  gap: 15px;
  transition: all 0.3s ease;
}

.minigame-item:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #4CAF50;
  transform: translateY(-2px);
}

.minigame-icon {
  font-size: 2.2rem;
  min-width: 60px;
  text-align: center;
  flex-shrink: 0;
}

.minigame-info {
  flex: 1;
  text-align: left;
}

.minigame-info h3 {
  margin: 0 0 6px 0;
  color: #4CAF50;
  font-size: 1.2rem;
}

.minigame-info p {
  margin: 0 0 4px 0;
  color: #ddd;
  font-size: 0.85rem;
  line-height: 1.3;
}

.minigame-info p:last-child {
  margin-bottom: 0;
}

.play-btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 70px;
  flex-shrink: 0;
}

.play-btn:hover {
  background: #45a049;
  transform: scale(1.05);
}

/* Mobile optimizations for mini-games */
@media (max-width: 768px) {
  .minigames-header h1 {
    margin: 5px 0;
    font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  }
  
  .minigames-header p {
    margin: 0 0 8px 0;
    font-size: clamp(0.8rem, 2.2vw, 0.95rem);
  }
  
  .minigames-container {
    gap: 10px;
  }
  
  .minigame-item {
    padding: 10px 12px;
    gap: 12px;
  }
  
  .minigame-icon {
    font-size: 1.8rem;
    min-width: 50px;
  }
  
  .minigame-info h3 {
    font-size: 1.1rem;
    margin: 0 0 4px 0;
  }
  
  .minigame-info p {
    font-size: 0.8rem;
    margin: 0 0 3px 0;
    line-height: 1.2;
  }
  
  .play-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    min-width: 60px;
  }
}

@media (max-width: 480px) {
  .minigame-item {
    padding: 8px 10px;
    gap: 10px;
  }
  
  .minigame-icon {
    font-size: 1.6rem;
    min-width: 45px;
  }
  
  .minigame-info h3 {
    font-size: 1rem;
  }
  
  .minigame-info p {
    font-size: 0.75rem;
  }
  
  .play-btn {
    padding: 5px 10px;
    font-size: 0.8rem;
    min-width: 55px;
  }
}

/* Weddle Game Styles */
.weddle-header {
  text-align: center;
  margin-bottom: 10px;
}

.weddle-header h1 {
  margin: 10px 0 5px 0;
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.weddle-header p {
  margin: 5px 0 10px 0;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  opacity: 0.9;
}

.weddle-grid {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 4px;
  margin: 15px auto;
  max-width: min(350px, 90vw);
  width: 100%;
}

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

.weddle-cell {
  aspect-ratio: 1;
  min-height: 45px;
  max-height: 60px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: bold;
  color: white;
  text-transform: uppercase;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.weddle-cell.filled {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.2);
}

.weddle-cell.correct {
  background: #4CAF50;
  border-color: #4CAF50;
  color: white;
}

.weddle-cell.present {
  background: #FF9800;
  border-color: #FF9800;
  color: white;
}

.weddle-cell.absent {
  background: #757575;
  border-color: #757575;
  color: white;
}

.weddle-keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 15px auto;
  max-width: min(500px, 95vw);
  width: 100%;
  padding: 0 10px;
}

.weddle-keyboard-row {
  display: flex;
  justify-content: center;
  gap: clamp(3px, 1vw, 6px);
}

.weddle-key {
  min-width: clamp(28px, 8vw, 40px);
  height: clamp(40px, 10vw, 50px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  user-select: none;
}

.weddle-key:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.weddle-key:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.3);
}

.weddle-key.correct {
  background: #4CAF50;
  border-color: #4CAF50;
}

.weddle-key.present {
  background: #FF9800;
  border-color: #FF9800;
}

.weddle-key.absent {
  background: #757575;
  border-color: #757575;
}

.weddle-key.wide {
  min-width: clamp(60px, 15vw, 80px);
  font-size: clamp(0.7rem, 2vw, 0.9rem);
  padding: 0 8px;
}

.weddle-message {
  text-align: center;
  margin: 15px 0;
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: bold;
  min-height: 25px;
  padding: 0 10px;
}

.weddle-message.success {
  color: #4CAF50;
}

.weddle-message.failure {
  color: #f44336;
}

.weddle-message.info {
  color: #2196F3;
}

.weddle-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  padding: 0 10px;
}

/* Mobile-specific improvements for Weddle */
@media (max-width: 480px) {
  .weddle-grid {
    gap: 3px;
    margin: 10px auto;
  }
  
  .weddle-row {
    gap: 3px;
  }
  
  .weddle-cell {
    min-height: 40px;
    max-height: 50px;
    font-size: clamp(1rem, 4vw, 1.3rem);
  }
  
  .weddle-keyboard {
    gap: 4px;
    margin: 10px auto;
  }
  
  .weddle-keyboard-row {
    gap: 2px;
  }
  
  .weddle-key {
    min-width: clamp(25px, 7vw, 35px);
    height: clamp(35px, 9vw, 45px);
    font-size: clamp(0.7rem, 2.2vw, 0.9rem);
  }
  
  .weddle-key.wide {
    min-width: clamp(50px, 12vw, 70px);
    font-size: clamp(0.6rem, 1.8vw, 0.8rem);
  }
  
  .weddle-message {
    margin: 10px 0;
    font-size: clamp(0.9rem, 2.8vw, 1.1rem);
  }
  
  .weddle-controls {
    gap: 10px;
    margin-top: 15px;
  }
}

/* Very small screens */
@media (max-width: 320px) {
  .weddle-cell {
    min-height: 35px;
    max-height: 45px;
  }
  
  .weddle-key {
    min-width: 22px;
    height: 32px;
  }
  
  .weddle-key.wide {
    min-width: 45px;
  }
}

.weddle-completion {
  text-align: center;
  padding: 40px 20px;
  color: white;
}

.weddle-completion h2 {
  color: #FFD700;
  margin-bottom: 20px;
  font-size: 2rem;
}

.weddle-completion p {
  margin: 15px 0;
  font-size: 1.2rem;
}

.weddle-reset-btn {
  background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
  border: none;
  color: white;
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
}

.weddle-reset-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.weddle-new-game-btn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  border: none;
  color: white;
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 15px auto;
  display: block;
}

.weddle-new-game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Find It! Game Styles */
.character-selection {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 20px 0;
  flex-wrap: wrap;
}

.character-option {
  text-align: center;
}

.character-option .character-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 20px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 150px;
}

.character-option .character-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.character-option .character-btn h3 {
  margin: 10px 0 5px 0;
  font-size: 1.2rem;
}

.character-option .character-btn p {
  margin: 5px 0 0 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.findit-game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.character-info {
  color: white;
  font-size: 0.9rem;
}

.game-stats {
  display: flex;
  gap: 20px;
  color: white;
  font-size: 0.9rem;
}

.findit-game-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

#findItCanvas {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: white;
}

.findit-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.movement-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.control-row {
  display: flex;
  gap: 5px;
  align-items: center;
}

.movement-btn {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #4ECDC4, #44A08D);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.movement-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.press-btn {
  background: linear-gradient(135deg, #FF6B6B, #EE5A52);
  font-size: 0.8rem;
  width: 60px;
}

.action-display {
  text-align: center;
  color: white;
}

.action-display h4 {
  margin: 0 0 10px 0;
  font-size: 1rem;
}

.action-title-with-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}

.inline-movement-controls {
  display: flex;
  gap: 5px;
}

.movement-btn-small {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #4ECDC4, #44A08D);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.movement-btn-small:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.movement-btn-small:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-sequence {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 10px 15px;
  min-height: 30px;
  font-size: 1.2rem;
  font-family: monospace;
  color: white;
  min-width: 200px;
  word-break: break-all;
}

.game-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.execute-btn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  font-size: 1rem;
  padding: 12px 20px;
}

.game-message {
  background: rgba(76, 175, 80, 0.9);
  color: white;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  margin-top: 15px;
  font-weight: bold;
}

/* Mobile responsiveness for Find It */
@media (max-width: 768px) {
  .character-selection {
    flex-direction: column;
    align-items: center;
  }
  
  .character-option .character-btn {
    min-width: 120px;
    padding: 15px;
  }
  
  .findit-game-info {
    flex-direction: column;
    text-align: center;
  }
  
  .game-stats {
    justify-content: center;
  }
  
  #findItCanvas {
    max-width: 90vw;
    height: auto;
  }
  
  .movement-btn {
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }
  
  .press-btn {
    width: 55px;
    font-size: 0.7rem;
  }
  
  .action-sequence {
    min-width: 150px;
    font-size: 1rem;
  }
  
  .game-controls {
    gap: 8px;
  }
  
  .action-title-with-controls {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  
  .movement-btn-small {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
  
  .inline-movement-controls {
    gap: 3px;
  }
}

/* Where's the Sprite Game Styles */
.wheresthesprite-header {
  text-align: center;
  margin-bottom: 20px;
}

.wheresthesprite-header h1 {
  color: #FFD700;
  margin-bottom: 10px;
}

.wheresthesprite-game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.target-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.target-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  background: rgba(255, 215, 0, 0.2);
  border-radius: 5px;
}

.target-text {
  font-weight: bold;
  color: #FFD700;
}

.timer-display {
  font-size: 1.2rem;
  font-weight: bold;
  color: #FF6B6B;
  padding: 5px 10px;
  background: rgba(255, 107, 107, 0.2);
  border-radius: 5px;
}

.wheresthesprite-game-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

#wheresTheSpriteCanvas {
  border: 2px solid #FFD700;
  border-radius: 10px;
  background: #FFFFFF;
  cursor: crosshair;
  touch-action: none; /* Prevent default touch behaviors */
  user-select: none; /* Prevent text selection */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.wheresthesprite-top-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
}

.wheresthesprite-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.game-message {
  text-align: center;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  font-weight: bold;
}

.game-message.success {
  background: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
  border: 1px solid #4CAF50;
}

.game-message.failure {
  background: rgba(244, 67, 54, 0.2);
  color: #F44336;
  border: 1px solid #F44336;
}

.game-message.info {
  background: rgba(33, 150, 243, 0.2);
  color: #2196F3;
  border: 1px solid #2196F3;
}

/* Loading Screen Styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #001428;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  text-align: center;
  transition: opacity 0.5s ease;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loading-logo {
  max-width: 300px;
  margin-bottom: 20px;
}

.loading-text {
  font-size: 1.2rem;
  margin: 10px 0;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

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

.loading-progress-container {
  width: 300px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(135deg, #9a7b4f, #ab772c);
  width: 0%;
  animation: progress 3s ease-in-out forwards;
}

@keyframes progress {
  0% { width: 0%; }
  100% { width: 100%; }
}


/* Fix for Where's the Sprite message to prevent game window shifting */
#wheresTheSpriteMessage {
  min-height: 50px; /* Reserve space even when hidden */
  display: flex !important; /* Always take up space */
  align-items: center;
  justify-content: center;
  visibility: hidden; /* Hide content but keep space */
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#wheresTheSpriteMessage.show {
  visibility: visible;
  opacity: 1;
}

@media (max-width: 768px) {
  .wheresthesprite-game-info {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  .target-info {
    flex-direction: column;
    gap: 10px;
  }
  
  #wheresTheSpriteCanvas {
    max-width: 90vw;
    height: auto;
  }
  
  .wheresthesprite-controls {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}
