:root {
  --ink: #FFEFF4; --mut: #EBBBCB; --panel: rgba(46, 3, 24, .74); --line: rgba(255, 194, 214, .34);
  --pri: #FF8CC4; --on: #3C0420; --star: #FFC2D6; --off: rgba(255, 194, 214, .24); --page: #2E0318;
  --radius: 16px; --ctl: 12px; --body: "Quicksand", "Segoe UI", system-ui, sans-serif; --head: "Bagel Fat One", "Arial Rounded MT Bold", sans-serif;
  --danger: #FFB3C0;
}
.him {
  --ink: #F2ECE2; --mut: #B7B2CC; --panel: rgba(9, 8, 32, .84); --line: rgba(245, 168, 60, .4);
  --pri: #F5A83C; --on: #1A0F02; --star: #F5A83C; --off: rgba(245, 168, 60, .2); --page: #07071C;
  --radius: 3px; --ctl: 2px; --body: "Jost", "Segoe UI", system-ui, sans-serif; --head: "Jost", Georgia, serif;
  --danger: #F2A08C;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--page); min-height: 100vh; color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
#bg { position: fixed; inset: 0; background: var(--bgi) center top / cover no-repeat; }
.him #bg { bottom: 34vh; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.him.login #bg { bottom: 0; -webkit-mask-image: none; mask-image: none; }
body.leo { background: #0A0304; --ink: #F6E6DC; --mut: #CDAF94; --panel: rgba(14, 3, 5, .86); --line: rgba(212, 170, 92, .42); --pri: #D9B366; --on: #1A0A04; --star: #E2BC6E; --off: rgba(212, 170, 92, .22); --radius: 4px; --ctl: 3px; --body: "Jost", "Segoe UI", system-ui, sans-serif; --danger: #F2A08C; }
#app { position: relative; max-width: 480px; margin-inline: auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(92px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); gap: 14px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }

/* login */
.login #app { padding-bottom: 28px; justify-content: flex-end; gap: 12px; }
.login-logo { display: block; width: min(92%, 380px); margin: 0 auto 8px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .6)); }
.login form { display: flex; flex-direction: column; gap: 12px; background: var(--panel); padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.login label { display: flex; flex-direction: column; gap: 5px; font-size: .9rem; font-weight: 600; }
.login .link { align-self: center; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 66px; }
.brand { margin: 0; flex: 1; min-width: 0; }
.brand img { display: block; width: 100%; max-width: 270px; height: auto; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .7)); }
.bank { flex: none; display: flex; align-items: center; gap: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.him .bank, .leo .bank { border-radius: var(--ctl); font-weight: 600; }
.bank svg { width: 18px; height: 18px; fill: var(--star); }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
h2 { margin: 0; font-size: 1.1rem; font-weight: 700; line-height: 1.25; }
.him h2, .leo h2 { font-weight: 600; }
.sub { margin: 0; color: var(--mut); font-size: .92rem; }
.stars { display: flex; justify-content: center; gap: 8px; }
.stars svg { width: 46px; height: 46px; fill: var(--off); }
.stars svg.on { fill: var(--star); filter: drop-shadow(0 0 7px var(--star)); }
.score { text-align: center; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.row { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.tick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; text-align: left; min-height: 46px; padding: 4px 0; overflow-wrap: anywhere; }
.box { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--pri); display: grid; place-items: center; transition: background .15s; }
.him .box, .leo .box { border-radius: 2px; }
.done .box { background: var(--pri); }
.done .box::after { content: ""; width: 11px; height: 6px; border-left: 2.4px solid var(--on); border-bottom: 2.4px solid var(--on); transform: translateY(-1.5px) rotate(-45deg); }
.done .txt { color: var(--mut); text-decoration: line-through; }
.x { flex: none; width: 44px; height: 44px; color: var(--mut); font-size: 1.3rem; line-height: 1; }
.empty { margin: 0; padding: 8px 0; color: var(--mut); font-size: .95rem; }
.add { display: flex; gap: 8px; }
.add input { flex: 1; min-width: 0; }
input { width: 100%; min-height: 46px; padding: 0 12px; border-radius: var(--ctl); border: 1px solid var(--line); background: rgba(0, 0, 0, .3); font-size: 16px; }
input::placeholder { color: var(--mut); opacity: .9; }
.btn { min-height: 46px; padding: 0 16px; border-radius: var(--ctl); background: var(--pri); color: var(--on); font-weight: 700; white-space: nowrap; }
.btn.ghost { background: none; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.btn.sm { min-height: 44px; padding: 0 12px; font-size: .92rem; }
.btn:active { transform: scale(.98); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btns .btn { flex: 1; }
.err { margin: 0; color: var(--danger); font-size: .92rem; }
.rules { margin: 0; padding: 9px 12px; color: var(--ink); font-size: .86rem; text-align: center; background: var(--panel); border-radius: var(--ctl); }

/* his task hero */
.hero { position: relative; height: min(58vh, 470px); margin: -8px -16px -64px; overflow: hidden; pointer-events: none; }
.hero img { position: absolute; right: -44px; bottom: 0; height: 100%; max-width: none; filter: drop-shadow(-8px 0 22px rgba(90, 80, 255, .45)); }
.leo .hero img { filter: drop-shadow(-6px 0 18px rgba(220, 20, 50, .5)); }
.hero.small { height: min(42vh, 340px); margin: -14px -16px -48px; }
.bubble { position: absolute; left: 16px; top: 16px; width: 150px; padding: 11px 12px; background: rgba(9, 8, 32, .9); border: 1px solid var(--pri); font: 600 1.14rem/1.24 var(--body); color: var(--ink); z-index: 1; }
.bubble::after { content: ""; position: absolute; right: -10px; top: 26px; border: 6px solid transparent; border-left: 9px solid var(--pri); border-right: 0; }
.solid { position: relative; background: #0B0A26; }
.her .solid { background: var(--panel); }
.leo .score, .leo .panel { position: relative; }

/* shop */
.reward { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 7px 0; border-top: 1px solid var(--line); }
.reward:first-of-type { border-top: 0; }
.reward > div { min-width: 0; overflow-wrap: anywhere; }
.meta { display: block; color: var(--mut); font-size: .85rem; }
.deal { display: flex; flex-direction: column; gap: 9px; padding: 11px 0; border-top: 1px solid var(--line); }
.deal:first-of-type { border-top: 0; }
.counter { display: flex; gap: 8px; }
.counter input:first-child { flex: 0 0 84px; }
.link { color: var(--mut); text-decoration: underline; min-height: 44px; padding: 0 6px; font-size: .9rem; }
.foot { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* repeat, carry, log */
.when { display: block; color: var(--mut); font-size: .8rem; }
.when:empty { display: none; }
.days { display: flex; gap: 5px; }
.day { flex: 1; min-width: 0; position: relative; }
.day input { position: absolute; opacity: 0; width: 1px; min-height: 0; height: 1px; padding: 0; }
.day span { display: grid; place-items: center; min-height: 40px; border: 1px solid var(--line); border-radius: var(--ctl); font-size: .85rem; font-weight: 600; color: var(--mut); }
.day input:checked + span { background: var(--pri); color: var(--on); border-color: var(--pri); }
.day input:focus-visible + span { outline: 2px solid var(--pri); outline-offset: 2px; }
.lbl { margin: 0; font-size: .86rem; font-weight: 600; color: var(--mut); }

/* nav */
nav { position: fixed; z-index: 3; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 480px); display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.him nav { background: #0B0A26; }
.leo nav { background: #120406; }
nav button { min-height: 52px; color: var(--mut); font-weight: 600; border-radius: var(--ctl); position: relative; }
nav button[aria-current="page"] { color: var(--pri); font-weight: 700; }
.pip { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: var(--pri); color: var(--on); font-size: .72rem; line-height: 18px; font-weight: 700; }
.toast { position: fixed; z-index: 4; left: 50%; bottom: calc(82px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100vw - 32px); background: var(--pri); color: var(--on); padding: 9px 14px; border-radius: var(--ctl); font-weight: 700; font-size: .92rem; }
@media (prefers-reduced-motion: reduce) { .box, .btn { transition: none; } }

/* login composition: keep the leopard and the car visible */
.login .login-logo { width: min(74%, 300px); margin-bottom: auto; }
.him.login #bg { bottom: 31vh; background-position: center bottom; -webkit-mask-image: linear-gradient(#000 88%, transparent); mask-image: linear-gradient(#000 88%, transparent); }
.login form { gap: 8px; padding: 12px 14px; }

/* clean pass: no glows, one flat surface per screen */
.hero img, .leo .hero img { filter: none; }
.brand img, .login .login-logo { filter: none; }
.leo .brand img, .leo .login-logo { filter: brightness(1.5) saturate(1.1); }
.stars svg.on { filter: none; }
.panel, nav { -webkit-backdrop-filter: none; backdrop-filter: none; }
.leo .panel, .leo nav, .leo.login form { background: #100305; }
.him .panel, .him nav, .him.login form { background: #0B0A26; }
.leo #bg::after { content: ""; position: absolute; inset: 0; background: rgba(8, 2, 3, .62); }
.leo.login #bg::after { background: rgba(8, 2, 3, .22); }
.hero.small { height: min(46vh, 380px); margin: -14px -16px -30px; }
.hero.small img { right: 50%; transform: translateX(50%); }
.panel { gap: 10px; }
.stars svg { width: 38px; height: 38px; }
.center { text-align: center; }
.him.login #bg::after { content: ""; position: absolute; inset: 0 0 auto; height: 34%; background: linear-gradient(rgba(7, 7, 28, .82), transparent); }

/* character */
.stage { height: min(56vh, 460px); margin: -6px -16px 0; display: flex; justify-content: center; pointer-events: none; }
.stage img { height: 100%; max-width: none; }
.hero { height: min(66vh, 560px); margin: -8px -16px 8px; }
.hero img { right: 14px; }
.mood-row { display: flex; align-items: center; gap: 12px; }
.mood-row .score { flex: 1; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.mood { flex: none; width: 76px; height: 76px; object-fit: cover; object-position: 50% 18%; border-radius: 50%; background: #2A0A10; border: 1px solid var(--line); }
.him .mood { background: #17163E; }

/* big screens: the app stays phone-shaped, so pictures are never stretched */
.leo .brand img, .leo .login-logo { filter: none; }
@media (min-width: 520px) {
  body, body.leo, body.him { background: #050203; }
  #bg { left: 50%; right: auto; width: 480px; transform: translateX(-50%); }
  #app { background: linear-gradient(transparent, transparent); }
  .him #app { box-shadow: 0 0 0 1px rgba(245, 168, 60, .18); }
  .leo #app { box-shadow: 0 0 0 1px rgba(212, 170, 92, .18); }
}

/* titles: real text so they stay sharp and readable */
.brand, .login-title { margin: 0; font-weight: 400; line-height: 1.05; }
.leo .brand, .leo .login-title { font-family: "Playfair Display", Georgia, serif; font-style: italic; font-weight: 700; color: #F6DFAE; }
.him .brand, .him .login-title { font-family: "Limelight", Georgia, serif; color: #F7BC52; }
.brand { font-size: clamp(1.75rem, 8vw, 2.2rem); }
.login-title { font-size: clamp(2.9rem, 14vw, 3.7rem); text-align: center; margin-bottom: auto; padding-top: 14px; }
.him .login-title { font-size: clamp(2.5rem, 12vw, 3.2rem); }

.him .brand, .him .login-title { font-family: "Cinzel", Georgia, serif; font-weight: 700; color: #F7BC52; text-transform: uppercase; letter-spacing: .04em; }
.him .brand { font-size: clamp(1.25rem, 6vw, 1.6rem); }
.him .login-title { font-size: clamp(2rem, 9.6vw, 2.5rem); text-shadow: 0 2px 10px rgba(0, 0, 0, .8); }

/* softer pass: fewer lines, rounder shapes, her full pose */
:root, .him, body.leo { --radius: 22px; --ctl: 14px; }
.panel { border: 0; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); padding: 16px; }
.leo .panel, .leo.login form { background: linear-gradient(165deg, rgba(58, 12, 24, .94), rgba(18, 4, 8, .94)); }
.him .panel, .him.login form { background: linear-gradient(165deg, rgba(27, 26, 78, .94), rgba(10, 9, 36, .94)); }
.login form { border: 0; }
.bank, .him .bank, .leo .bank { border: 0; border-radius: 99px; background: rgba(0, 0, 0, .5); font-weight: 600; }
.box, .him .box, .leo .box { border-radius: 50%; }
input { border: 0; background: rgba(255, 255, 255, .08); border-radius: var(--ctl); }
.btn { border-radius: 99px; }
.day span { border: 0; border-radius: 50%; aspect-ratio: 1; min-height: 0; background: rgba(255, 255, 255, .07); }
.days { gap: 6px; }
.bubble { border: 0; border-radius: 18px 18px 18px 4px; background: rgba(9, 8, 32, .92); }
.bubble::after { display: none; }
nav, .him nav, .leo nav { border-top: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, .45); }
.reward, .deal { border-top: 1px solid rgba(255, 255, 255, .07); }
.mood { width: 92px; height: 104px; object-fit: contain; object-position: center bottom; border: 0; border-radius: 0; background: none; margin: -24px 0 -6px -4px; -webkit-mask-image: linear-gradient(#000 84%, transparent); mask-image: linear-gradient(#000 84%, transparent); }
.him .mood { background: none; }
.panel:first-of-type { overflow: visible; }

/* shop */
.leo { --aw1: #6E1426; --aw2: #2A0A14; --tile1: #5C1428; --tile2: #24070F; --plate: rgba(226, 188, 110, .13); }
.him { --aw1: #2A2670; --aw2: #0F0E36; --tile1: #23225F; --tile2: #0C0B2C; --plate: rgba(245, 168, 60, .12); }
.awning { position: absolute; top: 0; left: 0; right: 0; height: 74px; background: repeating-linear-gradient(90deg, var(--aw1) 0 40px, var(--aw2) 40px 80px); -webkit-mask: linear-gradient(#000 0 56px) top / 100% 56px no-repeat, radial-gradient(circle 20px at 20px 56px, #000 98%, transparent) 0 0 / 40px 76px repeat-x; mask: linear-gradient(#000 0 56px) top / 100% 56px no-repeat, radial-gradient(circle 20px at 20px 56px, #000 98%, transparent) 0 0 / 40px 76px repeat-x; }
.shop-top { position: relative; }
.shop-top .brand { text-align: center; }
.back { flex: none; width: 44px; height: 44px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: var(--pri); font-size: 1.9rem; line-height: 1; padding-bottom: 5px; }
.banner { margin: 14px 0 0; text-align: center; padding: 8px 12px; border-radius: 99px; background: linear-gradient(90deg, var(--aw2), var(--aw1), var(--aw2)); font-size: .92rem; font-weight: 500; }
#cd { color: var(--pri); font-variant-numeric: tabular-nums; font-weight: 600; }
.notice { display: block; width: 100%; min-height: 44px; border-radius: 99px; background: var(--pri); color: var(--on); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px 0; min-width: 0; border-radius: 16px; overflow: hidden; color: var(--ink); background: linear-gradient(170deg, var(--tile1), var(--tile2)); box-shadow: 0 8px 20px rgba(0, 0, 0, .4); }
.tile:active { transform: scale(.97); }
.art { display: block; width: 100%; aspect-ratio: 1; border-radius: 12px; background: var(--plate); overflow: hidden; }
.art img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.name { font-size: .8rem; font-weight: 600; line-height: 1.15; min-height: 2.3em; display: grid; place-items: center; text-align: center; overflow-wrap: anywhere; }
.left { font-size: .74rem; color: var(--mut); }
.price { display: flex; align-items: center; justify-content: center; gap: 4px; align-self: stretch; margin: 4px -6px 0; padding: 6px 0; background: rgba(0, 0, 0, .34); color: var(--pri); font-weight: 700; font-variant-numeric: tabular-nums; }
.price svg { width: 15px; height: 15px; fill: var(--star); }
.tile.add { justify-content: center; gap: 6px; padding-bottom: 8px; background: rgba(0, 0, 0, .42); box-shadow: inset 0 0 0 1.5px var(--line); }
.plus { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--pri); color: var(--on); font-size: 1.7rem; line-height: 1; }
.scrim { position: fixed; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .62); }
.sheet { width: min(100%, 480px); max-height: 86vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 20px 18px calc(16px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: linear-gradient(170deg, var(--tile1), var(--tile2)); }
.sheet h2 { text-align: center; }
.sheet .link { align-self: center; }
.sheet-art { display: block; height: 170px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* comic speech bubble */
.bubble { left: 12px; top: 18px; width: 172px; padding: 20px 14px 18px; background: #FFF; color: #14101A; border: 3px solid #14101A; border-radius: 50% / 46%; box-shadow: 4px 5px 0 #14101A; font: 400 1.5rem/1.05 "Bangers", "Comic Sans MS", sans-serif; letter-spacing: .04em; text-align: center; text-transform: uppercase; transform: rotate(-4deg); z-index: 2; }
.bubble::before, .bubble::after { content: ""; display: block; position: absolute; border: 0; }
.bubble::before { right: -21px; bottom: -2px; width: 46px; height: 42px; background: #14101A; clip-path: polygon(0 0, 100% 100%, 32% 62%); }
.bubble::after { right: -11px; top: auto; bottom: 7px; width: 34px; height: 30px; background: #FFF; clip-path: polygon(0 0, 100% 100%, 30% 62%); }

/* motion */
:root { --tx: 0; --ease: cubic-bezier(.2, .9, .25, 1); --spring: cubic-bezier(.3, 1.6, .5, 1); }
@media (min-width: 520px) { :root { --tx: -50%; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes step { from { opacity: 0; transform: translateX(26px) scale(.98); } }
@keyframes bubble { 0% { opacity: 0; transform: rotate(-14deg) scale(.3); } 70% { opacity: 1; transform: rotate(-1deg) scale(1.08); } 100% { transform: rotate(-4deg) scale(1); } }
@keyframes float { 50% { transform: translateY(-5px); } }
@keyframes drift { to { transform: translateX(var(--tx)) scale(1.05); } }
@keyframes pop { 0% { transform: scale(.3) rotate(-30deg); } 60% { transform: scale(1.4) rotate(8deg); } 100% { transform: scale(1); } }
@keyframes tick { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 14px); } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fly { 0% { opacity: 1; transform: translate(0, 0) scale(.2) rotate(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(var(--s)) rotate(var(--r)); } }
.enter .top, .enter .banner, .enter .notice { animation: fade .4s ease both; }
.enter .panel, .enter .rules { animation: rise .5s var(--ease) both; }
.enter .panel:nth-of-type(2) { animation-delay: .08s; }
.enter .panel:nth-of-type(3) { animation-delay: .16s; }
.enter .stage, .enter .hero { animation: fade .6s ease both; }
.enter .stage img { animation: step .6s var(--ease) both; }
.enter .tile { animation: rise .45s var(--ease) both; animation-delay: calc(var(--n, 0) * 45ms); }
.tile:nth-child(2) { --n: 1; } .tile:nth-child(3) { --n: 2; } .tile:nth-child(4) { --n: 3; } .tile:nth-child(5) { --n: 4; } .tile:nth-child(6) { --n: 5; } .tile:nth-child(n+7) { --n: 6; }
.enter .bubble { animation: bubble .55s var(--ease) .25s both; }
.hero img { animation: float 6s ease-in-out infinite; }
.login #bg { animation: drift 16s ease-in-out infinite alternate; transform: translateX(var(--tx)); }
.login form, .login .link { animation: rise .6s var(--ease) .1s both; }
.login-title { animation: fade .9s ease both; }
.stars svg.pop { animation: pop .5s var(--spring) both; animation-delay: calc((var(--i) - 1) * 70ms); }
.just .box { animation: tick .35s var(--spring); }
.tile, .btn, .back, .notice, nav button { transition: transform .16s var(--ease), box-shadow .2s ease, filter .2s ease; }
.tile:active, .btn:active, .back:active, .notice:active { transform: scale(.95); }
@media (hover: hover) { .tile:hover { transform: translateY(-3px); filter: brightness(1.12); } .btn:hover { filter: brightness(1.08); } }
nav button::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 22px; height: 3px; margin-left: -11px; border-radius: 3px; background: var(--pri); transform: scaleX(0); transition: transform .3s var(--spring); }
nav button[aria-current="page"]::after { transform: scaleX(1); }
.toast { animation: toast .3s var(--ease); }
.scrim.new { animation: fade .22s ease both; }
.scrim.new .sheet { animation: up .38s var(--ease) both; }
.burst { position: fixed; z-index: 9; left: 50%; top: 42%; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; animation: fly 1.05s cubic-bezier(.15, .7, .3, 1) both; }
.burst svg { width: 100%; height: 100%; fill: var(--star); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* his side: black, oxblood, gold, tailored */
.him { --ink: #EFE7D6; --mut: #A99C86; --pri: #C9A24B; --on: #120C04; --star: #D9B25A; --off: rgba(201, 162, 75, .2); --line: rgba(201, 162, 75, .34); --page: #08070A; --radius: 4px; --ctl: 3px; --aw1: #16130F; --aw2: #0A0908; --tile1: #1A1712; --tile2: #0B0A08; --plate: #050504; --danger: #E8A08C; }
.him #bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(8, 7, 10, .3), rgba(8, 7, 10, .55)); }
.him.login #bg::after { height: 100%; background: linear-gradient(rgba(8, 7, 10, .6), transparent 30%); }
.him .panel, .him.login form { background: linear-gradient(180deg, rgba(20, 17, 13, .96), rgba(9, 8, 7, .97)); border: 0; border-top: 2px solid var(--pri); box-shadow: 0 12px 30px rgba(0, 0, 0, .6); }
.him nav { background: #0B0A08; border-top: 1px solid var(--line); border-radius: 0; }
.him .btn { border-radius: 2px; text-transform: uppercase; letter-spacing: .08em; font-size: .86rem; font-weight: 600; }
.him h2 { font-family: "Cinzel", Georgia, serif; font-weight: 700; letter-spacing: .05em; font-size: 1rem; text-transform: uppercase; color: var(--pri); }
.him input { background: #050504; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--line); }
.him .box { border-radius: 2px; }
.him .day span { border-radius: 2px; background: #050504; box-shadow: inset 0 0 0 1px rgba(201, 162, 75, .2); aspect-ratio: auto; min-height: 40px; }
.him .bank { border-radius: 2px; background: #0B0A08; box-shadow: inset 0 0 0 1px var(--line); }
.him .back { border-radius: 2px; background: #0B0A08; }
.him .awning { height: 56px; background: repeating-linear-gradient(90deg, #14110D 0 7px, #1E1A14 7px 8px); -webkit-mask: none; mask: none; border-bottom: 2px solid var(--pri); }
.him .banner { border-radius: 2px; background: #0B0A08; box-shadow: inset 0 0 0 1px var(--line); letter-spacing: .03em; }
.him .notice { border-radius: 2px; text-transform: uppercase; letter-spacing: .06em; font-size: .86rem; }
.him .tile { border-radius: 3px; border-top: 2px solid var(--pri); }
.him .art { border-radius: 2px; }
.him .tile.add { border-top: 0; }
.him .plus { border-radius: 2px; }
.him .sheet { border-radius: 4px 4px 0 0; border-top: 2px solid var(--pri); }
.him nav button { letter-spacing: .04em; font-size: .92rem; }
.him .brand { color: var(--pri); }
.him .login-title { color: #D9B25A; }
.score h2 { margin-bottom: 8px; }
.art img { object-fit: contain; object-position: center; padding: 8%; }
.sheet-art { height: 150px; }

.boss { flex: none; width: 76px; height: 76px; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 2px var(--pri); }
.him .mood-row { gap: 14px; }

/* his header stays readable over every picture */
.him:not(.login) #bg::after { background: linear-gradient(rgba(8, 7, 10, .9), rgba(8, 7, 10, .45) 24%, rgba(8, 7, 10, .55)); }
.him .awning { background: #0B0A08; height: 62px; }
.him .brand { text-shadow: 0 2px 6px rgba(0, 0, 0, .9); }
.boss { object-position: 40% 30%; }

/* themes and the no-theme star */
@keyframes star-spin { to { transform: rotateY(360deg); } }
@keyframes star-float { 50% { transform: translateY(-7%); } }
.spin-star { display: grid; place-items: center; width: 100%; height: 100%; perspective: 300px; animation: star-float 2.6s ease-in-out infinite; }
.spin-star svg { width: 62%; height: 62%; fill: #FFD65A; filter: drop-shadow(0 0 8px rgba(255, 214, 90, .95)); animation: star-spin 3.4s linear infinite; }
.sheet-art { display: block; width: 170px; height: 170px; margin: 0 auto; }
.sheet-art img { width: 100%; height: 100%; object-fit: contain; }
.themes { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; }
.chip span { display: block; padding: 8px 12px; border-radius: 99px; background: rgba(255, 255, 255, .08); font-size: .86rem; font-weight: 600; color: var(--mut); }
.him .chip span { border-radius: 2px; }
.chip input:checked + span { background: var(--pri); color: var(--on); }
.chip input:focus-visible + span { outline: 2px solid var(--pri); outline-offset: 2px; }
.him .mood { width: 92px; }
.him .mood { width: 88px; height: 92px; object-fit: cover; object-position: 50% 0; margin: -18px 0 -4px -2px; }

/* calendar */
nav { grid-template-columns: repeat(4, 1fr); padding-inline: 6px; }
nav button, .him nav button { font-size: .84rem; letter-spacing: 0; padding: 0 2px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-head h2 { flex: 1; text-align: center; }
.cgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cgrid.week span { font-size: .78rem; font-weight: 600; color: var(--mut); }
.cday { position: relative; aspect-ratio: 1; min-height: 40px; border-radius: 50%; font-weight: 600; font-variant-numeric: tabular-nums; }
.him .cday { border-radius: 3px; }
.cday.now { box-shadow: inset 0 0 0 1.5px var(--pri); }
.cday.sel { background: var(--pri); color: var(--on); }
.cday i { position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--pri); }
.cday.sel i { background: var(--on); }
.ev-time { flex: none; width: 76px; color: var(--pri); font-weight: 600; font-size: .9rem; font-variant-numeric: tabular-nums; }
input[type=date], input[type=time] { color-scheme: dark; min-width: 0; }

/* calendar, iPhone-safe form */
.cday { min-height: 38px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--mut); min-width: 0; }
.field input, .field select { color: var(--ink); font-weight: 500; }
input[type=date] { -webkit-appearance: none; appearance: none; display: block; width: 100%; max-width: 100%; min-height: 48px; line-height: 48px; padding: 0 14px; text-align: left; box-sizing: border-box; }
input[type=date]::-webkit-date-and-time-value { text-align: left; }
.pick { display: flex; align-items: center; gap: 8px; }
.pick b { color: var(--pri); font-size: 1.2rem; }
select { flex: 1; min-width: 0; min-height: 48px; padding: 0 12px; border: 0; border-radius: var(--ctl); background: rgba(255, 255, 255, .08); color: var(--ink); font: inherit; font-size: 16px; -webkit-appearance: none; appearance: none; text-align: center; text-align-last: center; }
.him select { background: #050504; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--line); }
select option { color: #111; }
.ev-time { width: 82px; line-height: 1.25; }
.ev-time b { display: block; font-size: .78rem; color: var(--mut); font-weight: 600; }
.tx { margin: 0; font-size: .8rem; }

/* five tabs, plan types, notes */
nav { grid-template-columns: repeat(5, 1fr); padding-inline: 2px; }
nav button, .him nav button { font-size: .78rem; }
.pip { min-width: 15px; padding: 0 3px; line-height: 15px; font-size: .64rem; margin-left: 2px; }
.tag { font-style: normal; font-weight: 700; padding: 1px 7px; border-radius: 99px; font-size: .72rem; }
.t-work { background: #2B3F6B; color: #CFE0FF; } .t-family { background: #2F5A46; color: #CFF2DF; } .t-date { background: #8A1530; color: #FFD9E2; } .t-fun { background: #7A5A16; color: #FFE9B0; } .t-other { background: rgba(255, 255, 255, .14); color: var(--ink); }
.share { flex: none; min-height: 34px; padding: 0 10px; border-radius: 99px; font-size: .76rem; font-weight: 600; color: var(--mut); background: rgba(255, 255, 255, .08); }
.him .share { border-radius: 2px; }
.share.on { background: var(--pri); color: var(--on); }

/* full-bleed reward art */
.art img { object-fit: cover; padding: 0; }
.sheet-art img { border-radius: 14px; object-fit: cover; }

/* your framed icons */
.art:has(img) { background: none; border-radius: 0; }
.art img { object-fit: contain; }
.sheet-art img { object-fit: contain; border-radius: 0; }

/* shop: redeem on the left, add on the right */
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 99px; background: rgba(0, 0, 0, .55); }
.seg button { min-height: 42px; border-radius: 99px; font-weight: 700; color: var(--mut); transition: background .2s ease, color .2s ease; }
.seg button[aria-selected="true"] { background: var(--pri); color: var(--on); }
.him .seg, .him .seg button { border-radius: 2px; }
.him .seg { background: #0B0A08; box-shadow: inset 0 0 0 1px var(--line); }
.him .seg button { text-transform: uppercase; letter-spacing: .08em; font-size: .84rem; }
.shelf { margin: 4px 2px -4px; color: var(--ink); }
.note-card { margin: 0; padding: 18px 14px; text-align: center; border-radius: var(--radius); background: rgba(0, 0, 0, .55); color: var(--mut); }

.streak { margin: 0; padding: 7px 12px; text-align: center; font-size: .84rem; font-weight: 600; color: var(--pri); background: rgba(0, 0, 0, .28); border-radius: var(--ctl); }

/* star rules and daily tracker */
.info { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .5); }
.him .info { border-radius: 2px; background: #0B0A08; box-shadow: inset 0 0 0 1px var(--line); }
.info svg { width: 20px; height: 20px; fill: none; stroke: var(--pri); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.meter { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; border-radius: var(--radius); background: rgba(0, 0, 0, .55); }
.meter-top { display: flex; align-items: baseline; gap: 8px; font-size: .84rem; color: var(--mut); }
.meter-top b { font-size: 1.3rem; color: var(--pri); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .12); }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--pri); transition: width .45s var(--ease); }
.him .bar, .him .bar i { border-radius: 1px; }
.stage { height: min(50vh, 410px); }
.rule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rule-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: var(--ctl); background: rgba(0, 0, 0, .3); }
.rule-list span { color: var(--pri); font-weight: 700; }
.plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; color: var(--mut); }

/* owed */
.seg { grid-template-columns: repeat(3, 1fr); }
.owed-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, .07); }
.owed-row:first-of-type { border-top: 0; }
.owed-row .grow { display: flex; flex-direction: column; gap: 5px; overflow-wrap: anywhere; }
.owed-row .btn { align-self: flex-start; }
.owed-art { flex: none; display: block; width: 62px; height: 62px; }
.owed-art img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* plan ahead */
.date-drop { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--ctl); background: rgba(255, 255, 255, .08); color: var(--ink); font-weight: 600; text-align: left; }
.him .date-drop { background: #050504; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--line); }
.date-drop i { flex: none; width: 9px; height: 9px; margin-top: -4px; border-right: 2px solid var(--pri); border-bottom: 2px solid var(--pri); transform: rotate(45deg); transition: transform .2s ease, margin .2s ease; }
.date-drop[aria-expanded="true"] i { margin-top: 4px; transform: rotate(225deg); }
.two .field { min-width: 0; }
.plan-day { display: flex; flex-direction: column; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .07); }
.plan-day .lbl { display: flex; justify-content: space-between; gap: 10px; color: var(--pri); }
.plan-day .lbl span { flex: none; font-weight: 500; color: var(--mut); }
.plan-row { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.ptxt { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* clarity pass */
.panel .meter { padding: 0; background: none; border-radius: 0; }
.meter-top em { margin-left: auto; font-style: normal; font-size: .8rem; font-variant-numeric: tabular-nums; }
.stage { height: min(52vh, 430px); margin: 4px -16px 0; }
.hero { height: min(44vh, 370px); margin: -8px -16px 6px; }
.hero img { top: 0; bottom: auto; right: 6px; height: 170%; -webkit-mask-image: linear-gradient(#000 52%, transparent 60%); mask-image: linear-gradient(#000 52%, transparent 60%); }
.him .awning { display: none; }
.shop-top .brand { text-align: left; }
.her .shop-top .brand { text-shadow: 0 2px 8px rgba(0, 0, 0, .85); }
.banner { margin: 0; padding: 0 6px; background: none; border-radius: 0; font-size: .9rem; color: var(--ink); text-align: center; text-shadow: 0 1px 6px rgba(0, 0, 0, .9); }
.him .banner { background: none; box-shadow: none; letter-spacing: 0; }
.seg { margin-top: 2px; }

/* to-do list */
.plan-day .list { margin-top: 2px; }
.share-all { width: 100%; background: rgba(0, 0, 0, .55); }

/* six-tab nav with icons */
nav { grid-template-columns: repeat(6, 1fr); padding-inline: 2px; }
nav button, .him nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; padding: 0; font-size: .68rem; letter-spacing: 0; line-height: 1.1; }
nav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
nav button::after { bottom: 1px; }
nav .pip { position: absolute; top: 3px; left: 50%; margin-left: 6px; }
/* jail */
.cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px 12px; text-align: center; border-radius: var(--radius); background: rgba(0, 0, 0, .55); box-shadow: inset 0 0 0 1px var(--line); }
.cell.in { box-shadow: inset 0 0 0 1.5px #C5283D; }
.cell img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.cell .state { font-size: .84rem; font-weight: 700; color: var(--pri); }
.cell.in .state { color: #FF7A7A; }
.cell small { font-size: .76rem; color: var(--mut); }
.gauge { display: flex; flex-direction: column; gap: 5px; }
.gauge-top { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.gauge-top b { color: var(--pri); }
.jail-bar { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 14px; text-align: left; color: #FFF; border-radius: var(--radius); background: linear-gradient(90deg, #7A0F1E, #3A0A12); }
.jail-bar span { font-size: .86rem; }
.stage img.jail-gif { height: 100%; max-width: 100%; object-fit: contain; }
/* good stars */
.good { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; font-size: .88rem; font-weight: 600; color: var(--mut); }
.good.on { color: var(--pri); }
.good svg { width: 18px; height: 18px; fill: var(--star); }
.tiny { margin-top: -4px; font-size: .78rem; }
.pop-cut { display: block; height: 190px; max-width: 100%; margin: 0 auto; object-fit: contain; }
.pop-line { margin: 0; text-align: center; font-size: 1.1rem; font-weight: 600; }
/* star bank */
button.bank { color: var(--ink); }
.strip { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 44px; padding: 0 14px; border-radius: var(--radius); background: rgba(0, 0, 0, .55); color: var(--ink); font-size: .92rem; font-weight: 600; }
.strip span { display: inline-flex; align-items: center; gap: 4px; }
.strip svg { width: 16px; height: 16px; fill: var(--star); }
.strip i { flex: none; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--pri); border-top: 2px solid var(--pri); transform: rotate(45deg); }
.duel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duel div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: var(--ctl); background: rgba(0, 0, 0, .34); }
.duel small { color: var(--mut); font-size: .84rem; }
.duel strong { display: flex; align-items: center; gap: 6px; font-size: 1.6rem; color: var(--pri); font-variant-numeric: tabular-nums; }
.duel svg { width: 22px; height: 22px; fill: var(--star); }
.rule-list li.total { background: var(--pri); color: var(--on); }
.rule-list li.total span { color: var(--on); }

/* app shell: the page never moves, only #app scrolls, so the bottom bar stays put */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; display: flex; flex-direction: column; min-height: 0; }
#app { flex: 1 1 auto; width: 100%; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 20px; }
#app > * { flex-shrink: 0; }
#navbar { position: relative; z-index: 3; flex: none; display: flex; justify-content: center; }
nav { position: static; left: auto; bottom: auto; transform: none; width: min(100%, 480px); }
.login #app { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
/* header clock */
.head-l { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#clock { font-size: .76rem; color: var(--mut); font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px rgba(0, 0, 0, .9); white-space: nowrap; }
.info svg path { stroke-linejoin: round; }
/* my day swipe */
.seg.two { grid-template-columns: 1fr 1fr; }
.swipe { display: flex; align-items: flex-start; margin: -22px -16px 0; padding-top: 22px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.swipe::-webkit-scrollbar { display: none; }
.page { flex: 0 0 100%; min-width: 0; padding-inline: 16px; display: flex; flex-direction: column; gap: 14px; scroll-snap-align: start; scroll-snap-stop: always; }
.page .stage { margin: 0; }
select { color: var(--ink); }
textarea { width: 100%; padding: 10px 12px; border: 0; border-radius: var(--ctl); background: rgba(255, 255, 255, .08); color: var(--ink); font: inherit; font-size: 16px; resize: none; }
.him textarea { background: #050504; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--line); }
textarea::placeholder { color: var(--mut); }
/* star history */
.hist { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .07); }
.hist:first-of-type { border-top: 0; }
.hist b { flex: none; color: var(--pri); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.hist b.neg { color: #FF7A7A; }
.hist-note { margin: 5px 0 0; padding: 7px 10px; border-radius: var(--ctl); background: rgba(0, 0, 0, .3); font-size: .9rem; overflow-wrap: anywhere; }
/* the envelope */
.env-screen { --paper: #FFF3E6; --env: #8E1230; --env2: #6B0C24; --glow: rgba(255, 90, 140, .75); position: fixed; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 24px; text-align: center; background: radial-gradient(circle at 50% 50%, #4A0A22, #0A0204 72%); animation: fade .35s ease both; }
.him .env-screen { --env: #1A1712; --env2: #0B0A08; --glow: rgba(240, 190, 90, .7); background: radial-gradient(circle at 50% 50%, #2A2010, #050403 72%); }
.env-title { margin: 0; max-width: 300px; font: italic 700 1.5rem/1.25 "Playfair Display", Georgia, serif; color: #FFE3B8; text-shadow: 0 0 14px var(--glow); }
.him .env-title { font: 700 1.2rem/1.3 "Cinzel", Georgia, serif; font-style: normal; color: #F7BC52; text-transform: uppercase; letter-spacing: .03em; }
@keyframes env-float { 50% { transform: translateY(-12px); } }
@keyframes env-glow { 50% { filter: drop-shadow(0 0 30px var(--glow)); } }
.env { position: relative; display: block; width: min(76vw, 300px); aspect-ratio: 3 / 2; margin-top: 10px; perspective: 900px; filter: drop-shadow(0 0 16px var(--glow)); animation: env-float 3.2s ease-in-out infinite, env-glow 2.4s ease-in-out infinite; }
.env span { position: absolute; display: block; }
.env-back { inset: 0; border-radius: 10px; background: var(--env2); }
.env-letter { z-index: 1; left: 6%; right: 6%; bottom: 6%; min-height: 88%; max-height: 230px; overflow: hidden; padding: 12px 14px; border-radius: 8px; background: var(--paper); color: #3A1220; font: 500 1rem/1.35 "Jost", sans-serif; text-align: left; overflow-wrap: anywhere; transition: transform .7s var(--ease) .25s; }
.env-letter small { display: block; margin-bottom: 4px; color: #8E1230; font-weight: 700; font-size: .8rem; }
.env-front { z-index: 2; inset: 0; border-radius: 10px; background: var(--env); clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%); }
.env-flap { z-index: 3; left: 0; right: 0; top: 0; height: 60%; background: var(--env); filter: brightness(1.25); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform .5s ease; }
.env-star { z-index: 4; left: 50%; top: 58%; width: 54px; height: 54px; margin: -27px 0 0 -27px; transition: opacity .25s ease, transform .3s ease; }
.env-star svg { width: 100%; height: 100%; fill: #FFD65A; filter: drop-shadow(0 0 10px #FFD65A); }
.env-hint { margin: 0; color: #FFE3B8; font-weight: 600; }
.env-done { display: none; min-width: 200px; }
.open .env { animation: none; margin-top: 110px; }
.open .env-flap { transform: rotateX(180deg); z-index: 0; }
.open .env-star { opacity: 0; transform: scale(.4); }
.open .env-letter { transform: translateY(-58%); z-index: 1; }
.open .env-hint { display: none; }
.open .env-done { display: block; }

/* slim bottom bar */
nav, .him nav { padding: 2px 2px max(2px, calc(env(safe-area-inset-bottom) - 16px)); border-radius: 14px 14px 0 0; }
nav button, .him nav button { min-height: 42px; gap: 1px; font-size: .64rem; }
nav svg { width: 19px; height: 19px; }
nav button::after { bottom: 0; width: 18px; height: 2px; margin-left: -9px; }
nav .pip { top: 0; }
/* no scroll slider anywhere */
#app, .sheet { scrollbar-width: none; -ms-overflow-style: none; }
#app::-webkit-scrollbar, .sheet::-webkit-scrollbar, .env-letter::-webkit-scrollbar { display: none; width: 0; height: 0; background: transparent; }
@media (max-width: 519px) {
  #app { width: calc(100% + 24px); max-width: none; margin: 0; padding-right: calc(max(16px, env(safe-area-inset-right)) + 24px); }
}

.date-drop.plain { min-height: 30px; padding: 0; background: none; box-shadow: none; }
.him .date-drop.plain { background: none; box-shadow: none; }
@media (max-width: 519px) { .awning { right: 24px; } }

/* shop cards: every card the same height, price band always at the bottom */
.tiles { grid-auto-rows: 1fr; align-items: stretch; }
.tile, .him .tile { height: 100%; padding: 8px 8px 0; justify-content: flex-start; }
.art { flex: none; }
.art:not(:has(img)) { border-radius: 16%; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 2px var(--pri); }
.him .art:not(:has(img)) { border-radius: 16%; }
.name { flex: none; display: -webkit-box; width: 100%; height: 2.35em; min-height: 0; margin-top: 3px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.left { flex: none; line-height: 1.3; }
.price { flex: none; align-self: stretch; margin: auto -8px 0; padding: 7px 0; }
.tile .left + .price { margin-top: auto; }
/* bottom bar, pushed lower */
nav, .him nav { padding: 1px 2px max(0px, calc(env(safe-area-inset-bottom) - 24px)); }
nav button, .him nav button { min-height: 38px; gap: 0; font-size: .6rem; }
nav svg { width: 18px; height: 18px; }

/* audit fixes */
.date-drop.flat, .him .date-drop.flat { min-height: 30px; padding: 0; background: none; box-shadow: none; }
.rule-list li { align-items: center; }
.rule-list span { flex: none; white-space: nowrap; }
.rule-list b { min-width: 0; }
.banner, .him .banner { padding: 7px 12px; border-radius: var(--ctl); background: rgba(0, 0, 0, .58); text-shadow: none; line-height: 1.3; }

/* seven tabs */
nav { grid-template-columns: repeat(7, 1fr); }
nav button, .him nav button { font-size: .58rem; }
nav svg { width: 17px; height: 17px; }
nav .pip { margin-left: 4px; }
/* double cross */
.gem { width: 1em; height: 1em; fill: var(--pri); flex: none; }
.g-intro { text-align: center; }
.g-stake { margin: 0; font-size: .9rem; font-weight: 600; text-align: center; color: var(--ink); overflow-wrap: anywhere; }
.g-stake.top { padding: 7px 12px; border-radius: var(--ctl); background: rgba(0, 0, 0, .58); }
.g-board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.g-side { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.g-side span { font-size: .84rem; color: var(--mut); }
.g-side b { display: flex; align-items: center; gap: 4px; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.g-pot { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 16px; border-radius: var(--radius); background: rgba(0, 0, 0, .4); box-shadow: inset 0 0 0 1px var(--line); }
.g-pot small { font-size: .74rem; color: var(--mut); white-space: nowrap; }
.g-pot strong { display: flex; align-items: center; gap: 6px; font-size: 2rem; line-height: 1.1; color: var(--pri); font-variant-numeric: tabular-nums; }
.g-track { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.g-track i { display: grid; place-items: center; height: 22px; border-radius: var(--ctl); font-style: normal; font-size: .74rem; font-weight: 600; color: var(--mut); background: rgba(255, 255, 255, .07); }
.g-track i.past { opacity: .45; }
.g-track i.now { background: var(--pri); color: var(--on); }
.gcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gcard { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; padding: 12px 4px 10px; border-radius: var(--ctl); color: var(--ink); background: rgba(0, 0, 0, .34); box-shadow: inset 0 0 0 1px var(--line); transition: transform .16s var(--ease), background .16s ease; }
.gcard svg { width: 30px; height: 30px; fill: none; stroke: var(--pri); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.gcard b { font-size: .96rem; }
.gcard small { font-size: .72rem; color: var(--mut); }
.gcard em { font-style: normal; font-size: .74rem; font-weight: 600; color: var(--pri); }
.gcard.sel { background: var(--pri); color: var(--on); transform: translateY(-3px); }
.gcard.sel svg { stroke: var(--on); }
.gcard.sel small, .gcard.sel em { color: var(--on); }
.gcard:disabled { opacity: .35; }
.gcard.small { width: 104px; margin: 0 auto; transform: none; }
.g-wait { align-items: center; text-align: center; }
.gline { padding: 8px 12px; border-radius: 99px; background: rgba(255, 255, 255, .08); color: var(--mut); font-size: .84rem; font-weight: 600; }
.him .gline { border-radius: 2px; }
.gline.on { background: var(--pri); color: var(--on); }
.g-left { display: flex; justify-content: space-between; gap: 8px; }
.g-left span { display: inline-flex; align-items: center; gap: 5px; font-size: .88rem; }
.g-left svg { width: 16px; height: 16px; fill: none; stroke: var(--pri); stroke-width: 1.7; stroke-linejoin: round; }
.g-left b { color: var(--pri); }
.g-over { align-items: center; text-align: center; }
.g-over small { color: var(--mut); }
.g-over h2 { font-size: 1.6rem; color: var(--pri); }
.g-final { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.g-final div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px; border-radius: var(--ctl); background: rgba(0, 0, 0, .34); }
.g-final span { font-size: .84rem; color: var(--mut); }
.g-final b { display: flex; align-items: center; gap: 5px; font-size: 1.5rem; }
/* reveal */
@keyframes flip { from { transform: rotateY(0); } }
@keyframes r-in { from { opacity: 0; transform: translateY(10px); } }
.reveal { position: fixed; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px max(20px, env(safe-area-inset-right)); text-align: center; background: rgba(6, 3, 5, .96); animation: fade .25s ease both; }
.r-top { margin: 0; color: var(--mut); font-weight: 600; }
.flips { display: grid; grid-template-columns: repeat(2, minmax(0, 150px)); gap: 16px; width: 100%; justify-content: center; }
.flip { display: flex; flex-direction: column; gap: 8px; perspective: 800px; }
.flip small { color: var(--mut); font-size: .9rem; }
.fc { position: relative; aspect-ratio: 3 / 4; transform-style: preserve-3d; transform: rotateY(180deg); animation: flip .7s var(--ease) .5s both; }
.flip:nth-child(2) .fc { animation-delay: .85s; }
.face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: inset 0 0 0 2px var(--pri); }
.him .face { border-radius: 4px; }
.face.front { background: rgba(255, 255, 255, .06); font-size: 2.6rem; }
.face.rear { transform: rotateY(180deg); background: var(--pri); color: var(--on); }
.face.rear svg { width: 54px; height: 54px; fill: none; stroke: var(--on); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.face.rear b { font-size: 1.2rem; }
.r-out { display: flex; flex-direction: column; gap: 4px; animation: r-in .4s ease 1.5s both; }
.r-out h2 { font-size: 1.5rem; color: var(--pri); }
.r-out p { margin: 0; color: var(--ink); }
.r-next { min-width: 200px; animation: r-in .4s ease 1.7s both; }
.flips { grid-template-columns: repeat(2, min(40vw, 150px)); }
.fc { width: 100%; }

/* diamond duel */
.g-earned { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; font-weight: 700; color: var(--pri); }
.g-earned svg { width: 18px; height: 18px; fill: var(--star); }
.gcard { padding-block: 14px 10px; }
.hist b { white-space: nowrap; }

/* public version: sign-up, pairing, and account */
.login .auth-card { display: flex; flex-direction: column; gap: 10px; background: var(--panel); padding: 16px; border-radius: var(--radius); }
.leo.login .auth-card { background: linear-gradient(165deg, rgba(58, 12, 24, .94), rgba(18, 4, 8, .94)); }
.him.login .auth-card { background: linear-gradient(165deg, rgba(27, 26, 78, .94), rgba(10, 9, 36, .94)); }
.auth-h { margin: 0; font-size: 1.15rem; }
.auth-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.login label.check { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--pri); }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side { display: flex; flex-direction: column; gap: 4px; min-height: 92px; justify-content: center; padding: 12px; text-align: center; border-radius: var(--ctl); box-shadow: inset 0 0 0 1px var(--line); }
.side b { font-size: 1.05rem; }
.side small { color: var(--mut); line-height: 1.25; }
.side.sel { box-shadow: inset 0 0 0 2px var(--pri); }
.code { margin: 4px 0; text-align: center; font-size: clamp(1.7rem, 9vw, 2.2rem); font-weight: 700; letter-spacing: .12em; color: var(--pri); user-select: all; }
.btn[disabled] { opacity: .6; }
.btn.danger { color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.btn.danger-fill { background: var(--danger); color: #2A0508; }

/* character picker */
.lk-stage { position: sticky; top: -20px; z-index: 1; display: flex; align-items: flex-end; justify-content: center; gap: 8px; height: min(30vh, 230px); margin: -4px -18px 0; padding: 6px 18px 8px; background: var(--tile1); box-shadow: 0 10px 14px -10px rgba(0, 0, 0, .7); }
.lk-stage img { min-width: 0; height: 100%; object-fit: contain; object-position: center bottom; transition: opacity .15s; }
#lk-face { flex: 1.4; } #lk-stand { flex: 1; }
.lk-row { display: flex; flex-direction: column; gap: 8px; }
.lk-name { display: flex; justify-content: space-between; gap: 12px; margin: 0; font-weight: 600; }
.lk-name span { color: var(--mut); font-weight: 500; }
.lk-opts { display: flex; flex-wrap: wrap; gap: 10px; }
.lk-dot { width: 44px; height: 44px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }
.lk-dot.sel { box-shadow: 0 0 0 2px var(--tile2), 0 0 0 4px var(--pri); }
.lk-chip { flex: 1 1 calc(50% - 5px); display: flex; flex-direction: column; justify-content: center; min-height: 48px; padding: 6px 10px; text-align: center; font-weight: 600; color: var(--ink); border-radius: var(--ctl); box-shadow: inset 0 0 0 1px var(--line); }
.lk-row:last-of-type .lk-chip { flex-basis: calc(33% - 7px); }
.lk-chip small { color: var(--mut); font-weight: 500; font-size: .75rem; }
.lk-chip.sel { box-shadow: inset 0 0 0 2px var(--pri); }
.lk-chip[disabled] { opacity: .55; }
