
:root {
  --bg:#f7f3fb;
  --card:#ffffff;
  --text:#2d2538;
  --muted:#8d8498;
  --purple:#7a46be;
  --purple2:#a878e8;
  --purple3:#efe4ff;
  --green:#56b46d;
  --green-bg:#ecf8ef;
  --yellow:#fff5cf;
  --line:#ece5f3;
  --shadow:0 12px 34px rgba(68,41,93,.10);
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);font-family:Pretendard,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans KR",sans-serif;color:var(--text)}
button{font:inherit}
body{min-height:100vh}
.shell{max-width:480px;margin:0 auto;background:#fbf9fd;min-height:100vh;position:relative;padding-bottom:86px;box-shadow:0 0 60px rgba(77,49,104,.08)}
.topbar{
  position:sticky;top:0;z-index:20;
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 18px 12px;
  background:rgba(251,249,253,.92);backdrop-filter:blur(12px);
  border-bottom:1px solid rgba(236,229,243,.8)
}
.brand{font-size:22px;font-weight:950;letter-spacing:-.5px;display:flex;align-items:center;gap:8px}
.grape-logo{font-size:26px}
.user-pill{
  display:flex;align-items:center;gap:8px;border:0;background:#fff;
  padding:7px 10px;border-radius:999px;box-shadow:0 4px 14px rgba(67,44,88,.08);
  font-weight:900;cursor:pointer
}
.avatar-dot{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#f0e2ff;font-size:16px}
.page{display:none;padding:10px 16px 22px}
.page.active{display:block}
.section-title{font-size:26px;font-weight:950;letter-spacing:-.8px;margin:12px 0 4px}
.sub{color:var(--muted);font-size:14px;line-height:1.55}
.card{background:var(--card);border:1px solid #fff;border-radius:24px;box-shadow:var(--shadow);padding:18px;margin-top:14px}
.hero{
  padding:0;overflow:hidden;position:relative;min-height:280px;
  background:linear-gradient(145deg,#f2e6ff,#fff6dc)
}
.hero-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 42%;filter:saturate(.94)}
.hero::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(255,255,255,.08),rgba(36,20,52,.10))}
.hero-copy{
  position:absolute;z-index:2;left:18px;bottom:18px;right:18px;
  color:#fff;text-shadow:0 2px 10px rgba(46,28,58,.35)
}
.hero-copy strong{display:block;font-size:30px;line-height:1.15;letter-spacing:-1px}
.hero-copy span{display:block;font-size:14px;margin-top:8px;font-weight:800}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:14px}
.stat{background:#fff;border:1px solid var(--line);border-radius:18px;padding:13px 10px;text-align:center}
.stat small{display:block;color:var(--muted);font-weight:800;font-size:12px}
.stat strong{display:block;margin-top:6px;font-size:19px;color:var(--purple);font-weight:950}
.quick-btn{
  width:100%;border:0;border-radius:18px;padding:15px 16px;margin-top:14px;
  color:white;font-weight:950;background:linear-gradient(135deg,#925bc9,#6939aa);
  box-shadow:0 10px 22px rgba(105,57,170,.22);cursor:pointer
}
.notice{background:linear-gradient(135deg,#fff8dd,#f7efff)}
.notice-title{font-weight:950;font-size:17px}
.notice-row{display:flex;gap:12px;align-items:flex-start}
.notice-icon{width:46px;height:46px;border-radius:15px;background:#fff;display:grid;place-items:center;font-size:24px;flex:0 0 auto}
.user-tabs{display:flex;gap:8px;overflow:auto;padding:2px 0 5px;margin-top:14px}
.user-chip{border:1px solid var(--line);background:#fff;border-radius:17px;padding:10px 12px;min-width:74px;font-weight:900;color:#766c82;cursor:pointer}
.user-chip.active{background:var(--purple3);color:var(--purple);border-color:#d7baf4}
.mascot-strip{height:190px;border-radius:22px;overflow:hidden;position:relative;background:#f2e8ff;margin-top:14px}
.mascot-strip img{width:100%;height:100%;object-fit:cover;object-position:52% 44%}
.mascot-strip::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(255,255,255,.72),transparent 55%)}
.mascot-message{position:absolute;z-index:2;left:16px;top:18px;width:42%;font-weight:950;line-height:1.45;font-size:17px}
.week-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:7px;margin-top:16px}
.day{aspect-ratio:1;border:1px solid var(--line);border-radius:13px;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:11px;color:var(--muted);font-weight:900;gap:2px}
.day.done{background:var(--green-bg);border-color:#c2e8cb;color:#2f944b}
.day.today{outline:2px solid #b78ce8}
.badge{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:8px 11px;background:#f2e8ff;color:var(--purple);font-size:13px;font-weight:900}
.big-action{
  width:100%;border:0;border-radius:18px;padding:17px 14px;margin-top:16px;background:var(--purple);
  color:#fff;font-weight:950;font-size:16px;cursor:pointer
}
.big-action:active{transform:translateY(1px)}
.ghost{background:#f1e8fa;color:var(--purple)}
.grape-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.switch{display:flex;background:#f4eff8;border-radius:13px;padding:4px}
.switch button{border:0;background:transparent;padding:8px 11px;border-radius:10px;font-weight:900;color:#92879d;cursor:pointer}
.switch button.active{background:#fff;color:var(--purple);box-shadow:0 3px 10px rgba(75,45,103,.08)}
.grape-board{display:flex;justify-content:center;padding:8px 0 4px;overflow:hidden}
.cluster{position:relative;padding:45px 0 12px;display:flex;flex-direction:column;align-items:center;gap:1px}
.stem{position:absolute;top:7px;width:58px;height:32px;background:#6f9e50;border-radius:60px 10px 40px 10px;transform:rotate(-12deg)}
.leaf{position:absolute;top:18px;width:70px;height:42px;background:#87b66a;border-radius:70% 20% 70% 20%}
.leaf.l{left:calc(50% - 92px);transform:rotate(-16deg)} .leaf.r{right:calc(50% - 92px);transform:scaleX(-1) rotate(-16deg)}
.grow{display:flex;justify-content:center;gap:1px}
.g{width:42px;height:42px;border-radius:50%;border:2px solid #b68ed9;background:#fff;color:#a095aa;display:grid;place-items:center;font-weight:950;font-size:11px;box-shadow:inset 0 -3px 0 rgba(125,75,177,.05)}
.g.fill{background:radial-gradient(circle at 30% 24%,rgba(255,255,255,.5),transparent 20%),linear-gradient(145deg,#aa74e9,#6c3bad);border-color:#6e3daf;color:#fff;box-shadow:inset 0 -4px 0 rgba(66,34,104,.18),0 3px 8px rgba(99,57,145,.14)}
.progress{height:11px;border-radius:999px;background:#eee8f3;overflow:hidden;margin-top:10px}
.progress i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#ac76e6,#6a3cad)}
.progress-line{display:flex;justify-content:space-between;align-items:end}
.progress-line strong{font-size:31px;color:var(--purple)}
.rank-list{display:grid;gap:10px;margin-top:12px}
.rank-item{background:#fff;border:1px solid var(--line);border-radius:19px;padding:12px;display:grid;grid-template-columns:34px 40px 1fr auto;gap:10px;align-items:center}
.rank-no{width:31px;height:31px;border-radius:11px;background:#efe5fb;display:grid;place-items:center;font-weight:950;color:var(--purple)}
.name{font-weight:950} .meta{font-size:12px;color:var(--muted);margin-top:2px}
.grapes{font-weight:950;color:var(--purple)}
.calendar{display:grid;grid-template-columns:repeat(7,1fr);gap:7px;margin-top:12px}
.chead{font-size:11px;text-align:center;font-weight:900;color:var(--muted);padding:4px 0}
.cday{aspect-ratio:1;border-radius:12px;border:1px solid var(--line);display:grid;place-items:center;background:#fff;color:#776d81;font-size:12px;position:relative}
.cday.done{background:var(--green-bg);color:#2e9149;font-weight:950;border-color:#c3e4ca}
.cday.done::after{content:"✓";position:absolute;right:4px;bottom:2px;font-size:9px}
.empty{border:0;background:transparent}
.history{display:grid;gap:9px;margin-top:14px}
.history-row{display:flex;justify-content:space-between;gap:12px;padding:12px 13px;border-radius:15px;background:#faf7fc;font-size:13px}
.rules{display:grid;gap:10px}
.rule{display:flex;gap:11px;padding:12px;border-radius:16px;background:#faf8fc;border:1px solid var(--line);line-height:1.5}
.rule span:first-child{width:29px;height:29px;border-radius:50%;background:var(--purple);color:#fff;display:grid;place-items:center;font-weight:950;flex:0 0 auto}
.bottom-nav{
  position:fixed;z-index:40;left:50%;transform:translateX(-50%);
  bottom:0;width:min(480px,100%);height:76px;padding:7px 10px calc(7px + env(safe-area-inset-bottom));
  background:rgba(255,255,255,.96);backdrop-filter:blur(14px);border-top:1px solid var(--line);
  display:grid;grid-template-columns:repeat(5,1fr)
}
.nav-btn{border:0;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:#9a91a3;font-size:11px;font-weight:900;cursor:pointer}
.nav-btn b{font-size:21px;line-height:1}
.nav-btn.active{color:var(--purple)}
.sheet{position:fixed;inset:0;background:rgba(37,25,49,.35);z-index:100;display:none;align-items:flex-end;justify-content:center}
.sheet.open{display:flex}
.sheet-box{width:min(480px,100%);background:#fff;border-radius:26px 26px 0 0;padding:18px 18px 28px;box-shadow:0 -20px 50px rgba(52,33,72,.18)}
.sheet-users{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-top:14px}
.sheet-user{border:1px solid var(--line);background:#faf8fc;border-radius:17px;padding:12px 5px;font-weight:900;cursor:pointer}
.sheet-user .avatar-dot{margin:0 auto 6px}
.toast{position:fixed;z-index:200;left:50%;bottom:92px;transform:translate(-50%,20px);opacity:0;background:#332740;color:white;padding:11px 16px;border-radius:999px;font-weight:900;font-size:13px;transition:.22s;pointer-events:none;white-space:nowrap}
.toast.show{opacity:1;transform:translate(-50%,0)}
@media(min-width:700px){body{padding:24px 0} .shell{border-radius:28px;overflow:hidden;min-height:calc(100vh - 48px)} .bottom-nav{bottom:24px;border-radius:0 0 28px 28px}}
button:disabled{opacity:.55;cursor:wait}
button:focus-visible{outline:3px solid #a878e8;outline-offset:3px}
.sheet-close{float:right;border:0;background:#f1e8fa;border-radius:50%;width:32px;height:32px;cursor:pointer}
.bottom-nav{height:calc(76px + env(safe-area-inset-bottom))}
.shell{padding-bottom:calc(96px + env(safe-area-inset-bottom))}
.g{width:clamp(30px,8.4vw,40px);height:clamp(30px,8.4vw,40px)}
.hero-copy strong #homeName{display:inline;font:inherit;margin:0}
[aria-busy="true"]{opacity:.6;pointer-events:none}
.connection-error{margin:14px 16px;color:#75428e;line-height:1.6}
.connection-error button{border:0;border-radius:9px;background:var(--purple3);padding:6px 10px;color:var(--purple);cursor:pointer}
.toast{max-width:calc(100% - 24px);white-space:normal;text-align:center}

[hidden]{display:none!important}
.welcome{padding:30px 24px calc(30px + env(safe-area-inset-bottom));text-align:center;background:linear-gradient(160deg,#f3eaff,#fff9ec)}
.welcome-brand{font-size:21px;font-weight:900;color:var(--purple)}
.welcome-image{display:block;width:100%;height:210px;object-fit:cover;object-position:50% 42%;border-radius:26px;margin:24px auto}
.welcome h1{font-size:27px;letter-spacing:-.8px;margin:0 0 8px}
.welcome-users{display:grid;gap:10px;margin:24px 0 18px}
.welcome-user{display:flex;align-items:center;justify-content:center;gap:14px;width:100%;padding:12px 18px;border:1px solid var(--line);border-radius:20px;background:white;color:var(--text);font-size:18px;font-weight:900;box-shadow:0 5px 16px rgba(68,41,93,.05);cursor:pointer}
.welcome-user .avatar-dot{width:38px;height:38px;font-size:24px}
.welcome-user:hover,.welcome-user:focus-visible{background:var(--purple3);border-color:#d7baf4}
