/* Attune: calm by default. Soft cream canvas, muted teal and apricot,
   generous spacing, big rounded targets, no motion beyond gentle fades. */
:root {
  --bg: #faf6ef;
  --ink: #33413e;
  --muted: #7d8a86;
  --teal: #2f8f83;
  --teal-soft: #d9ece9;
  --apricot: #f2b28c;
  --card: #ffffff;
  --line: #e8e1d5;
  --danger: #b3552f;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--teal); }
h1, h2, h3, h4 { line-height: 1.2; }

.topnav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--card);
}
.brand { font-size: 1.5rem; font-weight: 700; letter-spacing: 0.02em; color: var(--ink); text-decoration: none; }
.brand span { color: var(--teal); }
.navlinks { display: flex; gap: 18px; align-items: center; }
.navlinks a { text-decoration: none; font-weight: 600; }

.wrap { max-width: 1050px; margin: 0 auto; padding: 28px 20px; width: 100%; }

.btn {
  display: inline-block; background: var(--teal); color: #fff; border: none;
  padding: 12px 22px; border-radius: 999px; font-size: 1rem; font-weight: 600;
  cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { filter: brightness(1.06); }
.btn.small { padding: 8px 16px; }
.btn.ghost { background: transparent; color: var(--teal); border: 2px solid var(--teal); }
.danger-btn { background: var(--danger); }
.wide-btn { display: block; margin: 12px 0 6px; }
.tinybtn { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; cursor: pointer; color: var(--muted); font-size: 0.8rem; }
.tinybtn:hover { color: var(--danger); border-color: var(--danger); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--danger); font-weight: 600; }

/* landing */
.hero { text-align: center; padding: 48px 0 28px; }
.hero h1 { font-size: 2.6rem; margin-bottom: 8px; }
.hero em { color: var(--teal); font-style: normal; }
.lede { max-width: 640px; margin: 0 auto 24px; color: var(--muted); font-size: 1.1rem; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.threecol { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 30px 0; }
.bigmoji { font-size: 2.4rem; margin-bottom: 6px; }
.promise { margin-bottom: 24px; background: var(--teal-soft); border-color: var(--teal-soft); }

/* auth + forms */
.authcard { max-width: 460px; margin: 40px auto; }
.authcard.wide { max-width: 620px; }
label { display: block; margin: 14px 0 4px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 1rem; font-family: inherit; background: #fffdf9; color: var(--ink);
}
textarea { resize: vertical; }
form .btn { margin-top: 18px; }

/* guide layout */
.guide-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
@media (max-width: 800px) { .guide-layout { grid-template-columns: 1fr; } }
.side .card { margin-bottom: 16px; }
.ghostlink { display: block; margin-top: 8px; font-size: 0.9rem; }
.ghostlink.danger { color: var(--danger); }
.kidswitch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; text-decoration: none; color: var(--ink); font-size: 0.85rem; }
.chip.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.actrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 0.92rem; }
.actrow:last-child { border-bottom: none; }

.chatcol { display: flex; flex-direction: column; min-height: 65vh; }
.chat { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.msg { max-width: 85%; padding: 12px 16px; border-radius: 16px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--teal); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--teal-soft); border-bottom-left-radius: 4px; }
.msg.pending { opacity: 0.6; }
.chatform { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 14px; }
.chatform textarea { flex: 1; }
.chatform .btn { margin-top: 0; }

/* history */
.sessions { width: 100%; border-collapse: collapse; margin: 14px 0 24px; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.sessions th, .sessions td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.sessions th { background: var(--teal-soft); font-size: 0.85rem; }
.feedbackcard { max-width: 560px; }

.foot { padding: 20px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.82rem; display: flex; flex-direction: column; gap: 4px; }

/* auth extras */
.google-btn { display: block; background: #fff; color: var(--ink); border: 2px solid var(--line); margin-bottom: 4px; }
.google-btn:hover { border-color: var(--teal); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85rem; margin: 14px 0 4px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.pwwrap { position: relative; display: block; }
.pwwrap input { padding-right: 46px; }
.pwtoggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 1.1rem; cursor: pointer; padding: 4px 8px; }
.pwrules { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.pwrules li::before { content: "○ "; }
.pwrules li.ok { color: var(--teal); }
.pwrules li.ok::before { content: "● "; }
.hidden { display: none; }
.codebox { font-size: 1.6rem; letter-spacing: 0.5em; text-align: center; }

/* landing showcase */
.trysection { margin: 10px 0 26px; text-align: center; }
.trycard { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.trycard:hover { border-color: var(--teal); }
.trycard .btn { margin-top: auto; }

/* uploads and memory */
.uploadform { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.uploadform input[type=file] { font-size: 0.8rem; width: 100%; }
.memlist { margin: 0; padding-left: 18px; }
.memlist li { margin-bottom: 4px; }

/* dictation */
.dictwrap { position: relative; flex: 1; display: flex; flex-direction: column; }
.chatform .dictwrap textarea { width: 100%; }
.micbtn { position: absolute; right: 8px; top: 8px; background: none; border: 1px solid var(--line); border-radius: 999px; font-size: 1rem; cursor: pointer; padding: 4px 9px; }
.micbtn.listening { border-color: var(--danger); background: #fbe9e2; }
@media (prefers-reduced-motion: no-preference) {
  .micbtn.listening { animation: micpulse 1.4s ease infinite; }
  @keyframes micpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(179, 85, 47, 0.35); } 50% { box-shadow: 0 0 0 8px rgba(179, 85, 47, 0); } }
}
.dictpreview { margin-top: 6px; color: var(--muted); font-style: italic; font-size: 0.95rem; min-height: 1.3em; }

/* ---------------- playground ---------------- */
body.playground { background: #f3efe6; }
.playnav { padding: 12px 16px; }
.exit { font-size: 1.3rem; text-decoration: none; color: var(--muted); padding: 8px 14px; border-radius: 999px; }
.playwrap { max-width: 900px; margin: 0 auto; padding: 8px 20px 40px; width: 100%; }
.playhello { text-align: center; font-size: 2.2rem; }
.playempty { text-align: center; color: var(--muted); font-size: 1.2rem; }
.playgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
.playcard {
  background: var(--card); border: 3px solid var(--line); border-radius: 26px;
  padding: 34px 20px; text-align: center; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.playcard:active { border-color: var(--teal); }
.playmoji { font-size: 3.4rem; }
.playtitle { font-size: 1.25rem; font-weight: 700; }

.stage { display: flex; flex-direction: column; align-items: center; gap: 26px; padding-top: 10px; }
.stage h2 { font-size: 1.9rem; text-align: center; margin: 0; }
.prompt-emoji { font-size: 3rem; }
.bigrow { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; }
.bigbtn {
  min-width: 150px; min-height: 150px; font-size: 1.15rem; font-weight: 700;
  background: var(--card); color: var(--ink); border: 4px solid var(--line); border-radius: 26px;
  cursor: pointer; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center;
  padding: 16px; font-family: inherit; transition: border-color 0.2s ease, opacity 0.3s ease;
}
.bigbtn .em { font-size: 3rem; }
.bigbtn.selected { border-color: var(--apricot); }
.bigbtn.matched { border-color: var(--teal); background: var(--teal-soft); opacity: 0.65; cursor: default; }
.storypage { text-align: center; display: flex; flex-direction: column; gap: 18px; align-items: center; max-width: 560px; }
.storypage .em { font-size: 5rem; }
.storypage p { font-size: 1.6rem; margin: 0; }
.dots { display: flex; gap: 8px; }
.dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.dots span.on { background: var(--teal); }
.celebrate { text-align: center; font-size: 1.8rem; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.celebrate .em { font-size: 5rem; }
.cheer {
  position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%);
  background: var(--card); border: 3px solid var(--teal); border-radius: 999px;
  padding: 16px 34px; font-size: 1.7rem; font-weight: 800; color: var(--ink);
  box-shadow: 0 8px 30px rgba(47, 143, 131, 0.25); z-index: 50; pointer-events: none;
  opacity: 1; transition: opacity 0.45s ease, top 0.45s ease;
}
.cheer.gone { opacity: 0; top: 33%; }
@media (prefers-reduced-motion: no-preference) {
  .fadein { animation: fade 0.5s ease; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  .cheer { animation: pop 0.3s ease; }
  @keyframes pop { from { transform: translate(-50%, -50%) scale(0.8); } to { transform: translate(-50%, -50%) scale(1); } }
}
