:root{color-scheme:light;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}html{scroll-padding-top:env(safe-area-inset-top,0px)}body{margin:0;padding:0;font:14px -apple-system,BlinkMacSystemFont,sans-serif;background:#fff;color:#000}img{max-width:100%}[hidden]:not([hidden=until-found i]){display:none!important}

/* Layout: a home screen of release methods grouped by feeling; each method opens as its own single view (hash-routed) with a back link. Deliberately single light look: white, grey and beige. */
:root {
  --ground: #efe8dc;
  --paper: #ffffff;
  --sand: #e4dac9;
  --sand-deep: #c9bba4;
  --mist: #d8d6d2;
  --stone: #8c8882;
  --ink-soft: #66625c;
  --ink: #33312e;
  --display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--ground); color: var(--ink); }
body {
  font-family: var(--body); font-size: 16px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 14px 28px;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--stone); outline-offset: 2px; }

.wrap { max-width: 1000px; margin: 0 auto; display: grid; gap: 20px; }

/* Top strip */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; }
.chip { border: 1.5px solid var(--sand-deep); background: var(--paper); border-radius: 99px; padding: 6px 14px; cursor: pointer; font-size: 14px; font-weight: 600; }
.chip:hover { border-color: var(--stone); }

/* Home */
.hero { display: grid; gap: 8px; padding-block: 6px 4px; }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 9vw, 80px); line-height: .92; letter-spacing: -0.035em; margin: 0; text-wrap: balance; }
.hero p { margin: 0; max-width: 52ch; color: var(--ink-soft); font-size: 17px; }
.group { display: grid; gap: 12px; }
.grouphead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; border-top: 1.5px solid var(--sand-deep); padding-top: 14px; }
.grouphead h2 { font-family: var(--display); font-weight: 700; font-size: 24px; margin: 0; letter-spacing: -0.015em; }
.grouphead span { color: var(--ink-soft); font-size: 15px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
@media (max-width: 480px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.card {
  display: grid; grid-template-rows: auto auto 1fr; gap: 6px; text-decoration: none;
  background: var(--paper); border: 1.5px solid var(--mist); border-radius: 16px; padding: 14px 14px 16px;
  transition: transform .15s, border-color .15s, box-shadow .15s; min-width: 0;
}
.card:hover { transform: translateY(-2px); border-color: var(--sand-deep); box-shadow: 0 6px 0 var(--sand); }
.card svg { width: 34px; height: 34px; stroke: var(--ink); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card b { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.card small { color: var(--ink-soft); font-size: 14px; line-height: 1.35; }
.card.talk { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.card.talk svg { stroke: var(--paper); }
.card.talk small { color: var(--mist); }

/* Single view */
.view { display: grid; gap: 14px; }
.viewbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; padding: 8px 14px 8px 10px; border-radius: 99px; background: var(--paper); border: 1.5px solid var(--mist); }
.back:hover { border-color: var(--stone); }
.tag { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--ink-soft); }
.view h2.title { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 7vw, 56px); line-height: .95; letter-spacing: -0.03em; margin: 0; }
.lead { margin: 0; color: var(--ink-soft); max-width: 56ch; }
.panel { background: var(--paper); border: 1.5px solid var(--mist); border-radius: 20px; padding: 14px; display: grid; gap: 12px; min-width: 0; }
.stage {
  position: relative; min-height: 320px; border-radius: 14px; background: var(--sand);
  display: grid; place-items: center; overflow: hidden; cursor: pointer;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.stage.free { cursor: default; }
.stage.open { overflow: visible; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--ink-soft); }
.count { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); font-size: 16px; }
.jline { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; border: 1.5px dashed var(--sand-deep); }
.jline p { margin: 0; transition: opacity .3s; }
.jline p.fade { opacity: 0; }
.mini { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: var(--display); font-weight: 800; flex: none; font-size: 15px; }
.jline a { font-weight: 600; white-space: nowrap; }
.btn { border: 0; border-radius: 12px; padding: 11px 18px; cursor: pointer; font-weight: 700; background: var(--ink); color: var(--paper); }
.btn.ghost { background: var(--paper); color: var(--ink); border: 1.5px solid var(--sand-deep); }
.btn:disabled { opacity: .45; cursor: default; }
.field { width: 100%; border: 1.5px solid var(--sand-deep); background: var(--paper); border-radius: 12px; padding: 10px 12px; }
.field:focus { outline: none; border-color: var(--ink); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row .field { flex: 1 1 200px; min-width: 0; }

.shake { animation: shake .32s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake { 10%,90%{transform:translate(-2px,1px)} 20%,80%{transform:translate(4px,-2px)} 30%,50%,70%{transform:translate(-7px,2px)} 40%,60%{transform:translate(7px,-1px)} }

/* Door */
.doorframe { width: 150px; height: 230px; position: relative; perspective: 640px; }
.doorframe .hole { position: absolute; inset: 0; border-radius: 4px 4px 0 0; background: #3d3a36; box-shadow: inset 0 0 0 8px #b3a68f; }
.door { position: absolute; inset: 8px 8px 0 8px; transform-origin: left center; transform: rotateY(-62deg); transition: transform 1.4s cubic-bezier(.25,.8,.3,1); }
.door svg { width: 100%; height: 100%; display: block; }
.door.slam { transition: transform .11s cubic-bezier(.6,0,1,1); transform: rotateY(0deg); }

/* Plate */
.plate { width: 190px; height: 190px; }
.plate.in { animation: drop .38s cubic-bezier(.3,1.5,.5,1); }
.plate.gone { visibility: hidden; }
@keyframes drop { from { transform: translateY(-140px) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* Pillow */
.pillow { width: 230px; height: 160px; transition: transform .25s cubic-bezier(.3,1.8,.4,1); }
.pillow.hit { transition: transform .05s; }

/* Bubble wrap */
.wrapgrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; padding: 16px; width: 100%; max-width: 440px; touch-action: none; }
.bub {
  aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 32% 30%, #ffffff 0 14%, rgba(255,255,255,.75) 30%, rgba(255,255,255,.35) 72%);
  box-shadow: inset 0 0 0 1.5px rgba(140,136,130,.35), 0 2px 3px rgba(60,55,50,.18);
  transition: transform .08s;
}
.bub.popped { background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(140,136,130,.25); transform: scale(.8); cursor: default; }

/* Scream */
.screamtext { font-family: var(--display); font-weight: 800; color: var(--ink); line-height: 1; text-align: center; overflow-wrap: anywhere; max-width: 100%; padding: 14px; font-size: 26px; }
.screamtext.idle { color: var(--ink-soft); font-family: var(--body); font-weight: 500; font-size: 16px; }
.screambtn { font-family: var(--display); font-weight: 800; font-size: 18px; background: var(--ink); color: var(--paper); border: 0; border-radius: 14px; padding: 16px 22px; cursor: pointer; touch-action: none; box-shadow: 0 5px 0 var(--stone); user-select: none; -webkit-user-select: none; }
.screambtn.on { transform: translateY(4px); box-shadow: 0 1px 0 var(--stone); }

/* Crumple */
.sheet {
  width: 210px; height: 158px; background-color: var(--paper); padding: 14px; font-size: 15px; line-height: 1.35;
  box-shadow: 0 6px 14px rgba(60,55,50,.18); transition: transform .22s cubic-bezier(.3,1.6,.5,1), border-radius .22s, clip-path .22s;
  overflow: hidden; overflow-wrap: anywhere; color: var(--ink); cursor: pointer;
  background-image: repeating-linear-gradient(transparent 0 23px, rgba(140,136,130,.22) 23px 24px);
}
.sheet.in { animation: drop .38s cubic-bezier(.3,1.5,.5,1); }
.bin { position: absolute; right: 18px; bottom: 14px; width: 84px; height: 100px; }
.bin.wobble { animation: wob .4s; }
@keyframes wob { 30% { transform: rotate(-6deg); } 60% { transform: rotate(4deg); } }

/* Stress ball */
.sball { width: 170px; height: 170px; border-radius: 50%; touch-action: none; cursor: grab;
  background: radial-gradient(circle at 34% 30%, #ffffff 0 10%, #ece4d6 38%, #c9bba4 100%);
  box-shadow: 0 14px 20px -10px rgba(60,55,50,.35); display: grid; place-items: center; }
.sball svg { width: 70px; height: 40px; }
.bar { height: 10px; border-radius: 99px; background: var(--sand); overflow: hidden; flex: 1 1 140px; max-width: 260px; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); }

/* Rain */
#rainCv { width: 100%; height: 340px; display: block; touch-action: none; cursor: pointer; }

/* Balloon */
.balloon { width: 150px; height: 182px; border-radius: 50% 50% 48% 48% / 56% 56% 44% 44%; position: relative; display: grid; place-items: center; padding: 22px; text-align: center; font-weight: 600; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; box-shadow: inset -14px -10px 0 rgba(60,55,50,.07), 0 10px 18px -12px rgba(60,55,50,.4); transition: background-color .3s, opacity .4s; }
.balloon::before { content: ""; position: absolute; left: 50%; bottom: -8px; width: 14px; height: 10px; transform: translateX(-50%); background: inherit; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.balloon::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 110px; margin-top: 2px; background: var(--stone); }
.balstage { min-height: 360px; align-items: start; padding-top: 30px; }

/* Breathing */
.breathwrap { width: 260px; height: 260px; display: grid; place-items: center; position: relative; }
.breathwrap::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px dashed var(--sand-deep); }
.breath { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, #ffffff 0 30%, #f3eee5 70%); box-shadow: 0 0 0 1.5px var(--mist); transform: scale(.5); transition: transform 1s ease-in-out; }
.breathlabel { position: relative; text-align: center; display: grid; gap: 2px; }
.breathlabel b { font-family: var(--display); font-weight: 700; font-size: 20px; }
.breathlabel span { font-variant-numeric: tabular-nums; font-size: 34px; font-family: var(--display); font-weight: 800; color: var(--ink-soft); min-height: 1.1em; }

/* Scribble */
#scribCv { width: 100%; height: 360px; display: block; touch-action: none; cursor: crosshair; background: var(--paper); border-radius: 14px; }
.toolbtn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Grounding */
.gstage { min-height: 320px; cursor: default; padding: 24px 16px; }
.gbox { display: grid; gap: 14px; justify-items: center; text-align: center; max-width: 440px; }
.gnum { font-family: var(--display); font-weight: 800; font-size: 88px; line-height: .9; }
.gtext { font-size: 20px; font-weight: 600; text-wrap: balance; }
.gdots { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.gdot { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--stone); background: var(--paper); cursor: pointer; }
.gdot.on { background: var(--ink); border-color: var(--ink); }
.gprog { display: flex; gap: 6px; }
.gprog i { width: 28px; height: 6px; border-radius: 99px; background: var(--paper); }
.gprog i.on { background: var(--ink); }

/* Chat */
.chat { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 68vh; min-height: 440px; max-height: 760px; padding: 0; overflow: hidden; gap: 0; }
.msgs { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 0; background: var(--paper); }
.msg { max-width: 84%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.adult { align-self: flex-start; background: var(--ground); border-bottom-left-radius: 4px; }
.msg.teen { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; }
.msg.adult.aside { background: transparent; border: 1.5px dashed var(--sand-deep); color: var(--ink-soft); font-size: 14px; }
.msg.typing span { display: inline-block; animation: dot 1.2s infinite; }
.msg.typing span:nth-child(2) { animation-delay: .15s; }
.msg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.compose { border-top: 1.5px solid var(--mist); padding: 12px; display: grid; gap: 8px; background: var(--paper); }
.compose textarea { resize: none; min-height: 64px; }
.compose .btn { flex: 1 1 auto; }
.note { font-size: 12.5px; color: var(--ink-soft); margin: 0; }

/* Help */
.help { border-top: 1.5px solid var(--sand-deep); padding-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline; font-size: 14px; color: var(--ink-soft); }
.help strong { color: var(--ink); }
.help .num { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 700; user-select: all; }
.help.flash { animation: flash 1.6s ease-in-out 2; }
@keyframes flash { 50% { background: var(--sand); } }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

@media (max-width: 520px) {
  .stage { min-height: 280px; }
  .plate { width: 160px; height: 160px; }
  .pillow { width: 190px; height: 132px; }
  .doorframe { width: 124px; height: 190px; }
  .breathwrap { width: 220px; height: 220px; }
  .sheet { width: 176px; height: 132px; font-size: 14px; }
  .bin { width: 64px; height: 78px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .shake, .plate.in, .sheet.in, .bin.wobble, .help.flash { animation: none; }
  .door, .door.slam { transition-duration: .01s; }
  .card:hover { transform: none; }
}
