/* Charlie's Apartment */
:root {
  --cream: #FFF6E9; --paper: #FFFDF8; --ink: #1D1A1F; --ink-2: #4A4450;
  --tangerine: #E8893A; --tangerine-2: #B85E17; --pink: #FF9EC4; --pink-2: #C93A72; --pink-3: #FFE4EE;
  --sky: #A9C8E8; --sky-2: #2F5F9E; --mint: #A8DCC0; --butter: #FFE08A; --red: #E5484D;
  --font-display: "Fredoka", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
  --font-hand: "Caveat", "Bradley Hand", cursive;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--cream); overflow: hidden; overscroll-behavior: none; }
body { font-family: var(--font-body); color: var(--ink); -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 3px dashed var(--pink-2); outline-offset: 3px; }
.game { position: relative; height: 100vh; height: 100dvh; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; background: #CFC8BC; }
@media (min-width: 700px) and (min-height: 640px) {
  body { display: grid; place-items: center; background: var(--cream) radial-gradient(circle, rgba(201, 58, 114, .13) 2.5px, transparent 3px) 0 0 / 34px 34px; }
  .game { width: 430px; height: min(900px, calc(100dvh - 48px)); border: 3px solid var(--ink); border-radius: 44px; box-shadow: 10px 10px 0 var(--ink); }
}

.hud { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: calc(var(--sat) + 10px) 12px 8px; background: var(--cream); border-bottom: 3px solid var(--ink); z-index: 2; }
.hud__clock { background: var(--ink); color: var(--cream); border-radius: 14px; padding: 4px 10px 5px; text-align: center; min-width: 72px; }
.hud__clock b { display: block; font-family: var(--font-display); font-size: 22px; line-height: 1; }
.hud__clock span { font-family: var(--font-display); font-weight: 600; font-size: 11px; letter-spacing: .1em; }
.hud__mid { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.hud__hearts { font-size: 20px; line-height: 1; color: var(--red); text-shadow: 2px 2px 0 var(--ink); }
.hud__hearts .gone { color: rgba(29, 26, 31, .18); text-shadow: none; }
.hud__mood { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; width: 100%; max-width: 170px; }
.hud__mood span { width: 42px; text-align: right; }
.hud__mood i { flex: 1; height: 9px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.hud__mood b { display: block; height: 100%; width: 80%; background: var(--mint); transition: width .3s, background .3s; }
.hud__right { display: flex; align-items: center; gap: 8px; }
.hud__right > b { font-family: var(--font-display); font-size: 22px; min-width: 52px; text-align: right; }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--paper); display: grid; place-items: center; padding: 0; box-shadow: 2px 2px 0 var(--ink); }
.iconbtn svg { width: 18px; height: 18px; }

.stagewrap { position: relative; flex: 1; min-height: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.ticker { position: absolute; left: 10px; right: 10px; top: 8px; z-index: 3; text-align: center; pointer-events: none; }
.ticker span { display: inline-block; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); padding: 5px 11px; font-family: var(--font-display); font-weight: 600; font-size: 14px; line-height: 1.25; animation: tick .3s cubic-bezier(.3, 1.6, .5, 1); max-width: 100%; }
.ticker span.bad { background: #FFE1E1; }
.ticker span.good { background: #E4F4EA; }
@keyframes tick { from { transform: translateY(-10px) scale(.8); opacity: 0; } }
.bar { display: flex; gap: 10px; padding: 10px 12px calc(10px + var(--sab)); background: var(--cream); border-top: 3px solid var(--ink); z-index: 2; }
.blanketbtn, .callbtn { position: relative; display: flex; align-items: center; gap: 8px; border: 2.5px solid var(--ink); border-radius: 18px; background: var(--paper); box-shadow: 3px 3px 0 var(--ink); padding: 6px 12px 6px 6px; font-family: var(--font-display); font-weight: 700; font-size: 15px; overflow: hidden; }
.blanketbtn { flex: 0 0 auto; background: #F1DCC0; }
.callbtn { flex: 1; justify-content: center; font-size: 14.5px; }
.blanketbtn img { width: 46px; height: 32px; }
.callbtn img { width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--ink); }
.blanketbtn:active, .callbtn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.blanketbtn[disabled] { opacity: .75; }
.blanketbtn i { position: absolute; left: 0; bottom: 0; height: 100%; width: 0; background: rgba(29, 26, 31, .22); pointer-events: none; }

/* panels */
.panel { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: calc(var(--sat) + 14px) 14px calc(var(--sab) + 14px); background: rgba(255, 246, 233, .6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); overflow-y: auto; }
.panel__card { width: 100%; max-width: 420px; background: var(--paper); border: 3px solid var(--ink); border-radius: 26px; box-shadow: 6px 6px 0 var(--ink); padding: 18px 18px 16px; text-align: center; position: relative; }
.panel__card--small { max-width: 340px; }
.panel__back { position: absolute; left: 16px; top: 14px; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.kicker { display: block; font-family: var(--font-hand); font-weight: 700; font-size: 25px; color: var(--pink-2); transform: rotate(-2deg); margin-top: 14px; line-height: 1; }
.panel h1, .panel h2 { font-family: var(--font-display); font-weight: 700; margin: 4px 0 8px; line-height: 1; }
.panel h1 { font-size: clamp(34px, 10vw, 46px); }
.panel h1 span { color: var(--tangerine); text-shadow: 3px 3px 0 var(--ink); }
.panel h2 { font-size: 32px; }
.lede { margin: 0 0 12px; font-size: 15.5px; line-height: 1.45; color: var(--ink-2); }
.cast { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 0 0 10px; }
.cast div { padding: 5px 2px 7px !important; }
.cast b { font-size: 12px !important; }
.cast small { font-size: 10px !important; }
.cast img { height: 52px !important; }
.cast div { background: #F4EFE7; border: 2px solid var(--ink); border-radius: 14px; padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; }
.cast img { height: 60px; width: auto; }
.cast b { font-family: var(--font-display); font-size: 13px; line-height: 1.1; margin-top: 2px; }
.cast small { font-size: 10.5px; line-height: 1.2; color: var(--ink-2); }
.how { list-style: none; padding: 0; margin: 0 0 12px; font-size: 14.5px; line-height: 1.45; text-align: left; }
.how li { padding-left: 22px; position: relative; margin-bottom: 3px; }
.how li::before { content: "🐾"; position: absolute; left: 0; font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 19px; padding: 11px 22px; border-radius: 999px; border: 3px solid var(--ink); background: var(--tangerine); box-shadow: 4px 4px 0 var(--ink); text-decoration: none; color: var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn--go { width: 100%; }
.btn--paper { background: var(--paper); }
#pausePanel .btn { margin-top: 10px; }
.best { margin: 10px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.acct { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.acct a, .acct button { color: var(--sky-2); font-weight: 800; background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.links { margin: 10px 0 0; font-size: 14px; font-weight: 700; }
.links a { color: var(--sky-2); }
.tally { text-align: left; background: #F4EFE7; border: 2px solid var(--ink); border-radius: 14px; padding: 8px 14px; margin: 0 0 12px; font-size: 14px; line-height: 1.45; }
.tally div { display: flex; justify-content: space-between; gap: 10px; }
.tally div b { font-family: var(--font-display); }
.tally .tot { border-top: 2px dashed rgba(29, 26, 31, .3); margin-top: 4px; padding-top: 4px; font-size: 17px; }
.saved { margin: 0 0 12px; font-family: var(--font-display); font-weight: 600; font-size: 15px; min-height: 1.2em; }
.saved .ok { color: #1F7A4D; }
.saved .btn { width: 100%; font-size: 16px; padding: 10px 16px; background: var(--butter); }
.lb { text-align: left; background: #F4EFE7; border: 2px solid var(--ink); border-radius: 14px; padding: 8px 14px 10px; margin: 0 0 14px; }
.lb h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; text-align: center; }
.lb ol { margin: 0; padding-left: 22px; font-size: 14.5px; }
.lb li span { float: right; font-family: var(--font-display); font-weight: 600; }
.lb li.me { color: var(--pink-2); font-weight: 800; }
.over__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.over__btns .btn { font-size: 16px; padding: 10px; }
@media (max-height: 700px) { .how { display: none; } .cast img { height: 48px; } }
