:root {
  --font-family: 'Comic Sans MS', 'Quicksand', 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --primary-color: #ff6b8b;
  --primary-gradient: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
  --accent-yellow: #ffd166;
  --accent-blue: #4cc9f0;
  --accent-green: #06d6a0;
  --accent-purple: #9d4edd;
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.95);
  --glass-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --item-size: 130px;
  --item-font-size: 82px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  touch-action: none;
}

[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background: #a1c4fd;
}

/* Two stacked gradient layers; the new one fades in on top (gradients can't transition directly) */
.bg-stack {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.bg-layer.top {
  z-index: 1;
}

.bg-layer.visible {
  opacity: 1;
}

.bg-layer.instant {
  transition: none;
}

body {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Ambient Floating Bokeh Orbs in Background */
.ambient-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  animation: ambientFloat 14s infinite alternate ease-in-out;
}

.ambient-orb:nth-child(1) {
  width: 450px;
  height: 450px;
  background: #ff9a9e;
  top: -100px;
  left: -100px;
  animation-duration: 18s;
}

.ambient-orb:nth-child(2) {
  width: 500px;
  height: 500px;
  background: #a1c4fd;
  bottom: -150px;
  right: -100px;
  animation-duration: 15s;
}

.ambient-orb:nth-child(3) {
  width: 350px;
  height: 350px;
  background: #fbc2eb;
  top: 40%;
  left: 60%;
  animation-duration: 20s;
}

.ambient-orb:nth-child(4) {
  width: 300px;
  height: 300px;
  background: #d4fc79;
  bottom: 20%;
  left: 10%;
  animation-duration: 16s;
}

@keyframes ambientFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.15); }
  100% { transform: translate(-40px, 80px) scale(0.9); }
}

/* Game Play Area */
#playground {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow: hidden;
  cursor: pointer;
}

/* Canvas for Confetti and Magic Sparkles */
#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* Tap Ripple / Shockwave */
.tap-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.1);
  animation: rippleExpand 0.8s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  z-index: 4;
  border: 6px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.8), inset 0 0 15px rgba(255, 255, 255, 0.5);
}

@keyframes rippleExpand {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0.9;
  }
  70% {
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.8);
    opacity: 0;
  }
}

/* Spawned Interactive Item */
.smash-item {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--item-size);
  height: var(--item-size);
  margin-left: calc(-1 * var(--item-size) / 2);
  margin-top: calc(-1 * var(--item-size) / 2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
  transform-origin: center center;
  will-change: transform, opacity;
}

.smash-emoji {
  font-size: var(--item-font-size);
  line-height: 1;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.15)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transform-origin: center center;
  transition: transform 0.2s ease;
}

.smash-label {
  margin-top: 6px;
  padding: 4px 14px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  color: #333333;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  border: 2px solid rgba(255, 255, 255, 0.95);
  text-transform: capitalize;
}

/* Top Parental Control Bar (In-Game Floating Pill) */
.parent-bar {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 50;
  pointer-events: auto;
  opacity: 0.4;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.parent-bar:hover, .parent-bar:focus-within {
  opacity: 1;
  transform: scale(1.03);
}

.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  color: #444;
  outline: none;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.icon-btn:hover {
  transform: scale(1.1);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.icon-btn:active {
  transform: scale(0.92);
}

.hint-tooltip {
  position: absolute;
  top: 56px;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.parent-bar:hover .hint-tooltip {
  opacity: 0.9;
}

/* Modals & Overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(40, 30, 60, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Let parents scroll long menus on touch screens (everything else is touch-action: none) */
.modal-card,
.modal-card * {
  touch-action: pan-y;
}

.modal-card {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--glass-bg);
  border: 3px solid var(--glass-border);
  border-radius: 36px;
  box-shadow: var(--glass-shadow), 0 0 0 1px rgba(255, 255, 255, 0.6);
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: relative;
  animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Modal Header & Branding */
.brand-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 6px 18px;
  border-radius: 50px;
  box-shadow: 0 4px 14px rgba(255, 107, 139, 0.2);
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.brand-title {
  font-size: 38px;
  font-weight: 900;
  background: linear-gradient(135deg, #ff477e 0%, #ff70a6 50%, #70d6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  line-height: 1.3;
  padding-bottom: 0.08em;
}

.brand-subtitle {
  font-size: 16px;
  color: #636e72;
  font-weight: 600;
  max-width: 440px;
  line-height: 1.4;
}

/* Primary Big Play Button */
.btn-play {
  background: var(--primary-gradient);
  color: #ffffff;
  font-family: inherit;
  font-size: 24px;
  font-weight: 900;
  padding: 18px 36px;
  border: 4px solid #ffffff;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(255, 107, 139, 0.38), 0 4px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  outline: none;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: pulsePlay 2.5s infinite;
}

@keyframes pulsePlay {
  0% { transform: scale(1); box-shadow: 0 14px 28px rgba(255, 107, 139, 0.38); }
  50% { transform: scale(1.03); box-shadow: 0 18px 36px rgba(255, 107, 139, 0.55); }
  100% { transform: scale(1); box-shadow: 0 14px 28px rgba(255, 107, 139, 0.38); }
}

.btn-play:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #ff5477 0%, #ff6aa4 100%);
}

.btn-play:active {
  transform: scale(0.96);
}

/* App-style back button: pinned to the top-left while the card scrolls */
.modal-back {
  position: sticky;
  top: 0;
  z-index: 5;
  align-self: flex-start;
  flex-shrink: 0;
  /* Takes no room in the layout: cancel its own height plus the card gap */
  margin: -14px 0 -48px -10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: #ffffff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
  color: #475569;
  cursor: pointer;
  transition: transform 0.15s, color 0.2s;
}

.modal-back:hover {
  color: var(--primary-color);
}

.modal-back:active {
  transform: scale(0.92);
}

/* Settings sections share the How it works look: centered heading, pastel bubbles, rounded white cards */
.settings-title {
  font-size: 32px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-section-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -6px;
  font-size: 13px;
  font-weight: 600;
  color: #718096;
  text-align: center;
}

.quick-toggle-btn {
  background: #fff1f4;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-color);
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.quick-toggle-btn:hover {
  background: #ffe3ea;
}

/* Category Cards Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.category-card {
  --bubble-from: #ffe3ea;
  --bubble-to: #ffc2d1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px;
  background: #ffffff;
  border: 2px solid #f1f5f9;
  border-radius: 18px;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.category-card:nth-child(4n + 2) { --bubble-from: #e0f0ff; --bubble-to: #b5dcff; }
.category-card:nth-child(4n + 3) { --bubble-from: #fff4cc; --bubble-to: #ffe08a; }
.category-card:nth-child(4n + 4) { --bubble-from: #e9e3ff; --bubble-to: #cfc2ff; }

.category-card:hover {
  border-color: #ffd6e0;
  transform: translateY(-2px);
}

.category-card.active {
  border-color: #ffc2d1;
  box-shadow: 0 8px 20px rgba(255, 107, 139, 0.12);
}

.category-bubble {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 6px;
  background: linear-gradient(145deg, var(--bubble-from), var(--bubble-to));
  border: 4px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
  font-size: 28px;
  line-height: 1;
  transition: filter 0.2s, opacity 0.2s;
}

.category-card:not(.active) .category-bubble {
  filter: grayscale(0.7);
  opacity: 0.6;
}

/* Corner badge, like the step numbers */
.category-check {
  position: absolute;
  top: -5px;
  right: -7px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
  color: transparent;
  transition: background 0.2s, border-color 0.2s;
}

.category-card.active .category-check {
  background: var(--primary-color);
  border-color: #ffffff;
  color: #ffffff;
}

.category-name {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
  color: #2d3436;
}

/* Options: each one is its own rounded card, like the FAQ */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #ffffff;
  border: 2px solid #f1f5f9;
  border-radius: 18px;
}

/* Choice pills get their own full-width line */
.setting-row--pills {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.setting-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.setting-title {
  font-size: 15px;
  font-weight: 800;
  color: #2d3436;
}

.setting-desc {
  font-size: 13px;
  font-weight: 600;
  color: #718096;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e0;
  transition: 0.3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Pill Selection Group */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #f8fafc;
  padding: 4px;
  border-radius: 14px;
}

.pill-btn {
  flex: 1 1 auto;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 11px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
}

.pill-btn.active {
  background: #ffffff;
  color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(255, 107, 139, 0.15);
}

/* Secondary Action Buttons */
.modal-actions {
  display: flex;
  gap: 12px;
}

.btn-secondary {
  flex: 1;
  padding: 14px;
  background: #f1f5f9;
  color: #475569;
  border: none;
  border-radius: 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* Welcome screen: compact menu with on-demand extras */
.new-badge {
  margin-top: 4px;
  padding: 5px 14px;
  background: #fff7e0;
  border: 1px solid #ffe08a;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 800;
  color: #b7791f;
}

.welcome-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -6px;
}

.welcome-links-sep {
  color: #a0aec0;
  font-weight: 800;
}

.link-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 17px;
  font-weight: 900;
  color: #2d3748;
  padding: 9px 16px;
  border-radius: 20px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.link-btn:hover,
.link-btn[aria-expanded="true"] {
  background: #edf2f7;
  color: #1a202c;
}

.link-recommended {
  font-size: 13px;
  font-weight: 900;
  color: var(--primary-color);
}

.welcome-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 18px;
  border-top: 2px dashed #e2e8f0;
  animation: infoReveal 0.25s ease;
}

.info-heading {
  font-size: 21px;
  font-weight: 900;
  color: #2d3436;
  text-align: center;
}

.info-heading:not(:first-child) {
  margin-top: 6px;
}

/* Three numbered bubbles joined by a dotted line */
.how-steps {
  list-style: none;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.how-steps::before {
  content: '';
  position: absolute;
  top: 34px;
  left: 17%;
  right: 17%;
  border-top: 3px dotted #ffc2d1;
}

.how-step {
  --bubble-from: #ffe3ea;
  --bubble-to: #ffc2d1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.how-step--yellow {
  --bubble-from: #fff4cc;
  --bubble-to: #ffe08a;
}

.how-step--blue {
  --bubble-from: #e0f0ff;
  --bubble-to: #b5dcff;
}

.how-step-bubble {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  margin-bottom: 6px;
  background: linear-gradient(145deg, var(--bubble-from), var(--bubble-to));
  border: 4px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(255, 107, 139, 0.18);
  font-size: 30px;
  line-height: 1;
}

.how-step-num {
  position: absolute;
  top: -4px;
  right: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--primary-color);
  border: 2px solid #ffffff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
  color: #ffffff;
}

.how-step strong {
  font-size: 16px;
  font-weight: 900;
  color: #2d3436;
}

.how-step-text {
  max-width: 170px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: #718096;
}

.how-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: #ecfdf5;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: #166534;
}

/* Parents' FAQ: separate rounded cards */
.faq {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq details {
  background: #ffffff;
  border: 2px solid #f1f5f9;
  border-radius: 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.faq details:hover {
  border-color: #ffd6e0;
}

.faq details[open] {
  border-color: #ffc2d1;
  box-shadow: 0 8px 20px rgba(255, 107, 139, 0.1);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 800;
  color: #2d3436;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

/* Chevron drawn with borders: rotates when the answer opens */
.faq summary::after {
  content: '';
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 3px solid #cbd5e0;
  border-bottom: 3px solid #cbd5e0;
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.2s, border-color 0.2s;
}

.faq details[open] summary::after {
  border-color: var(--primary-color);
  transform: translateY(2px) rotate(-135deg);
}

.faq details p {
  padding: 0 18px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  color: #64748b;
}

.faq a {
  color: var(--primary-color);
  font-weight: 800;
}

@keyframes infoReveal {
  0% { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.ios-tip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 18px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #1e40af;
}

.ios-tip summary {
  cursor: pointer;
  text-align: center;
  list-style: none;
}

.ios-tip summary::-webkit-details-marker {
  display: none;
}

.ios-tip summary::after {
  content: ' ▾';
}

.ios-tip[open] summary::after {
  content: ' ▴';
}

.ios-tip p {
  margin-top: 8px;
  line-height: 1.45;
  text-align: center;
}

/* Feedback card on the welcome screen */
.feedback-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fff5f7 0%, #f0f7ff 100%);
  border: 2px solid #ffd6e0;
  border-radius: 22px;
  font-family: inherit;
  text-align: left;
  color: #2d3436;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(255, 107, 139, 0.1);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feedback-card:hover {
  transform: translateY(-2px);
  border-color: #ffadc0;
}

.feedback-card-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.feedback-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 900;
  color: #c2185b;
}

.feedback-card-text span {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  line-height: 1.35;
}

.feedback-card-arrow {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary-color);
}

.legal-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -8px;
  font-size: 12px;
  font-weight: 700;
  color: #a0aec0;
}

.legal-links a {
  color: #718096;
  text-decoration: none;
}

.legal-links a:hover {
  color: #2d3748;
  text-decoration: underline;
}

/* Feedback form modal */
.feedback-modal-card {
  max-width: 560px;
  gap: 18px;
}

.feedback-title {
  font-size: 32px;
}

.feedback-modal-card .brand-subtitle {
  font-size: 14px;
  line-height: 1.5;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 14px;
  font-weight: 800;
  color: #2d3436;
}

.field-optional {
  font-weight: 700;
  color: #94a3b8;
}

/* Form fields must be selectable and typeable (the game blocks selection and touch everywhere else) */
.feedback-form input,
.feedback-form textarea {
  width: 100%;
  padding: 12px 14px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  font-family: inherit;
  font-size: 16px; /* 16px stops iOS from zooming in on focus */
  font-weight: 600;
  color: #2d3436;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
  touch-action: manipulation;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.feedback-form textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.45;
}

.feedback-form input::placeholder,
.feedback-form textarea::placeholder {
  color: #a0aec0;
  font-weight: 600;
}

.feedback-form input:focus,
.feedback-form textarea:focus {
  border-color: #ff9bb3;
  box-shadow: 0 0 0 4px rgba(255, 107, 139, 0.15);
}

.feedback-form .is-invalid {
  border-color: #f87171;
}

.field-hint {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
}

.field-hint:has(#fb-message-count) {
  text-align: right;
}

.fb-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.fb-status {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  background: #f0fdf4;
  color: #166534;
}

.fb-status.is-error {
  background: #fef2f2;
  color: #b91c1c;
}

.feedback-submit {
  font-size: 19px;
  padding: 14px 24px;
  animation: none;
}

.feedback-submit:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.fb-privacy {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  text-align: center;
  line-height: 1.5;
}

.fb-privacy a {
  color: #64748b;
}

.feedback-thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 8px 0;
  animation: infoReveal 0.3s ease;
}

.feedback-thanks-icon {
  font-size: 56px;
  line-height: 1;
}

.feedback-thanks h3 {
  font-size: 26px;
  font-weight: 900;
  color: #2d3436;
}

.feedback-thanks p {
  max-width: 380px;
  font-size: 15px;
  font-weight: 600;
  color: #636e72;
  line-height: 1.5;
  margin-bottom: 8px;
}

/* Floating Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 30px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Watermark / Playful Center Hint when Idle */
.idle-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.6;
  transition: opacity 0.5s ease;
  animation: gentlePulse 3s infinite ease-in-out;
}

.idle-hint.hidden {
  opacity: 0;
}

.idle-icon {
  font-size: 64px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.1));
}

.idle-text {
  font-size: 20px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.15);
  padding: 8px 24px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
}

@keyframes gentlePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.05); }
}

/* --- Basketball Sensory Magic Hoop Styling --- */
/* Position (left/top) is set from JS so the hoop appears opposite the grabbed item */
.magic-hoop {
  --hoop-scale: 1;
  position: fixed;
  left: 0;
  top: 0;
  width: 210px;
  height: 222px;
  pointer-events: none;
  /* Above the background orbs (same z-index, later in DOM) but below #playground (z 2),
     so thrown items always stay visible in front of the hoop */
  z-index: 1;
  opacity: 0;
  transform: scale(calc(var(--hoop-scale) * 0.5)) translateY(-40px);
  transform-origin: center top;
  transition: opacity 0.45s ease,
              transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              left 0.55s cubic-bezier(0.34, 1.3, 0.64, 1),
              top 0.55s cubic-bezier(0.34, 1.3, 0.64, 1);
}

/* Used when placing a hidden hoop, so it pops in at its new spot instead of gliding there */
.magic-hoop.no-move {
  transition: opacity 0.45s ease,
              transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.magic-hoop.show {
  opacity: 1;
  transform: scale(var(--hoop-scale)) translateY(0);
}

@media (max-width: 600px), (max-height: 500px) {
  .magic-hoop {
    --hoop-scale: 0.75;
  }
}

/* Pulsing warm glow behind the rim - makes the target easy to spot */
.magic-hoop-glow {
  position: absolute;
  top: 100px;
  left: 5px;
  width: 200px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 190, 60, 0.75) 0%, rgba(255, 140, 0, 0.35) 45%, transparent 72%);
  animation: hoopGlowPulse 1.6s ease-in-out infinite;
}

@keyframes hoopGlowPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.75; }
  50% { transform: scale(1.12); opacity: 1; }
}

/* Bold white backboard with a sunny orange frame */
.magic-hoop-backboard {
  position: absolute;
  top: 34px;
  left: 0;
  width: 210px;
  height: 120px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 246, 230, 0.95) 100%);
  border: 6px solid #ff9f1c;
  border-radius: 20px;
  box-shadow: 0 14px 30px rgba(120, 60, 0, 0.25), inset 0 0 0 3px rgba(255, 255, 255, 0.9);
}

/* Target square above the rim */
.magic-hoop-backboard-square {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 84px;
  height: 58px;
  transform: translateX(-50%);
  border: 5px solid #ff5d00;
  border-radius: 8px;
}

/* Decorative ball that bobs on the backboard: "throw here!" */
.magic-hoop-ball {
  position: absolute;
  left: 50%;
  top: 6px;
  font-size: 30px;
  line-height: 1;
  transform: translateX(-50%);
  animation: hoopBallBob 1s ease-in-out infinite;
}

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

/* Thick glowing orange rim */
.magic-hoop-rim {
  position: absolute;
  top: 140px;
  left: 30px;
  width: 150px;
  height: 24px;
  z-index: 2;
  background: linear-gradient(180deg, #ff9a2e 0%, #ff5d00 100%);
  border: 4px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #ff5d00, 0 0 22px 6px rgba(255, 140, 0, 0.75), 0 10px 18px rgba(120, 50, 0, 0.3);
  animation: hoopRimGlow 1.6s ease-in-out infinite;
}

@keyframes hoopRimGlow {
  0%, 100% { box-shadow: 0 0 0 3px #ff5d00, 0 0 14px 3px rgba(255, 140, 0, 0.55), 0 10px 18px rgba(120, 50, 0, 0.3); }
  50% { box-shadow: 0 0 0 3px #ff5d00, 0 0 30px 10px rgba(255, 170, 0, 0.9), 0 10px 18px rgba(120, 50, 0, 0.3); }
}

/* Wiggling white mesh net */
.magic-hoop-net {
  position: absolute;
  top: 154px;
  left: 45px;
  width: 120px;
  height: 68px;
  z-index: 1;
  background-image: linear-gradient(45deg, transparent 46%, rgba(255, 255, 255, 0.95) 47%, rgba(255, 255, 255, 0.95) 53%, transparent 54%),
                    linear-gradient(-45deg, transparent 46%, rgba(255, 255, 255, 0.95) 47%, rgba(255, 255, 255, 0.95) 53%, transparent 54%);
  background-size: 16px 16px;
  clip-path: polygon(4% 0%, 96% 0%, 78% 100%, 22% 100%);
  -webkit-clip-path: polygon(4% 0%, 96% 0%, 78% 100%, 22% 100%);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.35));
  transform-origin: top center;
  transition: transform 0.15s ease-out;
}

/* Glowing scoreboard bubble */
.hoop-score-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: linear-gradient(135deg, #06d6a0 0%, #4cc9f0 100%);
  color: #ffffff;
  border: 3px solid #ffffff;
  padding: 3px 16px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(6, 214, 160, 0.45);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Scored shake/pulse keyframes */
@keyframes hoopScoreSpring {
  0% { transform: scale(var(--hoop-scale)); }
  35% { transform: scale(calc(var(--hoop-scale) * 1.22)) rotate(-3deg); }
  65% { transform: scale(calc(var(--hoop-scale) * 0.93)) rotate(2deg); }
  100% { transform: scale(var(--hoop-scale)) rotate(0deg); }
}

.magic-hoop.scored {
  animation: hoopScoreSpring 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.magic-hoop.scored .magic-hoop-glow {
  animation: none;
  transform: scale(1.4);
  opacity: 1;
}

/* ===================== Responsive: tablets & phones ===================== */

/* Phones */
@media (max-width: 600px) {
  .modal-overlay {
    padding: 12px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .modal-card {
    padding: 22px 16px;
    gap: 16px;
    border-radius: 26px;
    max-height: 100%;
  }

  .brand-badge {
    font-size: 12px;
    padding: 5px 14px;
  }

  .brand-title,
  h2.brand-title {
    font-size: 28px !important;
  }

  .brand-subtitle {
    font-size: 14px;
  }

  .btn-play {
    font-size: 19px;
    padding: 14px 20px;
    gap: 10px;
  }

  /* 2x2 grid for the four sound choices so nothing gets squeezed or cut off */
  #settings-sound-theme-pills .pill-btn {
    flex: 1 1 calc(50% - 8px);
    padding: 9px 8px;
  }

  .categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setting-row {
    padding: 12px 14px;
  }

  .modal-back {
    margin: -10px 0 -46px -4px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn-play,
  .modal-actions .btn-secondary {
    width: 100%;
  }

  /* Smaller floating parent bar */
  .parent-bar {
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
    gap: 6px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .hint-tooltip {
    display: none;
  }

  /* Idle hint */
  .idle-icon {
    font-size: 42px;
  }

  .idle-text {
    font-size: 15px;
    padding: 6px 16px;
    text-align: center;
    max-width: 85vw;
    white-space: normal;
  }

  /* Item word badges and corner radius follow the smaller icons */
  .smash-label {
    font-size: 12px;
    padding: 3px 10px;
    margin-top: 4px;
  }

  .ambient-orb {
    filter: blur(40px);
  }
}

/* Landscape phones (short height) */
@media (max-height: 500px) {
  .modal-card {
    padding: 18px 16px;
    gap: 14px;
    max-height: 100%;
  }

  .modal-overlay {
    padding: 10px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .idle-icon {
    font-size: 40px;
  }

  .idle-text {
    font-size: 15px;
  }

  .smash-label {
    font-size: 12px;
  }
}

/* Welcome links stack instead of wrapping around the separator */
@media (max-width: 520px) {
  .how-steps {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* The dotted line runs down through the bubbles */
  .how-steps::before {
    top: 30px;
    bottom: 30px;
    left: 29px;
    right: auto;
    border-top: none;
    border-left: 3px dotted #ffc2d1;
  }

  .how-step {
    display: grid;
    grid-template-columns: 60px 1fr;
    column-gap: 14px;
    align-items: center;
    text-align: left;
  }

  .how-step-bubble {
    grid-row: span 2;
    width: 60px;
    height: 60px;
    margin-bottom: 0;
    font-size: 26px;
  }

  .how-step strong {
    align-self: end;
  }

  .how-step-text {
    align-self: start;
    max-width: none;
  }

  .faq summary {
    padding: 13px 16px;
    font-size: 14px;
  }

  .faq details p {
    padding: 0 16px 14px;
    font-size: 13px;
  }

  .welcome-links {
    flex-direction: column;
    gap: 2px;
  }

  .welcome-links-sep {
    display: none;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .pill-btn {
    font-size: 12px;
  }

  .brand-title,
  h2.brand-title {
    font-size: 24px !important;
  }
}
