:root{
  --bg1:#EAF6FF;
  --bg2:#FFF7E6;
  --ink:#1F2A37;
  --muted:#6B7280;
  --card:#FFFFFFCC;
  --stroke:#00000012;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --radius: 18px;
  --pill: 999px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-rounded, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color:var(--ink);
  background:
    radial-gradient(1200px 800px at 20% 10%, var(--bg2), transparent 55%),
    radial-gradient(1200px 800px at 80% 0%, #E9FFEF, transparent 50%),
    linear-gradient(180deg, var(--bg1), #F7FAFF);
  overflow-x:hidden;
}

.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  background: #FFFFFFC8;
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--stroke);
}

.topbar__back{
  text-decoration:none;
  display:grid; place-items:center;
  width:40px; height:40px;
  border-radius: var(--pill);
  background:#fff;
  border:1px solid var(--stroke);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  color:var(--ink);
  font-size:18px;
}

.topbar__center{
  flex:1;
  text-align:center;
  font-weight:800;
  letter-spacing:.5px;
}

.topbar__btn{
  width:40px; height:40px;
  border-radius: var(--pill);
  border:1px solid var(--stroke);
  background:#fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  font-size:18px;
}

.wrap{
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 14px 80px;
}

.hero{
  margin-top:10px;
  padding:18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #FFFFFFCC, #FFFFFF88);
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
  position:relative;
  overflow:hidden;
}

.hero::after{
  content:"";
  position:absolute; inset:-40px -60px auto auto;
  width:240px; height:240px;
  background: radial-gradient(circle at 30% 30%, #FFE8A3, transparent 62%);
  filter: blur(2px);
  transform: rotate(12deg);
}

.hero__title h1{
  margin:0;
  font-size: 30px;
  line-height: 1.1;
}
.hero__title p{
  margin:10px 0 0;
  color:var(--muted);
  font-weight:600;
}

.island-badge{
  margin-top:12px;
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px;
  border-radius: var(--pill);
  background:#fff;
  border:1px solid var(--stroke);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  font-weight:700;
}
.badge-emoji{ font-size:18px; }

.grid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap:10px;
}
@media (min-width: 720px){
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap:12px; }
}
@media (min-width: 980px){
  .grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.card{
  display:flex; align-items:center; gap:12px;
  padding:14px;
  border-radius: var(--radius);
  text-decoration:none;
  color:inherit;
  background: var(--card);
  border:1px solid var(--stroke);
  box-shadow: 0 10px 28px rgba(0,0,0,.06);
  transition: transform .08s ease;
}
.card:active{ transform: scale(.99); }

.card__emoji{
  width:44px; height:44px;
  display:grid; place-items:center;
  border-radius: 14px;
  background:#fff;
  border:1px dashed #00000018;
  font-size:22px;
}

.card__title{ font-weight:900; }
.card__sub{ margin-top:3px; color:var(--muted); font-weight:650; font-size:13px; }
.card__body{ flex:1; }
.card__arrow{ font-size:22px; opacity:.5; }

.hint{ margin-top:14px; }
.hint__bubble{
  padding:14px;
  border-radius: var(--radius);
  background:#FFFFFFAA;
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
}
.hint__title{ font-weight:900; }
.hint__text{ margin-top:6px; color:var(--muted); font-weight:650; }

.page{
  max-width: 820px;
  margin: 0 auto;
  padding: 14px 14px 100px;
}

.panel{
  padding:16px;
  border-radius: var(--radius);
  background:#FFFFFFCC;
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.h2{
  margin:0 0 8px;
  font-size:20px;
  font-weight:900;
}
.p{
  margin:0 0 12px;
  color:var(--muted);
  font-weight:650;
}

.btnrow{ display:flex; gap:10px; flex-wrap:wrap; }
.btn{
  border:none;
  border-radius: var(--pill);
  padding:10px 14px;
  background:#fff;
  border:1px solid var(--stroke);
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
  font-weight:900;
}
.btn:active{ transform: scale(.99); }

.footer{
  position:fixed; left:0; right:0; bottom:0;
  padding:10px 14px calc(10px + env(safe-area-inset-bottom));
  background:#FFFFFFC8;
  border-top:1px solid var(--stroke);
  backdrop-filter: blur(10px);
  text-align:center;
  color:var(--muted);
  font-weight:650;
}

.island-host{
  position:fixed;
  right:14px;
  bottom:78px;
  width:64px; height:64px;
  border-radius: 50%;
  border:2px solid #FFFFFF;
  background:#fff;
  box-shadow: 0 14px 28px rgba(0,0,0,.18);
  padding:0;
  overflow:hidden;
  z-index:60;
}
.island-host img{
  width:100%; height:100%;
  object-fit:cover;
}

.toast{
  position:fixed; left:50%; bottom:160px;
  transform: translateX(-50%);
  min-width: min(90vw, 520px);
  padding:12px 14px;
  border-radius: var(--radius);
  background:#FFFFFFEE;
  border:1px solid var(--stroke);
  box-shadow: 0 18px 40px rgba(0,0,0,.14);
  font-weight:800;
  display:none;
  z-index:70;
}

.big-center{
  display:grid;
  place-items:center;
  padding:18px 0 6px;
}

.breathe-circle{
  width:220px; height:220px;
  border-radius:50%;
  background: radial-gradient(circle at 30% 30%, #BFE7FF, #FFFFFF 60%);
  border: 1px solid #00000012;
  box-shadow: 0 22px 50px rgba(0,0,0,.12);
  transform: scale(.92);
}

.kitty{
  width:240px;
  user-select:none;
  -webkit-user-select:none;
}

.canvas-wrap{
  width:100%;
  border-radius: var(--radius);
  overflow:hidden;
  border:1px solid var(--stroke);
  background:#fff;
}
canvas{ width:100%; height:auto; display:block; touch-action:none; }

.input{
  width:100%;
  padding:12px 14px;
  border-radius: var(--radius);
  border:1px solid var(--stroke);
  font-size:16px;
  font-weight:700;
  outline:none;
}

.small{
  font-size:13px;
  color:var(--muted);
  font-weight:650;
}

/* Fix for note div overflow */
#note {
  width: min(100%, 92vw);  /* Limit to 92% of the screen width */
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #FFFFFF, #FFF0F7);
  border: 1px solid #00000012;
  box-shadow: 0 22px 50px rgba(0, 0, 0, .12);
  font-weight: 900;
  font-size: 18px;
  text-align: left;
  line-height: 1.55;
  overflow-wrap: break-word;  /* Prevent overflow */
  word-wrap: break-word;      /* For older browsers */
  white-space: normal;        /* Ensure text wraps */
}
