:root {
  --ink: #3d3838;
  --muted: #756b67;
  --paper: #fffaf5;
  --paper-strong: #ffffff;
  --peach: #ffd9c7;
  --peach-strong: #f5ad8c;
  --lavender: #e4ddff;
  --butter: #fff1b8;
  --mint: #d8efe1;
  --line: rgba(67, 56, 52, 0.12);
  --shadow: 0 16px 45px rgba(82, 61, 52, 0.13);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Avenir Next", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 15%, rgba(255, 223, 184, .56), transparent 24%),
    radial-gradient(circle at 84% 12%, rgba(220, 211, 255, .72), transparent 26%),
    radial-gradient(circle at 58% 90%, rgba(207, 240, 222, .55), transparent 25%),
    #f8f1e9;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(10px);
  opacity: .35;
  z-index: -1;
}
body::before { background: var(--peach); left: -80px; bottom: 8%; }
body::after { background: var(--lavender); right: -90px; top: 35%; }

button { font: inherit; }
button:focus-visible { outline: 3px solid rgba(110, 87, 199, .5); outline-offset: 3px; }

.app-shell { min-height: 100svh; padding: 28px 20px; display: grid; place-items: center; }
.screen { width: min(720px, 100%); }

.icon-button,
.coffee-button {
  position: fixed;
  top: 24px;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(80,58,46,.1);
  color: var(--ink);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
  z-index: 5;
}
.icon-button:hover, .coffee-button:hover { transform: translateY(-2px) rotate(-2deg); background: white; }
.settings-trigger { right: 26px; font-size: 19px; }
.coffee-button { left: 26px; top: auto; bottom: 24px; font-size: 20px; }

.cover-page,
.question-page,
.complete-page {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 249, .77);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.cover-page { text-align: center; padding: clamp(48px, 9vw, 82px) clamp(24px, 7vw, 70px) 54px; }
.cover-page::before, .complete-page::before {
  content: "";
  position: absolute;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255, 225, 182, .35);
  top: -110px; right: -75px;
}
.cover-page::after, .complete-page::after {
  content: "";
  position: absolute;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(222, 214, 255, .4);
  bottom: -115px; left: -75px;
}

.fade-in { animation: fadeIn .42s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }

.eyebrow { margin: 0 0 10px; color: #896d64; font-size: 11px; letter-spacing: .14em; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { position: relative; z-index: 1; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 8vw, 66px); line-height: .99; letter-spacing: -.055em; margin-bottom: 22px; }
h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 6.2vw, 52px); line-height: 1.04; letter-spacing: -.045em; margin: 0; }
.cover-copy { position: relative; z-index: 1; color: var(--muted); line-height: 1.65; font-size: 16px; }

.cover-sparkles { position: absolute; inset: 30px; color: #bd8e79; pointer-events: none; font-size: 18px; }
.cover-sparkles span { position: absolute; animation: float 4.5s ease-in-out infinite; }
.cover-sparkles span:nth-child(1) { left: 8%; top: 13%; font-size: 18px; }
.cover-sparkles span:nth-child(2) { right: 8%; top: 20%; animation-delay: .8s; }
.cover-sparkles span:nth-child(3) { left: 14%; bottom: 23%; animation-delay: 1.2s; }
.cover-sparkles span:nth-child(4) { right: 15%; bottom: 15%; animation-delay: 2.1s; }
.cover-sparkles span:nth-child(5) { left: 50%; top: 8%; animation-delay: 1.7s; }
@keyframes float { 50% { transform: translateY(-7px) rotate(8deg); } }

.mascot { width: 116px; height: 104px; margin: 0 auto 22px; position: relative; z-index: 1; }
.mascot-face { position: absolute; width: 88px; height: 78px; border-radius: 45% 45% 42% 42%; background: #f7c7a6; border: 3px solid #4d403c; left: 14px; top: 18px; box-shadow: inset 0 -8px 0 rgba(255,255,255,.32); }
.mascot-ear { position: absolute; width: 32px; height: 39px; background: #f7c7a6; border: 3px solid #4d403c; border-radius: 60% 60% 45% 45%; top: 2px; }
.ear-left { left: 17px; transform: rotate(-15deg); }
.ear-right { right: 15px; transform: rotate(15deg); }
.eye { position: relative; left: 24px; top: 20px; font-size: 25px; margin-right: 13px; }
.mouth { position: absolute; left: 38px; top: 39px; font-size: 24px; }
.clipboard { position: absolute; right: -4px; bottom: -1px; width: 38px; height: 45px; display: grid; place-items: center; background: var(--butter); border: 2px solid #4d403c; border-radius: 8px; transform: rotate(11deg); font-weight: 900; }

.author-note { position: relative; z-index: 1; max-width: 470px; margin: 26px auto; padding: 13px 18px; color: #5b4c47; background: rgba(255,255,255,.62); border: 1px dashed rgba(108,81,71,.22); border-radius: 14px; line-height: 1.45; font-family: Georgia, serif; font-style: italic; }
.author-note span { display: block; margin-top: 6px; font-size: 12px; color: #907872; }

.primary-button,
.option-card,
.quiet-button,
.coffee-card-button,
.share-button {
  border: 0;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.primary-button { position: relative; z-index: 1; color: #3b3130; background: var(--peach); border: 1px solid rgba(89,55,42,.16); padding: 16px 22px; border-radius: 999px; font-size: 16px; font-weight: 800; box-shadow: 0 8px 0 rgba(177, 110, 78, .23); }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 10px 0 rgba(177,110,78,.23); }
.primary-button:active { transform: translateY(3px); box-shadow: 0 4px 0 rgba(177,110,78,.23); }
.primary-button span { display: inline-block; margin-left: 8px; transition: transform .18s ease; }
.primary-button:hover span { transform: translateX(3px); }
.subtle-line { color: #8f817c; font-size: 13px; margin: 20px 0 0; }

.question-page { min-height: min(720px, calc(100svh - 56px)); padding: clamp(28px, 5vw, 52px); display: flex; flex-direction: column; }
.question-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.question-count { margin: 0; font-size: 14px; color: var(--muted); font-weight: 700; }
.quiet-button { color: #836b64; background: transparent; padding: 7px 0; font-weight: 800; white-space: nowrap; }
.quiet-button:hover { transform: translateX(2px); color: var(--ink); }

.question-stage { flex: 1; display: grid; align-content: center; padding: 28px 0 20px; }
.question-stage h2 { max-width: 600px; margin: 0 auto 13px; text-align: center; }
.question-intro { text-align: center; color: var(--muted); margin-bottom: 28px; }
.record-stamp { justify-self: center; transform: rotate(-7deg); color: #a47b70; border: 1px solid rgba(164,123,112,.45); border-radius: 7px; padding: 4px 7px; font-size: 9px; font-weight: 900; letter-spacing: .13em; margin-bottom: 16px; opacity: .76; }
.option-stack { display: grid; gap: 14px; width: min(560px, 100%); margin: 0 auto; }
.option-card { display: grid; grid-template-columns: 47px 1fr auto; gap: 14px; align-items: center; text-align: left; padding: 18px 19px; border-radius: var(--radius-md); background: rgba(255,255,255,.86); border: 1px solid rgba(68, 51, 46, .11); box-shadow: 0 6px 0 rgba(78,58,49,.06); color: var(--ink); }
.option-card:hover { transform: translateY(-3px) rotate(-.25deg); background: white; box-shadow: 0 10px 0 rgba(78,58,49,.065); }
.option-card.selected { border-color: rgba(202,125,97,.58); background: #fff3ed; }
.option-card.dimmed { opacity: .64; }
.option-letter { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: var(--lavender); font-size: 14px; font-weight: 900; }
.option-card:nth-child(2) .option-letter { background: var(--mint); }
.option-copy { font-weight: 800; line-height: 1.35; }
.option-arrow { color: #aa887b; font-size: 22px; }

.result-panel { width: min(560px, 100%); margin: 25px auto 0; padding: 25px; border: 1px solid rgba(63,47,42,.10); border-radius: 23px; background: rgba(255,255,255,.76); animation: resultAppear .38s ease both; }
@keyframes resultAppear { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.result-kicker { color: #a27c70; font-size: 10px; letter-spacing: .14em; font-weight: 900; margin-bottom: 7px; }
.result-panel h3 { font-family: Georgia, serif; font-size: 25px; letter-spacing: -.025em; margin-bottom: 22px; }
.chosen-note { margin: 0 0 18px; padding: 13px 15px; border-radius: 16px; background: #fff3ed; color: #604d46; font-weight: 800; line-height: 1.45; }
.bar-group { display: grid; gap: 8px; }
.bar-row { display: flex; justify-content: space-between; gap: 14px; color: #5a4c47; font-size: 13px; }
.bar-row strong { color: var(--ink); }
.bar-track { overflow: hidden; width: 100%; height: 10px; border-radius: 999px; background: #eee5df; }
.bar-fill { width: 0; height: 100%; border-radius: inherit; transition: width .75s cubic-bezier(.34,1.56,.64,1); }
.bar-a { background: #e9b6a1; }
.bar-b { background: #aed4bd; }
.result-comment { margin: 21px 0 18px; color: #6d5b55; line-height: 1.55; }
.next-button { width: 100%; }
.progress-wrap { margin-top: auto; padding-top: 14px; }
.progress-label { display: flex; justify-content: space-between; color: #806f68; font-size: 12px; font-weight: 800; margin-bottom: 9px; }
.progress-track { height: 8px; overflow: hidden; background: rgba(121,95,83,.12); border-radius: 999px; }
.progress-fill { height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, #f3b899, #d1c6f5); transition: width .5s ease; }

.complete-page { padding: clamp(48px, 8vw, 78px) clamp(25px, 7vw, 70px) 45px; text-align: center; }
.completion-stamp { width: 66px; height: 66px; display: grid; place-items: center; margin: 0 auto 18px; background: var(--mint); border: 2px solid #426354; border-radius: 50%; color: #426354; font-size: 32px; font-weight: 900; box-shadow: 0 6px 0 rgba(66,99,84,.14); }
.completion-copy { color: var(--muted); max-width: 520px; margin: 18px auto 24px; line-height: 1.6; }
.insight-card { text-align: left; max-width: 510px; margin: 0 auto 24px; padding: 18px 20px; background: rgba(255,255,255,.75); border: 1px solid rgba(67,56,52,.1); border-radius: 18px; }
.insight-card p { margin: 0; }
.insight-card .insight-eyebrow { color: #9c786c; font-size: 10px; font-weight: 900; letter-spacing: .12em; margin-bottom: 5px; }
.insight-card .insight-title { font-family: Georgia, serif; font-size: 19px; margin-bottom: 5px; }
.insight-card .insight-detail { color: var(--muted); font-size: 13px; line-height: 1.45; }
.completion-actions { display: grid; gap: 12px; width: min(410px, 100%); margin: 0 auto; }
.coffee-card-button { display: flex; align-items: center; gap: 12px; padding: 15px 17px; text-align: left; color: var(--ink); background: var(--butter); border: 1px solid rgba(87,66,49,.12); border-radius: 19px; }
.coffee-card-button:hover { transform: translateY(-2px); }
.coffee-emoji { font-size: 28px; }
.coffee-card-button b, .coffee-card-button small { display: block; }
.coffee-card-button small { margin-top: 3px; color: #7f6d57; }
.share-button { margin-top: 20px; background: transparent; color: #8a6c61; font-weight: 800; }
.share-button:hover { color: var(--ink); transform: translateY(-1px); }
.tomorrow-line { margin: 21px 0 0; color: #96837c; font-size: 13px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(61,48,42,.30); backdrop-filter: blur(7px); }
.modal-backdrop[hidden] { display: none !important; }
.modal { position: relative; width: min(460px, 100%); max-height: min(720px, calc(100svh - 40px)); overflow: auto; padding: 31px 26px 27px; background: #fffcf7; border: 1px solid rgba(255,255,255,.9); border-radius: 28px; box-shadow: 0 24px 70px rgba(44,31,26,.25); animation: modalIn .24s ease both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.close-modal { position: absolute; right: 15px; top: 12px; border: 0; background: transparent; color: #876e66; font-size: 28px; cursor: pointer; }
.modal h3 { font-family: Georgia, serif; font-size: 29px; letter-spacing: -.035em; margin-bottom: 10px; }
.modal p { color: var(--muted); line-height: 1.55; }
.setting-row { display: grid; gap: 9px; margin: 18px 0; }
.setting-row label { display: flex; justify-content: space-between; gap: 14px; color: var(--ink); font-weight: 800; }
.setting-row output { color: #9b7569; }
input[type="range"] { accent-color: #e5a887; width: 100%; }
.modal-divider { height: 1px; background: var(--line); margin: 22px 0; }
.modal-link { display: inline-flex; padding: 11px 14px; border-radius: 12px; color: #6f5952; background: #fff0e8; text-decoration: none; font-weight: 800; }
.coffee-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 19px 0 10px; }
.coffee-amounts button { border: 1px solid rgba(86,63,50,.12); border-radius: 15px; padding: 14px 8px; color: var(--ink); cursor: pointer; background: var(--butter); font-weight: 900; }
.coffee-amounts button:hover { transform: translateY(-2px); }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; padding: 12px 16px; border-radius: 999px; background: #493e3a; color: white; font-size: 13px; transition: .25s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 540px) {
  .app-shell { padding: 18px 13px; align-items: start; }
  .screen { margin-top: 54px; }
  .settings-trigger { top: 15px; right: 15px; }
  .coffee-button { left: 15px; bottom: 15px; }
  .cover-page, .complete-page { border-radius: 27px; }
  .question-page { min-height: calc(100svh - 72px); border-radius: 27px; padding: 25px 19px; }
  .question-stage h2 { font-size: 35px; }
  .option-card { grid-template-columns: 37px 1fr auto; padding: 15px; }
  .option-letter { width: 30px; height: 30px; }
  .result-panel { padding: 19px; }
}



.completion-actions { width: min(217px, 100%); }
.completion-actions .primary-button { width: 100%; }

@media (max-width: 540px) {
  .app-shell { padding: 10px 9px; }
  .screen { margin-top: 45px; }
  .question-page { min-height: calc(100svh - 58px); padding: 16px 14px 13px; }
  .question-header { gap: 10px; }
  .question-header .eyebrow { margin-bottom: 5px; }
  .question-count { font-size: 12px; }
  .quiet-button { padding: 4px 0; font-size: 13px; }
  .question-stage { align-content: start; padding: 12px 0 8px; }
  .question-stage h2 { font-size: clamp(25px, 8vw, 31px); line-height: 1.04; margin-bottom: 7px; }
  .question-intro { margin-bottom: 12px; font-size: 13px; }
  .option-stack { gap: 8px; }
  .option-card { grid-template-columns: 32px 1fr auto; gap: 9px; padding: 11px 12px; border-radius: 15px; }
  .option-letter { width: 28px; height: 28px; }
  .option-copy { font-size: 14px; line-height: 1.25; }
  .result-panel { margin-top: 8px; padding: 13px; border-radius: 18px; }
  .result-panel h3 { font-size: 21px; margin-bottom: 10px; }
  .chosen-note { margin-bottom: 8px; padding: 9px 11px; font-size: 13px; line-height: 1.35; }
  .result-comment { margin: 9px 0 11px; font-size: 13px; line-height: 1.35; }
  .result-panel .primary-button { padding: 13px 16px; }
  .progress-wrap { padding-top: 7px; }
  .progress-label { margin-bottom: 6px; }
}