#wheel-wrapper {
    position: relative;
    width: 500px;
    margin: 40px auto;
    text-align: center;
    max-width: 100%;
}

/* Canvas Wheel Styling */
#fortune-wheel {
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle at center, #fff 40%, #f0f0f0 100%);
    border: 10px solid #fde68a;
    box-shadow:
        inset 0 0 20px rgba(0,0,0,0.15),
        0 10px 20px rgba(0,0,0,0.2);
    transition: transform 5s cubic-bezier(0.3, 1.1, 0.5, 1) !important;
    display: block;
    margin: 0 auto;
}

#spin-button {
    margin-top: 50px;
    padding: 14px 28px;
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #f43f5e, #facc15);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}
#spin-button:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
#spin-button:active {
    transform: scale(0.95);
}

/* Result Label */
#selected-label {
    margin-top: 25px;
    font-size: 28px;
    font-weight: bold;
    color: #16a34a;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.blink {
    animation: blinkAnim 0.6s step-start infinite;
}
@keyframes blinkAnim {
    50% { opacity: 0; }
}

.wheel-arrow {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) rotate(180deg);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 25px solid #dc2626;
    z-index: 2;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.3));
	animation: glowPulse 1.5s ease-in-out infinite !important;
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 6px #dc2626);
    }
    50% {
        filter: drop-shadow(0 0 12px #dc2626);
    }
}

#spin-button.hidden {
    display: none !important;
}

#fortune-wheel.shrunk {
    width: 150px !important;
    height: 150px !important;
	transform-origin: center center;
  	transition: transform 0.6s ease-in-out, width 0.6s ease-in-out, height 0.6s ease-in-out !important;
}

.wheel-arrow.shrunk {
	transform-origin: center center;
  	transition: transform 0.6s ease-in-out, width 0.6s ease-in-out, height 0.6s ease-in-out !important;
}

/* Memory Game */
#memory-game {
  justify-content: center;
  align-items: center;
  display: grid;
  grid-template-columns: repeat(4, 70px);
  gap: 12px;
  margin: auto;
  max-width: 320px;
}

.memory-card {
  width: 70px;
  height: 70px;
}

.memory-front {
  background-color: #fef3c7;
}

.memory-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s;
}
.memory-card.flipped .memory-inner {
  transform: rotateY(180deg);
}
.memory-front, .memory-back {
  position: absolute;
  width:100%; height:100%;
  backface-visibility: hidden;
  display: flex; justify-content:center; align-items:center;
  font-size:30px;
  border-radius:8px;
}
.memory-back {
  background:#4ade80;
  transform: rotateY(180deg);
}

/* Sequence Tap */
.pressed {
  background-color: #ddd !important;
  transform: scale(0.95);
}

.seq-btn {
  margin: 8px;
  padding: 10px 18px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.2s;
}

#complete-activity:disabled {
  opacity: 0.5;
  color: #666;
  cursor: not-allowed !important;
}

/* Activity CSS */
#activity-content input[type="text"] {
  padding: 10px;
  width: 80%;
  max-width: 300px;
  font-size: 18px;
  margin-top: 10px;
  border: 2px solid #a5b4fc;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#activity-content button {
  margin-top: 12px;
  padding: 10px 20px;
  background-color: #60a5fa;
  color: white;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
#activity-content button:hover {
  background-color: #3b82f6;
}

/* End Screen Container */
#end-screen {
  margin: 50px auto;
  padding: 30px 20px;
  text-align: center;
  background: linear-gradient(270deg, #ffb347, #ff4081, #6dd5ed, #cc2b5e);
  background-size: 800% 800%;
  animation: gradientFlow 8s ease infinite;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
  display: none;
  transition: all 0.5s ease;
}

.hidden-end-screen {
  display: none !important;
  padding: 20px;
  text-align: center;
}

#end-screen.active {
  display: block !important;
  animation: fadeIn 1s ease, gradientFlow 8s ease infinite;
}

@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hidden-end-screen.active {
  display: block !important;
}

/* Scratch Container */
#scratch-container {
  position: relative;
  width: 350px;
  height: 250px;
  margin: 20px auto;
  border: 2px solid #ccc;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 7 / 5;
}

/* Scratch Canvas Layer */
#scratch-canvas {
  position: absolute;
  top: 0;
  left: 0;
  cursor: crosshair;
  z-index: 2;
  width: 100%;
  height: 100%;
}

/* Revealed Message Layer */
#scratch-reveal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: linear-gradient(to right, #ffb6c1, #add8e6, #fceabb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  font-weight: bold;
  color: #333;
  animation: pulse 1.5s infinite;
}

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

/* Time taken text */
#end-screen p {
  font-size: 16px;
  margin-top: 15px;
  background: #f5f5f5;
  padding: 10px 20px;
  border-radius: 10px;
  display: inline-block;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  font-weight: bold;
  color: #333;
}

/* Share buttons */
.share-buttons {
  margin: 20px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.share-buttons button {
  padding: 10px 15px;
  border: none;
  background: #ff4081;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  min-width: 100px;
  flex: 1 1 30%;
  max-width: 120px;
}

.share-buttons button:hover {
  background: #e91e63;
}

/* Play Again button */
#play-again {
  padding: 10px 20px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}
#play-again:hover {
  background: #388e3c;
}

/* Modal Pop-up CSS */
.result-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 25%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.result-modal.active {
  display: flex;
}

.result-modal .modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  max-width: 300px;
  width: 90%;
}

@media (max-width: 600px) {
    #wheel-wrapper {
        width: 100%;
    }
    #fortune-wheel {
        width: 90vw;
        height: 90vw;
    }
    .wheel-arrow {
        left: 50%;
        transform: translateX(-50%) rotate(180deg);
        border-left: 16px solid transparent;
        border-right: 16px solid transparent;
        border-top: 20px solid #dc2626;
    }
	#spin-button {
        padding: 10px 20px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
  #scratch-container {
    width: 90%;
    height: calc(90vw * 0.714); /* Maintain 350x250 ratio (~7:5) */
  }
}
