/* ========== VARIABLES & RESET ========== */
:root {
  --bg: #fef6ff;
  --bg2: #fff0f5;
  --pink: #f0b6d0;
  --lavender: #c8a2d0;
  --blue: #a8d8ea;
  --mint: #b8e6d0;
  --yellow: #fce4a8;
  --peach: #fcd5ce;
  --text: #6b4c6e;
  --text-light: #9b7a9e;
  --white: #ffffff;
  --shadow: 0 4px 20px rgba(200, 162, 208, 0.25);
  --shadow-sm: 0 2px 10px rgba(200, 162, 208, 0.2);
  --radius: 20px;
  --radius-sm: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(168, 216, 234, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(240, 182, 208, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(184, 230, 208, 0.12) 0%, transparent 50%);
}

/* ========== FLOATING DECORATIONS ========== */
.floating-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  font-size: 1.5rem;
  animation: float 4s ease-in-out infinite;
  opacity: 0.6;
}

.star:nth-child(2n) { animation-duration: 5s; animation-delay: 1s; }
.star:nth-child(3n) { animation-duration: 6s; animation-delay: 0.5s; }
.star:nth-child(4n) { animation-duration: 4.5s; animation-delay: 1.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(10deg); }
}

/* ========== HEADER ========== */
header {
  text-align: center;
  padding: 2rem 1rem 1rem;
  position: relative;
  z-index: 1;
}

header h1 {
  font-family: 'Fredoka One', cursive;
  font-size: 2.8rem;
  background: linear-gradient(135deg, var(--pink), var(--lavender), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite alternate;
}

@keyframes shimmer {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(20deg); }
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  font-weight: 600;
  margin-top: 0.3rem;
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 50px;
  background: var(--white);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: var(--shadow);
}

.tab.active {
  background: linear-gradient(135deg, var(--pink), var(--lavender));
  color: var(--white);
  transform: scale(1.05);
  box-shadow: 0 4px 25px rgba(240, 182, 208, 0.4);
}

.tab-emoji { font-size: 1.3rem; }

/* ========== SECTIONS ========== */
.section {
  display: none;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.4s ease;
}

.section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.section h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 2rem;
  text-align: center;
  color: var(--lavender);
  margin-bottom: 0.3rem;
}

.section-desc {
  text-align: center;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* ========== CONTROLS ========== */
.controls-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.control-group label {
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
}

.color-options {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.color-btn, .popit-color, .squishy-color {
  width: 36px;
  height: 36px;
  border: 3px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.color-btn:hover, .popit-color:hover, .squishy-color:hover {
  transform: scale(1.15);
}

.color-btn.active, .popit-color.active, .squishy-color.active {
  border-color: var(--white);
  box-shadow: 0 0 0 3px var(--lavender), var(--shadow);
  transform: scale(1.1);
}

.custom-color {
  width: 36px;
  height: 36px;
  border: 3px solid var(--white);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.custom-color::-webkit-color-swatch-wrapper { padding: 0; }
.custom-color::-webkit-color-swatch { border: none; border-radius: 50%; }

.extras-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.toggle-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--lavender);
  border-radius: 50px;
  background: var(--white);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn:hover { transform: scale(1.05); }

.toggle-btn.active {
  background: var(--lavender);
  color: var(--white);
  border-color: var(--lavender);
}

.action-btn {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--pink), var(--lavender));
  color: var(--white);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.action-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 25px rgba(240, 182, 208, 0.5);
}

.action-btn:active {
  transform: scale(0.97);
}

.hint {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.8rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ========== SLIME PLAYGROUND ========== */
.slime-playground {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  text-align: center;
}

#slimeCanvas {
  width: 100%;
  max-width: 800px;
  height: 400px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  cursor: grab;
  touch-action: none;
}

#slimeCanvas:active { cursor: grabbing; }

/* ========== FIDGET TOYS ========== */
.fidget-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.fidget-tab {
  padding: 0.6rem 1.2rem;
  border: 2px solid var(--blue);
  border-radius: 50px;
  background: var(--white);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fidget-tab:hover { transform: scale(1.05); }

.fidget-tab.active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

.fidget-toy {
  display: none;
  animation: fadeIn 0.3s ease;
}

.fidget-toy.active { display: block; }

/* Pop It */
.popit-controls {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.popit-board {
  display: grid;
  gap: 6px;
  justify-content: center;
  padding: 1.5rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 500px;
  margin: 0 auto;
}

.popit-board.shape-square { grid-template-columns: repeat(6, 1fr); }
.popit-board.shape-heart { grid-template-columns: repeat(7, 1fr); }
.popit-board.shape-circle { grid-template-columns: repeat(7, 1fr); }

.pop-bubble {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: inset 0 -4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.08);
  position: relative;
}

.pop-bubble:hover:not(.popped) {
  transform: scale(1.08);
}

.pop-bubble.popped {
  box-shadow: inset 0 4px 6px rgba(0,0,0,0.12);
  transform: scale(0.92);
  filter: brightness(0.88);
  cursor: default;
}

.pop-bubble.pop-animate {
  animation: popBounce 0.3s ease;
}

@keyframes popBounce {
  0% { transform: scale(1); }
  40% { transform: scale(0.8); }
  70% { transform: scale(0.95); }
  100% { transform: scale(0.92); }
}

.pop-bubble.hidden { visibility: hidden; }

.pop-counter {
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--lavender);
  margin-top: 1rem;
}

/* Spinner */
.spinner-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
}

.spinner-widget {
  width: 200px;
  height: 200px;
  position: relative;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.spinner-widget:active { cursor: grabbing; }

.spinner-arm {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--peach));
  box-shadow: var(--shadow), inset 0 -3px 6px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.arm1 { top: 0; left: 50%; transform: translateX(-50%); }
.arm2 { bottom: 8px; left: 5px; }
.arm3 { bottom: 8px; right: 5px; }

.arm1 { background: linear-gradient(135deg, var(--pink), var(--peach)); }
.arm2 { background: linear-gradient(135deg, var(--blue), var(--mint)); }
.arm3 { background: linear-gradient(135deg, var(--lavender), var(--pink)); }

.spinner-center {
  position: absolute;
  width: 50px;
  height: 50px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow), inset 0 2px 4px rgba(0,0,0,0.05);
  border: 4px solid var(--lavender);
  z-index: 2;
}

.speed-display {
  font-weight: 800;
  color: var(--lavender);
  font-size: 1.1rem;
  background: var(--white);
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  box-shadow: var(--shadow-sm);
}

/* Keyboard Keys */
.keyboard-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 1.5rem;
  background: linear-gradient(180deg, #e8e0eb, #d8d0dc);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.5);
  max-width: 460px;
  margin: 0 auto;
}

.key-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.kb-key {
  width: 50px;
  height: 46px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f0e8f2 60%, #e0d6e4 100%);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  box-shadow:
    0 4px 0 #c0b4c4,
    0 6px 8px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(255,255,255,0.8);
  transition: all 0.06s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.kb-key:hover {
  background: linear-gradient(180deg, #fff0f8 0%, #f0e0f0 60%, #e0d0e4 100%);
}

.kb-key:active,
.kb-key.pressed {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 #c0b4c4,
    0 2px 4px rgba(0,0,0,0.1),
    inset 0 1px 0 rgba(255,255,255,0.5);
  background: linear-gradient(180deg, #ece4f0 0%, #e0d8e6 60%, #d6ceda 100%);
}

.kb-key.wide {
  width: 68px;
  font-size: 1.1rem;
}

.kb-key.space {
  width: 240px;
  font-size: 0.8rem;
  letter-spacing: 3px;
}

/* ========== SQUISHY 3D PLAY ========== */
.squishy-picker {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.squishy-pick {
  width: 50px;
  height: 50px;
  border: 3px solid transparent;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.squishy-pick:hover {
  transform: scale(1.12);
}

.squishy-pick.active {
  border-color: var(--white);
  box-shadow: 0 0 0 3px var(--lavender), 0 4px 15px rgba(0,0,0,0.15);
  transform: scale(1.1);
}

.squishy-play-area {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  text-align: center;
}

#squishyCanvas {
  width: 100%;
  max-width: 600px;
  height: 500px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff5f8, #fef0f5);
  cursor: pointer;
  touch-action: none;
}

/* ========== FOOTER ========== */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
  font-weight: 600;
  position: relative;
  z-index: 1;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
  header h1 { font-size: 2rem; }
  .section h2 { font-size: 1.5rem; }
  .tab { padding: 0.6rem 1rem; font-size: 0.85rem; }
  .tab-text { display: none; }
  .tab-emoji { font-size: 1.5rem; }
  .pop-bubble { width: 40px; height: 40px; }
  .kb-key { width: 40px; height: 38px; font-size: 0.85rem; }
  .kb-key.wide { width: 56px; }
  .kb-key.space { width: 180px; }
  #squishyCanvas { height: 350px; }
  .squishy-pick { width: 42px; height: 42px; font-size: 1.2rem; }
  .controls-row { gap: 1rem; }
}
