/* ---------- My Friends page ---------- */
.hero-small { padding-bottom: 56px; }
.hero-small h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }

.panel {
  background: #fff; border-radius: var(--radius); padding: 22px 24px 26px;
  box-shadow: 0 10px 30px #2d2a4a14;
}
.actions { display: flex; justify-content: center; margin-top: 22px; }
.big-btn {
  border: 0; font: inherit; font-weight: 800; font-size: 1.3rem; cursor: pointer; text-decoration: none;
  background: var(--yellow); color: var(--ink); padding: 12px 34px; border-radius: 999px;
  box-shadow: 0 6px 0 #d9a400; transition: transform .15s;
}
.big-btn:hover { transform: translateY(-3px); }
.big-btn:disabled { opacity: .45; cursor: default; transform: none; }
.big-btn.secondary { background: var(--purple); color: #fff; box-shadow: 0 6px 0 #5a3fd6; }

/* Builder */
.builder { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 26px; align-items: start; }
.preview { position: sticky; top: 16px; text-align: center; }
.avatar-big { background: radial-gradient(circle at 50% 40%, #fff6d9, #dff0fb); border-radius: var(--radius); padding: 14px; }
.avatar-big svg { width: 100%; height: auto; display: block; }
.name-input {
  margin-top: 14px; width: 100%; font: inherit; font-size: 1.4rem; font-weight: 800; text-align: center;
  border: 4px solid #f1edff; border-radius: 999px; padding: 8px 16px; outline: none; color: var(--ink);
}
.name-input:focus { border-color: var(--purple); }

.options { display: grid; gap: 14px; }
.opt-row h3 { margin: 0 0 6px; color: var(--purple); font-size: 1.05rem; }
.opt-items { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  position: relative; border: 3px solid transparent; cursor: pointer; padding: 0; background: #f6f4ff;
  transition: transform .15s, border-color .15s;
}
.opt:hover { transform: scale(1.08); }
.opt.active { border-color: var(--purple); box-shadow: 0 0 0 3px #7b5cff44; }
.swatches .opt { width: 38px; height: 38px; border-radius: 50%; }
.tiles .opt { width: 68px; height: 80px; border-radius: 16px; overflow: hidden; }
.tiles .opt svg { width: 100%; height: 100%; }
.opt .none { font-size: 1.8rem; color: var(--muted); }
.opt.locked { cursor: not-allowed; }
.opt.locked svg { filter: grayscale(1); opacity: .45; }
.opt .lock {
  position: absolute; inset: auto 0 4px; font-size: .75rem; font-weight: 800; color: var(--ink);
  background: #fffd; border-radius: 999px; margin: 0 6px;
}

/* Home */
.home-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.home-top h2 { margin: 0; font-size: clamp(1.6rem, 3.5vw, 2.3rem); color: var(--purple); }
.home-tools { display: flex; gap: 10px; align-items: center; }
.stars { background: #fff6d9; border-radius: 999px; padding: 4px 16px; font-weight: 800; font-size: 1.3rem; }
.hint { color: var(--muted); font-weight: 700; margin: 6px 0 0; }

.stage {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; row-gap: 76px; align-items: end; margin-top: 54px;
  background: linear-gradient(180deg, transparent 85%, #d8f3c8 85%); border-radius: var(--radius); padding: 0 12px 16px;
}
.friend { margin: 0; text-align: center; position: relative; }
.friend img, .friend .avatar-mid { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: var(--radius); display: block; }
.friend .avatar-mid { background: radial-gradient(circle at 50% 40%, #fff6d9, #dff0fb); }
.friend .avatar-mid svg { width: 100%; height: 100%; }
.friend figcaption { font-size: 1.2rem; margin-top: 6px; }
.friend.host { cursor: pointer; transition: transform .2s; }
.friend.host:hover { transform: translateY(-8px) rotate(-1deg); }
.friend.host img { border-bottom: 6px solid var(--accent); }
.friend.me .avatar-mid { outline: 4px dashed var(--yellow); outline-offset: 4px; }

.bubble {
  position: absolute; top: -46px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 4px 14px;
  font-weight: 800; font-size: 1rem; z-index: 1; animation: pop .5s ease both;
}
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%) rotate(45deg);
  width: 14px; height: 14px; background: #fff; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
}
.bubble.big { position: static; transform: none; white-space: normal; font-size: 1.6rem; flex: 1; text-align: left; animation: none; }
.bubble.big::after { left: -9px; bottom: auto; top: 50%; transform: translateY(-50%) rotate(135deg); }
@keyframes pop { from { transform: translateX(-50%) scale(.3); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

/* Word game */
.quiz-box { background: #fff; border-radius: var(--radius); padding: 22px; position: relative; }
.quiz-head { display: flex; align-items: center; gap: 18px; padding-right: 44px; }
.quiz-head img { width: 110px; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: 18px; }
.speak { border: 0; background: #f1edff; font-size: 1.8rem; border-radius: 50%; width: 56px; height: 56px; cursor: pointer; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.choice {
  border: 0; background: #f6f4ff; border-radius: var(--radius); font-size: clamp(3rem, 10vw, 5rem);
  padding: 18px 0; cursor: pointer; transition: transform .15s, background .2s;
}
.choice:hover { transform: scale(1.06); }
.choice.right { background: #c9f5df; animation: bounce .6s; }
.choice.wrong { background: #ffd6de; animation: shake .4s; }
.quiz-result { text-align: center; font-size: 1.5rem; font-weight: 800; min-height: 2em; margin: 14px 0 0; }
@keyframes shake { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
@keyframes bounce { 40% { transform: scale(1.18); } 70% { transform: scale(.95); } }

/* Repeat after me */
.repeat { text-align: center; margin-top: 10px; }
.repeat .say-word {
  font-size: clamp(2.6rem, 9vw, 4.2rem); font-weight: 800; color: var(--purple); line-height: 1.1;
  animation: pulse 1.2s ease-in-out infinite;
}
.repeat-btns { display: flex; justify-content: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
@keyframes pulse { 50% { transform: scale(1.08); } }

@media (max-width: 760px) {
  .builder { grid-template-columns: 1fr; }
  .preview { position: static; max-width: 280px; margin: 0 auto; }
  .stage { grid-template-columns: repeat(2, 1fr); row-gap: 70px; }
  .quiz-head img { width: 80px; }
  .bubble.big { font-size: 1.25rem; }
}
