:root {
  --bg: #f8f8e1; /* cream background */
  --panel: #f0f0cf; /* slightly darker cream for panels */
  --text: #201E1F; /* raisin black for text */
  --text-black: #201E1F; /* explicit black for text */
  --muted: #888; /* darker gray for muted text */
  --accent: #3772FF; /* blue (Crayola) */
  --accent-2: #5A8AFF; /* lighter blue variant */
  --danger: #FF6B6B; /* softer red for cream bg */
  --success: #22C55E; /* green equivalent to blue */
  --blue: #3772FF; /* blue for buttons */
  --green: #22C55E; /* green for correct answers */
}

* { 
  box-sizing: border-box; 
}

html, body { 
  height: 100%; 
}

body {
  font-family: 'Open Sans', sans-serif;
  margin: 0;
  padding: 20px;
  padding-top: 40px;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

#logo {
  position: fixed;
  top: 20px;
  left: 20px;
  height: 80px;
  width: auto;
  z-index: 100;
}

@media (max-width: 480px) {
  #logo {
    height: 50px;
  }
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 8px 0;
  letter-spacing: 0.3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}


button {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, rgba(34,211,238,.25), rgba(167,139,250,.25));
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .05s ease, filter .2s ease, box-shadow .2s ease;
  box-shadow: 0 8px 20px rgba(34,211,238,.18);
}

button:hover { 
  filter: brightness(1.06); 
}

button:active { 
  transform: translateY(1px); 
}

button.secondary {
  background: rgba(148, 163, 184, 0.18);
  box-shadow: none;
}


a { 
  color: var(--accent); 
  text-decoration: none; 
}

a:hover { 
  text-decoration: underline; 
}

.card {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Cat image */
#catImg {
  width: 100%;
  height: 60vh;
  max-height: 700px;
  min-height: 400px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  display: block;
  margin: 0 auto;
  object-position: center;
  transition: none;
}

/* Image container */
.cat-image-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  overflow: hidden;
  min-height: 400px;
}

/* Carousel navigation buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 1px solid var(--muted);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
  box-shadow: none;
  text-shadow: none;
  filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: none !important;
  animation: none !important;
}

.carousel-btn:active {
  transform: translateY(-50%) !important;
  transition: none !important;
}

.carousel-btn.prev {
  left: 10px;
}

.carousel-btn.next {
  right: 10px;
}

/* Slide indicator */
#slideIndicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  z-index: 10;
}

/* Round counter */
#roundCounter {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 0.3px;
  font-family: 'Open Sans', sans-serif;
}

/* Cat metadata */
#catMeta {
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.1px;
  font-family: 'Open Sans', sans-serif;
}

/* Hide mobile-only elements on desktop */
.mobile-only {
  display: none;
}

/* Red overlay for incorrect answers - positioned dynamically */
#redOverlay {
  position: absolute;
  background: rgba(255, 0, 0, 0.5);
  pointer-events: none;
  z-index: 5;
}

/* Carousel animations */
#catImg {
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
}

#catImg.slide-out-left {
  transform: translateX(-100%) !important;
  opacity: 0 !important;
}

#catImg.slide-out-right {
  transform: translateX(100%) !important;
  opacity: 0 !important;
}

#catImg.slide-in-from-left {
  transform: translateX(-100%) !important;
  opacity: 0 !important;
}

#catImg.slide-in-from-right {
  transform: translateX(100%) !important;
  opacity: 0 !important;
}

#catImg.slide-center {
  transform: translateX(0) !important;
  opacity: 1 !important;
}

#nextRoundBtn:hover { 
  opacity: 0.9; 
}

#nextRoundBtn {
  background: var(--blue);
  color: white;
  border: none;
  font-family: 'Open Sans', sans-serif;
  font-weight: 800;
  font-size: 32px;
  cursor: pointer;
  padding: 20px 40px;
  text-align: center;
  box-shadow: none;
  outline: none;
  border-radius: 8px;
  width: 500px;
  margin: 24px auto 0;
  display: block;
}

#nextRoundBtn .gradient-text {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: white;
  animation: none;
}

#nextRoundBtn .material-symbols-rounded {
  display: none;
}

.material-symbols-rounded {
  font-variation-settings:
  'FILL' 0,
  'wght' 700,
  'GRAD' 200,
  'opsz' 24;
  font-size: 48px;
  line-height: 1;
  vertical-align: -0.125em;
}

/* Choice buttons and layout */
#choices {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  justify-content: center;
  width: 100%;
}

#choiceA, #choiceB {
  padding: 20px 40px;
  font-weight: 800;
  font-size: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  width: 500px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Open Sans', sans-serif;
}

/* Mobile Breakpoints */

/* Large tablets and small laptops (1024px and down) */
@media (max-width: 1024px) {
  #choiceA, #choiceB {
    width: 400px;
    font-size: 28px;
    padding: 18px 32px;
  }
  
  #nextRoundBtn {
    width: 400px;
    font-size: 28px;
    padding: 18px 32px;
  }
  
  .material-symbols-rounded {
    font-size: 42px;
  }
}

/* Tablets (768px and down) */
@media (max-width: 768px) {
  body {
    padding: 16px;
    justify-content: flex-start;
    padding-top: 40px;
  }
  
  #choices {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  
  #choiceA, #choiceB {
    width: 100%;
    max-width: 400px;
    font-size: 24px;
    padding: 16px 24px;
  }
  
  #roundCounter {
    font-size: 28px !important;
  }
  
  #catMeta {
    font-size: 20px !important;
  }
  
  #nextRoundBtn {
    width: 350px;
    font-size: 24px;
    padding: 16px 28px;
  }
  
  .material-symbols-rounded {
    font-size: 36px;
  }
}

/* Mobile phones (480px and down) */
@media (max-width: 480px) {
  body {
    padding: 12px;
    padding-top: 80px;
    align-items: flex-start;
  }
  
  #choices {
    gap: 12px;
  }
  
  #choiceA, #choiceB {
    font-size: 20px;
    padding: 14px 20px;
    max-width: 100%;
  }
  
  #roundCounter {
    font-size: 24px !important;
  }
  
  #catMeta {
    font-size: 18px !important;
  }
  
  /* Hide desktop button, show mobile button */
  .desktop-only {
    display: none !important;
  }
  
  .mobile-only {
    display: block;
  }
  
  /* Unified Next Round button for mobile */
  #nextRoundBtn {
    width: 100%;
    max-width: 400px;
    font-size: 20px;
    padding: 14px 24px;
  }
  
  .material-symbols-rounded {
    font-size: 24px;
  }
  
  /* Adjust cat image height for mobile */
  #catImg {
    height: 50vh !important;
    max-height: 500px !important;
  }
  
  /* Hide carousel arrow buttons on mobile, show slide indicator instead */
  .carousel-btn {
    display: none !important;
  }
  
  #slideIndicator {
    display: block !important;
    font-size: 12px !important;
    padding: 3px 10px !important;
  }
}

/* Small mobile phones (360px and down) */
@media (max-width: 360px) {
  #choiceA, #choiceB {
    font-size: 18px;
    padding: 12px 16px;
  }
  
  #roundCounter {
    font-size: 20px !important;
  }
  
  #catMeta {
    font-size: 16px !important;
  }
  
  #nextRoundBtn {
    width: 100%;
    max-width: 350px;
    font-size: 18px;
    padding: 12px 20px;
  }
  
  .material-symbols-rounded {
    font-size: 28px;
  }
  
  #catImg {
    height: 45vh !important;
    max-height: 400px !important;
  }
}

/* End game gallery styles */
#endGameGallery {
  display: flex;
  gap: 20px;
  width: calc(100vw - 40px);
  max-width: calc(1200px - 40px);
  margin: 0 auto;
  padding: 8px 20px 12px 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto;
  justify-content: flex-start;
  overscroll-behavior-x: contain;
  box-sizing: border-box;
}

.gallery-item-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  height: 100%;
}

.gallery-cat-name {
  color: var(--text);
  font-weight: 900;
  font-size: 24px;
  text-align: center;
  font-family: 'Open Sans', sans-serif;
}

.gallery-cat-location {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  margin-top: 2px;
  line-height: 1;
  font-family: 'Open Sans', sans-serif;
}

.gallery-petfinder-link {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  display: block;
  margin-top: 1px;
  line-height: 1;
  font-family: 'Open Sans', sans-serif;
  transition: opacity 0.2s ease;
}

.gallery-petfinder-link:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.gallery-image-container {
  position: relative;
  overflow: hidden;
  background: transparent;
  height: 400px;
}

.gallery-cat-image {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  position: relative;
  display: block;
  margin: 0 auto;
}

.gallery-red-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 0, 0, 0.5);
  pointer-events: none;
  z-index: 2;
}

/* Scrollbar styling for gallery */
#endGameGallery::-webkit-scrollbar {
  height: 8px;
}

#endGameGallery::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

#endGameGallery::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

#endGameGallery::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments for gallery */
@media (max-width: 768px) {
  .gallery-image-container {
    height: 300px;
  }
  
  #endGameGallery {
    padding: 15px;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .gallery-image-container {
    height: 324px;
  }
  
  .gallery-cat-name {
    font-size: 16px;
  }
  
  .gallery-cat-location {
    font-size: 11px;
    margin-top: 2px;
  }
  
  .gallery-petfinder-link {
    font-size: 10px;
    margin-top: 1px;
  }
  
  #endGameGallery {
    padding: 12px;
    gap: 12px;
  }
}
