/* Guinea Pig Simulator — UI styles */
:root {
  --cream: #fcf7ee;
  --cream-2: #f6eddd;
  --line: #e7d8bf;
  --ink: #4a3526;
  --ink-soft: #7d6651;
  --wood-1: #e2ad70;
  --wood-2: #c48a4f;
  --wood-3: #9d6533;
  --blue: #3a78c9;
  --blue-d: #255aa3;
  --green: #5daa57;
  --red: #e0493f;
  --gold: #f5c03a;
  --shadow: 0 0.35rem 1.1rem rgba(84, 52, 22, 0.2), 0 0.1rem 0.25rem rgba(84, 52, 22, 0.12);
  --hand: 'Patrick Hand', 'Comic Sans MS', cursive;
  --round: 'Fredoka', 'Nunito', 'Arial Rounded MT Bold', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: clamp(10.5px, calc(0.6vw + 0.52vh), 17px); }
html, body { margin: 0; height: 100%; overflow: hidden; background: #efe3cc; color: var(--ink); font-family: var(--round); -webkit-font-smoothing: antialiased; }
body { user-select: none; -webkit-user-select: none; touch-action: none; }
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
svg { display: block; }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; }
#scene.c-pointer { cursor: pointer; }
#scene.c-grab { cursor: grab; }
#scene.c-pet { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M12 22c-2-3-5-6-3-8 2-1 4 1 6 3V7c0-2 3-2 3 0v9-11c0-2 3-2 3 0v11-9c0-2 3-2 3 0v10-7c0-2 3-2 3 0v13c0 6-4 10-9 10-4 0-6-2-9-7z' fill='%23fff3e8' stroke='%235a3a22' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") 14 6, grab; }
#scene.c-petting { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M10 20c3-2 8-2 10 0 2-2 7-2 9 0 1 4 0 10-5 13-5 3-11 1-14-4z' fill='%23ffe0e6' stroke='%235a3a22' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M20 12c-2-3-6-1-4 2l4 4 4-4c2-3-2-5-4-2z' fill='%23ff5a6e'/%3E%3C/svg%3E") 18 20, grabbing; }
#scene.c-place { cursor: crosshair; }

#ui { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.hud { position: absolute; inset: 0; pointer-events: none; transition: opacity .5s ease; }
.hud > * { pointer-events: auto; }
.hud.hidden { opacity: 0; }
.hud.hidden > * { pointer-events: none; }

/* ------------------------------------------------------------ level sign */
.level-sign {
  position: absolute; left: 1.1rem; top: 0.7rem; width: 26rem; height: 6.9rem;
  padding: 0.75rem 1.2rem 0.6rem 8.4rem; border-radius: 1.1rem;
  background:
    repeating-linear-gradient(176deg, rgba(120, 70, 25, 0.0) 0 0.55rem, rgba(120, 70, 25, 0.10) 0.6rem 0.68rem, rgba(255, 230, 190, 0.08) 0.7rem 0.8rem),
    radial-gradient(ellipse at 30% 40%, rgba(255, 232, 190, 0.45), transparent 60%),
    linear-gradient(180deg, #edc28a 0%, #d9a468 55%, #c68c50 100%);
  border: 0.22rem solid #a8713c;
  box-shadow: inset 0 0.15rem 0 rgba(255, 238, 205, 0.7), inset 0 -0.3rem 0.4rem rgba(110, 60, 20, 0.25), var(--shadow);
  transform: rotate(-0.6deg);
}
.level-sign .nail { position: absolute; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #d8c2a4, #6d5236 70%); box-shadow: 0 1px 1px rgba(0,0,0,.35); }
.level-sign .nail.a { left: 0.7rem; top: 0.7rem; } .level-sign .nail.b { right: 0.7rem; bottom: 0.7rem; } .level-sign .nail.c { right: 0.7rem; top: 0.7rem; } .level-sign .nail.d { left: 0.7rem; bottom: 0.7rem; }
.level-sign .sprig { position: absolute; left: 0.2rem; top: -1.3rem; width: 7.2rem; height: 7.2rem; transform: rotate(-12deg); filter: drop-shadow(0 0.2rem 0.2rem rgba(40, 60, 20, 0.3)); }
.level-sign .lv { font-weight: 700; font-size: 2.55rem; line-height: 1; color: #3e2816; letter-spacing: 0.01em; text-shadow: 0 0.1rem 0 rgba(255, 236, 200, 0.6); }
.level-sign .sub { font-family: var(--hand); font-size: 1.65rem; color: #4a2f1a; margin-top: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.level-sign .paw { position: absolute; right: 1.3rem; top: 1.3rem; width: 2.4rem; height: 2.4rem; color: #8e5a2c; opacity: 0.75; transform: rotate(18deg); }
.level-sign.bump { animation: signBump .9s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes signBump { 0% { transform: rotate(-0.6deg) scale(1); } 30% { transform: rotate(2deg) scale(1.08); } 100% { transform: rotate(-0.6deg) scale(1); } }

/* ------------------------------------------------------------ tasks */
.tasks-card {
  position: absolute; left: 1.1rem; top: 8.3rem; width: 20.5rem; padding: 1rem 1.3rem 1.1rem;
  background: rgba(252, 247, 238, 0.94); border-radius: 1.2rem; box-shadow: var(--shadow); border: 1px solid rgba(231, 216, 191, 0.9);
  backdrop-filter: blur(6px);
}
.tasks-card h3 { margin: 0 0 0.5rem; font-weight: 600; font-size: 1.75rem; color: #3b2a1d; }
.task { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.3rem 0; font-family: var(--hand); font-size: 1.45rem; line-height: 1.15; color: #3e2d21; position: relative; }
.task .box { flex: 0 0 auto; width: 1.45rem; height: 1.45rem; margin-top: 0.05rem; border: 0.16rem solid #5b4636; border-radius: 0.25rem; background: #fffdf8; display: grid; place-items: center; transition: background .3s, border-color .3s; }
.task .box svg { width: 1.2rem; height: 1.2rem; color: #fff; transform: scale(0); transition: transform .35s cubic-bezier(.3, 1.8, .5, 1); }
.task.done .box { background: var(--green); border-color: #3f8a3a; }
.task.done .box svg { transform: scale(1); }
.task .txt { text-decoration: line-through; text-decoration-color: transparent; text-decoration-thickness: 0.13rem; transition: text-decoration-color .45s ease .15s, color .45s ease; }
.task.done .txt { color: #8b7a6b; text-decoration-color: #6d5a4a; }
.task .prog { display: block; height: 0.3rem; margin-top: 0.25rem; border-radius: 1rem; background: #efe4d2; overflow: hidden; width: 9rem; }
.task .prog i { display: block; height: 100%; background: linear-gradient(90deg, #8fcf7e, #5daa57); width: 0; transition: width .4s ease; border-radius: 1rem; }
.task.done .prog { opacity: 0; height: 0; margin: 0; transition: all .3s; }
.task.pulse { animation: taskPulse .7s ease; }
@keyframes taskPulse { 50% { transform: translateX(0.3rem) scale(1.03); } }
.tasks-card .clock { margin-top: 0.5rem; font-size: 0.95rem; color: var(--ink-soft); display: flex; align-items: center; gap: 0.4rem; font-weight: 500; }

/* ------------------------------------------------------------ top right */
.top-right { position: absolute; right: 1rem; top: 0.8rem; display: flex; gap: 0.7rem; align-items: center; }
.pill { display: flex; align-items: center; height: 3.6rem; border-radius: 1.8rem; box-shadow: var(--shadow); }
.coins { background: linear-gradient(180deg, rgba(92, 76, 60, 0.82), rgba(64, 50, 38, 0.86)); padding: 0 1.4rem 0 0.25rem; gap: 0.7rem; color: #fff; min-width: 10.5rem; border: 1px solid rgba(255, 255, 255, 0.12); }
.coins .ico { width: 3.3rem; height: 3.3rem; margin-left: -0.35rem; filter: drop-shadow(0 0.15rem 0.2rem rgba(0,0,0,.35)); }
.coins .num { font-weight: 600; font-size: 1.9rem; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.coins.bump .ico { animation: coinSpin .6s ease; }
.coins.bump .num { animation: numPop .45s ease; }
@keyframes coinSpin { 50% { transform: scale(1.25) rotate(-12deg); } }
@keyframes numPop { 50% { transform: scale(1.18); color: #ffe27a; } }
.hearts { background: rgba(252, 247, 238, 0.95); padding: 0 0.9rem; gap: 0.35rem; border: 1px solid var(--line); }
.hearts .h { position: relative; width: 2.7rem; height: 2.7rem; }
.hearts .h > div { position: absolute; inset: 0; }
.hearts .h .full { clip-path: inset(0 100% 0 0); transition: clip-path .6s ease; filter: drop-shadow(0 0.1rem 0.15rem rgba(160, 20, 30, .3)); }
.hearts.beat .h .full { animation: beat 1.2s ease infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(0.98); } 45% { transform: scale(1.06); } }
.round-btns { display: flex; gap: 0.5rem; margin-right: 0.2rem; }
.rbtn { width: 2.7rem; height: 2.7rem; border-radius: 50%; background: rgba(252, 247, 238, 0.92); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--ink-soft); border: 1px solid var(--line); transition: transform .15s; }
.rbtn:hover { transform: scale(1.08); color: var(--ink); }
.rbtn svg { width: 1.45rem; height: 1.45rem; }

.tip-bubble {
  position: absolute; right: 1rem; top: 5.6rem; max-width: 17rem; padding: 0.9rem 1.2rem; border-radius: 1.2rem;
  background: rgba(252, 247, 238, 0.95); box-shadow: var(--shadow); font-family: var(--hand); font-size: 1.4rem; line-height: 1.2; color: #3e2d21;
  transform-origin: 80% 0; transition: opacity .35s, transform .35s cubic-bezier(.3, 1.4, .5, 1);
}
.tip-bubble::before { content: ''; position: absolute; top: -0.55rem; right: 3.2rem; width: 1.2rem; height: 1.2rem; background: inherit; transform: rotate(45deg); border-radius: 0.2rem; }
.tip-bubble .hrt { color: #e0485a; }
.tip-bubble.swap { opacity: 0; transform: scale(0.9) translateY(-0.4rem); }
.tip-bubble.alert { background: #fff3e3; box-shadow: 0 0 0 0.18rem #f4b35a, var(--shadow); }

/* ------------------------------------------------------------ bottom */
.logo { position: absolute; left: 1.2rem; bottom: 0.9rem; pointer-events: none; }
.logo h1, h1.logo { margin: 0; line-height: 0.86; font-weight: 700; font-size: 3.6rem; letter-spacing: -0.01em; transform: rotate(-3deg); }
/* Logo lettering: gradient text on top of a separate, solid outline layer.
   (-webkit-text-stroke directly on gradient text shows the overlapping contours
   of the variable font, e.g. inside "t" and "g"; the padding keeps descenders
   and ascenders inside the gradient's background box.) */
.lg {
  position: relative; display: block; width: fit-content;
  padding: 0.14em 0.1em 0.26em; margin: -0.14em -0.1em -0.26em;
  background: linear-gradient(180deg, #fff6d8 0%, #ffe6a3 45%, #f6c35c 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lg::before {
  content: attr(data-text); position: absolute; inset: 0; z-index: -1; padding: inherit;
  color: #6b3d17; -webkit-text-stroke: 0.32rem #6b3d17;
  filter: drop-shadow(0 0.22rem 0 #5a3312) drop-shadow(0 0.4rem 0.5rem rgba(60, 30, 10, 0.35));
}
.lg.l2 { margin-left: calc(1rem - 0.1em); font-size: 1.12em; }
.logo .leaf { position: absolute; width: 2.6rem; height: 2.6rem; }
.logo .leaf.l1 { left: 13.2rem; top: -1.5rem; transform: rotate(18deg) scale(0.85); }
.logo .leaf.l2 { right: -1.8rem; top: 2.6rem; transform: rotate(30deg) scale(0.8); }
/* red rubber stamp "Alpha Version" on the logo: double ink ring, worn ink via a noise mask */
.stamp {
  --grunge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='90'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3.4 0 0 0 2.95'/%3E%3C/filter%3E%3Crect width='180' height='90' filter='url(%23f)'/%3E%3C/svg%3E");
  position: absolute; z-index: 2; pointer-events: none; white-space: nowrap;
  padding: 0.32em 0.8em 0.26em; font-family: var(--round); font-weight: 700; font-size: 1rem; line-height: 1;
  letter-spacing: 0.14em; text-transform: uppercase; color: #d4232c;
  border: 0.2em solid #d4232c; border-radius: 0.4em; outline: 0.09em solid #d4232c; outline-offset: 0.17em;
  background: rgba(255, 244, 238, 0.22);
  -webkit-mask-image: var(--grunge); mask-image: var(--grunge); -webkit-mask-size: 9em 4.5em; mask-size: 9em 4.5em;
  transform: rotate(-11deg); opacity: 0.93;
  animation: stampIn .55s cubic-bezier(.25, 1.6, .45, 1) .9s backwards;
}
@keyframes stampIn { 0% { transform: rotate(-11deg) scale(2.3); opacity: 0; } 55% { opacity: 0.95; } 100% { transform: rotate(-11deg) scale(1); } }
.logo .stamp { left: -0.8rem; top: -1.2rem; font-size: 1.1rem; }
.brand { position: relative; display: inline-block; }
.brand .stamp { left: -4.6rem; top: -0.3rem; font-size: 1.3rem; }
.logo .tagline, .tagline { margin: 0.55rem 0 0 0.3rem; font-weight: 500; font-size: 1.05rem; color: #fff; text-shadow: 0 0.1rem 0.3rem rgba(40, 20, 5, 0.75), 0 0 0.6rem rgba(40, 20, 5, 0.4); }

.toolbar { position: absolute; left: 50%; bottom: 1.1rem; transform: translateX(-54%); display: flex; gap: 0.95rem; }
.tb {
  width: 6.5rem; height: 6.5rem; border-radius: 1.25rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem;
  background: linear-gradient(180deg, #fffdf7 0%, #f7eddc 100%); border: 0.13rem solid #e3cfae;
  box-shadow: inset 0 -0.3rem 0 rgba(214, 190, 150, 0.55), inset 0 0.15rem 0 #fff, var(--shadow);
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s;
}
.tb .ico { width: 3.3rem; height: 3.3rem; filter: drop-shadow(0 0.15rem 0.12rem rgba(40, 60, 100, 0.25)); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.tb .lbl { font-weight: 600; font-size: 1.15rem; color: #3b2b1f; }
.tb:hover { transform: translateY(-0.35rem); }
.tb:hover .ico { transform: scale(1.08) rotate(-4deg); }
.tb:active { transform: translateY(0.05rem) scale(0.97); box-shadow: inset 0 -0.1rem 0 rgba(214, 190, 150, 0.55), var(--shadow); }
.tb.active { background: linear-gradient(180deg, #fff 0%, #fdebc6 100%); border-color: #f0b75a; box-shadow: inset 0 -0.3rem 0 rgba(240, 183, 90, 0.5), 0 0 0 0.2rem rgba(255, 210, 120, 0.55), var(--shadow); }
.tb .badge { position: absolute; margin: -4.8rem 0 0 4.9rem; min-width: 1.5rem; height: 1.5rem; border-radius: 1rem; background: var(--red); color: #fff; font-size: 0.9rem; font-weight: 600; display: grid; place-items: center; padding: 0 0.35rem; box-shadow: 0 0.1rem 0.3rem rgba(0,0,0,.25); }

.photo-btn {
  position: absolute; left: calc(50% + 17.3rem); bottom: 3.1rem; height: 3.5rem; padding: 0 1.6rem 0 1.1rem; border-radius: 2rem; display: flex; align-items: center; gap: 0.8rem;
  background: linear-gradient(180deg, #4d8ad8 0%, #2e67b6 100%); color: #fff; font-weight: 500; font-size: 1.4rem;
  border: 0.22rem solid #fff; box-shadow: 0 0 0 0.12rem rgba(46, 103, 182, 0.35), var(--shadow); transition: transform .18s cubic-bezier(.3, 1.6, .5, 1);
}
.photo-btn svg { width: 2.2rem; height: 2.2rem; }
.photo-btn:hover { transform: translateY(-0.2rem) scale(1.03); }

.motto-card {
  position: absolute; right: 1rem; bottom: 1rem; padding: 1rem 1.6rem; border-radius: 1.3rem; background: rgba(252, 247, 238, 0.95); box-shadow: var(--shadow);
  font-family: var(--hand); font-size: 1.75rem; line-height: 1.2; color: #3e2d21; text-align: center; transform: rotate(-1.5deg); pointer-events: none;
}

/* ------------------------------------------------------------ emote bubble / tooltip / toasts */
.emote { position: absolute; left: 0; top: 0; width: 3.4rem; height: 3.4rem; margin: -4rem 0 0 -1.7rem; border-radius: 50%; background: #fffdf8; box-shadow: var(--shadow); display: grid; place-items: center; pointer-events: none;
  transform: scale(0); transition: transform .35s cubic-bezier(.3, 1.7, .5, 1); z-index: 3; }
.emote::after { content: ''; position: absolute; bottom: -0.35rem; left: 50%; margin-left: -0.45rem; width: 0.9rem; height: 0.9rem; background: #fffdf8; transform: rotate(45deg); border-radius: 0.15rem; }
.emote.show { transform: scale(1); }
.emote svg { width: 2.2rem; height: 2.2rem; position: relative; z-index: 1; }
.emote.show svg { animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-0.2rem); } }

.tooltip { position: absolute; left: 0; top: 0; padding: 0.35rem 0.8rem; border-radius: 0.8rem; background: rgba(58, 42, 30, 0.88); color: #fff; font-size: 1rem; font-weight: 500; white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(1.2rem, 1.2rem); transition: opacity .15s; z-index: 20; }
.tooltip.show { opacity: 1; }

.toasts { position: absolute; left: 50%; top: 1rem; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.5rem; pointer-events: none; z-index: 15; }
.toast { padding: 0.6rem 1.2rem; border-radius: 1.4rem; background: rgba(252, 247, 238, 0.97); box-shadow: var(--shadow); font-weight: 500; font-size: 1.15rem; display: flex; align-items: center; gap: 0.5rem; animation: toastIn .45s cubic-bezier(.3, 1.5, .5, 1); }
.toast.out { animation: toastOut .4s ease forwards; }
.toast svg { width: 1.6rem; height: 1.6rem; }
.toast.good { background: #eef8e8; color: #2f6b2a; }
.toast.bad { background: #fdeceb; color: #9c2b22; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-1rem) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-0.8rem) scale(.95); } }

.hint-bar { position: absolute; left: 50%; bottom: 9rem; transform: translateX(-50%); padding: 0.6rem 1.3rem; border-radius: 1.5rem; background: rgba(58, 42, 30, 0.85); color: #fff; font-size: 1.1rem; font-weight: 500; opacity: 0; transition: opacity .25s; pointer-events: none; white-space: nowrap; }
.hint-bar.show { opacity: 1; }

.fly-coin { position: fixed; width: 2.2rem; height: 2.2rem; z-index: 30; pointer-events: none; filter: drop-shadow(0 0.2rem 0.2rem rgba(0,0,0,.3)); }
.float-num { position: fixed; z-index: 30; pointer-events: none; font-weight: 700; font-size: 1.5rem; color: #f7c131;
  text-shadow: 0.08rem 0 0 #7a4a0a, -0.08rem 0 0 #7a4a0a, 0 0.08rem 0 #7a4a0a, 0 -0.08rem 0 #7a4a0a, 0.06rem 0.06rem 0 #7a4a0a, -0.06rem 0.06rem 0 #7a4a0a, 0.06rem -0.06rem 0 #7a4a0a, -0.06rem -0.06rem 0 #7a4a0a; }

/* ------------------------------------------------------------ panels */
.panel {
  position: absolute; left: 50%; bottom: 8.9rem; width: min(54rem, 94vw); max-height: min(31rem, 64vh); transform: translate(-50%, 1.5rem) scale(0.97); opacity: 0; pointer-events: none;
  background: rgba(252, 247, 238, 0.97); border-radius: 1.4rem; box-shadow: 0 1rem 2.5rem rgba(84, 52, 22, 0.28), var(--shadow); border: 1px solid var(--line);
  transition: transform .35s cubic-bezier(.25, 1.3, .4, 1), opacity .25s ease; display: flex; flex-direction: column; overflow: hidden; z-index: 8;
}
.panel.open { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.panel-head { display: flex; align-items: center; gap: 0.8rem; padding: 0.9rem 1.2rem 0.5rem 1.4rem; }
.panel-head h2 { margin: 0; font-weight: 600; font-size: 1.6rem; flex: 1; }
.panel-head .x { width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; background: var(--cream-2); color: var(--ink-soft); }
.panel-head .x:hover { background: #efe0c8; color: var(--ink); }
.panel-head .x svg { width: 1.2rem; height: 1.2rem; }
.panel-body { padding: 0.3rem 1.4rem 1.2rem; overflow-y: auto; }
.panel-body::-webkit-scrollbar { width: 0.5rem; } .panel-body::-webkit-scrollbar-thumb { background: #e3d2b6; border-radius: 1rem; }
.sec-title { font-weight: 600; font-size: 1.05rem; color: var(--ink-soft); margin: 0.6rem 0 0.5rem; text-transform: uppercase; letter-spacing: 0.06em; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tab { padding: 0.45rem 1rem; border-radius: 1.2rem; font-weight: 500; font-size: 1.05rem; background: var(--cream-2); color: var(--ink-soft); }
.tab.on { background: #f3d9a9; color: #5a3a1c; box-shadow: inset 0 -0.15rem 0 rgba(200, 150, 80, 0.4); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.6rem, 1fr)); gap: 0.8rem; }
.card { position: relative; background: #fff; border-radius: 1rem; padding: 0.55rem 0.55rem 0.65rem; box-shadow: 0 0.15rem 0.5rem rgba(84, 52, 22, 0.12); border: 1px solid #efe3cf; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; transition: transform .18s cubic-bezier(.3, 1.6, .5, 1); }
.card:hover { transform: translateY(-0.2rem); }
.card .thumb { width: 100%; aspect-ratio: 1.25; border-radius: 0.7rem; background: radial-gradient(circle at 50% 60%, #fff 0%, #f5ead7 100%); display: grid; place-items: center; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.card .nm { font-weight: 500; font-size: 1.02rem; text-align: center; line-height: 1.1; min-height: 2.2rem; display: grid; place-items: center; }
.card .cnt { position: absolute; top: 0.4rem; right: 0.4rem; min-width: 1.7rem; height: 1.7rem; border-radius: 1rem; background: #4a3526; color: #fff; font-size: 0.95rem; font-weight: 600; display: grid; place-items: center; padding: 0 0.4rem; }
.card .tag { font-size: 0.85rem; color: var(--green); font-weight: 600; }
.tab svg { width: 1.05rem; height: 1.05rem; vertical-align: -0.15rem; margin-right: 0.3rem; }
.card.premium { flex-direction: row; align-items: stretch; gap: 0.9rem; max-width: 30rem; padding: 0.75rem; border: 2px solid #f0c24b; background: linear-gradient(160deg, #fffaf0, #fff1cf); box-shadow: 0 0.2rem 0.8rem rgba(214, 150, 20, 0.25); }
.card.premium .thumb { width: 9rem; flex: none; aspect-ratio: 1.1; }
.pm-art { position: relative; width: 78%; }
.pm-art svg { display: block; width: 100%; height: auto; }
.pm-plus { position: absolute; right: -0.7rem; top: -0.9rem; padding: 0.15rem 0.45rem; border-radius: 0.8rem; background: #e2463c; color: #fff; font-weight: 700; font-size: 0.85rem; transform: rotate(8deg); box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, .2); }
.pm-info { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.35rem; }
.card.premium .nm { display: block; min-height: 0; text-align: left; font-size: 1.15rem; }
.pm-desc { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.25; }
.pm-free { display: inline-flex; align-items: center; gap: 0.3rem; color: #a86d08; font-size: 0.85rem; font-weight: 600; }
.pm-free svg { width: 1rem; height: 1rem; }
.crown-badge { position: absolute; top: -0.75rem; left: -0.6rem; width: 2rem; height: 2rem; transform: rotate(-14deg); filter: drop-shadow(0 0.1rem 0.15rem rgba(120, 70, 0, .35)); }
.crown-badge svg { width: 100%; height: 100%; }
.card.locked { opacity: 0.7; }
.card.locked .thumb img { filter: grayscale(0.9) brightness(1.05) opacity(0.6); }
.card.dim { opacity: 0.55; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; min-width: 5.8rem; height: 2.2rem; padding: 0 0.9rem; border-radius: 1.2rem; font-weight: 600; font-size: 1rem;
  background: linear-gradient(180deg, #6fbf63, #4f9f48); color: #fff; box-shadow: inset 0 -0.15rem 0 rgba(0,0,0,.15), 0 0.1rem 0.3rem rgba(40, 90, 30, .3); transition: transform .12s, filter .12s; }
.btn:hover { filter: brightness(1.06); transform: translateY(-0.05rem); }
.btn:active { transform: translateY(0.05rem); }
.btn.blue { background: linear-gradient(180deg, #5a95dc, #3470c0); box-shadow: inset 0 -0.15rem 0 rgba(0,0,0,.15), 0 0.1rem 0.3rem rgba(30, 60, 120, .3); }
.btn.ghost { background: var(--cream-2); color: var(--ink-soft); box-shadow: none; }
.btn.gold { background: linear-gradient(180deg, #ffd35c, #eeac1e); color: #5a3a0a; }
.btn:disabled { filter: grayscale(0.8); opacity: 0.55; cursor: not-allowed; transform: none; }
.btn .c { width: 1.25rem; height: 1.25rem; }
.btn svg { width: 1.1rem; height: 1.1rem; }
.btn.ico { min-width: 0; width: 3.1rem; padding: 0; }
.btn.ico svg { width: 1.3rem; height: 1.3rem; }
.btn.ghost.ico:hover { color: var(--ink); }

.staples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.staple { background: #fff; border-radius: 1rem; padding: 0.7rem 0.9rem; border: 1px solid #efe3cf; box-shadow: 0 0.15rem 0.5rem rgba(84, 52, 22, 0.1); display: grid; grid-template-columns: 2.6rem 1fr; grid-template-rows: auto auto auto; column-gap: 0.7rem; row-gap: 0.35rem; align-items: center; }
.staple .si { grid-row: 1 / span 2; width: 2.6rem; height: 2.6rem; }
.staple .sn { font-weight: 600; font-size: 1.1rem; }
.bar { height: 0.55rem; border-radius: 1rem; background: #efe4d2; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 1rem; transition: width .5s ease; }
.staple .btn { grid-column: 1 / span 2; width: 100%; }

.profile { display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.2rem; }
.pf-name { display: flex; align-items: center; gap: 0.6rem; }
.pf-name .big { font-weight: 700; font-size: 2rem; }
.pf-meta { color: var(--ink-soft); font-size: 1.02rem; margin-top: 0.2rem; }
.mood { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.6rem; padding: 0.35rem 0.9rem; border-radius: 1rem; background: #fdf0d6; font-weight: 600; }
.needs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem 1rem; }
.need { display: grid; grid-template-columns: 1.7rem 1fr; gap: 0.5rem; align-items: center; font-size: 0.98rem; font-weight: 500; }
.need svg { width: 1.7rem; height: 1.7rem; }
.need .lbl { display: flex; justify-content: space-between; margin-bottom: 0.15rem; }
.pf-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }

/* ------------------------------------------------------------ modals */
.modal-wrap { position: absolute; inset: 0; background: rgba(60, 40, 20, 0.35); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 40; backdrop-filter: blur(3px); }
.modal-wrap.open { opacity: 1; pointer-events: auto; }
.modal { background: var(--cream); border-radius: 1.6rem; padding: 1.6rem 2rem; box-shadow: 0 1.5rem 3rem rgba(60, 35, 10, 0.35); min-width: 24rem; max-width: 92vw; transform: scale(0.9) translateY(1rem); transition: transform .4s cubic-bezier(.25, 1.5, .4, 1); position: relative; text-align: center; }
.modal-wrap.open .modal { transform: none; }
.modal h2 { margin: 0 0 0.6rem; font-size: 2rem; font-weight: 700; }
.modal p { margin: 0.3rem 0; font-size: 1.15rem; color: var(--ink-soft); }
.modal .row { display: flex; justify-content: center; gap: 0.7rem; margin-top: 1.2rem; }
.modal input[type=text] { font-family: var(--hand); font-size: 1.8rem; padding: 0.4rem 1rem; border-radius: 0.9rem; border: 0.15rem solid var(--line); background: #fff; color: var(--ink); width: 18rem; text-align: center; outline: none; }
.modal input[type=text]:focus { border-color: #f0b75a; }
.banner { margin: -3.4rem auto 0.8rem; width: 24rem; height: 5rem; border-radius: 1rem; display: grid; place-items: center; font-weight: 700; font-size: 2.1rem; color: #3e2816;
  background: repeating-linear-gradient(176deg, rgba(120, 70, 25, 0) 0 0.55rem, rgba(120, 70, 25, 0.1) 0.6rem 0.68rem), linear-gradient(180deg, #edc28a, #c68c50); border: 0.22rem solid #a8713c; box-shadow: inset 0 0.15rem 0 rgba(255, 238, 205, 0.7), var(--shadow); }
.stars { display: flex; justify-content: center; gap: 0.6rem; margin: 0.4rem 0 0.8rem; }
.stars span { font-size: 2.6rem; filter: drop-shadow(0 0.2rem 0.2rem rgba(0,0,0,.2)); animation: starIn .6s cubic-bezier(.3, 1.8, .5, 1) backwards; }
.stars span:nth-child(2) { animation-delay: .15s; font-size: 3.2rem; } .stars span:nth-child(3) { animation-delay: .3s; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); opacity: 0; } }
.reward { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.6rem; color: #6a4a12; background: #fff4d4; padding: 0.4rem 1.2rem; border-radius: 1.4rem; }
.reward svg { width: 2rem; height: 2rem; }
.settings { text-align: left; min-width: 26rem; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--line); font-weight: 500; font-size: 1.1rem; }
.set-row:last-of-type { border-bottom: 0; }
.seg { display: flex; background: var(--cream-2); border-radius: 1rem; padding: 0.2rem; }
.seg button { padding: 0.3rem 0.8rem; border-radius: 0.8rem; font-weight: 500; font-size: 0.98rem; color: var(--ink-soft); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 0.1rem 0.3rem rgba(0,0,0,.1); }
input[type=range] { width: 11rem; accent-color: #e8a33c; }
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 45; }

/* polaroid */
.polaroid { background: #fff; padding: 1rem 1rem 0.5rem; border-radius: 0.3rem; box-shadow: 0 1rem 2rem rgba(0,0,0,.3); transform: rotate(-2deg); max-width: min(46rem, 80vw); }
.polaroid img { display: block; width: 100%; border-radius: 0.1rem; }
.polaroid .cap { font-family: var(--hand); font-size: 1.7rem; color: #3e2d21; padding: 0.6rem 0 0.2rem; }

/* ------------------------------------------------------------ photo mode */
.photo-ui { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; z-index: 12; }
.photo-ui.on { opacity: 1; }
.photo-ui.on > * { pointer-events: auto; }
.photo-ui .frame { position: absolute; inset: 6vh 5vw 13vh; pointer-events: none !important; }
.photo-ui .frame i { position: absolute; width: 3rem; height: 3rem; border: 0.3rem solid rgba(255, 255, 255, 0.9); filter: drop-shadow(0 0 0.2rem rgba(0,0,0,.35)); }
.photo-ui .frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 0.6rem 0 0 0; }
.photo-ui .frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 0.6rem 0 0; }
.photo-ui .frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 0.6rem; }
.photo-ui .frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 0.6rem 0; }
.photo-ui .thirds { position: absolute; inset: 0; background:
  linear-gradient(90deg, transparent calc(33.33% - 1px), rgba(255,255,255,.28) 33.33%, transparent calc(33.33% + 1px), transparent calc(66.66% - 1px), rgba(255,255,255,.28) 66.66%, transparent calc(66.66% + 1px)),
  linear-gradient(180deg, transparent calc(33.33% - 1px), rgba(255,255,255,.28) 33.33%, transparent calc(33.33% + 1px), transparent calc(66.66% - 1px), rgba(255,255,255,.28) 66.66%, transparent calc(66.66% + 1px)); }
.photo-top { position: absolute; top: 1rem; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0.6rem 0.5rem 1.2rem; border-radius: 2rem; background: rgba(40, 30, 22, 0.6); color: #fff; font-weight: 600; font-size: 1.2rem; backdrop-filter: blur(6px); }
.photo-top .x { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); }
.photo-top .x svg { width: 1.1rem; height: 1.1rem; }
.photo-bottom { position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 1.6rem; }
.filters { display: flex; gap: 0.45rem; padding: 0.4rem; border-radius: 2rem; background: rgba(40, 30, 22, 0.55); backdrop-filter: blur(6px); }
.filters button { padding: 0.45rem 0.95rem; border-radius: 1.4rem; color: #fff; font-weight: 500; font-size: 1rem; }
.filters button.on { background: #fff; color: var(--ink); }
.shutter { width: 5.2rem; height: 5.2rem; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0.35rem rgba(255,255,255,.45), 0 0.5rem 1rem rgba(0,0,0,.3); display: grid; place-items: center; transition: transform .12s; }
.shutter::after { content: ''; width: 4.1rem; height: 4.1rem; border-radius: 50%; border: 0.18rem solid #d8cfc4; }
.shutter:active { transform: scale(0.92); }
.flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 50; }
.flash.go { animation: flash .55s ease-out; }
@keyframes flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }

/* ------------------------------------------------------------ loader */
#loader { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #fbf1de 0%, #efdcbc 70%, #e5cda6 100%); transition: opacity .9s ease, visibility .9s; }
#loader.gone { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
#loader h1.logo { position: static; font-size: 5.2rem; margin-top: 1.4rem; }
#loader .tagline { color: #7a5b3e; text-shadow: none; font-size: 1.3rem; margin-top: 1rem; }
.loader-bar { width: 22rem; height: 0.9rem; border-radius: 1rem; background: rgba(255, 255, 255, 0.6); margin: 2rem 0 0.7rem; overflow: hidden; box-shadow: inset 0 0.1rem 0.2rem rgba(120, 80, 30, 0.2); }
#loader-fill { height: 100%; width: 0; border-radius: 1rem; background: linear-gradient(90deg, #f4c05a, #e79a3c); transition: width .3s ease; }
#loader-text { font-family: var(--hand); font-size: 1.4rem; color: #7a5b3e; margin: 0; min-height: 1.8rem; }
.loader-hint { font-size: 1rem; color: #9a7b5c; margin-top: 1.5rem; }
.big-btn { margin-top: 0.6rem; padding: 0.9rem 2.6rem; border-radius: 2.2rem; font-weight: 600; font-size: 1.7rem; color: #fff; background: linear-gradient(180deg, #5d9be4, #3170c2); border: 0.25rem solid #fff; box-shadow: 0 0.6rem 1.4rem rgba(49, 112, 194, 0.35); animation: pulse 1.6s ease-in-out infinite; }
.big-btn:hover { filter: brightness(1.06); }
@keyframes pulse { 50% { transform: scale(1.05); } }
.loader-pig { position: relative; width: 9rem; height: 6rem; animation: hop 0.9s ease-in-out infinite; }
.lp-body { position: absolute; inset: 0 0 0.8rem; border-radius: 50% 55% 45% 50% / 60% 60% 45% 45%; background: radial-gradient(circle at 68% 30%, #e0954e, #c7742f 55%, #a95c24); box-shadow: inset -0.6rem -0.5rem 0 rgba(120, 60, 20, 0.2); overflow: hidden; }
.lp-blaze { position: absolute; right: 1.55rem; top: -0.2rem; width: 0.85rem; height: 3.2rem; border-radius: 0.6rem; background: #fff6ec; transform: rotate(32deg); }
.lp-muzzle { position: absolute; right: -0.3rem; top: 2.1rem; width: 2.6rem; height: 2rem; border-radius: 50%; background: #fff6ec; }
.lp-ear { position: absolute; top: -0.4rem; width: 1.6rem; height: 1.2rem; border-radius: 50%; background: #8e4f22; }
.lp-ear.l { right: 3.3rem; transform: rotate(-20deg); } .lp-ear.r { right: 0.9rem; transform: rotate(25deg); }
.lp-eye { position: absolute; right: 2.6rem; top: 1.7rem; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: #1d120c; box-shadow: 0.15rem -0.1rem 0 -0.05rem #fff inset; }
.lp-nose { position: absolute; right: 0.25rem; top: 2.45rem; width: 0.7rem; height: 0.5rem; border-radius: 50%; background: #e08a8a; z-index: 1; }
.lp-feet { position: absolute; bottom: 0; left: 1.5rem; right: 1.5rem; display: flex; justify-content: space-between; }
.lp-feet span { width: 1.3rem; height: 0.8rem; border-radius: 50%; background: #e0a79a; animation: feet .3s ease-in-out infinite alternate; }
@keyframes hop { 50% { transform: translateY(-0.6rem) rotate(-3deg); } }
@keyframes feet { to { transform: translateY(-0.2rem); } }

/* ------------------------------------------------------------ alpha gate */
html:not(.unlocked) #loader, html.unlocked #gate { display: none; }
#gate { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; overflow-y: auto; padding: 1.5rem; box-sizing: border-box; background: radial-gradient(circle at 50% 40%, #fbf1de 0%, #efdcbc 70%, #e5cda6 100%); transition: opacity .7s ease, visibility .7s; }
#gate.open { opacity: 0; visibility: hidden; }
.gate-inner { display: flex; flex-direction: column; align-items: center; }
#gate h1.logo { position: static; font-size: 4.4rem; margin-top: 1rem; }
.gate-card { position: relative; margin-top: 4.6rem; width: 25rem; max-width: 86vw; box-sizing: border-box; padding: 3.4rem 1.8rem 1.4rem; border-radius: 1.8rem; background: rgba(255, 252, 245, 0.92); box-shadow: 0 1.2rem 2.8rem rgba(120, 75, 25, 0.25), inset 0 0 0 0.15rem #fff; text-align: center; transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.gate-card.shake { animation: gateShake .45s cubic-bezier(.36, .07, .19, .97); }
@keyframes gateShake { 20%, 60% { transform: translateX(-0.7rem); } 40%, 80% { transform: translateX(0.7rem); } }
#gate.unlocking .gate-card { transform: scale(1.04); }
.gate-lock { position: absolute; left: 50%; top: -2.8rem; width: 4.4rem; height: 5.2rem; margin-left: -2.2rem; animation: bob 2.4s ease-in-out infinite; }
.gl-shackle { position: absolute; left: 0.85rem; right: 0.85rem; top: 0; height: 2.9rem; box-sizing: border-box; border: 0.55rem solid #b7813f; border-bottom: 0; border-radius: 1.6rem 1.6rem 0 0; transform-origin: 100% 100%; transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
#gate.unlocking .gl-shackle { transform: translateY(-0.7rem) rotate(24deg); }
.gl-body { position: absolute; left: 0; right: 0; bottom: 0; height: 3.1rem; border-radius: 0.9rem; background: linear-gradient(180deg, #f7cf6a, #e6a23a); box-shadow: inset 0 -0.3rem 0 rgba(150, 90, 20, 0.35), 0 0.4rem 0.8rem rgba(150, 90, 20, 0.3); display: grid; place-items: center; }
.gl-body svg { width: 1.7rem; height: 1.7rem; color: #8a5620; opacity: 0.8; }
.gate-slogan { margin: 0; font-weight: 700; font-size: 1.55rem; letter-spacing: 0.08em; text-transform: uppercase; color: #6b3d17; }
.gate-hint { margin: 0.5rem 0 1.2rem; font-size: 1.05rem; line-height: 1.3; color: var(--ink-soft); }
.gate-row { display: flex; gap: 0.6rem; }
#gate-pw { flex: 1; min-width: 0; padding: 0.7rem 1rem; border-radius: 1.2rem; border: 0.15rem solid #ead9bf; background: #fff; color: var(--ink); font-family: var(--round); font-size: 1.25rem; outline: none; -webkit-user-select: text; user-select: text; transition: border-color .2s, box-shadow .2s; }
#gate-pw:focus { border-color: #f0c24b; box-shadow: 0 0 0 0.3rem rgba(240, 194, 75, 0.3); }
.gate-btn { padding: 0 1.3rem; border-radius: 1.2rem; font-weight: 600; font-size: 1.2rem; color: #5a3a0a; background: linear-gradient(180deg, #ffd35c, #eeac1e); box-shadow: inset 0 -0.15rem 0 rgba(0, 0, 0, .12), 0 0.3rem 0.7rem rgba(214, 150, 20, 0.35); }
.gate-btn:hover { filter: brightness(1.05); }
.gate-error { min-height: 1.4rem; margin: 0.7rem 0 0; font-size: 1rem; font-weight: 600; color: #d4232c; }

/* ------------------------------------------------------------ responsive */
@media (max-aspect-ratio: 4/3) {
  .motto-card { display: none; }
  .photo-btn { left: auto; right: 1rem; bottom: 9rem; }
  .toolbar { transform: translateX(-50%); }
}
@media (max-width: 700px) {
  html { font-size: 9px; }
  #ui .logo, .tip-bubble { display: none; }
  .level-sign { width: 20rem; height: 6.2rem; padding-left: 7rem; }
  .level-sign .sprig { width: 6rem; height: 6rem; }
  .level-sign .lv { font-size: 2.3rem; }
  .level-sign .sub { font-size: 1.5rem; }
  .level-sign .paw { display: none; }
  .tasks-card { top: 7.6rem; width: 19rem; }
  .top-right { flex-direction: column; align-items: flex-end; gap: 0.5rem; }
  .round-btns { order: 3; }
  .toolbar { gap: 0.7rem; bottom: 1.4rem; }
  .panel { bottom: 10rem; max-height: 58vh; }
}
