/* ================================================================
    Claymorphism Design System — Shona Kids Heritage Edition
    Zimbabwe Flag Palette: Green #006400 | Gold #FFD200 | Red #D40000
    ================================================================ */

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

/* ── Clay Surfaces ─────────────────────────────────────────────── */
.clay-card {
  background: #FFFFFF;
  border-radius: 2rem;
  box-shadow:
    12px 12px 24px rgba(0, 0, 0, 0.05),
    -12px -12px 24px rgba(255, 255, 255, 0.9),
    inset 4px 4px 8px rgba(255, 255, 255, 0.6),
    inset -4px -4px 8px rgba(0, 0, 0, 0.02);
  border: 2px solid rgba(255, 255, 255, 0.7);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.clay-card:hover { transform: translateY(-4px); }

.clay-card-green {
  background: #006400;
  color: white;
  border-radius: 2rem;
  box-shadow:
    12px 12px 24px rgba(0, 100, 0, 0.25),
    inset 4px 4px 8px rgba(255, 255, 255, 0.3),
    inset -4px -4px 8px rgba(0, 0, 0, 0.15);
}

.clay-card-gold {
  background: #FFD200;
  border-radius: 2rem;
  box-shadow:
    12px 12px 24px rgba(255, 210, 0, 0.3),
    inset 4px 4px 8px rgba(255, 255, 255, 0.6),
    inset -4px -4px 8px rgba(0, 0, 0, 0.05);
}

.clay-card-red {
  background: #D40000;
  color: white;
  border-radius: 2rem;
  box-shadow:
    12px 12px 24px rgba(212, 0, 0, 0.3),
    inset 4px 4px 8px rgba(255, 255, 255, 0.3),
    inset -4px -4px 8px rgba(0, 0, 0, 0.15);
}

.clay-inset {
  background: #FAF7F2;
  border-radius: 1.5rem;
  box-shadow:
    inset 6px 6px 12px rgba(0, 0, 0, 0.06),
    inset -6px -6px 12px rgba(255, 255, 255, 0.9);
}

/* ── Accent Borders ────────────────────────────────────────────── */
.clay-accent-top-green { border-top: 8px solid #006400 !important; }
.clay-accent-top-gold  { border-top: 8px solid #FFD200 !important; }
.clay-accent-top-red   { border-top: 8px solid #D40000 !important; }

.clay-accent-left-green { border-left: 12px solid #006400 !important; }
.clay-accent-left-gold  { border-left: 12px solid #FFD200 !important; }
.clay-accent-left-red   { border-left: 12px solid #D40000 !important; }

/* ── Puffy Buttons ─────────────────────────────────────────────── */
.puffy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 2rem;
  border-radius: 1.5rem;
  font-family: 'Fredoka', 'Quicksand', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 3.25rem;
  position: relative;
}

.puffy-btn:active { transform: translateY(4px) scale(0.96); }
.puffy-btn:focus-visible { outline: 3px solid #FFD200; outline-offset: 3px; }

.puffy-btn-green {
  background: #006400;
  color: white;
  box-shadow:
    0 8px 0 #004000,
    0 12px 20px rgba(0, 100, 0, 0.25),
    inset 0 3px 4px rgba(255, 255, 255, 0.2);
}
.puffy-btn-green:hover {
  background: #007400;
  transform: translateY(-2px);
  box-shadow: 0 10px 0 #004000, 0 14px 24px rgba(0, 100, 0, 0.3), inset 0 3px 4px rgba(255, 255, 255, 0.2);
  color: white;
}
.puffy-btn-green:active { box-shadow: 0 3px 0 #004000, 0 5px 10px rgba(0, 100, 0, 0.15); }

.puffy-btn-gold {
  background: #FFD200;
  color: #3a2e00;
  box-shadow:
    0 8px 0 #C8A800,
    0 12px 20px rgba(255, 210, 0, 0.3),
    inset 0 3px 4px rgba(255, 255, 255, 0.4);
}
.puffy-btn-gold:hover {
  background: #FFD900;
  transform: translateY(-2px);
  box-shadow: 0 10px 0 #C8A800, 0 14px 24px rgba(255, 210, 0, 0.35), inset 0 3px 4px rgba(255, 255, 255, 0.4);
  color: #3a2e00;
}
.puffy-btn-gold:active { box-shadow: 0 3px 0 #C8A800, 0 5px 10px rgba(255, 210, 0, 0.2); }

.puffy-btn-white {
  background: white;
  color: #006400;
  box-shadow:
    0 8px 0 #e0ddd8,
    0 12px 20px rgba(0, 0, 0, 0.06),
    inset 0 3px 4px rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(0, 0, 0, 0.04);
}
.puffy-btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 #e0ddd8, 0 14px 24px rgba(0, 0, 0, 0.08), inset 0 3px 4px rgba(255, 255, 255, 0.8);
  color: #006400;
}
.puffy-btn-white:active { box-shadow: 0 3px 0 #e0ddd8, 0 5px 10px rgba(0, 0, 0, 0.04); }

.puffy-btn-red {
  background: #D40000;
  color: white;
  box-shadow:
    0 8px 0 #9C0000,
    0 12px 20px rgba(212, 0, 0, 0.25),
    inset 0 3px 4px rgba(255, 255, 255, 0.2);
}
.puffy-btn-red:hover {
  background: #E00000;
  transform: translateY(-2px);
  box-shadow: 0 10px 0 #9C0000, 0 14px 24px rgba(212, 0, 0, 0.3), inset 0 3px 4px rgba(255, 255, 255, 0.2);
  color: white;
}
.puffy-btn-red:active { box-shadow: 0 3px 0 #9C0000; }

/* ── Bento Grid ────────────────────────────────────────────────── */
.clay-bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}

.clay-bento-hero {
  grid-column: span 8;
  grid-row: span 2;
  min-height: 380px;
}

.clay-bento-stat {
  grid-column: span 4;
  min-height: 175px;
}

/* ── Masonry Grid ──────────────────────────────────────────────── */
.clay-masonry {
  columns: 3;
  column-gap: clamp(1rem, 3vw, 1.5rem);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.clay-masonry-item {
  break-inside: avoid;
  margin-bottom: clamp(0.75rem, 3vw, 1.5rem);
  width: 100%;
  box-sizing: border-box;
}

/* ── Quick Action Grid ─────────────────────────────────────────── */
.clay-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(80px, 20vw, 200px), 1fr));
  gap: clamp(0.75rem, 3vw, 1.5rem);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.clay-quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.clay-quick-card:hover { color: inherit; }

.clay-quick-icon {
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.clay-quick-card:hover .clay-quick-icon { transform: scale(1.15) rotate(-10deg); }

/* ── Search Bar ────────────────────────────────────────────────── */
.clay-search-wrap {
  background: white;
  border-radius: 2rem;
  box-shadow:
    12px 12px 24px rgba(0, 0, 0, 0.05),
    -12px -12px 24px rgba(255, 255, 255, 0.9);
  border: 3px solid white;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
}

.clay-search-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Fredoka', 'Quicksand', sans-serif;
  font-size: 1.15rem;
  color: #212121;
  padding: 0.75rem 0;
}

.clay-search-wrap input::placeholder { color: #bdbdbd; }

/* ── Chat Bubbles ──────────────────────────────────────────────── */
.chat-bubble-a {
  background: #E8F5E9;
  border-radius: 1.75rem 1.75rem 1.75rem 0.5rem;
  padding: 1.25rem 1.5rem;
  box-shadow:
    inset 0 -5px 0 rgba(0, 100, 0, 0.1),
    inset 0 4px 6px rgba(255, 255, 255, 0.8);
}

.chat-bubble-b {
  background: #FFFFFF;
  border-radius: 1.75rem 1.75rem 0.5rem 1.75rem;
  padding: 1.25rem 1.5rem;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.03),
    inset 0 -5px 0 rgba(0, 0, 0, 0.05),
    inset 0 4px 6px rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.02);
}

.chat-row { display: flex; align-items: flex-end; gap: 1rem; }
.chat-row-reverse { flex-direction: row-reverse; }

.chat-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.875rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  border: 3px solid white;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15), 4px 4px 8px rgba(0, 0, 0, 0.08);
}

.chat-avatar-a { background: #006400; box-shadow: 0 4px 0 #004400, 4px 4px 8px rgba(0,0,0,0.08); }
.chat-avatar-b { background: #D40000; box-shadow: 0 4px 0 #9C0000, 4px 4px 8px rgba(0,0,0,0.08); }

/* ── Quiz Adventure Path ───────────────────────────────────────── */
.clay-quiz-track {
  height: 3.5rem;
  background: #e8e2d9;
  border-radius: 999px;
  position: relative;
  box-shadow: inset 6px 6px 12px rgba(0, 0, 0, 0.08);
  padding: 6px;
  margin-bottom: 1rem;
}

.clay-quiz-fill {
  height: 100%;
  background: linear-gradient(90deg, #D40000, #ff4d4d);
  border-radius: 999px;
  position: relative;
  box-shadow: 0 4px 10px rgba(212, 0, 0, 0.2);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.clay-quiz-rider {
  position: absolute;
  right: -1.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3.5rem;
  height: 3.5rem;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 8px 8px 16px rgba(0, 0, 0, 0.1), -4px -4px 12px #fff;
  z-index: 5;
  border: 4px solid #D40000;
  font-size: 1.5rem;
}

/* ── Quiz Choices ──────────────────────────────────────────────── */
.clay-choice {
  background: white;
  border-radius: 1.75rem;
  padding: 1.5rem 1.25rem;
  cursor: pointer;
  text-align: center;
  border: 4px solid #f0efeb;
  box-shadow: 8px 8px 16px #e0dcd5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: 100%;
  font-family: 'Fredoka', 'Quicksand', sans-serif;
  position: relative;
}

.clay-choice input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.clay-choice:hover { transform: translateY(-4px); box-shadow: 12px 12px 24px #e0dcd5; }
.clay-choice:focus-within { border-color: #006400; outline: none; }
.clay-choice:has(input:checked) {
  background: #FFD200;
  border-color: white;
  box-shadow: 0 0 0 4px rgba(255, 210, 0, 0.3), 10px 10px 20px rgba(255, 210, 0, 0.2);
}

.clay-choice-emoji { font-size: 3.5rem; line-height: 1; }
.clay-choice-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #006400;
}

.clay-choices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* ── Sticker Chips ─────────────────────────────────────────────── */
.clay-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: white;
  border-radius: 1.25rem;
  font-family: 'Fredoka', 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: #006400;
  cursor: pointer;
  box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.05);
  border: none;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.clay-chip:hover { transform: scale(1.05) rotate(1deg); color: #006400; }
.clay-chip.is-active {
  background: #FFD200;
  color: #006400;
  box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.08);
  transform: scale(0.97);
}

.clay-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

/* ── Section Kicker ────────────────────────────────────────────── */
.clay-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 100, 0, 0.08);
  color: #006400;
  padding: 0.4rem 1rem;
  border-radius: 1rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.clay-kicker-dot {
  width: 0.45rem;
  height: 0.45rem;
  background: #006400;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* ── Heritage Flag Bar ─────────────────────────────────────────── */
.heritage-bar {
  height: 4px;
  background: linear-gradient(90deg, #006400 33%, #FFD200 33% 66%, #D40000 66%);
  width: 100%;
}

/* ── Score Display ─────────────────────────────────────────────── */
.clay-score-big {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 700;
  line-height: 1;
  color: #006400;
}

/* ── Section Header ────────────────────────────────────────────── */
.clay-section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.clay-section-icon {
  width: 3.25rem;
  height: 3.25rem;
  background: white;
  border-radius: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

/* ── Answer Review Card ────────────────────────────────────────── */
.clay-answer-card {
  transition: transform 0.2s ease;
  overflow: hidden;
}
.clay-answer-card:hover { transform: translateX(4px); }

.clay-answer-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  border: 4px solid white;
  box-shadow: 4px 4px 8px rgba(0,0,0,0.1);
}

.clay-answer-correct { background: #006400; box-shadow: 0 4px 0 #004400, 4px 4px 8px rgba(0,0,0,0.08); }
.clay-answer-wrong   { background: #D40000; box-shadow: 0 4px 0 #9C0000, 4px 4px 8px rgba(0,0,0,0.08); }

/* ── Conversation Bubble (List Page) ───────────────────────────── */
.conv-bubble-left {
  background: white;
  border-radius: 4px 28px 28px 28px;
  box-shadow: 6px 6px 15px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0,0,0,0.02);
  padding: 1.25rem 1.5rem;
}

.conv-bubble-right {
  background: #f0fdf4;
  border-radius: 28px 4px 28px 28px;
  box-shadow: 6px 6px 15px rgba(0, 100, 0, 0.04);
  border: 1px solid rgba(0, 100, 0, 0.05);
  padding: 1.25rem 1.5rem;
  align-self: flex-end;
}

/* ── Word Explorer Card ────────────────────────────────────────── */
.clay-word-img-wrap {
  border-radius: 1.75rem;
  overflow: hidden;
  margin-bottom: 1.25rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: clamp(200px, 45vw, 300px);
  background: linear-gradient(135deg, rgba(0,100,0,0.04) 0%, rgba(255,210,0,0.04) 100%);
}

.clay-word-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.clay-word-card:hover .clay-word-img-wrap img { transform: scale(1.08); }

.clay-cat-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.05);
}

/* ── Floating Animation ────────────────────────────────────────── */
@keyframes clay-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-12px) rotate(2deg); }
}

.clay-float { animation: clay-float 5s ease-in-out infinite; }

/* ── Answer Modal ──────────────────────────────────────────────── */
.ask-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background 0.3s ease;
  padding: 1rem;
}

.ask-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: all;
  background: rgba(0, 0, 0, 0.4);
}

.ask-modal-content {
  position: relative;
  background: white;
  border-radius: 2rem;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.15),
    inset 4px 4px 8px rgba(255, 255, 255, 0.6),
    inset -4px -4px 8px rgba(0, 0, 0, 0.02);
  max-width: min(90vw, 600px);
  max-height: 85vh;
  overflow-y: auto;
  animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 2rem;
}

.ask-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  background: #f5f5f5;
  border: none;
  border-radius: 50%;
  font-size: 1.8rem;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  z-index: 10000;
}

.ask-modal-close:hover {
  background: #efefef;
  color: #333;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ask-modal-close:active {
  transform: scale(0.95);
}

.ask-modal-body {
  margin-top: 0.5rem;
}

@keyframes modalSlideUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .clay-masonry { columns: 2; }
  .clay-bento-hero { grid-column: span 7; }
  .clay-bento-stat { grid-column: span 5; }
}

@media (max-width: 768px) {
  .clay-bento {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  .clay-bento-hero { grid-column: span 2; min-height: auto; }
  .clay-bento-stat { grid-column: span 1; min-height: 120px; }
  .clay-quick-grid { grid-template-columns: repeat(2, 1fr); }
  .clay-masonry { columns: 1; }
  .clay-choices-grid { grid-template-columns: 1fr 1fr; }
  .clay-card { border-radius: 1.5rem; }
  .clay-quick-grid { gap: 0.875rem; }
}

@media (max-width: 480px) {
  .clay-bento { 
    grid-template-columns: 1fr; 
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  .clay-bento-stat { grid-column: span 1; min-height: 100px; }
  .puffy-btn { padding: 0.875rem 1.5rem; font-size: 1rem; }
  .clay-choices-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .clay-section-icon { width: 2.75rem; height: 2.75rem; font-size: 1.5rem; }
  .clay-card { padding: 1.25rem; }
  .clay-masonry { columns: 1; }
  .clay-quick-grid { grid-template-columns: repeat(2, 1fr); gap: clamp(0.5rem, 2vw, 1rem); }
  .ask-modal-content {
    max-width: 95vw;
    max-height: 90vh;
    padding: 1.5rem;
  }
}

/* ── Touch device squish ───────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .clay-card:hover { transform: none; }
  .clay-choice:hover { transform: none; box-shadow: 8px 8px 16px #e0dcd5; }
  .puffy-btn:hover { transform: none; }
  .clay-chip:hover { transform: none; }
  .clay-quick-card:hover .clay-quick-icon { transform: none; }
}
