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

body {
  font-family: "Comic Sans MS", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(160deg, #fff4d6 0%, #ffe0ec 50%, #d6f0ff 100%);
  min-height: 100vh;
  color: #34324a;
  text-align: center;
}

.topbar { padding: 1.5rem 1rem 0.5rem; }
.topbar h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); color: #ff6b9d; text-shadow: 2px 2px 0 #fff; }
.tagline { color: #7a6f9b; font-size: 1.05rem; margin-top: .25rem; }

/* Kategorier */
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  padding: 1rem;
}
.cat-btn {
  border: none;
  background: #fff;
  border-radius: 999px;
  padding: .6rem 1.2rem;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 0 #e3d4f5;
  transition: transform .1s;
}
.cat-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #e3d4f5; }
.cat-btn.active { background: #b388ff; color: #fff; box-shadow: 0 4px 0 #8a5cf0; }

main { max-width: 560px; margin: 0 auto; padding: 0 1rem 2rem; }

/* Lägesknappar */
.modes { display: flex; gap: .6rem; justify-content: center; margin: .5rem 0 1.5rem; }
.mode-btn {
  border: none; font-family: inherit; cursor: pointer;
  background: #fff; border-radius: 14px; padding: .7rem 1.4rem; font-size: 1.1rem;
  box-shadow: 0 4px 0 #ffd1e3;
}
.mode-btn.active { background: #ff8fb3; color: #fff; box-shadow: 0 4px 0 #ff5c8d; }

.panel { animation: pop .25s ease; }
.hidden { display: none !important; }
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Flashcard */
.card {
  background: #fff;
  border-radius: 28px;
  padding: 2rem 1.5rem;
  box-shadow: 0 12px 30px rgba(160,120,220,.25);
}
.emoji { font-size: clamp(5rem, 22vw, 8rem); line-height: 1; }
.word-en { font-size: 2.2rem; font-weight: bold; color: #5b3ea8; margin-top: .5rem; }
.word-sv { font-size: 1.2rem; color: #9a8fb5; margin-top: .2rem; }
.speak {
  margin-top: 1.2rem; border: none; font-family: inherit; cursor: pointer;
  background: #5cc6a8; color: #fff; font-size: 1.1rem;
  padding: .6rem 1.4rem; border-radius: 999px; box-shadow: 0 4px 0 #3aa888;
}
.speak:active { transform: translateY(2px); box-shadow: 0 2px 0 #3aa888; }

.card-nav { display: flex; align-items: center; justify-content: center; gap: 1.2rem; margin-top: 1.2rem; }
.round {
  border: none; cursor: pointer; font-size: 1.4rem; width: 60px; height: 60px;
  border-radius: 50%; background: #fff; box-shadow: 0 4px 0 #d8c4f5;
}
.round:active { transform: translateY(2px); box-shadow: 0 2px 0 #d8c4f5; }
.counter { font-size: 1.1rem; color: #7a6f9b; min-width: 60px; }

/* Quiz */
.score { font-size: 1.3rem; margin-bottom: 1rem; color: #ff7a59; font-weight: bold; }
.quiz-card { background: #fff; border-radius: 24px; padding: 1.5rem; box-shadow: 0 10px 26px rgba(160,120,220,.2); }
.quiz-prompt { font-size: 1.3rem; margin-top: .5rem; color: #5b3ea8; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1.2rem; }
.opt {
  border: none; font-family: inherit; cursor: pointer; font-size: 1.2rem;
  padding: 1rem; border-radius: 16px; background: #fff; box-shadow: 0 4px 0 #cfe3ff;
}
.opt:active { transform: translateY(2px); box-shadow: 0 2px 0 #cfe3ff; }
.opt.correct { background: #5cc6a8; color: #fff; box-shadow: 0 4px 0 #3aa888; }
.opt.wrong { background: #ff8a8a; color: #fff; box-shadow: 0 4px 0 #e05656; }
.opt:disabled { cursor: default; }
.feedback { font-size: 1.6rem; min-height: 2rem; margin-top: 1rem; font-weight: bold; }
.next-quiz {
  border: none; font-family: inherit; cursor: pointer; font-size: 1.15rem;
  background: #b388ff; color: #fff; padding: .7rem 1.6rem; border-radius: 999px;
  box-shadow: 0 4px 0 #8a5cf0; margin-top: .5rem;
}
.next-quiz:active { transform: translateY(2px); box-shadow: 0 2px 0 #8a5cf0; }

.footer { padding: 1.5rem; color: #9a8fb5; font-size: .9rem; }
