.fox-companion { --fox-ink: #294b43; --fox-muted: #667a70; --fox-green: #326b57; --fox-cream: #fffdf6; font-family: 'fredoka', system-ui, sans-serif; color: var(--fox-ink); }
html.fox-dialog-open, html.fox-dialog-open body { overflow: hidden; }
.fox-companion [hidden] { display: none !important; }
.fox-companion *, .fox-companion *::before, .fox-companion *::after { box-sizing: border-box; }
.fox-companion button { font: inherit; cursor: pointer; touch-action: manipulation; letter-spacing: normal; text-shadow: none; }
/* The global button:hover scale(1.1) would expand the dialog's scrollable area. */
.fox-companion button, .fox-companion button:hover, .fox-companion button:active { transform: none; transition: background-color .2s ease, border-color .2s ease; }
.fox-companion button:focus-visible { outline: 2px solid #54625c; outline-offset: 3px; }
.fox-companion .fox-launcher { position: fixed; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; z-index: 12; display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 4px 12px 4px 4px; margin: 0; border: 1px solid #c6d5c9; border-radius: 30px; background: #fffdf6f2; color: var(--fox-ink); box-shadow: 0 2px 8px #244b4319; }
.fox-mini-art { display: block; width: 42px; height: 42px; overflow: hidden; --fox-idle-cycle: 36s; }
.fox-mini-art .fox-art { width: 53px; height: 48px; transform: translate(-5px, 0); }
.fox-launcher-copy { display: block; white-space: nowrap; font-size: 14px; line-height: 1.2; }
.fox-companion .fox-dialog { border: 1px solid #e1e5d5; padding: 0; width: min(460px, calc(100vw - 24px)); max-width: 660px; max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; border-radius: 26px; background: var(--fox-cream); color: var(--fox-ink); box-shadow: 0 20px 100px #183e4333; margin: auto; }
.fox-dialog::backdrop { background: #193c4666; backdrop-filter: blur(3px); }
.fox-dialog:focus { outline: none; }
.fox-dialog-inner { padding: 20px 26px 16px; }
.fox-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fox-eyebrow { font-size: 11px; letter-spacing: 1.8px; color: var(--fox-muted); }
.fox-companion .fox-close { flex: 0 0 40px; width: 40px; height: 40px; padding: 0; margin: -6px -10px -6px 0; border: 0; border-radius: 50%; background: transparent; box-shadow: none; color: var(--fox-muted); font-size: 28px; line-height: 1; }
.fox-close:hover { background: #edf1e8; }
.fox-intro { text-align: center; min-width: 0; }
.fox-scene { position: relative; width: 230px; height: 201px; margin: 4px auto 0; isolation: isolate; }
.fox-scene-halo { position: absolute; inset: 24px 16px 3px; border-radius: 50% 50% 43% 43%; background: #eaf0dc; z-index: -1; }
.fox-main-art { width: 100%; height: 100%; position: relative; }
.fox-art { width: 100%; height: 100%; overflow: visible; }
.fox-scarf { display: none; }
.fox-companion.has-scarf .fox-scarf { display: block; }
.fox-tail { transform-origin: 161px 180px; }
.fox-head, .fox-lick { transform-origin: 130px 138px; }
.fox-eyes { transform-origin: 130px 87px; }
.fox-front-paw { transform-origin: 99px 171px; }
.fox-tongue { opacity: 0; transform-origin: 129px 125px; }
.fox-art .fox-tail { animation: fox-idle-tail 9s ease-in-out infinite; }
.fox-art .fox-eyes { animation: fox-idle-blink 7s ease-in-out infinite; }
.fox-art .fox-head, .fox-art .fox-lick { animation: fox-idle-head var(--fox-idle-cycle, 24s) ease-in-out infinite; }
.fox-art .fox-front-paw { animation: fox-idle-paw var(--fox-idle-cycle, 24s) ease-in-out infinite; }
.fox-art .fox-tongue { animation: fox-idle-lick var(--fox-idle-cycle, 24s) ease-in-out infinite; }
.fox-mini-art .fox-tail { animation-duration: 14s; }
.fox-companion.is-page-hidden * { animation-play-state: paused !important; }
.fox-companion h2 { font: 600 27px/1.16 'fredoka', system-ui, sans-serif; color: var(--fox-ink); margin: 14px 0 9px; letter-spacing: -.4px; text-shadow: none; }
.fox-companion p { font-size: 15px; line-height: 1.5; margin: 0; }
.fox-companion .fox-status { color: var(--fox-green); font-size: 14px; min-height: 22px; margin-top: 6px; }
.fox-companion .fox-status:empty { display: none; }
.fox-daily { background: #f0f3e8; border-radius: 16px; padding: 14px 16px; margin: 18px 0 14px; }
.fox-daily-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.fox-daily-label strong { white-space: nowrap; font-weight: 500; }
.fox-milestones { display: flex; justify-content: space-around; gap: 8px; margin-top: 12px; }
.fox-milestones > span { display: grid; justify-items: center; gap: 5px; flex: 1; }
.fox-milestones i { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #c9d3c4; border-radius: 50%; font-size: 17px; font-style: normal; background: #fffdf6; filter: grayscale(1); opacity: .5; }
.fox-milestones .is-earned i { background: #f9dca2; border-color: #d8b773; filter: none; opacity: 1; }
.fox-milestones small { font-size: 11px; color: var(--fox-muted); }
.fox-companion .fox-primary, .fox-companion .fox-secondary { width: 100%; padding: 13px 18px; border: 0; border-radius: 13px; margin: 0; font-size: 17px; font-weight: 500; color: #fffdf6; background: var(--fox-green); box-shadow: none; }
.fox-primary span { padding-left: 14px; }
.fox-companion .fox-primary:hover { background: #285945; }
.fox-companion .fox-secondary { background: #f1e7d5; color: var(--fox-ink); font-size: 14px; margin-bottom: 8px; }
.fox-dialog.is-care { width: min(650px, calc(100vw - 24px)); }
.fox-dialog.is-care .fox-layout { display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px; align-items: center; margin-top: 18px; }
.fox-dialog.is-care h2 { font-size: 24px; }
.fox-dialog.is-care .fox-scene { width: 215px; height: 190px; }
.fox-wallet { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 14px; }
.fox-wallet strong { padding: 5px 10px; background: #f9ebcd; border-radius: 18px; font-size: 18px; }
.fox-bond.is-care-gained .fox-bond-heart { animation: fox-heart-gain 1.2s ease-in-out; }
@keyframes fox-heart-gain { 0%, 100% { transform: scale(1); } 25%, 65% { transform: scale(1.2); } 45% { transform: scale(1); } }
.fox-shop { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fox-companion .fox-shop button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; margin: 0; border: 1px solid #dde2d4; border-radius: 14px; color: var(--fox-ink); background: #fff; box-shadow: none; font-size: 14px; min-height: 90px; }
.fox-companion .fox-shop button:hover:enabled { border-color: #9bad8d; background: #f5f7ee; }
.fox-companion button:disabled { cursor: default; }
.fox-companion .fox-shop button:disabled { opacity: .5; }
.fox-item-icon { font-size: 27px; line-height: 1.2; }
.fox-shop .fox-exchange { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 4px; color: var(--fox-ink); font-size: 13px; font-weight: 500; white-space: nowrap; }
.fox-price { font-weight: inherit; }
.fox-heart-value { color: #aa4860; }
.fox-bond { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; padding: 8px; border-radius: 17px; background: #f4ece8; font-size: 20px; }
.fox-bond-heart { font-family: system-ui, sans-serif; font-size: 42px; line-height: 1; color: #c46175; background: linear-gradient(to top, #c46175 var(--heart-fill, 0%), #e5d9d5 var(--heart-fill, 0%)); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.fox-bond strong { font-weight: 500; white-space: nowrap; }
.fox-next-reward { display: grid; place-items: center; flex: 0 0 58px; height: 58px; margin-left: 4px; border: 1px solid #e1c8a5; border-radius: 14px; background: #fff6df; font-size: 37px; line-height: 1; }
.fox-rewards { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 270px; margin: 12px auto 0; }
.fox-companion .fox-rewards button { display: grid; place-items: center; width: 46px; height: 44px; padding: 0; margin: 0; font-size: 25px; border: 1px solid #d4ddcf; border-radius: 12px; background: #f0f3e8; box-shadow: none; }
.fox-companion .fox-rewards button:hover:enabled, .fox-companion .fox-rewards button[aria-pressed="true"] { background: #dceade; border-color: #83a894; }
.fox-companion .fox-rewards button:disabled { opacity: .5; }
.fox-pillow, .fox-sleeping, .fox-ball, .fox-happy-eyes, .fox-dirt, .fox-clean-stars, .fox-puddle { display: none; }
.fox-companion.has-ball:not(.is-resting) .fox-ball, .fox-companion.is-dirty .fox-dirt,
.fox-companion.is-washed .fox-clean-stars, .fox-companion.is-fed .fox-happy-eyes { display: block; }
.fox-companion.is-fed .fox-eyes, .fox-companion.is-resting .fox-awake { display: none; }
.fox-companion.is-resting .fox-sleeping, .fox-companion.is-resting.has-pillow .fox-pillow { display: block; }
.fox-awake { transform-origin: 130px 205px; }
.fox-sleeping { transform-origin: 130px 210px; animation: fox-breathe 4s ease-in-out infinite; }
.fox-ball { transform-origin: 214px 197px; }
.fox-flower, .fox-lantern, .fox-plush, .fox-tent { display: none; }
.fox-windmill, .fox-books, .fox-pond, .fox-lights, .fox-picnic { display: none; }
.fox-companion.has-windmill .fox-main-art .fox-windmill,
.fox-companion.has-books .fox-main-art .fox-books,
.fox-companion.has-pond .fox-main-art .fox-pond,
.fox-companion.has-lights .fox-main-art .fox-lights,
.fox-companion.has-picnic .fox-main-art .fox-picnic { display: block; }
/* New scenery stays inside the menu; the small launcher remains quiet. */
.fox-dialog:not([open]) .fox-main-art * { animation-play-state: paused; }
.fox-windmill-blades { transform-origin: 33px 145px; animation: fox-windmill-turn 18s linear infinite; }
.fox-water-ripple { animation: fox-water-shimmer 8s ease-in-out infinite; }
.fox-light-glow { animation: fox-water-shimmer 7s ease-in-out infinite; }
@keyframes fox-windmill-turn { to { transform: rotate(360deg); } }
@keyframes fox-water-shimmer { 0%, 100% { opacity: .3; } 50% { opacity: .7; } }
.fox-companion.has-flower .fox-main-art .fox-flower,
.fox-companion.has-lantern .fox-main-art .fox-lantern,
.fox-companion.has-plush.is-resting .fox-main-art .fox-plush,
.fox-companion.has-tent.is-resting .fox-main-art .fox-tent { display: block; }
.fox-lantern-light { transform-origin: 37px 182px; animation: fox-lantern-glow 7s ease-in-out infinite; }
.fox-wish { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 44px; height: 40px; border: 1px solid #d6dfd3; border-radius: 50%; background: #fffdf6; font-size: 25px; line-height: 1; animation: fox-wish-appear 14s ease-in-out infinite; }
.fox-wish::after { content: ''; position: absolute; bottom: -5px; left: 7px; width: 7px; height: 7px; border-radius: 50%; background: #fffdf6; border: 1px solid #d6dfd3; }
.fox-yawn { opacity: 0; }
.fox-scene.wants-wash .fox-dirt { display: block; opacity: .4; }
.fox-scene.wants-wash .fox-clean-stars, .fox-scene.wants-food .fox-happy-eyes { display: none; }
.fox-scene.wants-food .fox-eyes { display: block; }
.fox-scene.wants-food:not(.is-eating):not(.is-waving):not(.is-playing) .fox-head { animation: fox-food-glance 14s ease-in-out infinite; }
.fox-scene.wants-rest .fox-yawn { animation: fox-yawn 14s ease-in-out infinite; }
.fox-scene.wants-rest .fox-head { animation: fox-sleepy-nod 14s ease-in-out infinite; }
@keyframes fox-wish-appear { 0%, 18%, 100% { opacity: 1; transform: translateY(0); } 25%, 92% { opacity: 0; transform: translateY(3px); } }
@keyframes fox-food-glance { 0%, 22%, 100% { transform: none; } 7%, 16% { transform: rotate(6deg) translateY(2px); } }
@keyframes fox-sleepy-nod { 0%, 30%, 100% { transform: none; } 12%, 20% { transform: translateY(4px) rotate(-3deg); } }
@keyframes fox-yawn { 0%, 7%, 25%, 100% { opacity: 0; } 12%, 20% { opacity: 1; } }
@keyframes fox-lantern-glow { 0%, 100% { opacity: .18; transform: scale(.96); } 50% { opacity: .3; transform: scale(1.04); } }
.fox-treat { position: absolute; left: 99px; top: 115px; font-size: 34px; opacity: 0; }
.fox-bubbles { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.fox-bubbles i { position: absolute; width: 37px; height: 37px; background: #edfaffdc; border: 2px solid #c4e3e6; border-radius: 50%; top: 110px; left: 85px; }
.fox-bubbles i:nth-child(2) { width: 48px; height: 48px; top: 104px; left: 111px; }
.fox-bubbles i:nth-child(3) { top: 124px; left: 136px; }
.fox-bubbles i:nth-child(4) { width: 23px; height: 23px; top: 95px; left: 151px; }
.fox-bubbles i:nth-child(5) { width: 19px; height: 19px; top: 94px; left: 73px; }
.fox-sparkle { position: absolute; opacity: 0; font-size: 27px; color: #cd9435; }
.fox-sparkle-one { top: 60px; left: 23px; }
.fox-sparkle-two { top: 29px; right: 19px; }
.fox-scene:is(.is-eating, .is-washing, .is-dressing, .is-waving, .is-playing, .is-stretching) :is(.fox-head, .fox-lick, .fox-front-paw, .fox-tongue) { animation: none; }
.fox-scene.is-eating .fox-treat { animation: fox-eat 2.4s ease-in-out; }
.fox-scene.is-eating .fox-head { animation: fox-nibble .3s .3s 6 alternate; }
.fox-scene.is-washing .fox-bubbles { animation: fox-wash 2.5s ease-in-out; }
.fox-scene.is-washing .fox-bubbles i { animation: fox-bubble .6s ease-in-out 4 alternate; }
.fox-scene.is-washing .fox-sparkle, .fox-scene.is-dressing .fox-sparkle { animation: fox-shine 2.5s ease-in-out; }
.fox-scene.is-waving .fox-front-paw { animation: fox-wave 2.2s ease-in-out; }
.fox-scene.is-playing .fox-ball { animation: fox-ball-play 3s ease-in-out; }
.fox-scene.is-playing .fox-head { animation: fox-follow-ball 3s ease-in-out; }
.fox-scene.is-playing .fox-puddle { display: block; animation: fox-mud 3s ease-in-out; }
.fox-scene.is-stretching .fox-awake { animation: fox-stretch 1.4s ease-in-out; }
@keyframes fox-wave { 0%, 100% { transform: none; } 22%, 48%, 74% { transform: rotate(118deg); } 35%, 61% { transform: rotate(145deg); } }
@keyframes fox-ball-play { 0%, 100% { transform: none; } 28% { transform: translate(-48px, -18px) rotate(-145deg); } 53% { transform: translate(-63px, 0) rotate(-190deg); } 77% { transform: translate(-27px, -24px) rotate(-80deg); } }
@keyframes fox-follow-ball { 0%, 100% { transform: none; } 35%, 55% { transform: rotate(8deg) translateY(3px); } 80% { transform: rotate(-3deg); } }
@keyframes fox-mud { 0%, 100% { opacity: 0; } 20%, 80% { opacity: .65; } }
@keyframes fox-stretch { 0%, 100% { transform: none; } 30% { transform: scale(1.06, .94); } 68% { transform: scale(.96, 1.04) rotate(-2deg); } }
@keyframes fox-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.018); } }
@keyframes fox-idle-tail {
  0%, 20%, 62%, 100% { transform: rotate(0deg); }
  31%, 49% { transform: rotate(5deg); }
  40%, 56% { transform: rotate(-3deg); }
}
@keyframes fox-idle-blink {
  0%, 42%, 48%, 74%, 80%, 100% { transform: scaleY(1); }
  45%, 77% { transform: scaleY(.08); }
}
@keyframes fox-idle-head {
  0%, 8%, 24%, 57%, 80%, 100% { transform: none; }
  15%, 18% { transform: rotate(4deg); }
  33%, 51% { transform: translate(-8px, 8px) rotate(-8deg); }
  70%, 74% { transform: rotate(-3deg); }
}
@keyframes fox-idle-paw {
  0%, 27%, 58%, 100% { transform: none; }
  33%, 51% { transform: translate(0, -4px) rotate(-145deg); }
}
@keyframes fox-idle-lick {
  0%, 34%, 39%, 44%, 49%, 100% { opacity: 0; transform: scaleY(.2); }
  36%, 41%, 46% { opacity: 1; transform: scaleY(1); }
  38%, 43%, 48% { opacity: 0; transform: scaleY(.2); }
}
@keyframes fox-nibble { to { transform: translateY(3px) rotate(-2deg); } }
@keyframes fox-eat { 0% { opacity: 0; transform: translateY(20px); } 15%, 70% { opacity: 1; transform: translateY(-14px) scale(1); } 90%, 100% { opacity: 0; transform: translateY(-17px) scale(.2); } }
@keyframes fox-wash { 0%, 100% { opacity: 0; } 15%, 75% { opacity: 1; } }
@keyframes fox-bubble { to { transform: translate(3px, -9px) scale(1.07); } }
@keyframes fox-shine { 0%, 30%, 100% { opacity: 0; transform: scale(.5); } 55%, 80% { opacity: 1; transform: scale(1); } }
@media (max-width: 560px) {
  .fox-companion .fox-launcher { padding: 3px 10px 3px 3px; left: 8px; bottom: max(8px, env(safe-area-inset-bottom)); }
  .fox-dialog-inner { padding: 16px 18px 14px; }
  .fox-dialog.is-care .fox-layout { grid-template-columns: 1fr; gap: 16px; margin-top: 0; }
  .fox-dialog.is-care .fox-intro { display: grid; grid-template-columns: 110px 1fr; column-gap: 12px; align-items: center; text-align: left; }
  .fox-dialog.is-care .fox-scene { grid-row: 1 / 3; width: 110px; height: 101px; margin: 0; }
  .fox-dialog.is-care h2 { font-size: 22px; margin-top: 10px; }
  .fox-dialog.is-care .fox-status { font-size: 12px; }
  .fox-dialog.is-care .fox-wish { width: 32px; height: 30px; font-size: 19px; top: -3px; right: -2px; }
  .fox-dialog.is-care .fox-bond { grid-column: 1 / -1; margin-top: 10px; }
  .fox-dialog.is-care .fox-treat { left: 43px; top: 56px; font-size: 22px; }
  .fox-dialog.is-care .fox-bubbles { transform: scale(.5); transform-origin: top left; }
  .fox-dialog.is-care .fox-shop { grid-template-columns: repeat(4, 1fr); }
  .fox-dialog.is-care .fox-shop button { padding: 9px 3px; font-size: 12px; min-height: 81px; }
  .fox-dialog.is-care .fox-exchange { gap: 3px; font-size: 12px; }
  .fox-dialog.is-care .fox-daily { margin-top: 14px; }
}
@media (max-width: 360px) {
  .fox-dialog.is-care .fox-shop { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .fox-companion *, .fox-companion *::before, .fox-companion *::after { animation: none !important; transition: none !important; }
  .fox-scene.is-eating .fox-treat, .fox-scene.is-washing .fox-bubbles, .fox-scene.is-dressing .fox-sparkle { opacity: 1; }
}
