@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }
}

    body {
      font-family: sans-serif;
      background-color: #DFF6F3;
      margin: 0;
	 padding-bottom: 80px; /* should match or slightly exceed footer height */
      color: #333;
    }
	
    html, body {
      margin: 0;
      font-family: sans-serif;
      text-align: center;
/*      touch-action: none;
      overscroll-behavior: none;*/
    }
		
	    .container {
		position: relative;
		top:20px;
      max-width: 600px;
	  margin: 0 auto;
      padding: 20px;
      background-color: white;
      border-radius: 12px;
      box-shadow: 0 0 20px rgba(0,0,0,0.1);
      text-align: center;
    }
	
    .containerLeft {
		position: relative;
		top:20px;
      max-width: 600px;
	  margin: 0 auto;
      padding: 20px;
      background-color: white;
      border-radius: 12px;
      box-shadow: 0 0 20px rgba(0,0,0,0.1);
      text-align: left;
    }
	
	
		.hero-image {
	  width: auto;
	  height: auto;
	  max-height: 35vh;
	  max-width: 100%;
	  display: block;
	  margin: 20px auto;
	  border-radius: 12px;
	}
	
/* Hide arrows by default (desktop) */
.swipe-arrow {
  display: none;
}

.mobile-break {
  display: none;
}



/* Show arrows only on screens less than 768px wide */
@media (max-width: 1024px) {

.mobile-break {
  display: block;
}

  .hero-image {
    height: 30vh;
    max-height: 50vh;
	width: auto;
  }

  .swipe-arrow {
    display: block;
	opacity: 0.3;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3em;
    color: rgba(100, 100, 100); 
    z-index: 1000;
    cursor: pointer;
    user-select: none;
    pointer-events: auto;
  }

  .swipe-arrow.left {
    left: 10px;
  }

  .swipe-arrow.right {
    right: 10px;
  }
}

body.dark-theme {
  background-color: #000 !important;
}



@keyframes fadeArrow {
  0%   { opacity: 0.2; transform: translateY(-50%) translateX(0); }
  50%  { opacity: 1;   transform: translateY(-50%) translateX(6px); }
  100% { opacity: 0.2; transform: translateY(-50%) translateX(0); }
}

	
	h1, h2, h3 {
  font-family: 'Fredoka', sans-serif;
}
	
    h2 { margin: 20px 0 10px; font-size: 1.5em; }
    #controls { margin-bottom: 20px; }
    #difficultyLabel { font-weight: bold; font-size: 18px; }
    input[type=range] {
      width: 200px;
      margin-top: 10px;
      accent-color: #2196F3;
    }
    #spinner-container {
      position: relative;
      width: 90vw;
      height: 90vw;
      max-width: 400px;
      max-height: 400px;
      margin: 0 auto 20px;
      display: block;
    }
	
	
/* Optional: tablet-specific fine-tuning */
@media (min-width: 768px) and (max-width: 1024px) {
  #spinner-container {
    max-width: 90vw;
    max-height: 90vw;
  }
}

/* Optional: landscape mode */
@media (min-width: 768px) and (orientation: landscape) {
  #spinner-container {
    max-width: 70vh;
    max-height: 70vh;
  }
}
	
    canvas {
      width: 100%; height: 100%; display: block;
      border-radius: 50%; background: white;
    }
	
	canvas#spinner {
	  background-image: url('images/spinbottle2.jpg');
	  background-size: cover;
	  background-position: center;
	  box-shadow: 8px 8px 10px rgba(0, 0, 0, 0.3);
	  border: 2px solid white; /* White outline */
	  box-sizing: border-box;  /* Ensures border doesn't affect size */
	}

 
 #arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 20%; /* Adjust as needed for your image proportions */
  width: auto;
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: center center;
  z-index: 2;
  cursor: pointer;
  opacity: 0.65;
  filter: drop-shadow(8px 8px 10px rgba(0, 0, 0, 0.9));  
}

    #result {
      font-size: 1.2em;
      font-weight: bold;
      padding: 0 20px 0px;
    }
    #startOverlay {
      position: absolute; top: 0; left: 0;
      width: 100%; height: 100%;
      border-radius: 50%; background: #4CAF50;
      display: none; justify-content: center; align-items: center;
      z-index: 4; cursor: pointer;
      color: white; font-size: 24px; font-weight: bold;
    }
	
#startOverlayPic {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #FFF;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  display: none;
  z-index: 5;
  cursor: pointer;
  border: 4px solid black;
}


#startOverlayPic.show {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

    #timerCanvas {
      position: absolute; top: 0; left: 0;
      display: none;
      width: 100%; height: 100%; z-index: 3;
    }
	
	.button{
	width:70px; 
	padding: 3px 3px; 
	font-size: 14px;
	}

#rerollChallengeBtn {
  margin-top: 12px;
  font-size: 14px;
  padding: 8px 14px;
  background-color: #fff;
  color: #4CAF50;
  border: 2px solid #fff;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s, color 0.3s;
}

#rerollChallengeBtn:hover {
  background-color: #4CAF50;
  color: #fff;
}

#startOverlayContent {
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  max-width: 90%;
}


#challengeText {
  transition: opacity 1s ease;
  opacity: 1;
}

.challenge-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px; /* space between buttons */
  margin-top: 12px;
}

.diagram-button,
.start-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: #444;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s ease;
  text-align: center;
}

.diagram-button {
  background-image: url('images/diagram_icon.png?nc=1');
  background-size: cover;
  background-position: center;
  color: transparent; /* hide text if icon-only */
}

.diagram-button:hover,
.start-button:hover {
  transform: scale(1.1);
}


.diagram-button:hover {
  background-color: #666;
}

.diagram-button .timer-line1,
.diagram-button .timer-line2 {
  line-height: 1.2;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#startOverlayPic {
  opacity: 0;
  transition: opacity 0.7s ease;
}

#startOverlayPic[style*="display: flex"] {
  animation: fadeIn 0.7s ease forwards;
}


#startTimerButton {
  width: 80px;
  height: 80px;
  margin: 10px auto;
  border-radius: 50%;
  background-color: #444;
  color: white;
  text-align: center;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#startTimerButton:hover {
  transform: scale(1.05);
}


.timer-line1,
.timer-line2 {
  line-height: 1.2;
}

.timer-line1 {
  font-size: 20px;
}

.timer-line2 {
  font-size: 16px;
  opacity: 0.9;
}

  @keyframes pulse {
    0% { opacity: 1; }
    100% { opacity: 0.6; }
  }

   
  #overlayButtons button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 16px;
  margin: 6px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#overlayButtons button:hover {
  background-color: #0056b3;
}

#overlayButtons button:active {
  background-color: #003f8a;
}

    .back-button {
      display: inline-block;
      margin-top: 20px;
      text-decoration: none;
      background-color: #007bff;
      color: white;
	  cursor:pointer;
      padding: 10px 10px;
      border-radius: 6px;
	    vertical-align: middle;
		  line-height: 1;
      font-size: 16px;
      transition: background-color 0.2s ease;
    }

    .back-button:hover {
      background-color: #0056b3;
    }
	
    button {
      margin-top: 15px;
      padding: 10px 20px;
      font-size: 16px;
      cursor: pointer;
    }

    input[type="submit"]{
      margin-top: 20px;
      padding: 10px 20px;
      font-size: 16px;
      cursor: pointer;
    }
	
	section {
	text-align:left;
	}
	
	.shadow {
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.3);
}

ul, li {
  text-align: left;
  list-style-position: inside;
  padding-left: 0;
  margin-left: 0;
}


@keyframes overlayReveal {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  60% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

#startOverlay {
  animation: overlayReveal 0.5s ease-out;
}

#termsNotice {
  font-size: 0.75em;
  line-height: 1.3;
  padding: 6px;
  text-align: center;
  background: #f8f8f8;
  border-top: 1px solid #ccc;
  color: #555;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 4.5em;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
  word-wrap: break-word;
  white-space: normal;
}

#termsNotice a {
  color: #d6336c;
  text-decoration: underline;
  font-weight: bold;
  white-space: nowrap;
}

#termsNotice a:hover {
  text-decoration: none;
}

@media (max-width: 1024px) {
  #termsNotice {
    font-size: 0.4em;
    padding: 5px;
    max-height: 5.5em;
	width: 99%;	
  }
}


#leaderboardContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
  display: none;
  z-index: 999;
  font-family: 'Fredoka', sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
}


#leaderboardContainer h2 {
  margin-top: 0;
}

#leaderboardList {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: center;
  color:#000000;
  width: 100%;
}
#leaderboardList li {
  font-size: 1.2em;
  margin: 6px 0;
   text-align: center; 
  color: #000;
}

#showLeaderboardBtn {
  position: absolute;
  top: -6%;
  right: 2%;
  width: 15%;
  height: 15%;
  border-radius: 50%;
  background-color: #4CAF50;
  color: white;
  border: none;
  font-size: clamp(1.5rem, 4vw, 3rem);  /* Slightly narrower range */
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10;
  display: none; /* shown only in points mode */
  transition: background-color 0.3s ease;
  
  /* Flex centering */
  /*display: flex;*/
  align-items: center;
  justify-content: center;

  padding: 0;
  line-height: 1;
}

#showLeaderboardBtn:hover {
  background-color: #45a049;
}

#pointsSuccessBtn, #pointsFailBtn {
  width: 40%;
  aspect-ratio: 1 / 1; /* Ensures height equals width */
 font-size: clamp(1rem, 5vw, 2rem); /* min 1rem, preferred 5vw, max 2rem */
  font-weight: bold;
  border: none;
  border-radius: 50%; /* Makes it a circle */
  cursor: pointer;
  transition: background 0.3s ease;
  color: white;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 10px;
}

.tooltip {
  position: relative;
  cursor: pointer;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 220px;
  background-color: black;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 6px;
  position: absolute;
  z-index: 10;
  bottom: 125%; /* position above the button */
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}


/* Green button */
#pointsSuccessBtn {
  background-color: #28a745;
}

/* Red button */
#pointsFailBtn {
  background-color: #dc3545;
}


#pointsSuccessBtn:hover {
  background-color: #218838;
}

#pointsFailBtn:hover {
  background-color: #c82333;
}

#pointsAnimation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.05);
  font-size: clamp(1.5rem, 5vw, 3rem); /* Responsive size */
  font-weight: bold;
  color: gold;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  text-align: center;
}


@media (max-width: 1024px) {
  #pointsAnimation {
    font-size: clamp(0.8rem, 4vw, 2rem);
    max-width: 80vw;
  }
}



#failAnimation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%) scale(0.05); /* moved down slightly */
  font-size: 5rem; /* Base before scaling */
  font-weight: bold;
  color: #cc0000;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}

/* Style the Start Game button to fully overlay the canvas */
#startGameBtn {
  position: absolute;
  top: -20px;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(145deg, #4CAF50, #45a049);
  color: white;
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: bold;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: transform 0.2s ease, background 0.3s ease;
}

#startGameBtn:hover {
  transform: scale(1.05);
  background: linear-gradient(145deg, #45a049, #3e9240);
}

.overlay-inner {
  font-family: sans-serif;
  text-align: center;
}

.overlay-title {
  font-size: 24px;
}

.challenge-text .challenge-line {
  margin: 6px 0;
  font-size: 30px;
}

.challenge-text .challenge-desc {
  font-size: 13px;
  margin: 6px 0;
}

.challenge-points {
  margin: 6px 0;
  font-size: 20px;
  color: gold;
}

.challenge-diagram em {
  cursor: pointer;
  color: yellow;
  font-size: 13px;
  text-decoration: underline;
}

.challenge-timer {
  margin: 6px 0;
  font-size: 20px;
}

/* 🔽 Media Query for smaller screens */
@media (max-width: 1024px) {
  .overlay-title {
    font-size: 14px;
  }

  .challenge-text .challenge-line {
    font-size: 13px;
  }

  .challenge-text .challenge-desc {
    font-size: 11px;
  }

  .challenge-points {
    font-size: 16px;
  }

  .challenge-diagram em {
    font-size: 11px;
  }

  .challenge-timer {
    font-size: 16px;
  }
  
  	    
	.container {
		  margin-bottom:200px;
		}
}

.mobile-break {
  display: none;
}

    .mobbutton{
      margin-top: 20px;
      padding: 10px 20px;
      font-size: 16px;
      cursor: pointer;
    }

