:root {
  --bg: #f6efe5;
  --card: rgba(255, 250, 243, 0.92);
  --card-strong: #fff9f1;
  --stroke: rgba(120, 92, 68, 0.14);
  --text: #39271d;
  --muted: #876c59;
  --accent: #d26d4b;
  --accent-soft: #f5b38f;
  --teal: #6b9f9a;
  --gold: #c89a4c;
  --shadow: 0 24px 60px rgba(70, 43, 24, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Avenir Next", "Trebuchet MS", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 244, 220, 0.9), transparent 38%),
    linear-gradient(180deg, #f7ede0 0%, #efe4d7 46%, #e9decd 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.22;
  pointer-events: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 22px 64px;
}

.topbar,
.panel,
.scene-card,
.modal-card,
.invite-box {
  backdrop-filter: blur(16px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 251, 245, 0.86);
  border: 1px solid rgba(120, 92, 68, 0.12);
  box-shadow: 0 10px 22px rgba(120, 92, 68, 0.08);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow,
.section-label {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 700;
}

h1,
h2,
h3,
.partner-name,
.feed-title {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

h2,
h3 {
  margin: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-status,
.panel-tip,
.anniversary span,
.partner-note,
.pet-caption p,
.feed-time,
.settings-help p,
.empty-state,
.note-actions span {
  color: var(--muted);
}

.sync-status {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--stroke);
  font-size: 0.92rem;
}

.layout {
  display: grid;
  grid-template-columns: 1.04fr 1.12fr 0.84fr;
  gap: 16px;
}

.scene-card {
  grid-column: 1 / -1;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.scene-background {
  position: relative;
  min-height: 560px;
  padding: 28px 28px 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 228, 188, 0.92), transparent 24%),
    radial-gradient(circle at 82% 16%, rgba(140, 198, 193, 0.48), transparent 18%),
    linear-gradient(180deg, #fbf4e8 0%, #f5e7d5 54%, #efdbc3 100%);
}

.scene-background::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 6%, transparent 6% 12%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 35%);
  opacity: 0.38;
  mix-blend-mode: screen;
  pointer-events: none;
}

.scene-background::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  height: 134px;
  border-radius: 34px 34px 42px 42px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 36%),
    linear-gradient(180deg, #dda879 0%, #c7885a 52%, #a86b46 100%);
  box-shadow: inset 0 12px 24px rgba(255, 255, 255, 0.15);
  opacity: 0.92;
}

.scene-meta,
.partners {
  position: relative;
  z-index: 1;
}

.scene-meta {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 16px;
  padding-right: 212px;
}

.scene-meta-hidden {
  display: none;
}

.window-glow {
  position: absolute;
  top: 28px;
  right: 40px;
  width: 180px;
  height: 220px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(122, 182, 176, 0.92) 0%, rgba(255, 249, 234, 0.88) 100%);
  box-shadow:
    inset 0 0 0 8px rgba(255, 255, 255, 0.45),
    0 18px 40px rgba(107, 159, 154, 0.18);
}

.window-curtain {
  position: absolute;
  top: 24px;
  width: 54px;
  height: 230px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.95), rgba(242, 223, 204, 0.88));
  box-shadow: inset -8px 0 14px rgba(194, 155, 118, 0.08);
  z-index: 0;
}

.curtain-left {
  right: 160px;
}

.curtain-right {
  right: 26px;
}

.window-glow::before,
.window-glow::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.45);
}

.window-glow::before {
  top: 50%;
  left: 14px;
  right: 14px;
  height: 4px;
}

.window-glow::after {
  left: 50%;
  top: 14px;
  bottom: 14px;
  width: 4px;
}

.ceiling-lamp {
  position: absolute;
  left: 50%;
  top: 0;
  width: 88px;
  height: 142px;
  transform: translateX(-50%);
  pointer-events: none;
}

.lamp-cord {
  position: absolute;
  left: 50%;
  top: 0;
  width: 4px;
  height: 50px;
  transform: translateX(-50%);
  background: rgba(94, 67, 51, 0.35);
}

.lamp-shade {
  position: absolute;
  left: 50%;
  top: 42px;
  width: 88px;
  height: 52px;
  transform: translateX(-50%);
  border-radius: 18px 18px 28px 28px;
  background: linear-gradient(180deg, #fff7ec 0%, #f2d9b3 100%);
  box-shadow:
    inset 0 -6px 14px rgba(208, 163, 108, 0.18),
    0 10px 18px rgba(120, 92, 68, 0.08);
}

.lamp-glow {
  position: absolute;
  left: 50%;
  top: 78px;
  width: 170px;
  height: 120px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 238, 188, 0.44), transparent 68%);
  filter: blur(4px);
}

.wall-shelf {
  position: absolute;
  left: 44px;
  top: 120px;
  width: 150px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d5a47c 0%, #b87b53 100%);
  box-shadow: 0 10px 18px rgba(120, 92, 68, 0.14);
}

.shelf-book,
.shelf-plant {
  position: absolute;
  bottom: 12px;
  border-radius: 12px 12px 8px 8px;
}

.shelf-book-a {
  left: 14px;
  width: 20px;
  height: 42px;
  background: linear-gradient(180deg, #f4c88e 0%, #d58f56 100%);
}

.shelf-book-b {
  left: 40px;
  width: 28px;
  height: 36px;
  background: linear-gradient(180deg, #9ac4c0 0%, #6a9e98 100%);
}

.shelf-plant {
  right: 10px;
  width: 42px;
  height: 28px;
  background: linear-gradient(180deg, #f9ead8 0%, #ebc59d 100%);
}

.shelf-plant::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 16px;
  height: 42px;
  border-radius: 50% 50% 10px 10px;
  background:
    radial-gradient(circle at 20% 70%, #77a892 0 12px, transparent 13px),
    radial-gradient(circle at 72% 32%, #8dc1ac 0 14px, transparent 15px),
    radial-gradient(circle at 50% 8%, #5f947c 0 14px, transparent 15px);
}

.sticky-note {
  position: absolute;
  right: 300px;
  top: 138px;
  width: 168px;
  min-height: 110px;
  padding: 16px 18px;
  border-radius: 20px 20px 18px 18px;
  background:
    linear-gradient(180deg, rgba(255, 248, 216, 0.96), rgba(255, 238, 189, 0.92));
  border: 1px solid rgba(212, 182, 97, 0.34);
  box-shadow:
    0 14px 24px rgba(120, 92, 68, 0.1),
    inset 0 -10px 16px rgba(248, 219, 130, 0.16);
  color: #6d4a2f;
  line-height: 1.5;
  z-index: 1;
}

.sticky-note::before {
  content: "";
  position: absolute;
  left: 22px;
  top: -9px;
  width: 46px;
  height: 18px;
  border-radius: 999px;
  background: rgba(149, 196, 188, 0.64);
  transform: rotate(-5deg);
}

.anniversary {
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(120, 92, 68, 0.12);
}

.anniversary strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}

.anniversary-subtitle {
  display: block;
  margin-top: 10px;
}

.partners {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(320px, 1.45fr) minmax(190px, 1fr);
  gap: 18px;
  align-items: end;
  min-height: 410px;
  margin-top: 24px;
}

.partner-card,
.panel,
.invite-box {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.partner-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  min-height: 116px;
  background: rgba(255, 251, 245, 0.88);
}

.partner-avatar {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1.8rem;
  box-shadow: inset 0 0 0 1px rgba(120, 92, 68, 0.12);
}

.partner-name {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.partner-note {
  margin: 0;
  line-height: 1.5;
}

.pet-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.speech-bubble {
  position: relative;
  max-width: 388px;
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(255, 252, 246, 0.95);
  border: 1px solid rgba(120, 92, 68, 0.12);
  text-align: center;
  line-height: 1.55;
  box-shadow: 0 16px 28px rgba(120, 92, 68, 0.08);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 22px;
  height: 22px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(255, 252, 246, 0.95);
  border-right: 1px solid rgba(120, 92, 68, 0.1);
  border-bottom: 1px solid rgba(120, 92, 68, 0.1);
}

.ritual-row {
  width: min(100%, 468px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ritual-chip {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 250, 245, 0.82);
  border: 1px solid rgba(120, 92, 68, 0.12);
  box-shadow: 0 10px 20px rgba(120, 92, 68, 0.06);
}

.ritual-label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.ritual-chip strong {
  display: block;
  margin-top: 6px;
  line-height: 1.45;
  font-size: 1rem;
}

.pet-body {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(340px, 48vw, 520px);
  min-width: 340px;
  aspect-ratio: 1 / 0.96;
  perspective: 1200px;
  transform-style: preserve-3d;
  --pet-main: #fffdf9;
  --pet-main-dark: #e2ebf3;
  --pet-accent: #c1d8ec;
  --pet-inner: #f6c4a7;
  --pet-belly: #fffef8;
  --pet-cheek: #efb4a4;
  --pet-rug-color: #f4ddc7;
  --pet-prop-color: #7cb4a8;
  --pet-outline: rgba(120, 92, 68, 0.12);
  --pet-shadow-color: rgba(96, 58, 34, 0.28);
  --pet-eye-color: #3f2d27;
  --pet-tail-rotation: 18deg;
  --pet-tail-width: 82px;
  --pet-tail-height: 96px;
  --pet-float-duration: 5.2s;
  --pet-float-distance: 12px;
  --pet-tilt-x: 8deg;
  --pet-tilt-y: -8deg;
}

.pet-shadow {
  position: absolute;
  bottom: 20px;
  width: 74%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--pet-shadow-color), transparent 70%);
  filter: blur(10px);
  transform-origin: center;
  animation: pet-shadow-breathe var(--pet-float-duration) ease-in-out infinite;
}

.pet-aura {
  position: absolute;
  inset: 20% 18% 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.72), transparent 68%);
  filter: blur(14px);
  transform: translateZ(-30px);
  animation: pet-aura-drift 8s ease-in-out infinite;
}

/* Reserved for future pet-bed themes. The current MVP keeps this layer empty. */

.pet-prop {
  position: absolute;
  bottom: 72px;
}

.pet-prop-left {
  left: 34px;
  width: 70px;
  height: 34px;
  border-radius: 20px 20px 24px 24px;
  background: linear-gradient(180deg, #fbf0e0 0%, #d89c69 100%);
  box-shadow: 0 12px 20px rgba(120, 92, 68, 0.08);
  transform-origin: center bottom;
  animation: pet-bowl-wobble 6.8s ease-in-out infinite;
}

.pet-prop-left::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  height: 10px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 16% 50%, var(--pet-prop-color) 0 8px, transparent 9px),
    radial-gradient(circle at 44% 50%, #f8db88 0 8px, transparent 9px),
    radial-gradient(circle at 74% 50%, #ffb476 0 8px, transparent 9px);
  opacity: 0.92;
}

.pet-prop-right {
  right: 40px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), transparent 26%),
    linear-gradient(180deg, color-mix(in srgb, var(--pet-prop-color) 86%, white 14%), var(--pet-prop-color));
  box-shadow: 0 10px 18px rgba(120, 92, 68, 0.08);
  animation: pet-toy-bob 4.4s ease-in-out infinite;
}

.pet-prop-right::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 15px;
  width: 16px;
  height: 10px;
  border-radius: 999px;
  background: rgba(110, 172, 153, 0.7);
  transform: rotate(24deg);
}

.pet-illustration {
  position: relative;
  width: 360px;
  height: 360px;
  z-index: 1;
  transform-style: preserve-3d;
  animation: pixel-stage-hop var(--pet-float-duration) steps(4, end) infinite;
}

.pet-portrait {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
}

.pet-portrait.is-loading::before {
  content: "";
  width: 58%;
  height: 58%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.08));
  filter: blur(8px);
  animation: pet-loading-pulse 1.6s ease-in-out infinite;
}

.pet-portrait svg,
.pet-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  shape-rendering: crispEdges;
  transform-origin: 50% 72%;
  filter:
    drop-shadow(0 8px 0 rgba(97, 53, 30, 0.2))
    drop-shadow(0 18px 18px rgba(97, 53, 30, 0.18))
    saturate(1.04)
    contrast(1.02);
  animation:
    pixel-pet-idle calc(var(--pet-float-duration) * 1.1) steps(4, end) infinite,
    pet-breathe 2.8s steps(3, end) infinite;
}

.pet-body.is-frame-mode .pet-portrait {
  align-items: end;
}

.pet-body.is-frame-mode .pet-illustration {
  animation: none;
}

.pet-body.is-frame-mode .pet-portrait img {
  width: 132%;
  height: 132%;
  object-fit: contain;
  transform: translateY(8px);
  animation: none;
  filter:
    drop-shadow(0 10px 0 rgba(97, 53, 30, 0.2))
    drop-shadow(0 18px 18px rgba(97, 53, 30, 0.16))
    saturate(1.03)
    contrast(1.01);
}

.pet-sleep-float {
  position: absolute;
  right: 14%;
  top: 4%;
  width: 92px;
  height: 84px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.pet-portrait[data-action="sleep"] .pet-sleep-float {
  opacity: 1;
}

.pet-sleep-float span {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 26px;
  min-height: 26px;
  padding: 4px 6px;
  font-family: "Courier New", monospace;
  font-weight: 900;
  line-height: 1;
  color: #fffdf8;
  background: linear-gradient(180deg, rgba(255, 247, 230, 0.98), rgba(250, 228, 195, 0.96));
  border-radius: 10px;
  box-shadow:
    0 0 0 2px rgba(90, 61, 48, 0.92),
    4px 4px 0 rgba(90, 61, 48, 0.3),
    inset 0 -4px 0 rgba(211, 167, 116, 0.46);
  text-shadow:
    1px 0 0 rgba(90, 61, 48, 0.96),
    -1px 0 0 rgba(90, 61, 48, 0.96),
    0 1px 0 rgba(90, 61, 48, 0.96),
    0 -1px 0 rgba(90, 61, 48, 0.96);
  animation: sleep-z-float 3.4s ease-in-out infinite;
}

.pet-sleep-float span:nth-child(1) {
  right: 38px;
  bottom: 8px;
  font-size: 0.88rem;
  min-width: 24px;
  min-height: 24px;
  animation-delay: 0s;
}

.pet-sleep-float span:nth-child(2) {
  right: 18px;
  bottom: 26px;
  font-size: 1.04rem;
  min-width: 28px;
  min-height: 28px;
  animation-delay: 0.5s;
}

.pet-sleep-float span:nth-child(3) {
  right: -4px;
  bottom: 48px;
  font-size: 1.2rem;
  min-width: 32px;
  min-height: 32px;
  animation-delay: 1s;
}

.pet-body.is-frame-mode .pet-portrait[data-action="sleep"] img {
  width: 122%;
  height: 122%;
  transform: translateX(-10px) translateY(8px);
}

.pet-body.is-frame-mode .pet-portrait[data-action="wait_door"] img {
  transform: translateY(9px);
}

.pet-body.is-frame-mode .pet-portrait[data-action="happy_hop"] img {
  transform: translateY(4px);
}

.pet-render-stage svg {
  overflow: visible;
  transform: scale(1.26);
}

.pet-render-stage .pet-character,
.pet-render-stage .pet-head-piece,
.pet-render-stage .pet-tail-piece,
.pet-render-stage .pet-leg-front-piece,
.pet-render-stage .pet-leg-back-piece,
.pet-render-stage .pet-sway-left-piece,
.pet-render-stage .pet-sway-right-piece,
.pet-render-stage .pet-eye-piece,
.pet-render-stage .pet-accessory-piece,
.pet-render-stage .pet-sparkle-piece {
  transform-box: fill-box;
}

.pet-render-stage .pet-character {
  transform-origin: center bottom;
  animation: pixel-character-bob 1.8s steps(3, end) infinite;
}

.pet-render-stage .pet-head-piece {
  transform-origin: center center;
  animation: pixel-head-nod 1.8s steps(3, end) infinite;
}

.pet-render-stage .pet-tail-piece {
  transform-origin: center center;
  animation: pixel-tail-swish 1.2s steps(3, end) infinite;
}

.pet-render-stage .pet-leg-front-piece {
  transform-origin: center top;
  animation: pixel-front-step 0.9s steps(2, end) infinite;
}

.pet-render-stage .pet-leg-back-piece {
  transform-origin: center top;
  animation: pixel-back-step 0.9s steps(2, end) infinite;
}

.pet-render-stage .pet-sway-left-piece {
  transform-origin: center bottom;
  animation: pixel-sway-left 1.6s steps(3, end) infinite;
}

.pet-render-stage .pet-sway-right-piece {
  transform-origin: center bottom;
  animation: pixel-sway-right 1.6s steps(3, end) infinite;
}

.pet-render-stage .pet-eye-piece {
  transform-origin: center center;
  animation: pixel-blink 3.8s steps(2, end) infinite;
}

.pet-render-stage .pet-accessory-piece {
  transform-origin: center top;
  animation: pixel-accessory-swing 1.8s steps(3, end) infinite;
}

.pet-render-stage .pet-sparkle-piece {
  transform-origin: center center;
  animation: pixel-sparkle 1.4s steps(2, end) infinite;
}

.pet-illustration::before,
.pet-illustration::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.pet-illustration::before {
  inset: 14% 16% 18%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.7), transparent 28%),
    radial-gradient(circle at 56% 56%, rgba(255, 255, 255, 0.2), transparent 64%);
  transform: translateZ(20px) rotateX(62deg);
  mix-blend-mode: screen;
  opacity: 0.56;
}

.pet-illustration::after {
  left: 18%;
  right: 18%;
  bottom: 10%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.24), transparent 68%);
  transform: translateZ(10px);
  filter: blur(12px);
}

.pet-illustration > :not(.pet-portrait) {
  display: none;
}

.pet-tail {
  position: absolute;
  right: 18px;
  bottom: 60px;
  width: var(--pet-tail-width);
  height: var(--pet-tail-height);
  border-radius: 58px 58px 44px 44px;
  background: linear-gradient(180deg, var(--pet-main) 0%, var(--pet-main-dark) 100%);
  transform: rotate(var(--pet-tail-rotation));
  box-shadow: inset -8px -12px 18px rgba(0, 0, 0, 0.05);
}

.pet-ear {
  position: absolute;
  top: 22px;
  width: 56px;
  height: 74px;
  border-radius: 40px 40px 24px 24px;
  background: linear-gradient(180deg, var(--pet-main) 0%, var(--pet-main-dark) 100%);
  box-shadow: inset 0 -10px 12px rgba(0, 0, 0, 0.04);
}

.pet-ear::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  top: 16px;
  bottom: 8px;
  border-radius: 30px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pet-inner) 94%, white 6%), var(--pet-inner));
}

.pet-ear-left {
  left: 48px;
  transform: rotate(-12deg);
}

.pet-ear-right {
  right: 48px;
  transform: rotate(12deg);
}

.pet-silhouette {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 198px;
  height: 184px;
  transform: translateX(-50%);
  border-radius: 42% 42% 38% 38% / 44% 44% 34% 34%;
  background: linear-gradient(180deg, var(--pet-main) 0%, var(--pet-main-dark) 100%);
  box-shadow:
    inset 0 -10px 18px rgba(255, 255, 255, 0.34),
    0 18px 28px rgba(120, 92, 68, 0.12);
}

.pet-belly {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 112px;
  height: 92px;
  transform: translateX(-50%);
  border-radius: 50% 50% 44% 44%;
  background: linear-gradient(180deg, var(--pet-belly) 0%, color-mix(in srgb, var(--pet-belly) 86%, #f1e1cf 14%) 100%);
}

.pet-face {
  position: absolute;
  left: 50%;
  top: 36px;
  width: 118px;
  height: 98px;
  transform: translateX(-50%);
}

.pet-eye {
  position: absolute;
  top: 28px;
  width: 12px;
  height: 18px;
  border-radius: 50%;
  background: var(--pet-eye-color);
}

.pet-eye::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

.pet-eye-left {
  left: 26px;
}

.pet-eye-right {
  right: 26px;
}

.pet-blush {
  position: absolute;
  top: 48px;
  width: 22px;
  height: 12px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--pet-cheek) 76%, white 24%);
  opacity: 0.7;
}

.pet-blush-left {
  left: 10px;
}

.pet-blush-right {
  right: 10px;
}

.pet-nose {
  position: absolute;
  left: 50%;
  top: 48px;
  width: 16px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 50% 50% 60% 60%;
  background: color-mix(in srgb, var(--pet-inner) 82%, #7a4e34 18%);
}

.pet-mouth {
  position: absolute;
  left: 50%;
  top: 62px;
  width: 26px;
  height: 16px;
  transform: translateX(-50%);
}

.pet-mouth::before,
.pet-mouth::after {
  content: "";
  position: absolute;
  top: 0;
  width: 14px;
  height: 10px;
  border-bottom: 2px solid rgba(96, 58, 34, 0.7);
  border-radius: 0 0 14px 14px;
}

.pet-mouth::before {
  left: -1px;
  transform: rotate(8deg);
}

.pet-mouth::after {
  right: -1px;
  transform: rotate(-8deg);
}

.pet-paw {
  position: absolute;
  bottom: 20px;
  width: 48px;
  height: 32px;
  border-radius: 22px 22px 18px 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pet-main) 88%, white 12%), var(--pet-main-dark));
  box-shadow: inset 0 -8px 10px rgba(0, 0, 0, 0.05);
}

.pet-paw-left {
  left: 64px;
}

.pet-paw-right {
  right: 64px;
}

.pet-charm {
  position: absolute;
  left: 50%;
  top: 80px;
  transform: translateX(-50%);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #e9f2fb 100%);
  box-shadow:
    inset 0 -6px 10px rgba(0, 0, 0, 0.06),
    0 10px 16px rgba(120, 92, 68, 0.1);
  font-size: 1.05rem;
}

.pet-body[data-pet-type="cloud-dog"] {
  --pet-main: #fffefb;
  --pet-main-dark: #d9e8f4;
  --pet-accent: #c1d8ec;
  --pet-inner: #f3c2a5;
  --pet-belly: #fffef8;
  --pet-cheek: #efb4a4;
  --pet-rug-color: #f4ddc7;
  --pet-prop-color: #8dc4bd;
  --pet-float-duration: 5.8s;
  --pet-float-distance: 14px;
  --pet-tilt-y: -10deg;
}

.pet-body[data-pet-type="moon-fox"] {
  --pet-main: #fff0df;
  --pet-main-dark: #ffd1a2;
  --pet-accent: #ffab61;
  --pet-inner: #f39a63;
  --pet-belly: #fff7ee;
  --pet-cheek: #efab90;
  --pet-rug-color: #f2d5c2;
  --pet-prop-color: #ffb178;
  --pet-tail-rotation: 28deg;
  --pet-tail-width: 96px;
  --pet-tail-height: 112px;
  --pet-float-duration: 5s;
  --pet-float-distance: 13px;
  --pet-tilt-x: 9deg;
  --pet-tilt-y: -12deg;
}

.pet-body[data-pet-type="moon-fox"] .pet-ear {
  height: 82px;
}

.pet-body[data-pet-type="penguin"] {
  --pet-main: #282b33;
  --pet-main-dark: #0f1115;
  --pet-accent: #fff8ef;
  --pet-inner: #ffb864;
  --pet-belly: #fff9f1;
  --pet-cheek: #f1c2a4;
  --pet-rug-color: #d9e7e8;
  --pet-prop-color: #7cb4a8;
  --pet-tail-width: 54px;
  --pet-tail-height: 72px;
  --pet-float-duration: 4.7s;
  --pet-float-distance: 9px;
  --pet-tilt-x: 7deg;
  --pet-tilt-y: -5deg;
}

.pet-body[data-pet-type="penguin"] .pet-ear {
  display: none;
}

.pet-body[data-pet-type="penguin"] .pet-tail {
  right: 24px;
  bottom: 82px;
  border-radius: 48px 48px 28px 28px;
}

.pet-body[data-pet-type="penguin"] .pet-silhouette {
  border-radius: 48% 48% 42% 42% / 52% 52% 30% 30%;
}

.pet-body[data-pet-type="penguin"] .pet-face {
  top: 26px;
  width: 126px;
  height: 122px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.28), transparent 30%), var(--pet-belly);
  box-shadow: inset 0 -8px 0 rgba(255, 228, 200, 0.28);
}

.pet-body[data-pet-type="penguin"] .pet-belly,
.pet-body[data-pet-type="penguin"] .pet-blush {
  display: none;
}

.pet-body[data-pet-type="penguin"] .pet-eye {
  top: 34px;
}

.pet-body[data-pet-type="penguin"] .pet-nose {
  top: 50px;
  width: 22px;
  height: 16px;
  background: #ffb154;
}

.pet-body[data-pet-type="penguin"] .pet-mouth {
  display: none;
}

.pet-body[data-pet-type="penguin"] .pet-paw {
  bottom: 20px;
  width: 42px;
  height: 22px;
  border-radius: 24px 24px 10px 10px;
  background: linear-gradient(180deg, #ffc36c 0%, #ff9e44 100%);
}

.pet-body[data-pet-type="penguin"] .pet-charm {
  top: 84px;
  background: linear-gradient(180deg, #41506a 0%, #1c2536 100%);
  color: #fff;
}

.pet-body[data-pet-type="hamster"] {
  --pet-main: #f0b983;
  --pet-main-dark: #dd9560;
  --pet-accent: #ffe3c4;
  --pet-inner: #ffcfb4;
  --pet-belly: #fff4e8;
  --pet-cheek: #e8a688;
  --pet-rug-color: #f2dfc6;
  --pet-prop-color: #d99d65;
  --pet-tail-width: 20px;
  --pet-tail-height: 36px;
  --pet-float-duration: 4.4s;
  --pet-float-distance: 8px;
  --pet-tilt-x: 6deg;
  --pet-tilt-y: -6deg;
}

.pet-body[data-pet-type="hamster"] .pet-tail {
  opacity: 0;
}

.pet-body[data-pet-type="hamster"] .pet-ear {
  top: 28px;
  width: 56px;
  height: 56px;
  background: linear-gradient(180deg, #f6d2b2 0%, #ecaa78 100%);
}

.pet-body[data-pet-type="hamster"] .pet-silhouette {
  width: 188px;
  height: 172px;
  border-radius: 48%;
}

.pet-body[data-pet-type="hamster"] .pet-belly {
  width: 120px;
  height: 96px;
}

.pet-body[data-pet-type="cat"] {
  --pet-main: #f1e7df;
  --pet-main-dark: #d8c0af;
  --pet-accent: #c1845d;
  --pet-inner: #efc1a7;
  --pet-belly: #fff6ee;
  --pet-cheek: #e6ae9d;
  --pet-rug-color: #e6d8ce;
  --pet-prop-color: #88b8a6;
  --pet-tail-rotation: 34deg;
  --pet-tail-width: 66px;
  --pet-tail-height: 122px;
  --pet-float-duration: 5.1s;
  --pet-float-distance: 11px;
  --pet-tilt-x: 8deg;
  --pet-tilt-y: -11deg;
}

.pet-body[data-pet-type="cat"] .pet-ear {
  top: 18px;
  width: 54px;
  height: 86px;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  border-radius: 10px;
}

.pet-body[data-pet-type="cat"] .pet-silhouette::after {
  content: "";
  position: absolute;
  top: 48px;
  left: 34px;
  width: 46px;
  height: 10px;
  border-radius: 50%;
  background: rgba(164, 122, 92, 0.18);
  transform: rotate(-28deg);
  box-shadow: 48px 20px 0 rgba(164, 122, 92, 0.14);
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pet-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, calc(var(--pet-float-distance) * -1), 0);
  }
}

@keyframes pet-idle {
  0%,
  100% {
    transform: rotateX(0deg) rotateY(0deg) scale(1);
  }
  22% {
    transform: rotateX(var(--pet-tilt-x)) rotateY(var(--pet-tilt-y)) scale(1.015);
  }
  56% {
    transform: rotateX(calc(var(--pet-tilt-x) * -0.45)) rotateY(calc(var(--pet-tilt-y) * -0.65)) scale(0.99);
  }
  78% {
    transform: rotateX(calc(var(--pet-tilt-x) * 0.35)) rotateY(calc(var(--pet-tilt-y) * 0.45)) scale(1.01);
  }
}

@keyframes pet-breathe {
  0%,
  100% {
    filter:
      drop-shadow(0 24px 30px rgba(97, 53, 30, 0.16))
      saturate(1.04)
      contrast(1.02);
  }
  50% {
    filter:
      drop-shadow(0 28px 34px rgba(97, 53, 30, 0.2))
      saturate(1.08)
      contrast(1.04);
  }
}

@keyframes pet-shadow-breathe {
  0%,
  100% {
    transform: scaleX(1) scaleY(1);
    opacity: 0.56;
  }
  50% {
    transform: scaleX(0.9) scaleY(0.78);
    opacity: 0.38;
  }
}

@keyframes pet-aura-drift {
  0%,
  100% {
    opacity: 0.54;
    transform: translate3d(0, 0, -30px) scale(1);
  }
  50% {
    opacity: 0.82;
    transform: translate3d(0, -10px, -30px) scale(1.05);
  }
}

@keyframes pet-bowl-wobble {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-3deg) translateY(-1px);
  }
  50% {
    transform: rotate(2deg) translateY(1px);
  }
  75% {
    transform: rotate(-1deg);
  }
}

@keyframes pet-toy-bob {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.04);
  }
}

@keyframes pixel-stage-hop {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  35% {
    transform: translate3d(0, -10px, 0);
  }
  65% {
    transform: translate3d(0, -6px, 0);
  }
}

@keyframes pixel-pet-idle {
  0%,
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  30% {
    transform: translateY(-2px) scale(1.04) rotate(-1deg);
  }
  60% {
    transform: translateY(1px) scale(0.98) rotate(1deg);
  }
}

@keyframes pixel-character-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes pixel-head-nod {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(1px);
  }
}

@keyframes pixel-tail-swish {
  0%,
  100% {
    transform: rotate(0deg);
  }
  33% {
    transform: rotate(-8deg);
  }
  66% {
    transform: rotate(10deg);
  }
}

@keyframes pixel-front-step {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(2px);
  }
}

@keyframes pixel-back-step {
  0%,
  100% {
    transform: translateY(2px);
  }
  50% {
    transform: translateY(0);
  }
}

@keyframes pixel-sway-left {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-6deg) translateY(-1px);
  }
}

@keyframes pixel-sway-right {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(6deg) translateY(-1px);
  }
}

@keyframes pixel-blink {
  0%,
  44%,
  48%,
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
  46%,
  47% {
    opacity: 0.85;
    transform: scaleY(0.12);
  }
}

@keyframes pixel-accessory-swing {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(2px) rotate(4deg);
  }
}

@keyframes pixel-sparkle {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes pet-character-breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.018);
  }
}

@keyframes pet-tail-swish {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-6deg);
  }
  50% {
    transform: rotate(8deg);
  }
  75% {
    transform: rotate(-4deg);
  }
}

@keyframes pet-sway-left {
  0%,
  100% {
    transform: rotate(0deg);
  }
  35% {
    transform: rotate(-4deg) translateY(-2px);
  }
  60% {
    transform: rotate(3deg) translateY(1px);
  }
}

@keyframes pet-sway-right {
  0%,
  100% {
    transform: rotate(0deg);
  }
  35% {
    transform: rotate(4deg) translateY(-2px);
  }
  60% {
    transform: rotate(-3deg) translateY(1px);
  }
}

@keyframes pet-blink {
  0%,
  44%,
  48%,
  100% {
    transform: scaleY(1);
  }
  46%,
  47% {
    transform: scaleY(0.08);
  }
}

@keyframes pet-accessory-swing {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  30% {
    transform: rotate(-4deg) translateY(-1px);
  }
  60% {
    transform: rotate(3deg) translateY(1px);
  }
}

@keyframes pet-sparkle {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes pet-loading-pulse {
  0%,
  100% {
    opacity: 0.46;
    transform: scale(0.94);
  }
  50% {
    opacity: 0.92;
    transform: scale(1.04);
  }
}

@keyframes sleep-z-float {
  0% {
    transform: translate(0, 8px) scale(0.9);
    opacity: 0;
  }
  14% {
    opacity: 0.56;
  }
  28% {
    transform: translate(-2px, 3px) scale(0.96);
    opacity: 0.82;
  }
  54% {
    transform: translate(1px, -2px) scale(1);
    opacity: 0.9;
  }
  74% {
    transform: translate(3px, -7px) scale(1.03);
    opacity: 0.72;
  }
  100% {
    transform: translate(6px, -15px) scale(1.08);
    opacity: 0;
  }
}

.pet-caption {
  text-align: center;
}

.pet-caption small {
  color: var(--accent);
  font-size: 0.95rem;
}

.pet-caption p {
  margin: 8px 0 0;
  max-width: 420px;
  line-height: 1.6;
}

.panel {
  padding: 22px;
}

.stats-panel {
  grid-column: span 1;
}

.action-panel {
  grid-column: span 1;
  padding: 16px 18px;
}

.utility-dock-panel {
  grid-column: span 1;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.utility-dock {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.utility-icon-button,
.utility-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(120, 92, 68, 0.1);
  color: var(--text);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.utility-icon-button span {
  font-size: 1.1rem;
}

.utility-icon-button.active,
.utility-icon-button:hover,
.utility-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(70, 43, 24, 0.12);
  background: rgba(255, 248, 239, 0.96);
}

.utility-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(57, 39, 29, 0.18);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 19;
}

.utility-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.utility-window {
  position: fixed;
  left: 50%;
  bottom: 28px;
  width: min(560px, calc(100vw - 28px));
  max-height: min(72vh, 680px);
  display: none;
  overflow: auto;
  transform: translateX(-50%);
  z-index: 20;
}

.utility-window.visible {
  display: block;
}

.utility-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.utility-panel-actions .panel-tip {
  margin: 0;
}

.event-panel.utility-window,
.note-panel.utility-window,
.memory-preview-panel.utility-window {
  width: min(500px, calc(100vw - 28px));
}

.feed-panel.utility-window,
.reminder-panel.utility-window {
  width: min(620px, calc(100vw - 28px));
}

.event-panel,
.note-panel,
.memory-preview-panel,
.feed-panel {
  grid-column: span 1;
}

.reminder-panel {
  grid-column: span 2;
}

.feed-panel {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stat-item {
  padding: 11px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 238, 0.92));
  border-radius: var(--radius-md);
  border: 1px solid rgba(120, 92, 68, 0.08);
  box-shadow:
    inset 0 -6px 0 rgba(255, 255, 255, 0.5),
    0 10px 18px rgba(120, 92, 68, 0.07);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.stat-row strong {
  min-width: 44px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
  font-size: 0.95rem;
  box-shadow: inset 0 0 0 1px rgba(120, 92, 68, 0.06);
}

.stat-bar {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(107, 159, 154, 0.14);
}

.stat-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal) 0%, #9fcfcb 100%);
  transition: width 220ms ease;
}

.stat-bar.accent span {
  background: linear-gradient(90deg, var(--accent) 0%, #efb284 100%);
}

.stat-item-fullness {
  background: linear-gradient(180deg, rgba(255, 243, 222, 0.98), rgba(255, 229, 191, 0.94));
}

.stat-item-fullness .stat-row strong {
  color: #bb6d1f;
}

.stat-item-fullness .stat-bar {
  background: rgba(244, 177, 87, 0.18);
}

.stat-item-fullness .stat-bar span {
  background: linear-gradient(90deg, #f3a446 0%, #f8d274 100%);
}

.stat-item-mood {
  background: linear-gradient(180deg, rgba(255, 230, 232, 0.98), rgba(255, 210, 219, 0.94));
}

.stat-item-mood .stat-row strong {
  color: #d25c79;
}

.stat-item-mood .stat-bar {
  background: rgba(228, 109, 138, 0.18);
}

.stat-item-mood .stat-bar span {
  background: linear-gradient(90deg, #ef7b9a 0%, #ffb1c1 100%);
}

.stat-item-cleanliness {
  background: linear-gradient(180deg, rgba(225, 246, 239, 0.98), rgba(202, 236, 225, 0.94));
}

.stat-item-cleanliness .stat-row strong {
  color: #2f9b81;
}

.stat-item-cleanliness .stat-bar {
  background: rgba(71, 182, 151, 0.18);
}

.stat-item-cleanliness .stat-bar span {
  background: linear-gradient(90deg, #41be9d 0%, #8edac5 100%);
}

.stat-item-energy {
  background: linear-gradient(180deg, rgba(233, 239, 255, 0.98), rgba(211, 223, 255, 0.94));
}

.stat-item-energy .stat-row strong {
  color: #5373d1;
}

.stat-item-energy .stat-bar {
  background: rgba(92, 123, 230, 0.18);
}

.stat-item-energy .stat-bar span {
  background: linear-gradient(90deg, #6488f1 0%, #9fb6ff 100%);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.action-button,
.chip-button,
.ghost-button,
.primary-button {
  border-radius: 18px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.action-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 62px;
  padding: 8px 6px;
  background: linear-gradient(180deg, #fff7ee 0%, #fff1e1 100%);
  border: 1px solid rgba(120, 92, 68, 0.08);
  text-align: center;
}

.action-button span {
  font-size: 1.05rem;
}

.action-button strong {
  font-size: 0.82rem;
  line-height: 1.15;
}

.action-button small {
  display: none;
}

.action-panel .panel-heading,
.stats-panel .panel-heading {
  margin-bottom: 12px;
}

.action-panel .panel-heading h2,
.stats-panel .panel-heading h2 {
  font-size: 1.5rem;
  line-height: 1.15;
}

.action-panel .panel-tip,
.stats-panel .panel-tip {
  font-size: 0.86rem;
}

.action-button:hover,
.chip-button:hover,
.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(70, 43, 24, 0.12);
}

.event-description {
  margin: 0 0 18px;
  line-height: 1.6;
}

.event-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.event-dots {
  display: flex;
  gap: 10px;
}

.event-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(120, 92, 68, 0.18);
  box-shadow: inset 0 0 0 1px rgba(120, 92, 68, 0.08);
}

.event-dot.done {
  background: linear-gradient(180deg, var(--accent) 0%, #ebb287 100%);
}

.mood-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.chip-button,
.ghost-button {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(120, 92, 68, 0.1);
  color: var(--text);
}

.chip-button {
  padding: 10px 14px;
}

.note-form textarea,
.settings-grid input,
.settings-grid select,
.invite-box textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(120, 92, 68, 0.12);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
}

.note-form textarea,
.invite-box textarea {
  min-height: 120px;
  padding: 16px;
  resize: vertical;
  line-height: 1.6;
}

.note-actions,
.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.note-actions {
  margin-top: 12px;
}

.primary-button {
  padding: 12px 18px;
  background: linear-gradient(180deg, var(--accent) 0%, #b95a38 100%);
  color: white;
}

.ghost-button {
  padding: 12px 16px;
}

.feed-list {
  display: grid;
  gap: 12px;
}

.feed-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(120, 92, 68, 0.08);
}

.feed-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(210, 109, 75, 0.12);
  font-size: 1.35rem;
}

.feed-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.feed-detail {
  margin: 6px 0 0;
  line-height: 1.55;
}

.memory-preview-list {
  display: grid;
  gap: 12px;
}

.memory-preview-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(120, 92, 68, 0.08);
}

.memory-preview-item span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(210, 109, 75, 0.12);
}

.memory-preview-item p {
  margin: 0;
  line-height: 1.6;
}

.reminder-list,
.memory-reminder-grid {
  display: grid;
  gap: 14px;
}

.reminder-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reminder-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(120, 92, 68, 0.09);
}

.reminder-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reminder-kind {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.reminder-kind strong {
  color: var(--text);
  font-size: 1rem;
}

.reminder-countdown {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(210, 109, 75, 0.12);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
}

.reminder-date {
  margin: 12px 0 8px;
  font-size: 1.05rem;
}

.reminder-detail {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(47, 30, 21, 0.36);
}

.modal.visible {
  display: flex;
}

.modal-card {
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  background: rgba(247, 240, 231, 0.98);
  border: 1px solid rgba(120, 92, 68, 0.12);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(47, 30, 21, 0.26);
}

.memory-modal-card {
  width: min(1120px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.memory-hero-text {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.memory-hero {
  margin-top: 6px;
}

.memory-summary-grid,
.memory-anniversary-grid,
.memory-growth-grid,
.memory-moment-grid {
  display: grid;
  gap: 14px;
}

.memory-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.memory-stat-card,
.memory-anniversary-card,
.memory-growth-card,
.memory-moment-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(120, 92, 68, 0.09);
  border-radius: 22px;
}

.memory-stat-card {
  padding: 18px;
}

.memory-stat-card span,
.memory-anniversary-label,
.memory-moment-meta,
.memory-growth-tag {
  color: var(--muted);
  font-size: 0.92rem;
}

.memory-stat-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
}

.memory-stat-card small {
  color: var(--muted);
  line-height: 1.5;
}

.memory-section {
  margin-top: 24px;
}

.memory-section-heading {
  margin-bottom: 14px;
}

.memory-anniversary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.memory-reminder-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.memory-anniversary-card {
  padding: 18px;
}

.memory-anniversary-label {
  margin: 0 0 8px;
}

.memory-anniversary-title {
  margin: 0;
  font-size: 1.2rem;
}

.memory-anniversary-badge {
  display: inline-flex;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(210, 109, 75, 0.12);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.memory-anniversary-detail {
  margin: 12px 0 0;
  line-height: 1.6;
}

.memory-growth-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.memory-growth-card {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.memory-growth-card.current {
  background: linear-gradient(180deg, rgba(247, 214, 181, 0.82) 0%, rgba(255, 246, 235, 0.82) 100%);
  border-color: rgba(210, 109, 75, 0.24);
}

.memory-growth-card.unlocked::after,
.memory-growth-card.current::after {
  content: "";
  position: absolute;
  inset: auto 18px 0 18px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, #efb284 100%);
}

.memory-growth-card.locked {
  opacity: 0.7;
}

.memory-growth-card h3 {
  margin: 8px 0;
  font-size: 1.15rem;
}

.memory-growth-card p {
  margin: 0;
  line-height: 1.6;
}

.memory-moment-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.memory-moment-card {
  padding: 18px;
}

.memory-moment-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.memory-moment-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.memory-moment-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(210, 109, 75, 0.12);
  font-size: 1.2rem;
}

.memory-moment-title strong {
  font-size: 1.06rem;
}

.memory-moment-body {
  margin: 12px 0 0;
  line-height: 1.7;
}

.memory-moment-chip {
  display: inline-flex;
  margin-top: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(107, 159, 154, 0.12);
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 600;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-grid label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

.settings-grid input,
.settings-grid select {
  padding: 12px 14px;
}

.settings-help {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px dashed rgba(120, 92, 68, 0.14);
}

.settings-help p {
  margin: 0;
  line-height: 1.6;
}

.settings-help p + p {
  margin-top: 8px;
}

.invite-box {
  margin-top: 20px;
  padding: 18px;
}

.invite-box textarea {
  margin: 10px 0 12px;
  min-height: 110px;
}

.hidden {
  display: none;
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr 1fr;
  }

  .scene-card,
  .stats-panel,
  .action-panel,
  .utility-dock-panel,
  .event-panel,
  .note-panel,
  .memory-preview-panel,
  .reminder-panel,
  .feed-panel {
    grid-column: span 2;
  }

  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reminder-list,
  .memory-summary-grid,
  .memory-reminder-grid,
  .memory-growth-grid,
  .memory-moment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 18px 14px 48px;
  }

  .topbar,
  .scene-meta,
  .event-progress,
  .panel-heading,
  .utility-panel-actions,
  .note-actions,
  .settings-actions,
  .modal-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .scene-card,
  .stats-panel,
  .action-panel,
  .utility-dock-panel,
  .event-panel,
  .note-panel,
  .memory-preview-panel,
  .reminder-panel,
  .feed-panel {
    grid-column: span 1;
  }

  .partners {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .utility-window {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
    transform: none;
    max-height: 72vh;
  }

  .utility-dock {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .utility-panel-actions {
    width: 100%;
    justify-content: space-between;
  }

  .scene-meta {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    padding-right: 0;
  }

  .scene-background {
    min-height: 528px;
    padding: 18px 16px 24px;
  }

  .anniversary {
    padding: 10px 12px;
    border-radius: 16px;
    max-width: 108px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 20px rgba(120, 92, 68, 0.08);
  }

  .anniversary span,
  .anniversary-subtitle {
    font-size: 0.74rem;
  }

  .anniversary strong {
    font-size: 1rem;
    line-height: 1.1;
  }

  .partner-card {
    width: 100%;
    min-height: 92px;
    padding: 14px 16px;
  }

  .window-glow {
    right: 22px;
    width: 120px;
    height: 160px;
  }

  .window-curtain {
    height: 166px;
  }

  .curtain-left {
    right: 108px;
  }

  .curtain-right {
    right: 8px;
  }

  .sticky-note {
    top: 106px;
    left: 16px;
    right: auto;
    width: 126px;
    min-height: 78px;
    padding: 12px 12px;
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .sticky-note::before {
    left: 14px;
    width: 34px;
    height: 14px;
    top: -7px;
  }

  .wall-shelf {
    display: none;
  }

  .ceiling-lamp {
    transform: translateX(-50%) scale(0.82);
  }

  .ritual-row {
    grid-template-columns: 1fr;
    width: min(100%, 320px);
    gap: 8px;
  }

  .ritual-chip {
    padding: 10px 12px;
  }

  .ritual-chip strong {
    font-size: 0.92rem;
  }

  .partners {
    gap: 12px;
    margin-top: 86px;
  }

  .pet-stage {
    width: 100%;
    gap: 10px;
  }

  .speech-bubble {
    max-width: min(100%, 252px);
    padding: 10px 12px;
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .speech-bubble::after {
    width: 18px;
    height: 18px;
    bottom: -8px;
  }

  .pet-body {
    min-width: 0;
    width: min(100%, 286px);
  }

  .pet-illustration {
    width: 286px;
    height: 286px;
  }

  .pet-body.is-frame-mode .pet-portrait img {
    width: 114%;
    height: 114%;
    transform: translateY(6px);
  }

  .pet-body.is-frame-mode .pet-portrait[data-action="sleep"] img {
    width: 108%;
    height: 108%;
    transform: translateX(-6px) translateY(6px);
  }

  .pet-prop {
    display: none;
  }

  .pet-sleep-float {
    right: 10%;
    top: 6%;
    width: 74px;
    height: 68px;
  }

  .pet-caption {
    width: min(100%, 300px);
  }

  .pet-caption h3 {
    font-size: 1.14rem;
  }

  .pet-caption small {
    display: block;
    margin-top: 4px;
    font-size: 0.84rem;
  }

  .pet-caption p {
    margin-top: 6px;
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .actions-grid {
    grid-template-columns: 1fr;
  }

  .reminder-list,
  .memory-summary-grid,
  .memory-anniversary-grid,
  .memory-reminder-grid,
  .memory-growth-grid,
  .memory-moment-grid {
    grid-template-columns: 1fr;
  }
}
