:root {
  --ink: #51444f;
  --forest: #8d6c63;
  --sage: #b8c8b5;
  --mint: #edf4ed;
  --cream: #fff6f3;
  --paper: #fffdfb;
  --gold: #c69a72;
  --rose: #f2d2cf;
  --blush: #ffe7e3;
  --mauve: #7d6574;
  --line: rgba(115, 86, 94, .12);
  --shadow: 0 22px 60px rgba(133, 103, 109, .12);
}

* { box-sizing: border-box; }
html { background: #f3ebe8; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,.92), transparent 26rem),
    radial-gradient(circle at 100% 12%, rgba(255,220,214,.8), transparent 24rem),
    linear-gradient(150deg, #fbf3f0, #efe8e4);
  font-family: "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }
[hidden] { display: none !important; }

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 20; opacity: .17;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}
.app-shell {
  width: min(100%, 480px); min-height: 100vh; margin: 0 auto;
  background:
    radial-gradient(circle at 115% 20%, rgba(255, 210, 203, .28), transparent 16rem),
    radial-gradient(circle at -10% 60%, rgba(184, 200, 181, .22), transparent 17rem),
    var(--cream);
  box-shadow: 0 0 60px rgba(112, 84, 91, .12);
  position: relative; overflow: hidden;
}
.view { min-height: 100vh; }

.login-view {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 30px; position: relative;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,255,255,.9), transparent 18rem),
    radial-gradient(circle at 85% 20%, rgba(255,228,223,.58), transparent 14rem),
    var(--cream);
}
.login-view::before, .login-view::after {
  content: ""; position: absolute; width: 280px; height: 280px;
  border: 1px solid rgba(139,164,143,.22); border-radius: 48% 52% 58% 42%;
  animation: spin 22s linear infinite;
}
.login-view::before { top: -150px; right: -110px; }
.login-view::after { bottom: -180px; left: -140px; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-mark {
  width: 132px; height: 132px; border: 1px solid var(--gold); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin-bottom: 34px; box-shadow: inset 0 0 0 7px var(--cream), inset 0 0 0 8px rgba(183,146,85,.3);
  background: linear-gradient(180deg, rgba(255,255,255,.8), rgba(255,239,235,.66));
}
.login-mark span { font: 54px/1 "Cormorant Garamond", serif; color: var(--mauve); font-weight: 700; }
.login-mark small { font-size: 9px; letter-spacing: .35em; color: var(--gold); margin-left: .35em; }
.eyebrow, .mini-label, .hero-kicker, .section-kicker {
  letter-spacing: .19em; font-size: 9px; font-weight: 700; color: var(--gold);
}
.login-view h1 { font-size: 27px; margin: 9px 0 14px; letter-spacing: .03em; }
.login-view h1 em { color: var(--gold); font: italic 24px "Cormorant Garamond", serif; font-weight: 700; }
.level-lockup { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.rainbow-logo {
  display: inline-block; position: relative; width: 29px; height: 21px;
  overflow: hidden; transform: translateY(2px);
}
.rainbow-logo i {
  position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%);
  border-style: solid; border-radius: 50% 50% 0 0;
}
.rainbow-logo i:nth-child(1) { width: 28px; height: 28px; border-width: 3px; border-color: #e58f8e; }
.rainbow-logo i:nth-child(2) { width: 20px; height: 20px; border-width: 3px; border-color: #e7b777; }
.rainbow-logo i:nth-child(3) { width: 12px; height: 12px; border-width: 3px; border-color: #9bb8a7; }
.rainbow-logo b {
  position: absolute; bottom: 0; left: 1px; width: 5px; height: 5px;
  border-radius: 50%; background: #e58f8e; box-shadow: 22px 0 #e58f8e;
}
.rainbow-logo-light { filter: saturate(.82) brightness(1.2); }
.login-copy { font-size: 13px; line-height: 2; color: #85767f; margin: 0 0 37px; }
.line-button, .complete-button {
  border: 0; cursor: pointer; transition: transform .18s, filter .18s;
}
.line-button:active, .complete-button:active { transform: scale(.98); }
.line-button {
  width: 100%; max-width: 330px; height: 58px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: white; background: #06c755; font-weight: 700; box-shadow: 0 12px 28px rgba(6,199,85,.22);
}
.line-button svg { width: 25px; height: 25px; }
.demo-button { border: 0; background: transparent; color: #768078; font-size: 12px; text-decoration: underline; padding: 18px; cursor: pointer; }
.privacy-note { font-size: 10px; color: #9ba29d; margin: 8px 0; }

.home-view { padding-bottom: 1px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 25px 22px 19px; }
.mini-label { margin: 0 0 3px; }
.avatar { width: 40px; height: 40px; padding: 0; border: 1px solid rgba(255,255,255,.88); border-radius: 50%; overflow: hidden; background: linear-gradient(160deg, #fff4f1, #ebf3ea); color: var(--mauve); font-weight: 700; box-shadow: 0 8px 20px rgba(138, 104, 112, .12); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.hero-card {
  margin: 0 15px; padding: 42px 24px 29px; text-align: center; color: white;
  background:
    radial-gradient(circle at 83% 8%, rgba(255,220,214,.26), transparent 10rem),
    linear-gradient(145deg, #c79a8d, #7b6273 72%);
  border: 1px solid rgba(255,255,255,.2); border-radius: 28px;
  position: relative; overflow: hidden; box-shadow: 0 22px 48px rgba(122, 94, 105, .22);
}
.hero-card::after {
  content: ""; position: absolute; inset: 0; opacity: .11;
  background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 18px 18px;
}
.hero-orbit { position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.orbit-one { width: 230px; height: 230px; top: -140px; right: -80px; }
.orbit-two { width: 180px; height: 180px; bottom: -120px; left: -70px; }
.hero-card > *:not(.hero-orbit) { position: relative; z-index: 1; }
.hero-kicker { color: #f8dfd5; margin: 0 0 9px; }
.hero-card h1 { font-size: 27px; margin: 0 0 13px; letter-spacing: .04em; }
.hero-card h1 em { color: #fff1df; font: italic 24px "Cormorant Garamond", serif; font-weight: 700; }
.hero-sparkles { position: absolute !important; inset: 17px 20px auto; display: flex; justify-content: space-between; color: #d7c296; opacity: .65; font-size: 10px; }
.hero-sparkles span:nth-child(2) { margin-top: 8px; }
.subtitle { margin: 0; font-size: 13px; line-height: 1.85; color: rgba(255,255,255,.9); }
.slogan {
  display: inline-block; margin: 19px 0; padding: 8px 15px;
  border-top: 1px solid rgba(255,232,214,.45); border-bottom: 1px solid rgba(255,232,214,.45);
  font-weight: 700; font-size: 14px; color: #f9f4e6;
}
.period { display: flex; align-items: baseline; justify-content: center; gap: 8px; color: #ffe6da; }
.period strong { font: 28px "Cormorant Garamond", serif; color: white; font-weight: 700; }
.period span { font-size: 8px; letter-spacing: .17em; }
.period i { font-style: normal; opacity: .5; }

.progress-section, .prayer-section { padding: 35px 18px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 0 2px 14px; }
.section-kicker { margin: 0 0 3px; }
.section-heading h2 { font-size: 19px; margin: 0; }
.section-heading .english-title {
  font: 23px/1 "DM Serif Display", serif; letter-spacing: .1em;
  color: var(--forest);
}
.status-pill { font-size: 10px; font-weight: 700; padding: 6px 11px; border-radius: 20px; background: linear-gradient(180deg, #fff8f7, #f2ebe8); color: var(--mauve); }
.progress-card {
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(255,253,248,.75));
  border: 1px solid rgba(255,255,255,.9); outline: 1px solid var(--line);
  border-radius: 28px; display: flex; padding: 23px;
  box-shadow: 0 14px 34px rgba(120,92,101,.08);
  backdrop-filter: blur(12px);
}
.day-count { min-width: 103px; border-right: 1px solid var(--line); }
.day-count span { display: block; font-size: 9px; letter-spacing: .2em; color: var(--gold); font-weight: 700; }
.day-count strong { font: 52px/1.1 "Cormorant Garamond", serif; color: var(--mauve); font-weight: 700; }
.day-count small { font-size: 11px; color: #8a928d; }
.progress-detail { flex: 1; padding: 7px 0 0 20px; }
.progress-copy { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: #7e8781; }
.progress-copy strong { font: 22px "Cormorant Garamond", serif; color: var(--mauve); font-weight: 700; }
.progress-track { height: 7px; border-radius: 9px; background: #e9ece7; overflow: hidden; margin: 9px 0; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ebc3bd, #a98579); transition: width .8s ease; }
.progress-detail p { margin: 0; font: 11px "Cormorant Garamond", serif; letter-spacing: .08em; color: #9f8f96; }
.tap-hint { color: #929a94; font-size: 9px; }

.prayer-groups { display: grid; gap: 12px; }
.prayer-group {
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255,255,255,.91), rgba(255,253,248,.8));
  border: 1px solid rgba(255,255,255,.88); outline: 1px solid var(--line);
  overflow: hidden; box-shadow: 0 10px 28px rgba(120,92,101,.055);
}
.group-toggle { width: 100%; padding: 17px 18px; border: 0; background: transparent; display: flex; align-items: center; text-align: left; cursor: pointer; color: var(--ink); }
.group-number {
  font: 18px "Cormorant Garamond", serif; color: var(--gold); width: 34px; height: 34px;
  display: grid; place-items: center; border: 1px solid rgba(183,146,85,.35); border-radius: 50%;
  margin-right: 10px;
}
.group-title { flex: 1; font-weight: 700; font-size: 14px; }
.group-count { font-size: 9px; color: #939b96; margin-right: 12px; }
.chevron { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #f7efed; transition: transform .25s; }
.prayer-group.open .chevron { transform: rotate(180deg); }
.group-content { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s ease; }
.prayer-group.open .group-content { grid-template-rows: 1fr; }
.group-content-inner { overflow: hidden; }
.prayer-list { list-style: none; padding: 0 18px 7px; margin: 0; }
.prayer-list li { position: relative; padding: 15px 4px 15px 26px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.9; color: #526159; }
.prayer-list li::before { content: ""; position: absolute; left: 3px; top: 22px; width: 7px; height: 7px; border: 1px solid var(--gold); border-radius: 50%; }

.complete-area { padding: 24px 18px 42px; text-align: center; }
.complete-button {
  width: 100%; border-radius: 24px; color: white;
  background: linear-gradient(135deg, #d4a092, #866a7b); min-height: 78px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  box-shadow: 0 15px 30px rgba(138,104,112,.24); position: relative; overflow: hidden;
}
.complete-button::after { content: "✦"; position: absolute; right: 20px; color: rgba(255,240,229,.65); font-size: 10px; }
.button-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); }
.complete-button span:last-child { text-align: left; }
.complete-button strong, .complete-button small { display: block; }
.complete-button strong { font-size: 14px; }
.complete-button small { color: rgba(255,255,255,.65); font-size: 9px; margin-top: 2px; }
.complete-button:disabled { background: #91a097; box-shadow: none; cursor: default; }
.recorded-note { font-size: 10px; color: #8b9290; }
footer { text-align: center; font: 11px "Cormorant Garamond", serif; letter-spacing: .25em; color: #b49ea6; padding: 0 0 26px; }

.message-view { position: relative; background: linear-gradient(160deg, #fff7f5, #f8eeeb 58%, #eef4ec); color: var(--ink); padding: 25px 27px; overflow: hidden; }
.message-view::before { content: ""; position: absolute; inset: 0; opacity: .24; background-image: radial-gradient(rgba(198,154,114,.35) 1px, transparent 1px); background-size: 22px 22px; }
.message-glow { position: absolute; width: 360px; height: 360px; left: calc(50% - 180px); top: 5%; background: rgba(242, 210, 207, .55); filter: blur(75px); border-radius: 50%; }
.back-button { position: relative; z-index: 2; color: var(--mauve); background: rgba(255,255,255,.66); border: 1px solid rgba(198,154,114,.16); border-radius: 50%; width: 40px; height: 40px; cursor: pointer; box-shadow: 0 10px 22px rgba(133,103,109,.1); }
.message-content { position: relative; z-index: 1; min-height: calc(100vh - 90px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.message-check { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 25px; color: #8d6c63; background: linear-gradient(160deg, #fffdfc, #fff1ee); font-size: 30px; box-shadow: 0 0 0 12px rgba(255,255,255,.35), 0 18px 40px rgba(133,103,109,.1); }
.message-content .eyebrow { color: var(--gold); margin: 0 0 10px; }
.message-card { width: 100%; min-height: 300px; padding: 34px 28px 26px; border: 1px solid rgba(198,154,114,.2); border-radius: 34px; background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,249,247,.9)); display: flex; flex-direction: column; justify-content: center; position: relative; box-shadow: 0 22px 48px rgba(133,103,109,.11); overflow: hidden; }
.message-aura { position: absolute; inset: auto -30px -40px auto; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, rgba(184,200,181,.35), rgba(184,200,181,0)); }
.quote-mark { position: absolute; top: 16px; left: 26px; font: 52px "Cormorant Garamond", serif; color: var(--gold); opacity: .78; }
.message-date { margin: 0 0 16px; font: 600 16px "Cormorant Garamond", serif; letter-spacing: .14em; color: #b08d82; }
.message-card p { font: 600 24px/1.9 "Cormorant Garamond", serif; color: #423a46; margin: 0 0 24px; }
.message-signoff { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.message-label { font-size: 8px; letter-spacing: .2em; color: var(--gold); }
.message-signoff strong { font: 700 15px "Noto Sans JP", sans-serif; color: #8d6c63; }
.saved-status { font-size: 10px; color: #8f858f; margin: 21px 0 12px; }
.saved-status::before { content: "✓ "; color: var(--gold); }
.save-image-button {
  border: 0;
  width: 100%;
  margin: 0 0 12px;
  min-height: 54px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fffdfc, #f6ece8);
  color: var(--mauve);
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(133,103,109,.1);
  cursor: pointer;
}
.save-image-button:disabled { opacity: .72; cursor: default; }
.home-button { border: 0; background: transparent; color: var(--mauve); padding: 10px 20px; text-decoration: underline; text-underline-offset: 5px; cursor: pointer; font-size: 12px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translate(-50%, 20px); width: max-content; max-width: calc(100% - 32px); background: #27362e; color: white; padding: 12px 17px; border-radius: 12px; font-size: 11px; opacity: 0; pointer-events: none; transition: .25s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 481px) {
  body { padding: 24px 0; }
  .app-shell { min-height: calc(100vh - 48px); border-radius: 28px; }
  .view { min-height: calc(100vh - 48px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
