:root {
  --bg: #fff7fb;
  --bg-soft: #fff0f7;
  --card: rgba(255, 255, 255, 0.86);
  --card-strong: rgba(255, 255, 255, 0.96);
  --text: #5a4665;
  --muted: #9d84aa;
  --primary: #ff9ecf;
  --primary-strong: #ff86bf;
  --accent: #98e7d0;
  --ok: #56c596;
  --bad: #ff8f9f;
  --border: rgba(255, 182, 213, 0.45);
  --shadow: 0 18px 40px rgba(255, 173, 213, 0.22);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: 'Trebuchet MS', 'Comic Sans MS', 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 190, 220, 0.45), transparent 30%),
    radial-gradient(circle at bottom right, rgba(152, 231, 208, 0.35), transparent 28%),
    linear-gradient(180deg, #fff9fc 0%, #fff2f8 100%);
}
.aurora {
  position: fixed; inset: auto; width: 36rem; height: 36rem; border-radius: 50%;
  filter: blur(60px); opacity: 0.28; pointer-events: none; z-index: 0;
}
.aurora-a { top: -10rem; right: -10rem; background: #ffb7da; }
.aurora-b { bottom: -12rem; left: -10rem; background: #b9f1de; }
.app-shell {
  position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; min-height: 100vh;
  padding: 28px 20px 40px; display: flex; align-items: center; justify-content: center;
}
.screen { display: none; width: 100%; }
.screen.active { display: block; }
.panel, .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.glass { backdrop-filter: blur(20px); }
.inset { background: rgba(255,255,255,0.04); box-shadow: none; }
.hero { padding: 28px; }
.compact-hero { min-height: min(92vh, 760px); display: flex; flex-direction: column; justify-content: center; }
.eyebrow, .chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: #fff3fa; color: #c26f9d; font-size: 0.85rem;
  letter-spacing: 0.03em; border: 1px solid rgba(255, 170, 206, 0.45);
}
.hero h1 { margin: 14px 0 12px; font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.02; }
.hero p, .phonetic, .phonetic-sub, .status, .history-list, .capabilities { color: var(--muted); }
.hero p { max-width: 60ch; font-size: 1.04rem; }
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 24px 0;
}
.stats > div, .home-grid article {
  padding: 16px; border-radius: 22px; background: rgba(255,255,255,0.78); border: 1px solid rgba(255, 182, 213, 0.38);
}
.cute-card {
  position: relative;
}
.cute-card::after {
  content: '✦'; position: absolute; top: 12px; right: 16px; color: #ff9ecf; font-size: 1rem;
}
.version-badge {
  margin-top: 16px; display: inline-flex; padding: 10px 14px; border-radius: 999px;
  background: #fffafb; border: 1px solid rgba(255, 182, 213, 0.45); color: #b26d94; font-size: 0.9rem;
}
.stats strong { display: block; font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 6px; }
.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.home-grid .panel { padding: 20px; }
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.first-screen-actions { margin-top: 18px; margin-bottom: 18px; }
button {
  border: 1px solid rgba(255, 182, 213, 0.45); border-radius: 18px; padding: 14px 18px; font-size: 1rem;
  background: #fffafb; color: var(--text); cursor: pointer; transition: 180ms ease;
  box-shadow: 0 8px 18px rgba(255, 173, 213, 0.15);
}
button:hover { transform: translateY(-1px); border-color: rgba(255, 150, 198, 0.55); }
button.primary, .big-btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: white; }
.browse-btn {
  background: linear-gradient(135deg, #ffd86f, #ffb347);
  color: #7a4d00;
  border-color: rgba(255, 179, 71, 0.55);
}
.big-btn { font-size: clamp(1.2rem, 3vw, 1.7rem); padding: 24px 18px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.topbar h2 { margin: 0; }
.card { padding: 24px; }
.card-browser, .card-test { min-height: 74vh; }
.card-browser {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
}
.test-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px;
}
.stack-actions { display: grid; gap: 10px; }
.word { font-size: clamp(2.6rem, 8vw, 5.4rem); font-weight: 800; line-height: 1; margin: 14px 0 10px; word-break: break-word; }
.phonetic { font-size: 1.2rem; }
.phonetic-sub { font-size: 0.94rem; }
.actions-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.wrap-left { justify-content: flex-start; }
.answer-panel, .history-panel { padding: 18px; border-radius: 24px; }
.answer-panel { background: rgba(255,255,255,0.72); border: 1px solid rgba(255, 182, 213, 0.35); }
.meaning, .hint-box, .speech-preview {
  font-size: clamp(1.05rem, 3.2vw, 1.45rem); line-height: 1.7; max-width: 34ch;
}
.hint-box, .speech-preview {
  width: 100%; padding: 14px 16px; border-radius: 18px; background: #fffafb;
  border: 1px solid rgba(255, 182, 213, 0.35); margin-bottom: 12px;
}
.hold-btn {
  width: 100%; min-height: 68px; font-size: 1.12rem; font-weight: 700;
}
.hold-btn.recording,
.hold-btn:active {
  transform: scale(0.99);
  background: linear-gradient(135deg, #db5d97, #c94884);
  color: white;
}
.hidden { display: none; }
.result {
  min-height: 120px; margin: 18px 0; padding: 18px; border-radius: 24px;
  background: rgba(255,255,255,0.76); line-height: 1.75;
}
.result.ok { border: 1px solid rgba(74, 222, 128, 0.35); color: var(--ok); }
.result.bad { border: 1px solid rgba(248, 113, 113, 0.35); color: var(--bad); }
.history-list { display: grid; gap: 10px; }
.history-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start;
  padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,0.72);
}
.history-item b { color: var(--text); }
.capabilities { margin-top: 10px; font-size: 0.92rem; }
@media (max-width: 900px) {
  .stats, .home-grid { grid-template-columns: repeat(2, 1fr); }
  .test-head { flex-direction: column; }
  .stack-actions { width: 100%; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .app-shell { padding: 10px 10px 20px; align-items: flex-start; }
  .stats, .big-actions, .home-grid, .stack-actions { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .card, .hero { padding: 16px; border-radius: 22px; }
  .compact-hero { min-height: calc(100vh - 20px); justify-content: flex-start; }
  .hero h1 { font-size: clamp(2rem, 10vw, 2.8rem); margin: 10px 0 8px; }
  .hero p { font-size: 0.95rem; margin: 0; }
  .stats { margin: 14px 0; gap: 10px; }
  .home-grid { margin-top: 12px; gap: 10px; }
  button { width: 100%; }
  .actions-row { flex-direction: column; }
  .history-item { grid-template-columns: 1fr; }
}
