/* Huellitas de Ringo: scrapbook paper UI over painted scenes */


:root {
  --display: 'Bowlby One', Georgia, serif;
  --hand: 'Caveat', cursive;
  --body: 'Nunito', system-ui, sans-serif;
  --paper: #FBF1DE;
  --bar: #B08A6A; /* the scrollbars: a soft brown, like the drawings' ink, never the system's grey */
  --paper-2: #FFF8EC;
  --ink: #2A1F1A;
  --ink-soft: #6B5040;
  --accent: #D9503F;
  --green: #5E9C5A;
  --gold: #E8B83A;
  --tape: rgba(242, 205, 110, 0.75);
  --shadow: 3px 4px 0 var(--ink);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body, #root { margin: 0; height: 100%; overflow: hidden; }
body { font-family: var(--body); color: var(--ink); background: #F4D9A8; }
button { font: inherit; color: inherit; cursor: pointer; }
img { user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1; }
.hand { font-family: var(--hand); font-weight: 700; color: var(--ink-soft); font-size: 20px; }
.muted { color: var(--ink-soft); font-size: 14px; }
.ico { display: inline-block; object-fit: contain; vertical-align: middle; flex: none; }

/* ─── Paper cards ─── */
.paper {
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.55), transparent 40%),
    var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.tape { position: relative; }
.tape::before {
  content: ''; position: absolute; top: -11px; left: 50%; width: 64px; height: 20px;
  transform: translateX(-50%) rotate(-3deg); background: var(--tape);
  border: 1px solid rgba(140, 100, 40, .35); pointer-events: none;
}

/* ─── App + scene ─── */
.app { position: fixed; inset: 0; overflow: hidden; }
.scene-clip { position: absolute; inset: 0; overflow: hidden; overflow: clip; pointer-events: none; }
.scene {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center bottom; pointer-events: none;
}
.scene-tint {
  position: absolute; inset: 0; pointer-events: none; transition: background .8s;
  background: radial-gradient(ellipse at 50% 60%, transparent 55%, rgba(42, 31, 26, .22));
}
.is-night .scene-tint { background: rgba(18, 22, 58, .5); }

/* ─── Header ─── */
.top-stack { display: contents; }
.topbar {
  position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 16px; right: 16px; z-index: 6;
  display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none;
  gap: 12px; /* the title card is tilted a little: without room it touched the buttons on a tablet (2/11) */
}
.topbar > * { pointer-events: auto; }
.title-card { padding: 12px 22px 12px; transform: rotate(-.6deg); }
.title-date { font-family: var(--hand); font-size: 17px; color: var(--ink-soft); text-transform: lowercase; }
.title-card h1 { font-size: 30px; margin-top: 2px; }
.title-sub { font-size: 14px; font-weight: 700; color: var(--ink-soft); margin-top: 5px; }
.top-right { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 46px; height: 46px; display: grid; place-items: center; font-size: 20px;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow);
}
.icon-btn:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }

.dog-chips { display: flex; gap: 5px; }
.dog-chip {
  position: relative; display: flex; align-items: center; gap: 5px; padding: 2px 10px 2px 2px;
  font-weight: 900; font-size: 14px; background: var(--paper-2); border: 2px solid var(--ink); border-radius: 999px;
}
.dog-chip img { width: 28px; height: 28px; object-fit: cover; object-position: center 14%; border-radius: 50%; background: #fff; border: 1.5px solid var(--ink); }
.dog-chip.is-on { background: var(--ink); color: var(--paper); }
.chip-dot { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid var(--ink); animation: pulse 1.2s infinite; }

/* ─── Stats ─── */
.stats-card {
  position: absolute; left: 16px; top: 136px; width: 250px; padding: 14px 16px 10px; z-index: 5;
  transform: rotate(-1deg);
}
.stats-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 6px; }
.stats-head .hand { white-space: nowrap; font-size: 19px; }
.level { display: flex; align-items: center; gap: 5px; font-weight: 900; font-size: 13px; white-space: nowrap; }
.xp { width: 34px; height: 7px; border-radius: 4px; border: 1.5px solid var(--ink); background: rgba(42,31,26,.1); overflow: hidden; }
.xp span { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.stat { margin-bottom: 9px; }
.stat-top { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.stat-label { font-weight: 800; font-size: 14px; flex: 1; }
.stat-num { font-family: var(--display); font-size: 14px; margin-left: auto; }
.stat-track { height: 10px; border-radius: 6px; border: 2px solid var(--ink); background: rgba(42,31,26,.1); overflow: hidden; }
.stat-fill { height: 100%; transition: width .5s, background .3s; }
.stat.is-low .stat-num { color: var(--accent); }
.stat.is-low .stat-track { animation: pulse 1.2s infinite; }

/* ─── Diary ─── */
.diary-card {
  position: absolute; right: 16px; top: 96px; width: 272px; padding: 14px 16px; z-index: 5;
  transform: rotate(1deg); max-height: calc(100% - var(--panel-h, 200px) - 120px); display: flex; flex-direction: column;
}
.diary-title { margin-bottom: 4px; }
.diary-list { overflow-y: auto; padding-right: 4px; }
.diary-day { font-family: var(--hand); font-size: 18px; font-weight: 700; color: var(--accent); margin: 8px 0 4px; }
.diary-day::first-letter { text-transform: uppercase; } /* "Viernes, 16 de octubre", not "16 De Octubre" */
.diary-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.diary-emoji { font-size: 18px; width: 22px; text-align: center; }
.diary-text { font-size: 14px; font-weight: 700; line-height: 1.25; }
.diary-time { font-family: var(--hand); font-size: 15px; color: var(--ink-soft); }
.diary-list::-webkit-scrollbar { width: 6px; }
.diary-list::-webkit-scrollbar-thumb { background: var(--bar); border-radius: 3px; }
.diary-modal .diary-list { max-height: 58vh; text-align: left; }

/* ─── Stage + dogs ─── */
.stage { position: absolute; left: 0; right: 0; z-index: 2; }
.dog-slot { position: absolute; bottom: 4px; transform: translateX(-50%); }
.dog-slot.front { z-index: 3; }
.dog-slot.back { z-index: 2; }
.dog { position: relative; cursor: pointer; touch-action: manipulation; }
.dog-body {
  position: relative; height: 100%; transform-origin: 50% 100%;
  animation: pose-in .42s ease-out, breathe 3.6s ease-in-out .42s infinite;
}
.dog-move { height: 100%; transform-origin: 50% 100%; }
.fidget-tilt { animation: fidget-tilt 1.1s ease-in-out; }
.fidget-wiggle { animation: fidget-wiggle .9s ease-in-out; }
.fidget-hop { animation: fidget-hop .75s ease-out; }
.dog-img {
  height: 100%; width: auto; display: block;
  filter: drop-shadow(0 3px 0 rgba(42,31,26,.18)) drop-shadow(0 12px 14px rgba(0,0,0,.16));
}
.dog-front { position: absolute; pointer-events: none; height: auto; } /* the mouth in front of the neck piece (Dog.jsx frontOf) */
.dog-acc { position: absolute; pointer-events: none; filter: drop-shadow(0 2px 1.5px rgba(42,31,26,.32)); } /* contact shadow on the fur */
.dog-shadow {
  position: absolute; left: 12%; right: 12%; bottom: -6px; height: 22px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(42,31,26,.32), transparent 70%);
}
.dog.is-selected .dog-shadow {
  left: 8%; right: 8%; bottom: -9px; height: 26px;
  background: radial-gradient(ellipse at center, rgba(232,184,58,.55), rgba(232,184,58,.18) 60%, transparent 72%);
  box-shadow: 0 0 0 2.5px rgba(232,184,58,.9);
}
.modal-dogs { display: flex; justify-content: center; align-items: flex-end; gap: 4px; }
.modal-dogs .modal-art.dog { height: 140px; }
.modal-dogs .modal-art.dog + .modal-art.dog { height: 118px; }
.pose-happy .dog-body { animation: pose-in .42s ease-out, hop 1.1s ease-in-out .42s infinite; }
.pose-sad .dog-body, .pose-sick .dog-body { animation: pose-in .42s ease-out, breathe 5s ease-in-out .42s infinite; }
.pose-sleep .dog-body { animation: pose-in .42s ease-out, sleep-breathe 4.6s ease-in-out .42s infinite; }
.pose-eat .dog-body { animation: pose-in .42s ease-out, munch .46s ease-in-out .42s infinite; }
.pose-bath .dog-body { animation: pose-in .42s ease-out, shiver 1.2s linear .42s infinite; }
.pose-run .dog-body { animation: gallop .34s ease-in-out infinite; }
.is-walking { animation: walk 2.6s ease-in-out both; }
.is-chasing { animation: chase 2.6s ease-in-out both; }
.is-chasing.chase-follow { animation-delay: .22s; }

/* dust kicked up behind a running dog (the run sprites face left, so behind is the right side) */
.dust { position: absolute; right: 4%; bottom: 0; width: 0; height: 0; pointer-events: none; }
.dust i {
  position: absolute; left: 0; bottom: 0; width: 30px; height: 30px; border-radius: 50%;
  background: #FFF8EC; border: 2.5px solid rgba(42,31,26,.55); opacity: 0;
  animation: dust .5s ease-out infinite;
}
.dust i:nth-child(2) { animation-delay: .17s; width: 22px; height: 22px; }
.dust i:nth-child(3) { animation-delay: .34s; width: 36px; height: 36px; }

.bubbles { position: absolute; left: 10%; right: 10%; top: 8%; height: 50%; pointer-events: none; }
.bubbles i {
  position: absolute; bottom: 0; width: 18px; height: 18px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 32% 30%, #fff 0 22%, rgba(190,226,255,.55) 40%, rgba(255,255,255,.25) 70%);
  border: 1.5px solid rgba(80,140,190,.6); animation: bubble 1.6s ease-out infinite;
}
.bubbles i:nth-child(1) { left: 6%; animation-delay: .1s; }
.bubbles i:nth-child(2) { left: 22%; animation-delay: .7s; width: 12px; height: 12px; }
.bubbles i:nth-child(3) { left: 40%; animation-delay: .35s; width: 24px; height: 24px; }
.bubbles i:nth-child(4) { left: 58%; animation-delay: 1s; }
.bubbles i:nth-child(5) { left: 74%; animation-delay: .5s; width: 14px; height: 14px; }
.bubbles i:nth-child(6) { left: 88%; animation-delay: .2s; width: 20px; height: 20px; }
.bubbles i:nth-child(7) { left: 50%; animation-delay: 1.2s; width: 10px; height: 10px; }

.burst { position: absolute; left: 50%; top: 28%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.burst img {
  position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; opacity: 0;
  filter: drop-shadow(0 2px 0 rgba(42,31,26,.35)); animation: heart-burst 1.1s ease-out forwards;
}

.zzz { position: absolute; top: -4%; pointer-events: none; --zdx: 14px; }
.zzz-ringo { --zdx: -18px; }
.zzz span {
  position: absolute; font-family: var(--display); color: #fff; -webkit-text-stroke: 1.5px var(--ink);
  font-size: 30px; opacity: 0; animation: zzz 3s ease-out infinite;
}
.zzz span:nth-child(2) { animation-delay: 1s; font-size: 36px; }
.zzz span:nth-child(3) { animation-delay: 2s; font-size: 44px; }

.need-bubble {
  position: absolute; top: -6%; right: -14%; width: 68px; height: 62px; display: grid; place-items: center;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 50%; box-shadow: 2px 3px 0 var(--ink);
  animation: bob 1.6s ease-in-out infinite; pointer-events: none;
}
.need-bubble::after {
  content: ''; position: absolute; bottom: -10px; left: 12px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--ink);
}
.need-bubble img { width: 40px; height: 40px; object-fit: contain; }
.need-bubble.need-left { top: -15%; } /* the left dog's bubble floats above the other dog's head, not over it */
.need-bubble.need-above { top: auto; bottom: calc(100% + 6px); right: auto; left: 50%; margin-left: -34px; } /* a small pet: above its head */

.mg-pan-hint { /* centered with margins: the nudge animation owns transform */
  position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; max-width: 94%; bottom: 12px; z-index: 6; white-space: nowrap; pointer-events: none;
  padding: 4px 12px; font-weight: 900; background: rgba(255,248,236,.92); border: 2px solid var(--ink); border-radius: 999px;
  animation: nudge 1.6s ease-in-out infinite;
}
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .mg-head { margin-bottom: 4px; }
  .mg-head h2 { font-size: 19px; }
  .mg-head .icon-btn { width: 36px; height: 36px; }
  .mg-hud { margin-top: 0; font-size: 13px; }
  .mg-tip { font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

.poop {
  position: absolute; transform: translateX(-50%); z-index: 4; width: 58px; height: 58px; padding: 0;
  background: none; border: 0; animation: wiggle 2.4s ease-in-out infinite;
}
.poop img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 3px rgba(0,0,0,.25)); }
.poop::before {
  content: '〰'; position: absolute; top: -18px; left: 50%; transform: translateX(-50%) rotate(-90deg);
  color: #7a8f3c; font-size: 18px; opacity: .7; animation: stink 1.8s ease-in-out infinite;
}

.float {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 8; pointer-events: none;
  display: flex; align-items: center; gap: 4px; white-space: nowrap; opacity: 0;
  font-family: var(--display); font-size: 26px; color: var(--ink);
  text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff, 2px 2px #fff, -2px -2px #fff;
  animation: rise 1.5s ease-out forwards;
}

.hint {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 7; white-space: nowrap;
  font-family: var(--hand); font-weight: 700; font-size: 21px; padding: 2px 14px;
  background: rgba(255, 248, 236, .92); border: 2px dashed var(--ink); border-radius: 999px;
  animation: bob 1.8s ease-in-out infinite; pointer-events: none;
}
.hint-poop { top: 10px; bottom: auto !important; }
.toast {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 9;
  padding: 10px 18px; font-weight: 800; max-width: min(92%, 460px); text-align: center;
  animation: toast-in .25s ease-out;
}

/* ─── Bottom panel ─── */
.panel {
  position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 6;
  width: min(780px, calc(100% - 28px)); padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 10px;
}
.tabs { display: flex; gap: 6px; justify-content: center; }
.tab {
  display: flex; align-items: center; gap: 6px; padding: 7px 14px; font-weight: 900; font-size: 15px;
  background: transparent; border: 2px solid var(--ink); border-radius: 999px;
}
.tab-emoji { font-size: 17px; line-height: 1; }
.tab.is-on { background: var(--ink); color: var(--paper); }
.acts {
  display: flex; gap: 8px; overflow-x: auto; justify-content: safe center; padding: 2px 2px 6px;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--bar) transparent;
}
.act {
  flex: none; width: 98px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px 7px; background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: 14px;
  box-shadow: 0 3px 0 var(--ink); scroll-snap-align: start; transition: transform .08s;
}
.act:hover:not(:disabled) { transform: translateY(-2px); }
.act:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.act-art { height: 46px; display: grid; place-items: center; }
.act-art img { max-height: 46px; max-width: 64px; object-fit: contain; }
.act-emoji { font-size: 30px; }
.act-label { font-weight: 900; font-size: 13px; line-height: 1.1; overflow-wrap: anywhere; }
.act-sub { font-size: 11px; font-weight: 700; color: var(--ink-soft); display: flex; align-items: center; gap: 3px; }
.act.is-alert { background: #FFE2A0; animation: nudge 1.6s ease-in-out infinite; }
.act.is-active { background: var(--ink); color: var(--paper); }
.act.is-active .act-sub { color: #E9D7BE; }
.tab-scene .act-art img, .act-art img[src*='thumb-'] {
  width: 70px; height: 46px; max-width: none; object-fit: cover; border-radius: 8px; border: 2px solid var(--ink);
}

/* ─── Buttons, modals ─── */
.big-btn {
  display: block; width: 100%; margin-top: 12px; padding: 13px 18px; font-weight: 900; font-size: 18px;
  background: var(--accent); color: #fff; border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink);
}
.big-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.big-btn:disabled { opacity: .5; }
.big-btn.ghost { background: var(--paper-2); color: var(--ink); }
.modal-back {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(42, 31, 26, .55); backdrop-filter: blur(4px); animation: fade .2s;
}
.modal { width: min(420px, 100%); padding: 22px; text-align: center; animation: pop-in .25s ease-out; max-height: 100%; overflow: auto; }
.modal h2 { font-size: 28px; margin: 6px 0 8px; }
.modal p { margin: 6px 0; font-weight: 700; }
.modal-art { width: 84px; height: 84px; object-fit: contain; }
.modal-house { display: block; width: 100%; max-width: 280px; aspect-ratio: 3 / 2; margin: 0 auto 12px; object-fit: cover; border-radius: 14px; }
.modal-art.dog { width: auto; height: 160px; }
.away-list { text-align: left; font-weight: 700; margin: 10px 0 0; padding-left: 22px; }
.away-list li { margin: 4px 0; }
.row-toggle { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 18px; padding: 12px 4px; flex-wrap: wrap; gap: 6px 10px; }
/* the label on one line; when the choices don't fit beside it, they go below (2/11: "Quién juega" broke in two) */
.row-toggle > span:first-child { white-space: nowrap; }
.row-toggle input { width: 22px; height: 22px; accent-color: var(--accent); }

/* ─── Mini-games ─── */
.mg-overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 12px;
  background: rgba(42, 31, 26, .6); backdrop-filter: blur(5px); animation: fade .2s;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; /* holding a finger down is part of the games */
}
.mg-card { width: min(780px, 100%); max-height: 100%; overflow: auto; padding: 16px; animation: pop-in .25s ease-out; }
.mg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mg-head h2 { font-size: 28px; }
.mg-hud { font-weight: 800; color: var(--ink-soft); margin-top: 3px; }
.mg-stage {
  position: relative; aspect-ratio: 16 / 10; max-height: 62vh; width: 100%; overflow: hidden;
  border: 2.5px solid var(--ink); border-radius: 14px; touch-action: none;
}
.mg-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 85%; }
.mg-sprite {
  position: absolute; bottom: 5%; transform: translateX(-50%); pointer-events: none;
  filter: drop-shadow(0 8px 8px rgba(0,0,0,.2));
}
.mg-sprite.tug { transform: translateX(-50%); }
.mg-ball { position: absolute; width: 6%; transform: translateX(-50%); filter: drop-shadow(0 4px 3px rgba(0,0,0,.3)); }
.mg-flag { position: absolute; bottom: 7%; font-size: clamp(22px, 5vw, 38px); transform: translateX(-15%); }
.mg-pop {
  position: absolute; bottom: 48%; transform: translateX(-50%); font-family: var(--display); font-size: 30px;
  color: var(--green); text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff;
  animation: rise 1s ease-out forwards; pointer-events: none;
}
.mg-pop.bad { color: var(--accent); }
.mg-foot { margin-top: 10px; }
.mg-tip { text-align: center; color: var(--ink-soft); font-weight: 700; font-size: 14px; margin: 8px 0 0; }
.meter {
  position: relative; height: 24px; border: 2.5px solid var(--ink); border-radius: 12px; overflow: hidden;
  background: linear-gradient(90deg, #F3C9B9, #F7E2B5 50%, #F3C9B9);
}
.meter-zone { position: absolute; top: 0; bottom: 0; background: #8CC97E; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }
.meter-needle { position: absolute; top: -2px; bottom: -2px; width: 6px; margin-left: -3px; background: var(--ink); border-radius: 3px; }
.tug-rope { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.tug-piece { position: absolute; transform-origin: 0 50%; background: url(assets/cs/soga.webp?a=3) repeat-x 0 0; }
.tug-under { position: absolute; transform-origin: 0 50%; background: #fff;
  box-shadow: inset 0 0.6px 0 rgba(70, 70, 65, .7), inset 0 -0.6px 0 rgba(70, 70, 65, .7); } /* the drawings' sticker edge */
.ball-live {
  position: absolute; top: 14%; left: 50%; transform: translateX(-50%); font-family: var(--display); font-size: 38px; color: var(--ink);
  text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff; pointer-events: none;
}
.tug-chalk { stroke: #fff; stroke-width: 5; stroke-dasharray: 10 8; stroke-linecap: round; opacity: .9; }
.tug-ribbon { fill: var(--accent); stroke: var(--ink); stroke-width: 2.5; }
.mg-side { position: absolute; top: 8px; font-family: var(--hand); font-weight: 700; font-size: 24px; background: rgba(255,248,236,.85); padding: 0 10px; border-radius: 10px; }
.mg-side-you { left: 10px; }
.mg-side-dog { right: 10px; }
.mg-touch { position: absolute; inset: 0; touch-action: none; cursor: grab; }
.mg-item { position: absolute; width: 7%; transform: translateX(-50%); filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); }
.mg-result { text-align: center; width: min(420px, 100%); }
.mg-record { font-family: var(--display); font-size: 20px; color: var(--accent); margin: 2px 0 6px; animation: pop-in .4s ease-out; }
.mg-records { display: flex; justify-content: center; gap: 14px; margin: 4px 0 12px; font-weight: 800; color: var(--ink-soft); }
.mg-records .is-me { color: var(--ink); }

/* Carrera */
/* the plaza's grass, painted like the plaza (assets/scenes/pasto.webp, a piece that repeats; 28/10, Joaco: "que el
   pasto sea un poco más lindo con la misma estética"): the pets' feet go on its path, 36 % from its bottom */
.run-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 33%; pointer-events: none;
  background: url(assets/scenes/pasto.webp) repeat-x left bottom / auto 100%;
}
.run-dog { position: absolute; height: 22%; transform: translateX(-50%) scaleX(-1); filter: drop-shadow(0 6px 5px rgba(0,0,0,.2)); pointer-events: none; }
.run-dog.is-running { animation: run-gallop .3s ease-in-out infinite; } /* translate/rotate: keeps the flip and the centering */
.run-dog.is-hurt { opacity: .55; }
.run-obs, .run-item { position: absolute; transform: translateX(-50%); pointer-events: none; filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); }
.run-item { width: 6.5%; animation: bob 1s ease-in-out infinite; }

/* Pelota */
.ball-ground { height: 22%; }
.ball-mark { position: absolute; bottom: 9%; width: 0; height: 22%; border-left: 2px dashed rgba(42,31,26,.45); pointer-events: none; }
.ball-mark span {
  position: absolute; top: -4px; left: 4px; white-space: nowrap; font-weight: 900; font-size: 13px;
  background: rgba(255,248,236,.9); border: 1.5px solid var(--ink); border-radius: 8px; padding: 0 5px;
}
.ball-mark.is-record { border-left: 3px solid var(--gold); }
.ball-dot { position: absolute; width: 9px; height: 9px; margin: 0 0 -4px -4px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); pointer-events: none; }
.ball-dog { position: absolute; pointer-events: none; filter: drop-shadow(0 6px 5px rgba(0,0,0,.2)); }

/* Escondidas */
.hide-count {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 12px; padding-bottom: 6%;
}
.hide-count img { height: 52%; }
.hide-count span { font-family: var(--display); font-size: 64px; color: #fff; -webkit-text-stroke: 2.5px var(--ink); margin-bottom: 14%; animation: pop-in .3s ease-out; }
.hide-occ { pointer-events: none; z-index: 2; }
.hide-dog {
  position: absolute; z-index: 1; transform: translateX(-50%); pointer-events: none;
  transition: translate .35s ease-out; /* only the peek moves smoothly: the spot follows the room at once */
}
.hide-dog.is-out { z-index: 4; animation: hide-out .5s cubic-bezier(.3,1.6,.5,1); }
.hide-dog.is-peek { animation: peek-bob .9s ease-in-out infinite; } /* a bit of movement so the eye catches it */
.hide-hit {
  position: absolute; z-index: 3; padding: 0; border: 0; background: transparent; border-radius: 14px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hide-hit:active { background: rgba(255,255,255,.18); }
.hide-hit.is-miss { animation: wiggle-x .4s ease-in-out; }
.hide-no, .hide-bark {
  position: absolute; z-index: 5; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font-family: var(--display); font-size: 18px; color: var(--accent);
  text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff; animation: rise 1s ease-out forwards;
}
.hide-bark { z-index: 5; top: auto; color: var(--ink); animation: rise .9s ease-out forwards; }
.mg-result-dog { height: 150px; }
.mg-result h2 { font-size: 28px; margin: 4px 0; }
.mg-stars { font-size: 40px; color: rgba(42,31,26,.2); letter-spacing: 4px; }
.mg-stars .on { color: var(--gold); -webkit-text-stroke: 1.5px var(--ink); }
.mg-score { font-family: var(--display); font-size: 44px; }
.mg-score small { font-family: var(--body); font-size: 16px; font-weight: 800; color: var(--ink-soft); }

/* ─── Animations ─── */
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, .988); } }
@keyframes hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 40% { transform: translateY(-5px) scale(.99, 1.01); } 60% { transform: translateY(0) scale(1.015, .985); } }
@keyframes pose-in {
  0% { transform: scale(1.07, .9); opacity: .7; }
  45% { transform: scale(.96, 1.05); opacity: 1; }
  75% { transform: scale(1.015, .99); }
  100% { transform: scale(1, 1); }
}
@keyframes sleep-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.025, .97); } }
@keyframes munch { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(2px) rotate(.9deg) scale(1.01, .985); } }
@keyframes shiver {
  0%, 34%, 100% { transform: translateX(0); }
  4% { transform: translateX(-2px) rotate(-.6deg); } 10% { transform: translateX(2px) rotate(.6deg); }
  16% { transform: translateX(-2px) rotate(-.4deg); } 22% { transform: translateX(2px) rotate(.4deg); } 28% { transform: translateX(-1px); }
}
@keyframes gallop { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-7%) rotate(2.5deg); } }
@keyframes run-gallop { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -7%; rotate: 2.5deg; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }
@keyframes cs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fidget-tilt { 0%, 100% { transform: rotate(0); } 25%, 70% { transform: rotate(-4deg); } }
@keyframes fidget-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(3deg); } 40% { transform: rotate(-3deg); } 60% { transform: rotate(2deg); } 80% { transform: rotate(-1deg); } }
@keyframes fidget-hop {
  0%, 100% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(0) scale(1.05, .93); }
  45% { transform: translateY(-16px) scale(.97, 1.04); } 75% { transform: translateY(0) scale(1.04, .95); }
}
/* zoomies: run off to the right (sprites mirrored), come back in from the left */
@keyframes chase {
  0% { transform: translateX(0) scaleX(-1); opacity: 1; }
  44% { transform: translateX(110vw) scaleX(-1); opacity: 1; }
  45% { transform: translateX(110vw) scaleX(-1); opacity: 0; }
  46% { transform: translateX(-110vw) scaleX(-1); opacity: 0; }
  47% { transform: translateX(-110vw) scaleX(-1); opacity: 1; }
  100% { transform: translateX(0) scaleX(-1); opacity: 1; }
}
@keyframes dust { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(40px, -22px) scale(1.25); } }
@keyframes bubble { 0% { opacity: 0; transform: translateY(0) scale(.5); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-90px) translateX(8px) scale(1.1); } }
@keyframes heart-burst {
  0% { opacity: 0; transform: translate(0, 0) scale(.3); }
  18% { opacity: 1; transform: translate(calc(var(--x) * .4), calc(var(--y) * .4)) scale(1.2); }
  65% { opacity: 1; transform: translate(calc(var(--x) * .88), calc(var(--y) * .88)) scale(1) rotate(6deg); }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(.8) rotate(12deg); }
}
@keyframes walk {
  0% { transform: translateX(0); opacity: 1; }
  44% { transform: translateX(-70vw); opacity: 1; }
  45% { transform: translateX(-70vw); opacity: 0; }
  55% { transform: translateX(70vw); opacity: 0; }
  56% { transform: translateX(70vw); opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes zzz { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--zdx)), -80px) scale(1.1); } }
@keyframes bob { 0%, 100% { transform: translate(var(--bx, 0), 0); } 50% { transform: translate(var(--bx, 0), -6px); } }
.hint { --bx: -50%; }
@keyframes rise { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -6px) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -90px) scale(1); } }
@keyframes wiggle { 0%, 100% { transform: translateX(-50%) rotate(0); } 50% { transform: translateX(-50%) rotate(-5deg); } }
@keyframes stink { 0%, 100% { opacity: .2; margin-top: 0; } 50% { opacity: .8; margin-top: -6px; } }
@keyframes peek-bob { 0%, 100% { transform: translate(-50%, 0) rotate(0); } 50% { transform: translate(-50%, -4%) rotate(-3deg); } }
@keyframes hide-out { 0% { transform: translate(-50%, 0) scale(.9); } 60% { transform: translate(-50%, -18%) scale(1.06); } 100% { transform: translate(-50%, 0) scale(1); } }
@keyframes wiggle-x { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-6%) rotate(-4deg); } 75% { transform: translateX(6%) rotate(4deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop-in { from { transform: scale(.92); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .zzz span { animation: none !important; opacity: 1; transform: translate(-50%, -30px); }
  .zzz span:nth-child(2) { transform: translate(calc(-50% + var(--zdx)), -62px); }
  .zzz span:nth-child(3) { transform: translate(calc(-50% + var(--zdx) * 2), -100px); }
}

/* ─── Mid widths: diary goes behind the book button ─── */
@media (max-width: 1099px) {
  .stats-card { width: 230px; }
}

/* ─── Phones: header + stats stack on top, dog fills the middle ─── */
@media (max-width: 699px), (orientation: landscape) and (max-height: 519px) {
  .top-stack {
    display: flex; flex-direction: column; gap: 6px; position: absolute; top: 0; left: 0; right: 0;
    padding: calc(8px + env(safe-area-inset-top)) 8px 0; z-index: 6;
  }
  .topbar { position: static; gap: 8px; }
  .title-card { padding: 6px 12px 7px; transform: none; flex: 1; min-width: 0; }
  .title-card.tape::before, .stats-card.tape::before { display: none; }
  .title-date { display: none; }
  .title-card h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .title-sub { font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-right { gap: 6px; }
  .icon-btn { width: 40px; height: 40px; font-size: 17px; border-radius: 12px; }
  .dog-chip { font-size: 12px; padding: 1px 8px 1px 1px; }
  .dog-chip img { width: 22px; height: 22px; }
  .stats-card { position: relative; top: auto; left: auto; width: auto; transform: none; padding: 7px 10px 6px; } /* relative: its minimize button sits in its corner */
  .stats-head { margin-bottom: 5px; }
  .stats-head .hand { font-size: 17px; }
  .stats-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .stat { margin: 0; }
  .stat-top { gap: 3px; margin-bottom: 3px; }
  .stat-num { font-size: 12px; }
  .stat-track { height: 7px; border-width: 1.5px; }
  .panel { bottom: calc(8px + env(safe-area-inset-bottom)); width: calc(100% - 16px); padding: 8px 6px 6px; gap: 7px; }
  .tabs { gap: 4px; }
  .tab { padding: 5px 9px; font-size: 13px; gap: 4px; }
  .tab .ico { width: 16px; height: 16px; }
  .acts { gap: 6px; justify-content: flex-start; }
  .act { width: 74px; padding: 6px 2px 5px; border-radius: 12px; }
  .act-art { height: 36px; }
  .act-art img { max-height: 36px; max-width: 50px; }
  .act-label { font-size: 12px; }
  .act-sub { font-size: 10px; }
  .act-art img[src*='thumb-'] { width: 56px; height: 36px; }
  .acts.tab-care { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; overflow: visible; }
  .acts.tab-care .act { width: auto; min-width: 0; }
  .acts.tab-care .act-label { font-size: 10px; white-space: nowrap; letter-spacing: -.2px; }
  .acts.tab-care .act-sub { white-space: nowrap; }
  /* these blocks are defined further down the file, so they need the extra .is-mobile to win */
  .is-mobile .today { gap: 4px; }
  .is-mobile .today-chip { font-size: 11.5px; padding: 2px 7px 2px 3px; border-width: 1.5px; }
  .is-mobile .today-chip img { width: 17px; height: 17px; }
  .is-mobile .routine-pill, .is-mobile .health-pill, .is-mobile .test-pill {
  display: block; width: 100%; margin-top: 6px; padding: 5px 8px; text-align: left; font-size: 12.5px; font-weight: 800;
  background: #FFF1A8; border: 2px dashed var(--ink); border-radius: 12px;
}
  .need-bubble { width: 56px; height: 52px; right: -8%; }
  .need-bubble.need-left { top: -15%; }
  .need-bubble img { width: 32px; height: 32px; }
  .need-bubble.need-above { right: auto; margin-left: -28px; }
  .hint { font-size: 18px; }
  .mg-head h2 { font-size: 23px; }
}

.avatar {
  display: inline-grid; place-items: center; flex: none; overflow: hidden; vertical-align: middle; border-radius: 50%;
  border: 2px solid var(--ink); font-family: var(--display); color: #fff; -webkit-text-stroke: 1px var(--ink); line-height: 1;
}
/* span.avatar: beats the "every img inside" rules of the places an avatar sits in (.routine-item img made the
   20 px photo 34 px and contained, 28/10) */
span.avatar img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; border: 0; border-radius: 0; flex: none; }
.me-btn { padding: 0; }
.who-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.menu-h { margin: 16px 0 6px; font-size: 18px; text-align: left; }
.avatar-edit { display: flex; gap: 22px; justify-content: center; }
.avatar-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 800; cursor: pointer; }
.test-scenes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; }
.cs-by {
  position: absolute; left: 10px; bottom: 12px; z-index: 6; display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px;
  background: rgba(255,248,236,.92); border: 2px solid var(--ink); border-radius: 999px; font-weight: 800; font-size: 13px;
}
.sync-pill { margin-top: 5px; padding: 4px 8px; font-size: 12px; }

/* ─── Routine ─── */
.routine-pill {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 6px; padding: 6px 8px;
  background: var(--paper-2); border: 2px dashed var(--ink); border-radius: 12px; text-align: left; font-size: 13px;
}
.routine-pill.is-due { border-style: solid; background: #FFE2A0; animation: nudge 1.6s ease-in-out infinite; }
.bath-date { display: flex; align-items: flex-end; gap: 8px; margin: 4px 0 8px; }
.bath-date label { display: flex; flex-direction: column; gap: 3px; font-weight: 800; font-size: 13px; }
.bath-date input { font: inherit; padding: 6px 8px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; }
.today { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin: 2px 0 0; padding: 0; background: none; border: 0; text-align: left; }
.today-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 4px; border: 2px solid var(--ink);
  border-radius: 999px; background: #fff; font-size: 13px; font-weight: 800; white-space: nowrap;
}
.today-chip img { width: 22px; height: 22px; object-fit: contain; }
.today-chip.is-done { background: #D6EDC4; }
.today-chip.is-due { background: #FFE2A0; animation: nudge 1.6s ease-in-out infinite; }
.steps { text-align: left; margin: 0 0 12px; padding-left: 22px; line-height: 1.45; }
.steps li { margin-bottom: 6px; }
.sync-pill {
  margin-top: 6px; padding: 5px 8px; border: 2px solid var(--ink); border-radius: 12px;
  background: #F6D3C9; font-size: 12.5px; font-weight: 800;
}
.routine-count { font-family: var(--display); font-size: 15px; flex: none; }
.routine-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.routine-streak { flex: none; font-weight: 900; }
.routine-ayer-dot { margin-left: 6px; padding: 1px 7px; border-radius: 9px; background: #FFE2A0; border: 1.5px solid var(--ink); font-size: 11px; font-weight: 900; }
.routine-ayer { margin: 12px 0 4px; padding: 10px 12px; border: 2px dashed var(--ink-soft); border-radius: 14px; background: #FFF6E2; }
.routine-ayer h3 { margin: 0 0 4px; font-size: 16px; }
.routine-item.is-ayer { opacity: .95; }
.routine h2 { font-size: 24px; }
.routine-list { list-style: none; padding: 0; margin: 12px 0; text-align: left; }
.routine-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; margin-bottom: 6px; border: 2px solid transparent; }
.routine-item img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.routine-main { flex: 1; min-width: 0; }
.routine-label { font-weight: 900; }
.routine-when { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.routine-state { font-size: 13px; font-weight: 900; text-align: right; white-space: nowrap; }
.routine-item.is-done { background: rgba(94,156,90,.14); }
.routine-item.is-done .routine-state { color: var(--green); }
.routine-item.is-now { border-color: var(--ink); background: #FFE2A0; }
.routine-item.is-late { opacity: .75; }
.routine-item.is-late .routine-state { color: var(--accent); }
.routine-item.is-later { opacity: .7; }

/* ─── Diary book, adventures, map ─── */
.modal.is-wide { width: min(640px, 100%); }
.icon-btn { position: relative; }
.btn-badge {
  position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--accent); color: #fff; font-style: normal; font-size: 12px; font-weight: 900; line-height: 16px; border: 2px solid var(--ink);
}
.diary-tabs { margin-bottom: 8px; }
.adventures { text-align: left; }
.hint-line { font-weight: 800; margin: 0 0 8px; }
.places-map { height: 220px; border: 2.5px solid var(--ink); border-radius: 14px; margin-bottom: 12px; z-index: 0; }
.paw-pin {
  display: grid; place-items: center; font-size: 18px; background: #fff; border: 2.5px solid var(--ink);
  border-radius: 50%; box-shadow: 2px 2px 0 var(--ink);
}
.paw-pin.is-locked { background: #E9DFCF; filter: grayscale(.4); }
.polaroids { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; max-height: 46vh; overflow-y: auto; padding: 4px; }
.polaroid {
  display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 10px; background: #fff; border: 2px solid var(--ink);
  border-radius: 6px; box-shadow: 2px 3px 0 var(--ink); text-align: left; transform: rotate(-1deg);
}
.polaroid:nth-child(even) { transform: rotate(1.2deg); }
.polaroid-img {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden;
  background: #E9DFCF; border: 1.5px solid rgba(42,31,26,.3);
}
.polaroid-pic { position: absolute; inset: 0; background: center / cover no-repeat; }
.polaroid.is-locked .polaroid-pic { filter: blur(7px) grayscale(.5); transform: scale(1.1); }
.polaroid-lock { position: relative; font-size: 34px; }
.polaroid-title { font-family: var(--hand); font-size: 20px; font-weight: 700; line-height: 1; }
.polaroid-date { font-size: 12px; color: var(--ink-soft); font-weight: 800; }
.adventure { text-align: left; }
.adventure h2 { font-size: 26px; margin: 8px 0 4px; }
.adventure-text { font-weight: 700; line-height: 1.4; }
.adventure-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; max-height: 52vh; overflow-y: auto; }
.adventure-media img, .adventure-media video { width: 100%; border-radius: 10px; border: 2px solid var(--ink); background: #000; }
.link-btn { background: none; border: 0; padding: 0; font-weight: 900; color: var(--accent); }
.who-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.who-switch { display: flex; gap: 6px; }
/* on desktop the stage starts under the header, keep notices clear of the title card */
.app:not(.is-mobile) .toast, .app:not(.is-mobile) .hint-poop { top: 112px; }

/* ─── Health ─── */
.health { text-align: left; max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.health h3 { font-family: var(--display); font-weight: 400; font-size: 18px; margin: 16px 0 6px; }
.health-dogs { margin-bottom: 4px; }
.health-line { margin: 4px 0; font-weight: 700; }
.health-list { margin: 0; padding-left: 18px; font-weight: 700; }
.health-list li { margin: 6px 0; }
.health-list li.is-done { color: var(--green); }
/* Salud > Cuidados: its stage, the plan's suggestion under each care, turnos (src/plan.js, HealthTab.jsx) */
.etapa { margin: 4px 0 10px; }
.etapa-line { margin: 0 0 6px; font-weight: 700; }
.etapa-q { margin: 8px 0 4px; font-weight: 800; font-size: 14px; }
.etapa .dog-chips, .turnos .dog-chips { flex-wrap: wrap; }
.care-plan { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-top: 2px; }
.care-plan a { color: inherit; }
.toma-list li.is-late { border-color: var(--accent, #D9503F); }
.field.choice { grid-template-columns: 90px 1fr; align-items: center; }
.field.choice .dog-chips { flex-wrap: wrap; gap: 6px; }
/* Salud > Comida: what the pet takes (HealthTab.jsx Toma) */
.toma-list { padding-left: 0; list-style: none; }
.toma-list li { padding: 8px 10px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; }
.toma-btns { display: flex; gap: 14px; margin-top: 2px; }
.toma-edit { margin-top: 8px; padding: 10px; border: 2px dashed var(--ink); border-radius: 12px; }
.toma-edit .bath-date { flex-wrap: wrap; }
.toma-edit .bath-date label { flex: 1 1 150px; }
.toma-edit .bath-date input { width: 100%; box-sizing: border-box; }
.toma-edit .dog-chips { flex-wrap: wrap; margin: 4px 0 10px; }
.toma-q { display: block; font-size: 13px; margin-top: 4px; }
.toma-err { color: var(--coral-d, #B83E2F); font-weight: 800; margin: 0 0 8px; }
.health-done { font-weight: 900; }
.give-btn {
  margin-left: 8px; padding: 3px 10px; font-weight: 900; font-size: 13px; color: #fff; background: var(--green);
  border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 2px 0 var(--ink);
}
.guides { display: grid; gap: 8px; }
.guide { padding: 10px 12px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; }
.guide p { margin: 6px 0; font-weight: 600; font-size: 14px; line-height: 1.4; }
.guide-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.guide-badge { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); font-size: 12px; font-weight: 900; }
.guide.is-ok .guide-badge { background: #CDE8C4; }
.guide.is-check .guide-badge { background: #FFE2A0; }
.guide.is-todo .guide-badge { background: #E9DFCF; }
.guide-tag { margin-left: auto; font-size: 12px; font-weight: 900; color: var(--ink-soft); }
.guide-src { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.guide-src a { color: var(--accent); }
.small { font-size: 12px; }
.health-pill {
  display: block; width: 100%; margin-top: 6px; padding: 5px 8px; text-align: left; font-size: 12.5px; font-weight: 800;
  background: #EAF3FB; border: 2px solid var(--ink); border-radius: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ─── Health history ─── */
.history { margin-bottom: 4px; }
.add-record { margin-left: 0; padding: 6px 14px; font-size: 14px; }
.record-form { display: grid; gap: 8px; padding: 10px; border: 2px dashed var(--ink); border-radius: 12px; background: var(--paper-2); }
.record-form label { display: grid; gap: 3px; font-weight: 800; font-size: 13px; }
.record-form input, .record-form select, .record-form textarea {
  font: inherit; font-weight: 600; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; width: 100%;
}
.record-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.record-form .big-btn { margin-top: 0; }
.records { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.record { padding: 10px 12px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; }
.record-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.record-kind { font-size: 11px; font-weight: 900; padding: 1px 8px; border-radius: 999px; background: #EAF3FB; border: 1.5px solid var(--ink); }
.record-date { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.record-note { margin: 6px 0; font-weight: 600; font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
.record-files { display: flex; flex-wrap: wrap; gap: 6px; }
.record-files img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 2px solid var(--ink); }
.record-pdf { font-weight: 800; font-size: 13px; color: var(--accent); }
.record-foot { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; font-weight: 800; color: var(--ink-soft); }

/* ─── Escenas animadas al anotar algo real (Cutscene.jsx) ─── */
.cs-overlay {
  position: fixed; inset: 0; z-index: 200; overflow: hidden; background: #F4D9A8; animation: fade .25s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
/* the whole screen: the background fills it, the action happens in a frame standing on the floor */
.cs-stage { position: absolute; inset: 0; overflow: hidden; }
.cs-frame {
  --lift: calc(46px + env(safe-area-inset-bottom)); /* room for "Lo anotó" under the dogs' paws */
  position: absolute; left: 50%; bottom: var(--lift); transform: translateX(-50%); overflow: visible;
  width: min(100vw, calc((100dvh - var(--lift)) * 4 / 3)); aspect-ratio: 4 / 3;
}
@media (orientation: portrait) { .cs-frame { width: min(100vw, calc((100dvh - var(--lift)) * 3 / 4)); aspect-ratio: 3 / 4; } }
.cs-bg { position: absolute; inset: 0; background-size: cover; background-position: center 80%; }
.cs-bg-home { background-image: url(assets/scenes/home.webp?a=3); }
.cs-bg-kitchen { background-image: url(assets/scenes/kitchen.webp?a=3); }
.cs-bg-park { background-image: url(assets/scenes/park.webp?a=3); }
.cs-bg-house { background-image: url(assets/scenes/house.webp?a=3); }
.is-pan .cs-bg { inset: 0 -40% 0 0; animation: cs-pan var(--dur) linear both; }
.cs-bg-bathroom { background-image: url(assets/scenes/bathroom.webp?a=3); }
.cs-bg-vet { background-image: url(assets/scenes/vet.webp?a=3); }
.cs-dog {
  position: absolute; bottom: 7%; transform: translateX(-50%) scaleX(var(--flip, 1)); transform-origin: 50% 100%;
  filter: drop-shadow(0 6px 6px rgba(0,0,0,.22)); pointer-events: none;
}
/* centered on (left, top). The pivot sits at that same point (origin 0 0, after the -50% shift), so spins,
   tilts and pops from the rotate/scale properties turn the prop in place instead of throwing it sideways */
.cs-fx { position: absolute; transform: translate(-50%, -50%); transform-origin: 0 0; filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); pointer-events: none; }
/* a box the size of the dog's drawing: props inside it are placed in % of the dog */
.cs-box { position: absolute; bottom: 7%; transform: translateX(-50%); pointer-events: none; }
.cs-prop { position: absolute; transform: translate(-50%, -50%); width: clamp(60px, 18vmin, 120px); filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); }
.cs-prop.is-medal { width: clamp(44px, 12vmin, 80px); }
.cs-caption {
  position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 7vmin); transform: translateX(-50%); width: 92%; text-align: center; line-height: 1.05; z-index: 5;
  font-family: var(--display); font-size: clamp(20px, 6.2vmin, 42px); color: #fff; -webkit-text-stroke: 2px var(--ink);
  text-shadow: 3px 3px 0 var(--ink);
}
.cs-count {
  position: absolute; right: 8%; top: 24%; font-family: var(--display); font-size: clamp(30px, 9vmin, 58px); color: #E8B83A;
  -webkit-text-stroke: 2px var(--ink);
}
.cs-small { position: absolute; transform: translate(-50%, -50%); font-family: var(--hand); font-weight: 700; font-size: clamp(18px, 5vmin, 30px); color: var(--accent); }
/* painted props (assets/cs): small pieces are divs with the drawing as background */
.cs-spark { position: absolute; width: clamp(18px, 5vmin, 34px); aspect-ratio: 1; background: url(assets/cs/sparkle.webp) center / contain no-repeat; }
.cs-drop { position: absolute; width: 3.2%; aspect-ratio: 3 / 4; background: url(assets/cs/drop.webp) center / contain no-repeat; }
.cs-drop.is-gold { background-image: url(assets/cs/drop-gold.webp); }
.cs-bubble { position: absolute; aspect-ratio: 1; background: url(assets/cs/bubble.webp) center / contain no-repeat; }
.cs-kibble { position: absolute; width: 3.2%; aspect-ratio: 1.2; background: url(assets/cs/kibble.webp) center / contain no-repeat; }
.cs-kibble.is-crumb { background-image: url(assets/cs/crumbs.webp); width: 2.6%; }
.cs-kibble.is-home { background-image: url(assets/cs/casera.webp); aspect-ratio: 1.32; } /* home-made food: rice, chicken, squash */
.cs-dust { position: absolute; width: 6%; aspect-ratio: 1.1; background: url(assets/cs/puff.webp) center / contain no-repeat; }
.cs-pill { position: absolute; width: 9%; aspect-ratio: 1.06; background: url(assets/cs/pill.webp) center / contain no-repeat; transform: translateX(-50%); }
.cs-shower {
  position: absolute; aspect-ratio: 307 / 290; transform: translate(-50%, -50%);
  background: url(assets/cs/shower.webp) center / contain no-repeat; filter: drop-shadow(0 4px 3px rgba(0,0,0,.25));
}
.cs-towel { position: absolute; left: 50%; bottom: 32%; width: 34%; transform: translateX(-50%) rotate(-6deg); }
.cs-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(5px + env(safe-area-inset-bottom)); z-index: 6;
  background: var(--accent); transform-origin: 0 50%; animation: cs-progress var(--dur) linear both;
}
.cs-btns {
  position: absolute; z-index: 7; top: calc(10px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right));
  display: flex; gap: 8px;
}
.cs-btns button {
  padding: 8px 16px; font: inherit; font-weight: 900; color: var(--ink);
  background: rgba(251, 241, 222, .94); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink);
}
.cs-btns .cs-undo { background: #fff; }
.cs-overlay .cs-by { left: calc(10px + env(safe-area-inset-left)); bottom: calc(16px + env(safe-area-inset-bottom)); }
@media (max-width: 699px), (orientation: landscape) and (max-height: 519px) { .cs-overlay .cs-caption { top: calc(env(safe-area-inset-top) + 64px); } }
@keyframes cs-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@keyframes cs-pan { from { transform: translateX(0); } to { transform: translateX(-28%); } }
@keyframes cs-run-in { from { transform: translateX(calc(-50% + var(--from))) scaleX(var(--flip, 1)); } to { transform: translateX(-50%) scaleX(var(--flip, 1)); } }
@keyframes cs-gallop { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -6%; rotate: 2.5deg; } }
@keyframes cs-land { 0% { transform: translateX(-50%) scale(1.08, .88); } 55% { transform: translateX(-50%) scale(.96, 1.05); } 100% { transform: translateX(-50%) scale(1); } }
@keyframes cs-squash { 0% { transform: translateX(-50%) scale(1.1, .86); } 50% { transform: translateX(-50%) scale(.95, 1.07); } 100% { transform: translateX(-50%) scale(1); } }
@keyframes cs-munch { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 2%; rotate: 1deg; } }
@keyframes cs-wag { 0%, 100% { rotate: 0deg; } 50% { rotate: -3deg; } }
@keyframes cs-hop { 0% { translate: 0 0; } 50% { translate: 0 -18%; } 100% { translate: 0 0; } }
@keyframes cs-shiver { 0%, 30%, 100% { translate: 0 0; } 5% { translate: -1.5% 0; } 10% { translate: 1.5% 0; } 15% { translate: -1.5% 0; } 20% { translate: 1.5% 0; } }
@keyframes cs-shake { 0%, 100% { rotate: 0deg; } 25% { rotate: -9deg; } 75% { rotate: 9deg; } }
@keyframes cs-slide-in { from { transform: translateX(calc(-50% - 60vw)); } to { transform: translateX(-50%); } }
@keyframes cs-pop { from { scale: .4; opacity: 0; } 70% { scale: 1.12; opacity: 1; } to { scale: 1; opacity: 1; } }
@keyframes cs-float { 0% { opacity: 0; translate: 0 20%; scale: .4; } 20% { opacity: 1; scale: 1.1; } 100% { opacity: 0; translate: 0 -260%; scale: .9; } }
@keyframes cs-twinkle { 0% { opacity: 0; scale: .2; rotate: 0deg; } 40% { opacity: 1; scale: 1.2; } 100% { opacity: 0; scale: .6; rotate: 90deg; } }
@keyframes cs-fall { 0% { opacity: 0; translate: 0 0; } 15% { opacity: 1; } 100% { opacity: 0; translate: 0 var(--fall, 34vmin); } }
.cs-drop.is-short { --fall: 13vmin; width: 3.6%; }
@keyframes cs-rise { 0% { opacity: 0; translate: 0 0; scale: .5; } 15% { opacity: 1; } 100% { opacity: 0; translate: 4% -42vmin; scale: 1.1; } }
@keyframes cs-crumb { 0% { opacity: 0; translate: 0 0; } 20% { opacity: 1; } 100% { opacity: 0; translate: 0 -10vmin; } }
@keyframes cs-puff { 0% { opacity: 0; scale: .4; translate: 0 0; } 20% { opacity: 1; } 100% { opacity: 0; scale: 1.3; translate: -8vmin -3vmin; } }
@keyframes cs-bounce-by { 0% { left: -10%; top: 62%; } 20% { top: 40%; } 40% { top: 62%; } 60% { top: 46%; } 80% { top: 62%; } 100% { left: 110%; top: 54%; } }
@keyframes cs-swoop { from { translate: 60% -80%; rotate: 25deg; opacity: 0; } to { translate: 0 0; rotate: 0deg; opacity: 1; } }
@keyframes cs-tilt { from { rotate: -12deg; } to { rotate: 12deg; } }
@keyframes cs-scrub { from { translate: -40% 0; } to { translate: 40% 0; } }
/* thrown from the right into the mouth at (--tx, --ty) */
@keyframes cs-toss { 0% { left: calc(var(--tx, 47%) + 190%); top: calc(var(--ty, 46%) + 55%); rotate: 0deg; } 55% { left: calc(var(--tx, 47%) + 60%); top: calc(var(--ty, 46%) - 28%); } 100% { left: var(--tx, 47%); top: var(--ty, 46%); rotate: 540deg; opacity: 1; } }
@keyframes cs-pill-drop { from { top: var(--y0, 6%); rotate: 0deg; } to { top: var(--y1, 80%); rotate: 220deg; } }
@keyframes cs-splash { 0% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: var(--dx) var(--dy); } }
@keyframes cs-towel-drop { from { translate: 0 -70vmin; } to { translate: 0 0; } }
@keyframes cs-rub { from { rotate: -4deg; } to { rotate: 4deg; } }
@keyframes cs-beat { 0%, 100% { scale: 1; } 50% { scale: 1.25; } }
@keyframes cs-jab { 0% { translate: 40% -30%; opacity: 0; } 40% { translate: 0 0; opacity: 1; } 70% { translate: -6% 4%; } 100% { translate: 30% -20%; opacity: 0; } }

/* ─── Su día vs Jugar: two clearly separate worlds on the bottom panel ─── */
.mode-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mode-switch {
  display: flex; flex: none; padding: 3px; gap: 3px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--paper-2);
}
.mode-btn {
  padding: 6px 13px; font: inherit; font-weight: 900; font-size: 15px; color: var(--ink); white-space: nowrap;
  background: transparent; border: 0; border-radius: 999px; transition: background .15s, color .15s;
}
.mode-btn.is-real.is-on { background: var(--green); color: #fff; box-shadow: 0 2px 0 var(--ink); }
.mode-btn.is-game.is-on { background: #7A5BC7; color: #fff; box-shadow: 0 2px 0 var(--ink); }
.mode-note { flex: 1; min-width: 0; font-size: 13px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The bottom panel, compact (27/10, Joaco: "la caja de abajo ocupa muchísimo espacio y le roba mucho lugar a las
   mascotas"): Juegos, Ropa y Lugares beside the switch, the note in up to two short lines after them, smaller buttons.
   One line on top in every mode, so on a computer the panel keeps its height and the pets don't jump. */
.mode-row { flex-wrap: wrap; row-gap: 3px; }
.mode-row .tabs { flex: none; }
.mode-row .mode-note { flex: 1 1 0; white-space: normal; line-height: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (min-width: 700px) and (orientation: portrait), (min-width: 700px) and (min-height: 520px) {
  .panel { padding: 8px 10px 6px; gap: 6px; }
  .mode-btn { padding: 4px 12px; font-size: 14px; }
  .mode-row .tab { padding: 4px 11px; font-size: 14px; }
  .mode-row .mode-note { font-size: 12px; padding-left: 2px; }
  .panel .acts { padding: 2px 2px 4px; gap: 7px; }
  .panel .act { width: 88px; padding: 6px 4px 5px; }
  .panel .act-art { height: 40px; }
  .panel .act-art img { max-height: 40px; max-width: 58px; }
  .panel .act-emoji { font-size: 27px; }
  .panel .act-art img[src*='thumb-'] { width: 62px; height: 40px; }
}
.panel.is-real { box-shadow: 0 0 0 4px rgba(94,156,90,.35), var(--shadow); }
.panel.is-game { background: #EEE6FA; box-shadow: 0 0 0 4px rgba(122,91,199,.35), var(--shadow); }
.panel.is-game .act { background: #F7F2FF; }
.panel.is-game .act.is-active { background: var(--ink); }
.panel.is-game .act.is-alert { background: #FFE2A0; }
.panel.is-game .tab.is-on { background: #7A5BC7; border-color: var(--ink); color: #fff; }
.toast.has-undo {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: min(92vw, 420px);
  padding: 8px 8px 8px 14px; text-align: left; line-height: 1.2;
}
.toast-undo, .undo-link {
  flex: none; font: inherit; font-weight: 900; color: var(--accent); background: #fff;
  border: 2px solid var(--ink); border-radius: 999px; padding: 5px 12px; box-shadow: 0 2px 0 var(--ink);
}
.undo-link { margin-left: 8px; padding: 1px 8px; font-size: 12px; box-shadow: none; }
.routine-item.is-done .routine-state { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.routine-item.is-done .undo-link { margin-left: 0; }
.test-pill {
  display: block; width: 100%; margin-top: 6px; padding: 5px 8px; text-align: left; font-size: 12.5px; font-weight: 800;
  background: #FFF1A8; border: 2px dashed var(--ink); border-radius: 12px;
}
.app .demo-pill { background: #E4F1FB; border-style: solid; }
.modal:focus { outline: none; }
.name-form { display: flex; gap: 8px; margin-top: 12px; }
.name-form input {
  flex: 1; min-width: 0; font: inherit; font-weight: 800; font-size: 18px; padding: 10px 12px;
  border: 2.5px solid var(--ink); border-radius: 12px; background: #fff;
}
.name-form .big-btn { width: auto; margin-top: 0; }
.name-form.is-small { margin-top: 0; }
.name-form.is-small input { font-size: 14px; padding: 5px 8px; width: 120px; flex: none; }
@media (max-width: 699px), (orientation: landscape) and (max-height: 519px) {
  .mode-row { gap: 6px; }
  .mode-btn { padding: 5px 10px; font-size: 13px; }
  .mode-note { font-size: 11.5px; white-space: normal; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
.sync-pill.is-soft { background: #EAF3FB; }

/* Every game takes the whole screen, on phones (portrait or on its side) and on computers.
   At the end of the file so it wins over the older window-style rules above. */
.mg-overlay { padding: 0; }
.mg-card {
  width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; box-shadow: none; display: flex; flex-direction: column;
  padding: calc(8px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left));
}
.mg-head { margin-bottom: 8px; }
.mg-stage { flex: 1 1 auto; aspect-ratio: auto; max-height: none; min-height: 0; }
.mg-result { justify-content: center; align-items: center; }

/* ─── After a walk: poops, pees and how long (WalkSheet.jsx) ─── */
.walk-sheet h2 { margin-bottom: 2px; }
.walk-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 10px; align-items: center; margin: 12px 0; }
.walk-row { display: contents; }
.walk-col { font-weight: 900; font-size: 13px; text-align: center; }
.walk-dog { display: flex; align-items: center; gap: 6px; font-weight: 900; text-align: left; }
.walk-dog img { width: 34px; height: 34px; object-fit: contain; }
.stepper { display: inline-flex; align-items: center; border: 2.5px solid var(--ink); border-radius: 999px; background: #fff; }
.stepper button { width: 36px; height: 36px; font: inherit; font-size: 20px; font-weight: 900; background: none; border: 0; color: var(--ink); }
.stepper b { min-width: 20px; text-align: center; font-size: 18px; }
.walk-mins { text-align: left; font-weight: 900; }
.walk-mins > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.walk-line { font-weight: 700; color: var(--ink-soft); }
.undo-link.is-soft { color: var(--ink); }
.walk-sheet h2 { font-size: 26px; }

/* ─── Diario mode: notes, log, health and the scenes, one tap away ─── */
.mode-btn.is-diary.is-on { background: #3E7CB1; color: #fff; box-shadow: 0 2px 0 var(--ink); }
.mode-btn { position: relative; }
.mode-dot { position: absolute; top: 2px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 1.5px solid var(--ink); }
.panel.is-diary { background: #E8F1F8; box-shadow: 0 0 0 4px rgba(62,124,177,.32), var(--shadow); }
.panel.is-diary .act { background: #F5FAFE; }
.panel.is-diary .act.is-active { background: var(--ink); }
.panel.is-diary .act.is-alert { background: #FFE2A0; }
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 12px 0; }
.scene-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; font: inherit; font-weight: 900;
  background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 0 3px 0 var(--ink); color: var(--ink);
}
.scene-tile span { font-size: 30px; line-height: 1; }
/* notes between the papis */
.notes { text-align: left; }
.notes-chat { max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.note-bubble { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.note-bubble > div { background: #fff; border: 2px solid var(--ink); border-radius: 14px 14px 14px 4px; padding: 7px 11px; }
.note-bubble p { margin: 0; font-weight: 700; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-bubble.is-me { align-self: flex-end; flex-direction: row-reverse; }
.note-bubble.is-me > div { background: #FFF1C9; border-radius: 14px 14px 4px 14px; }
.note-meta { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.note-meta .link-btn { margin-left: 8px; font-size: 12px; }
.note-form { display: flex; gap: 8px; align-items: stretch; margin-top: 10px; }
.note-form textarea {
  flex: 1; min-width: 0; font: inherit; font-weight: 700; padding: 8px 10px; resize: none;
  border: 2.5px solid var(--ink); border-radius: 12px; background: #fff;
}
.note-form .big-btn { width: auto; margin-top: 0; padding: 8px 16px; }
.notes-book { max-height: 56vh; overflow-y: auto; }
.notes-day { padding: 10px 12px; margin-bottom: 10px; background: #fff; border: 2px solid var(--ink); border-radius: 6px; box-shadow: 2px 3px 0 var(--ink); }
.notes-day h3 { font-family: var(--hand); font-weight: 700; font-size: 22px; margin: 0 0 6px; color: var(--accent); }
.notes-day h3::first-letter { text-transform: uppercase; }
.notes-day p { margin: 0 0 8px; font-weight: 600; line-height: 1.4; white-space: pre-wrap; }
@media (max-width: 699px), (orientation: landscape) and (max-height: 519px) {
  /* the phone's diario: its seven places in two rows of four, whole names, no cut-off lines (27/10, Joaco: on the phone
     he could not find the notes, the friends and the places) */
  .acts.tab-diary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px 4px; overflow: visible; }
  .acts.tab-diary .act { width: auto; min-width: 0; padding: 4px 2px 5px; gap: 1px; }
  .acts.tab-diary .act-art { height: 24px; }
  .acts.tab-diary .act-emoji { font-size: 21px; }
  .acts.tab-diary .act-label { font-size: 11px; white-space: nowrap; }
  .acts.tab-diary .act-sub { display: none; }
  .mode-btn { padding: 5px 8px; font-size: 12.5px; }
  .mode-row { flex-wrap: wrap; row-gap: 3px; }
  /* the phone's panel, compact: the note in two short lines beside the switch; in Jugar the tabs take a line of their
     own, because they don't fit beside the three switch buttons */
  .panel { padding: 6px 6px 5px; gap: 5px; }
  .mode-btn { padding: 4px 8px; }
  .panel .mode-note { order: 2; font-size: 10.5px; line-height: 13px; letter-spacing: -.2px; padding-left: 0; -webkit-line-clamp: 3; }
  .mode-row.has-tabs .tabs { order: 3; flex-basis: 100%; gap: 4px; }
  .mode-row.has-tabs .tab { padding: 4px 8px; font-size: 12.5px; }
  .mode-row.has-tabs .tab-emoji { font-size: 15px; }
  .panel .acts { padding: 2px 2px 3px; }
  .panel .act { padding: 5px 2px 4px; }
  .panel .act-art { height: 32px; }
  .panel .act-art img { max-height: 32px; max-width: 46px; }
  .panel .act-emoji { font-size: 24px; }
  .panel .act-art img[src*='thumb-'] { width: 50px; height: 32px; }
}

/* ─── Salud in sections: Ficha, Comida, Cuidados, Historial, Fuentes ─── */
.health-sections { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 6px; margin: 4px 0 6px; scrollbar-width: none; }
.health-sections .tab { flex: none; font-size: 13px; padding: 5px 10px; }
.field { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; align-items: baseline; padding: 7px 0; border-bottom: 1.5px dashed rgba(42,31,26,.2); }
.field-label { font-weight: 900; font-size: 13px; color: var(--ink-soft); }
.field-value { font-weight: 700; overflow-wrap: anywhere; white-space: pre-wrap; }
.field-value.is-empty { color: var(--ink-soft); font-style: italic; font-weight: 600; }
.field.is-edit { grid-template-columns: 1fr; gap: 5px; }
.field input, .field textarea { font: inherit; font-weight: 700; padding: 7px 9px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; width: 100%; }
.field-btns { display: flex; gap: 10px; align-items: center; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.menu-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; text-align: center; background: #fff; border: 2px solid var(--ink); border-radius: 12px; }
.menu-item img { width: 56px; height: 56px; object-fit: contain; }
.menu-item b { font-size: 13px; }
.menu-item span { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.menu-item.is-pick { padding: 0; opacity: .6; }
.menu-item.is-pick.is-on { opacity: 1; background: #E6F2DD; }
.menu-item.is-pick button { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; padding: 6px 4px; background: none; border: 0; font: inherit; color: var(--ink); }
.menu-item.is-pick input { width: calc(100% - 10px); margin: 0 5px 6px; font: inherit; font-size: 12px; padding: 3px 6px; border: 1.5px solid var(--ink); border-radius: 8px; }
.care { padding: 10px 12px; margin: 8px 0; background: #fff; border: 2px solid var(--ink); border-radius: 12px; }
.care.is-due { background: #FFE2A0; }
.care-head { display: flex; gap: 10px; align-items: center; }
.care-head > div { flex: 1; min-width: 0; }
.care-icon { font-size: 26px; }
.care-status { font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.care-more { margin-top: 6px; }
.care-more .bath-date { flex-wrap: wrap; }
.care-more input[type=number] { width: 90px; }

/* ─── Right column on wide screens: the diary card, with filters on top that pick what it shows ─── */
.side-col {
  position: absolute; right: 16px; top: 96px; bottom: calc(var(--panel-h, 200px) + 18px); width: 292px; z-index: 5;
  display: flex; flex-direction: column; gap: 22px; pointer-events: none;
}
/* wide enough that the bottom panel (780 px, centered) doesn't reach the column: it goes down to the bottom */
@media (min-width: 1420px) { .side-col { bottom: 16px; } }
/* the card on top, the notepad below it, both always on screen */
/* the notepad takes what its notes need (up to 42%); the card on top, the rest (27/10: "¿por qué el de arriba es tan cortito?") */
.side-col > .notepad { flex: 0 0 auto; min-height: 120px; max-height: 40%; }
.side-col > * { pointer-events: auto; }
.side-book { flex: 1 1 0; min-height: 200px; display: flex; flex-direction: column; padding: 14px 12px 12px; transform: rotate(.6deg); }
.side-filters { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 8px; border-bottom: 2px dashed rgba(42, 31, 26, .25); }
.side-filter {
  position: relative; display: inline-flex; align-items: center; gap: 3px; padding: 4px 7px; font: inherit; font-size: 12px; font-weight: 800;
  color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 2px 0 var(--ink); cursor: pointer;
}
.side-filter.is-on { background: #3E7CB1; color: #fff; }
/* the whole tab in a window (SideBook onWhole) */
.side-whole {
  align-self: flex-end; display: inline-flex; align-items: center; gap: 4px; margin: 6px 0 -2px; padding: 2px 9px;
  font: inherit; font-size: 12px; font-weight: 800; color: var(--ink-soft); background: transparent;
  border: 1.5px solid rgba(42, 31, 26, .35); border-radius: 999px; cursor: pointer;
}
.side-whole span { font-size: 14px; line-height: 1; }
.side-whole:hover { color: var(--ink); border-color: var(--ink); background: var(--paper-2); }
.side-filter .btn-badge { top: -7px; right: -6px; }
.side-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding-top: 10px; }
.side-body::-webkit-scrollbar { width: 6px; }
.side-body::-webkit-scrollbar-thumb { background: var(--bar); border-radius: 3px; }
.side-log .diary-title { display: none; }
.side-body .notepad { max-height: none; flex: 1 1 auto; transform: rotate(-.8deg); margin: 14px 4px 4px; }
/* in the card: three small tiles a row, so every scene fits without scrolling (27/10: "sigo viendo esto cortado") */
.side-scenes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.side-scenes .scene-tile { padding: 7px 3px; gap: 2px; font-size: 12px; border-width: 2px; box-shadow: 0 2px 0 var(--ink); }
.side-scenes .scene-tile span { font-size: 22px; }
.side-health-dog { margin-bottom: 12px; }
.side-health-dog > b { font-family: var(--hand); font-size: 20px; color: var(--accent); }
.side-health-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; padding: 3px 0; }
.side-health-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-health-when { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.side-health-row.is-due .side-health-when { color: var(--accent); font-weight: 900; }
.side-adv p { margin: 0 0 10px; }
.notepad {
  position: relative; flex: 0 1 auto; min-height: 150px; max-height: 52%; display: flex; flex-direction: column;
  padding: 26px 14px 10px 30px; transform: rotate(-1.2deg);
  background:
    linear-gradient(90deg, transparent 21px, rgba(217, 80, 63, .45) 21px, rgba(217, 80, 63, .45) 23px, transparent 23px),
    repeating-linear-gradient(180deg, transparent 0 25px, rgba(70, 110, 170, .22) 25px 26px),
    #FFF6C9;
  background-position: 0 0, 0 18px, 0 0;
  border: 2.5px solid var(--ink); border-radius: 6px 6px 12px 12px; box-shadow: var(--shadow);
}
.notepad-rings { position: absolute; top: -10px; left: 18px; right: 18px; display: flex; justify-content: space-between; pointer-events: none; }
.notepad-rings i { width: 9px; height: 22px; border: 2.5px solid #6B5B52; border-radius: 6px; background: linear-gradient(90deg, #D8D2CC, #9E948C); }
.notepad-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.notepad-head .hand { color: var(--accent); }
.notepad-head .link-btn { font-size: 12px; }
.notepad-lines { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.notepad-lines p { margin: 0; font-family: var(--hand); font-size: 18px; line-height: 26px; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.notepad-lines p b { font-family: var(--body, inherit); font-size: 13px; }
.notepad-lines p .ava, .notepad-lines p img { vertical-align: -3px; }
.notepad-lines p.is-new { background: rgba(255, 214, 90, .55); border-radius: 4px; }
.notepad-time { font-size: 14px; color: var(--ink-soft); }
.notepad-empty { color: var(--ink-soft) !important; }
.notepad-form input {
  width: 100%; margin-top: 4px; border: 0; border-bottom: 2px dashed rgba(42, 31, 26, .35); background: transparent;
  font-family: var(--hand); font-size: 18px; color: var(--ink); padding: 2px 0; outline: none;
}
.notepad-form input:focus { border-bottom-color: var(--accent); }
.notepad-err { margin: 4px 0 0; font-size: 12px; font-weight: 800; color: var(--accent); }
.notepad-lines::-webkit-scrollbar { width: 6px; }
.notepad-lines::-webkit-scrollbar-thumb { background: var(--bar); border-radius: 3px; }

/* ─── Phones: no surprise zooms ─── */
/* iPhone zooms into any field under 16px when you tap it, and doesn't zoom back */
@media (pointer: coarse) { input, select, textarea { font-size: max(16px, 1em) !important; } }
/* fast taps count as taps, never as a double-tap zoom */
button, a, input, select, textarea, label, .act, .scene-tile, [role="button"] { touch-action: manipulation; }
/* the narrowest phones (320 px): labels shrink instead of spilling out of their buttons */
@media (max-width: 340px) {
  .acts.tab-care .act-label, .acts.tab-diary .act-label { font-size: 9px; letter-spacing: -.3px; }
  .acts.tab-care .act-sub { display: block; font-size: 9px; overflow: hidden; text-overflow: ellipsis; }
}

/* ─── Places they went: paper map, polaroids, the place and its form ─── */
/* the map looks drawn on old paper: warm, soft tiles under a paper grain, pins as paw stickers */
.places-map { position: relative; height: 240px; overflow: hidden; background: #EFE3C8; }
.places-map.is-mini { height: 170px; margin: 0 0 8px; }
.places-map.is-picker { height: 220px; margin: 6px 0 4px; }
.places-map .leaflet-tile-pane { filter: sepia(.42) saturate(.72) hue-rotate(-8deg) brightness(1.04) contrast(.93); }
.places-map::after {
  content: ''; position: absolute; inset: 0; z-index: 450; pointer-events: none;
  box-shadow: inset 0 0 40px rgba(120, 80, 30, .28);
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), transparent 55%);
}
.places-map .leaflet-control-attribution { font-size: 9px; background: rgba(251,241,222,.85); }
.paw-pin.is-open { background: #FFF1C9; }
.paw-pin.is-new { background: transparent; border: 0; box-shadow: none; font-size: 30px; }
.places { text-align: left; }
.places-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.places-head .big-btn { width: auto; margin: 0; padding: 9px 16px; }
.place-card .polaroid-pic { display: grid; place-items: center; font-size: 34px; background-color: #F4ECDD; }
.place-view, .place-form { text-align: left; }
.place-view-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.place-view h2, .place-form h2 { font-size: 26px; margin: 4px 0; }
.place-note { font-weight: 700; line-height: 1.45; white-space: pre-wrap; }
.place-video { width: 100%; max-height: 60vh; border-radius: 12px; border: 2.5px solid var(--ink); background: #000; margin: 6px 0; }
.place-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 6px; }
.place-photo { padding: 0; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; background: #fff; aspect-ratio: 1; }
.place-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.place-big { position: fixed; inset: 0; z-index: 300; background: rgba(20, 14, 10, .92); display: grid; place-items: center; padding: 12px; }
.place-big img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.pf-label { display: block; font-weight: 900; font-size: 13px; color: var(--ink-soft); margin: 10px 0 0; }
.pf-label input, .pf-label textarea, .place-search input {
  display: block; width: 100%; margin-top: 4px; font: inherit; font-weight: 700; color: var(--ink);
  padding: 8px 10px; border: 2px solid var(--ink); border-radius: 10px; background: #fff;
}
.place-search { display: flex; gap: 6px; margin-top: 4px; }
.place-search input { margin-top: 0; flex: 1; min-width: 0; }
.place-hits { list-style: none; margin: 6px 0; padding: 0; font-size: 13px; }
.place-hits li { margin: 3px 0; }
.place-media-edit { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.place-thumb {
  position: relative; width: 96px; height: 96px; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden;
  background: #fff; display: grid; place-items: center; font-weight: 900; font-size: 12px; text-align: center;
}
.place-thumb img { width: 100%; height: 100%; object-fit: cover; }
.place-thumb-video { position: relative; width: 100%; height: 100%; display: grid; place-items: center; font-size: 24px; color: #fff; background: #2A1F1A; }
.place-thumb-video img { position: absolute; inset: 0; opacity: .8; }
.place-thumb-x { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; font-weight: 900; line-height: 1; padding: 0; }
.place-thumb-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 2px; padding: 3px; background: linear-gradient(transparent, rgba(42,31,26,.55)); }
.place-thumb-bar button { min-width: 26px; height: 26px; padding: 0 5px; border-radius: 13px; border: 2px solid var(--ink); background: #fff; font-weight: 900; font-size: 14px; line-height: 1; }
.place-thumb-bar button:disabled { visibility: hidden; }
.place-thumb-scene { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; font-size: 14px; line-height: 1; padding: 0; }
.place-thumb.is-scene { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.place-thumb.is-scene .place-thumb-scene { background: #FFE2A0; }
.place-thumb.is-up { background: #FFF1C9; }
.place-thumb.is-error { background: #FDE2DD; color: var(--accent); padding: 4px; }
.place-thumb.is-add { border-style: dashed; font-size: 28px; cursor: pointer; }
.place-thumb.is-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.check-row { display: flex; gap: 8px; align-items: flex-start; font-weight: 700; font-size: 14px; margin: 8px 0; }
.check-row input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.link-btn.is-danger { color: var(--accent); }
.places-mini-list { list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; }
.places-mini-list li { padding: 3px 0; border-bottom: 1.5px dashed rgba(42,31,26,.15); }
/* the family's page */
/* the app is one fixed screen (html, body, #root never scroll); this page is a long list: it scrolls (27/10, Joaco: "no
   puedo scrollear para abajo"; it never could since 19/10) */
html.is-familia, html.is-familia body, html.is-familia #root { height: auto; min-height: 100%; overflow: visible; }
body.is-familia { min-height: 100vh; padding: max(16px, env(safe-area-inset-top)) 16px 24px; background: #F4D9A8 url(assets/scenes/park.webp?a=3) center / cover fixed; }
.familia { max-width: 900px; margin: 0 auto; }
.familia-head { display: flex; align-items: flex-end; gap: 8px; padding: 14px 16px; margin-bottom: 14px; }
.familia-head img { height: 70px; }
.familia-head h1 { font-size: clamp(22px, 5vw, 34px); }
.familia-head p { margin: 4px 0 0; }
.familia-body { padding: 14px; }
.familia-body .polaroids { max-height: none; }

/* "Un día como hoy" */
.memory-chip { display: block; width: 100%; margin-top: 6px; padding: 5px 10px; border: 2px solid var(--ink); border-radius: 12px; background: #FFF1D6; text-align: left; font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.memory-card { display: flex; gap: 10px; align-items: center; width: 100%; margin-bottom: 10px; padding: 8px; border: 2px solid var(--ink); border-radius: 14px; background: #FFF1D6; text-align: left; color: var(--ink); }
.memory-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 2px solid var(--ink); flex: none; }
.memory-card-icon { font-size: 34px; width: 64px; text-align: center; flex: none; }
.memory-card-txt { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.memory-card-txt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memory-view { text-align: center; }
.memory-view h2 { margin: 2px 0 10px; }
.memory-photo { width: 100%; max-height: 50vh; object-fit: cover; border-radius: 14px; border: 2.5px solid var(--ink); }
.memory-text { white-space: pre-wrap; text-align: left; background: #FFFDF7; border-radius: 12px; padding: 10px 12px; }

/* ─── The casita's things and visitors, on the scene behind the dogs ─── */
.things { position: absolute; inset: 0; pointer-events: none; overflow: clip; } /* what falls off the screen never makes the page scroll sideways */
.thing { position: absolute; height: auto; transform: translate(-50%, -100%); user-select: none; }
/* stuck to it: a short shadow along its own outline, mostly under its feet (2/11, Joaco: "la sombra tiene que estar al
   objeto para que no parezca que vuela"); the oval under it looked like a patch of its own */
.things .thing[data-id] { filter: drop-shadow(0 2px 1.5px rgba(52, 38, 22, .45)); }
.visitor { animation: visitor-bob 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
.visitor.is-mariposa, .visitor.is-picaflor { animation: visitor-flutter 1.6s ease-in-out infinite; }
@keyframes visitor-bob { 0%, 100% { transform: translate(-50%, -100%); } 50% { transform: translate(-50%, -100%) scaleY(.97); } }
@keyframes visitor-flutter { 0%, 100% { transform: translate(-50%, -100%); } 50% { transform: translate(-50%, -112%) rotate(-4deg); } }
.things.is-big { position: absolute; inset: 0; }
/* Acomodar on the scene itself (2/11): a clear layer over the scene takes the finger, the bar sits at the bottom;
   below the windows that pop up (a medal's party, .modal-back z 60). The pets fade so the floor behind them shows */
.arrange-layer { position: fixed; inset: 0; z-index: 40; touch-action: none; cursor: grab; }
.arrange-bar { position: fixed; z-index: 45; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(560px, calc(100% - 20px)); display: grid; gap: 8px; padding: 10px 12px; }
.arrange-tip { margin: 0; font-size: 13px; text-align: center; }
.arrange-chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.arrange-chip { width: 44px; height: 44px; padding: 4px; border: 2px solid transparent; border-radius: 10px; background: var(--paper-2); cursor: pointer; }
.arrange-chip img { width: 100%; height: 100%; object-fit: contain; }
.arrange-chip.is-on { border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.arrange-chip.is-out { opacity: .45; border-style: dashed; border-color: var(--soft); } /* taken off: a tap puts it back */
.arrange-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.arrange-btns .give-btn { min-width: 44px; }
/* a phone lying down: at the bottom it covered the whole floor and nothing could be dragged there (3/11): a narrow
   column at the right, without the long explanation */
@media (orientation: landscape) and (max-height: 519px) { /* the bar lives in body (a portal): main.jsx's land, by size */
  .arrange-bar { left: auto; right: calc(8px + env(safe-area-inset-right)); top: 8px; bottom: auto; transform: none;
    width: 172px; max-height: calc(100% - 16px); overflow-y: auto; padding: 8px; gap: 6px; }
  .arrange-tip { display: none; }
  .arrange-btns { gap: 5px; }
  .arrange-btns .give-btn { padding: 5px 8px; font-size: 12px; }
}
.things .thing[data-id].is-sel { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 5px #FFD54A); }
.arrange-knob { position: fixed; z-index: 42; width: 36px; height: 36px; transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--paper); border: 2.5px solid var(--ink); box-shadow: 0 2px 0 var(--ink); touch-action: none; cursor: nesw-resize;
  display: grid; place-items: center; font-size: 18px; line-height: 1; color: var(--ink); }
.arrange-knob::before { content: '⤢'; }
.is-arranging .dog-slot { opacity: .4; transition: opacity .2s; }
.is-arranging .visitor { visibility: hidden; }
.is-arranging .hint, .is-arranging .need-bubble { visibility: hidden; }

/* ─── Light by the time of day, and the season outdoors ─── */
.light-morning .scene-tint { background: linear-gradient(180deg, rgba(255, 214, 160, .16), rgba(255, 236, 200, .05) 60%, transparent); }
.light-dusk .scene-tint { background: linear-gradient(180deg, rgba(232, 120, 70, .22), rgba(150, 70, 90, .14)); }
.light-night:not(.is-night) .scene-tint { background: rgba(28, 32, 78, .32); }
.season-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.season-fx i {
  position: absolute; top: -6%; left: calc(4% + var(--i) * 11%); width: 12px; height: 9px; border-radius: 60% 0 60% 0;
  opacity: .85; animation: season-fall calc(9s + var(--i) * 1.3s) linear calc(var(--i) * -2.1s) infinite;
}
.season-primavera .season-fx i { background: #F6B8C8; border: 1px solid rgba(160, 70, 100, .4); }
.season-otono .season-fx i { background: #D9873A; width: 15px; height: 11px; border: 1px solid rgba(110, 60, 20, .5); }
.season-verano .season-fx i { width: 6px; height: 6px; border-radius: 50%; background: #FFF4B0; box-shadow: 0 0 8px 3px rgba(255, 240, 150, .7); animation-name: season-float; }
.season-invierno .season-fx i { display: none; }
@keyframes season-fall { from { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(40px, 55vh) rotate(200deg); } to { transform: translate(-10px, 110vh) rotate(400deg); } }
@keyframes season-float { from { transform: translate(0, 70vh); opacity: 0; } 30% { opacity: .9; } to { transform: translate(30px, 20vh); opacity: 0; } }

/* ─── A birthday: confetti and a pill on the card ─── */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.confetti i {
  position: absolute; top: -4%; left: calc(3% + var(--i) * 5.4%); width: 8px; height: 13px; border-radius: 2px;
  background: hsl(calc(var(--i) * 47), 75%, 62%); animation: season-fall calc(6s + var(--i) * .4s) linear calc(var(--i) * -.9s) infinite;
}
.party-pill { margin-top: 6px; padding: 5px 10px; border: 2px solid var(--ink); border-radius: 12px; background: #FFE3EC; font-weight: 800; font-size: 13px; text-align: center; }
.visit-chip { display: flex; align-items: center; gap: 6px; background: #E9F6E2; }
.visit-chip img { width: 26px; height: 26px; object-fit: contain; flex: none; }

/* ─── The short celebration (1.5 s) ─── */
.quick { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); z-index: 8; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.quick-word {
  display: flex; align-items: center; gap: 8px; padding: 6px 16px 6px 10px; font-family: var(--display); font-size: 24px; color: var(--ink);
  background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow); white-space: nowrap;
  animation: quick-pop 1.5s ease-out both;
}
.quick-word img { width: 34px; height: 34px; }
.quick-hearts { position: relative; width: 160px; height: 40px; }
.quick-hearts img { position: absolute; left: calc(var(--i) * 30px); top: 10px; width: 24px; animation: quick-heart 1.3s calc(var(--i) * 80ms) ease-out both; }
.quick-treasure {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: #FFF1D6; border: 2.5px solid var(--ink); border-radius: 16px;
  box-shadow: var(--shadow); font-weight: 900; font-size: 15px; animation: quick-pop 1.6s 1.25s ease-out both;
}
.quick-treasure img { width: 46px; height: 46px; object-fit: contain; animation: quick-wiggle .5s 1.5s ease-in-out 2; }
@keyframes quick-pop { 0% { transform: scale(.4); opacity: 0; } 18% { transform: scale(1.08); opacity: 1; } 28% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes quick-heart { 0% { transform: translateY(20px) scale(.4); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-50px) scale(1); opacity: 0; } }
@keyframes quick-wiggle { 50% { transform: rotate(-12deg) scale(1.1); } }

/* clothes still to be won */
.act.is-locked .act-art img { filter: grayscale(1) opacity(.45); }

/* ─── La casita: the picture with its things, the visitors and the keys ─── */
.casa h2 { margin-bottom: 8px; }
.casa-pic { position: relative; margin: 10px 0; border: 2.5px solid var(--ink); border-radius: 14px; overflow: hidden; aspect-ratio: 2064 / 1152; }
.casa-pic > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.casa-visits { list-style: none; margin: 0 0 8px; padding: 0; }
.casa-visits li { text-align: left; display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #E9F6E2; border-radius: 12px; font-size: 14px; margin-bottom: 4px; }
.casa-visits img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.casa-keys { font-family: var(--display); font-size: 20px; margin: 6px 0; }
.casa-shop { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.casa-shop li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; }
.casa-shop li.is-has { background: #F3F8EE; }
.casa-shop img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.casa-shop-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 14px; text-align: left; }
.casa-shop-txt .muted { font-size: 12px; }
.casa-has { font-size: 12px; font-weight: 800; color: var(--green); white-space: nowrap; }
.casa-shop .give-btn:disabled { opacity: .45; }

/* ─── Logros: the week, the treasures, the postcards ─── */
.logros .tabs { margin-bottom: 10px; flex-wrap: wrap; }
.week { text-align: left; padding: 10px 12px; margin-bottom: 10px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; }
.week h3 { margin: 0 0 6px; font-family: var(--hand); font-size: 21px; color: var(--accent); }
.week p { margin: 4px 0; }
.week-people { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 16px; }
.week-people span { display: inline-flex; align-items: center; gap: 5px; }
.week-done { display: flex; flex-wrap: wrap; gap: 4px 12px; font-weight: 700; font-size: 14px; }
.week-total { font-size: 15px; margin: 8px 0 2px; }
.treasure-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.treasure { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; font-size: 12px; font-weight: 800; text-align: center; }
.treasure img { width: 48px; height: 48px; object-fit: contain; }
.treasure.is-missing img { filter: brightness(0) opacity(.28); }
.treasure.is-missing span { color: var(--ink-soft); }
.treasure-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 30vh; overflow-y: auto; }
.treasure-list li { text-align: left; display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; }
.treasure-list img { width: 28px; height: 28px; object-fit: contain; flex: none; }
.postcards { display: grid; gap: 10px; max-height: 58vh; overflow-y: auto; padding: 2px 4px 4px 2px; }
.postcard {
  position: relative; display: flex; gap: 12px; align-items: center; padding: 10px 44px 10px 10px; background: #FFFDF5; text-align: left;
  border: 2px solid var(--ink); border-radius: 6px; box-shadow: 3px 4px 0 var(--ink); transform: rotate(-.6deg);
}
.postcard:nth-child(even) { transform: rotate(.7deg); }
.postcard img { width: 70px; height: 70px; object-fit: contain; flex: none; }
.postcard b { font-family: var(--hand); font-size: 21px; }
.postcard p { margin: 2px 0; font-size: 14px; }
.postcard-date { font-size: 12px; color: var(--ink-soft); }
.postcard-stamp { position: absolute; top: 8px; right: 8px; width: 30px; height: 36px; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 3px; font-size: 16px; }

/* ─── Amiguitos: the album of figuritas, one friend's card and the form (Amiguitos.jsx) ─── */
.figu-count { margin: 10px 0 4px; font-weight: 700; }
.figu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; padding: 10px 6px 8px; max-height: 52vh; overflow-y: auto; }
.figu {
  position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 6px 6px 7px; background: #fff;
  border: 2px solid var(--ink); border-radius: 8px; box-shadow: 2px 3px 0 var(--ink); transform: rotate(var(--tilt, 0deg));
  font: inherit; color: var(--ink); text-align: center; cursor: pointer;
}
.figu-pic { display: block; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--paper-2); }
.figu-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.figu.is-drawn .figu-pic img { object-fit: contain; padding: 6%; }
.figu-none { display: grid; place-items: center; width: 100%; height: 100%; font-size: 30px; }
.figu-n { position: absolute; top: -9px; left: -6px; z-index: 1; padding: 1px 6px; background: var(--gold); border: 2px solid var(--ink); border-radius: 999px; font-size: 10.5px; font-weight: 900; }
.figu-name { font-family: var(--hand); font-size: 19px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.figu small { font-size: 11px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.figu.is-empty { background: transparent; border-style: dashed; box-shadow: none; transform: none; opacity: .6; }
.figu.is-empty .figu-none { font-family: var(--display); color: var(--ink-soft); }
.figu.is-big { width: min(240px, 72%); margin: 12px auto; cursor: default; transform: rotate(-1deg); }
.figu.is-big .figu-name { font-size: 28px; }
.figu.is-big .figu-pic button { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; }
.amigo-facts { display: grid; gap: 4px; margin: 6px 0; font-weight: 700; font-size: 15px; text-align: left; }
.amigo-note { margin: 6px 0; font-size: 22px; }
.amigo-photo { display: flex; align-items: center; gap: 12px; padding: 8px; background: #fff; border: 2px dashed var(--ink); border-radius: 12px; font-weight: 800; text-align: left; cursor: pointer; }
.amigo-photo.has-photo { border-style: solid; }
.amigo-photo img, .amigo-photo .figu-none { flex: none; width: 84px; height: 84px; object-fit: cover; border-radius: 8px; background: var(--paper-2); }
.amigo-pets { display: flex; flex-wrap: wrap; gap: 6px; }
.amigo-pets .tab { display: inline-flex; align-items: center; gap: 5px; }
.amigo-pets img { width: 26px; height: 26px; object-fit: contain; }
.amigo-old { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-weight: 700; text-align: left; }
.amigo-old input { width: 20px; height: 20px; }
.amigo-msg { color: var(--accent); }
.friend-btn { margin-top: 8px; }

/* clothes won with a level, things found while away */
.won-acc { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; }
.won-acc img { width: 52px; height: 52px; object-fit: contain; }
.gift-list { list-style: none; margin: 10px 0 0; padding: 0; text-align: left; }
.gift-list li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin-bottom: 4px; background: #FFF1D6; border-radius: 12px; font-weight: 700; font-size: 14px; }
.gift-list img { width: 40px; height: 40px; object-fit: contain; flex: none; }

/* ─── Treasures and real photos in the logbook ─── */
.tr-line { white-space: nowrap; }
.tr-line img { width: 20px; height: 20px; object-fit: contain; vertical-align: -5px; }
.log-photos { display: flex; gap: 6px; margin: 4px 0 2px; }
.log-photos button { padding: 0; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; background: none; }
.log-photos img { display: block; width: 64px; height: 64px; object-fit: cover; }
.photo-link { cursor: pointer; }
.photo-btn { display: block; text-align: center; cursor: pointer; }
.photo-big { position: fixed; inset: 0; z-index: 400; background: rgba(20, 14, 10, .92); display: grid; place-items: center; padding: 12px; }
/* the whole photo, standing or lying (27/10: "no la veo completa"; max-height: 100% does nothing in a grid without a
   height of its own, so a standing photo went past the bottom of the screen) */
.photo-big img { max-width: 100%; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); width: auto; height: auto; object-fit: contain; border-radius: 10px; }
.place-painted { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.place-painted img { width: 72px; height: 48px; object-fit: cover; border-radius: 8px; border: 2px solid var(--ink); }
/* on a computer the title card covers the top middle: the celebration goes a bit lower */
@media (min-width: 700px) and (orientation: portrait), (min-width: 700px) and (min-height: 520px) { .quick { top: 140px; } }

/* ─── The question of the day ─── */
.question { padding: 10px 12px; margin-bottom: 10px; background: #FFF6E2; border: 2px solid var(--ink); border-radius: 12px; text-align: left; }
.question-tag { font-family: var(--hand); font-size: 19px; font-weight: 700; color: var(--accent); }
.question-q { margin: 2px 0 8px; font-weight: 900; font-size: 16px; }
.question-answers p { margin: 5px 0; line-height: 1.35; }
.question-answers .avatar, .question-answers img { vertical-align: -6px; }
.question .note-form { margin: 0; }

/* ─── "Cómo crece": a little album in Salud ─── */
.grow-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.grow-add input { flex: 1 1 160px; min-width: 0; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 10px; font: inherit; }
.grow-add label { cursor: pointer; }
.grow-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 8px; }
.grow-item { margin: 0; padding: 6px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; text-align: center; }
.grow-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.grow-noimg { display: grid; place-items: center; aspect-ratio: 1; font-size: 34px; background: #FFF6E2; border-radius: 8px; }
.grow-item figcaption { display: flex; flex-direction: column; gap: 1px; font-size: 13px; margin-top: 4px; }
.grow-item figcaption b::first-letter { text-transform: uppercase; }
/* the album month by month (1/11) */
.grow-month { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; }
.grow-month input { padding: 6px 8px; border: 2px solid var(--ink); border-radius: 10px; font: inherit; font-size: 14px; background: #fff; }
.grow-month-group { margin-top: 12px; }
.grow-month-title { margin: 0 0 4px; font-family: var(--hand); font-size: 20px; color: var(--accent); }
.grow-month-title::first-letter { text-transform: uppercase; }
.grow-month-title span { color: var(--ink-soft); font-size: 17px; }
.grow-item figcaption input[type=month] { width: 100%; font: inherit; font-size: 12px; padding: 2px; }
/* the first time a family opens the app, while its ficha arrives (boot.jsx) */
.boot-wait { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; font-family: var(--hand); font-size: 26px; color: var(--ink-soft); }
.boot-off { max-width: 320px; padding: 0 20px; text-align: center; font-size: 20px; line-height: 1.3; }
.boot-off b { font-size: 28px; color: var(--ink); }

/* ─── A new family's first time: the questions and the photos (Bienvenida.jsx) ─── */
.alta { position: fixed; inset: 0; overflow-y: auto; padding: max(16px, env(safe-area-inset-top)) 16px 28px; background: #F4D9A8; }
.alta-card { width: min(460px, 100%); margin: 0 auto; padding: 18px 18px 20px; }
.alta-card h2 { font-size: 28px; margin: 4px 0 10px; }
.alta-card p { margin: 8px 0; font-weight: 700; }
/* the example of how to frame a place's photo (Bienvenida.jsx Encuadre) */
.alta-tip { margin: 8px 0 12px; padding: 10px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; }
.alta-tip img { display: block; width: 100%; height: auto; border-radius: 10px; border: 2px solid var(--ink); }
.alta-tip p { margin: 8px 0 4px; font-size: 14px; }
.alta-tip-more summary { cursor: pointer; font-weight: 800; margin: 6px 0; }
.alta-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.alta-dots i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink); }
.alta-dots i.is-on { background: var(--accent); }
.alta-input { display: block; width: 100%; margin: 8px 0; padding: 10px 12px; font: inherit; font-weight: 700; font-size: 17px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; }
/* the birthday in three lists (src/Bienvenida.jsx Bday) */
.alta-bday { display: grid; grid-template-columns: 0.8fr 1.5fr 1fr; gap: 6px; }
.alta-bday .alta-input { padding: 10px 6px; font-size: 16px; min-width: 0; }
.alta-bday-falta { grid-column: 1 / -1; color: var(--accent); font-weight: 700; }
.alta-card .alta-q { margin: 14px 0 6px; }
.alta-q small, .alta-shot small { display: block; font-weight: 600; color: var(--ink-soft); font-size: 13px; }
.alta-seg { flex-wrap: wrap; justify-content: flex-start; margin: 6px 0; }
.alta-more { margin: 6px 0; padding: 6px 0; background: none; border: 0; font-weight: 900; color: var(--accent); }
.alta-times { display: flex; flex-wrap: wrap; gap: 8px; }
.alta-times input { font: inherit; font-weight: 800; font-size: 17px; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; }
.alta-dog + .alta-dog { margin-top: 18px; padding-top: 14px; border-top: 2px dashed rgba(42,31,26,.25); }
.alta-shots { display: grid; gap: 8px; margin: 8px 0; }
.alta-shot { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 8px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper-2); }
.alta-shot img, .alta-shot-empty { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: #fff; font-size: 24px; }
.alta-shot.is-ok { background: #EAF4E4; }
.alta-shot.is-err small { color: var(--accent); }
.alta-shot-txt { min-width: 0; }
.alta-shot-txt b { font-size: 15px; }
.alta-err { color: var(--accent); }
.alta-link { word-break: break-all; }
/* their mail (src/Mail.jsx): the box's text reads from the left, the link in the app's ink */
.mail-form .check-row { text-align: left; }
.mail-form a { color: var(--ink); font-weight: 900; }
.alta-nav { display: flex; gap: 10px; margin-top: 12px; }
.alta-nav .big-btn { margin-top: 6px; }

.alta-pet-head { display: flex; justify-content: space-between; align-items: center; }
.alta-pet-head .alta-more { margin: 0; }

/* four to six pets: the cards keep only the drawing, and the chosen one its name */
.dog-chips.is-many { flex-wrap: wrap; }
.dog-chips.is-many .dog-chip:not(.is-on) span { display: none; }

/* ─── Medals (Logros > Medallas, 26/10) ─── */
.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; margin: 8px 0; }
.medal { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px 8px; background: #fff; border: 2px solid var(--ink); border-radius: 14px; text-align: center; font-size: 12px; }
.medal b { font-size: 13px; line-height: 1.15; }
.medal-what { color: var(--ink-soft); line-height: 1.25; }
.medal-when { font-weight: 800; font-size: 11px; }
.medal-face {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; font-size: 28px;
  background: radial-gradient(circle at 35% 30%, #fff6c9, #f2c94c 60%, #c99a1e); border: 2px solid var(--ink);
  box-shadow: 0 3px 0 rgba(42,31,26,.25), inset 0 -3px 0 rgba(0,0,0,.12);
}
.medal:not(.is-won) .medal-face { background: #e9e2d6; filter: grayscale(1); opacity: .55; }
.medal:not(.is-won) b { color: var(--ink-soft); }
.medal-bar { width: 80%; height: 6px; border-radius: 3px; background: #eee5d6; overflow: hidden; margin-top: 2px; }
.medal-bar i { display: block; height: 100%; background: #f2c94c; border-radius: 3px; }
.medal-party { display: flex; justify-content: center; gap: 10px; margin: 6px 0 4px; }
.medal-party .medal-face { width: 84px; height: 84px; font-size: 44px; animation: pose-in .5s ease-out; }

/* "📷 Más fotos" next to the drawing notice, and the later-photos panel (26/10) */
.title-sub.is-drawing { display: flex; align-items: baseline; gap: 6px; }
.title-sub.is-drawing > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-link { flex: none; border: 0; background: none; padding: 0; font: inherit; font-weight: 800; color: var(--ink); text-decoration: underline; cursor: pointer; }
.alta-more { max-height: 60vh; overflow: auto; margin: 6px 0 10px; }
.amigo-send-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.amigo-send-btns .big-btn { margin-top: 10px; padding-left: 6px; padding-right: 6px; font-size: 15px; }
.amigo-send h3 { margin: 4px 0 6px; font-size: 22px; }
.amigo-send textarea { resize: vertical; }
.amigo-preview { margin: 6px 0; font-size: 21px; }

/* this page's family is no longer the browser's session (src/boot.jsx askToEnter) */
.otra-familia { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 16px; background: rgba(42, 31, 26, .6); backdrop-filter: blur(4px); }
.otra-familia-card { width: min(420px, 100%); padding: 20px; text-align: center; }
.otra-familia-card h2 { margin: 0 0 8px; font-size: 24px; }
.otra-familia-card p { margin: 0 0 14px; font-weight: 700; }
.otra-familia-card .big-btn { display: block; text-decoration: none; }

/* Amiguitos in the computer's right column: a scrolling collection; a friend opens in a window (Amiguitos.jsx) */
.amiguitos.is-side .figu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; overflow: visible; }
.amiguitos.is-side > .muted { margin-top: 0; font-size: 13px; }
.amigo-popup { width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; }
.figu.is-add { opacity: 1; border-color: var(--accent); }
.figu.is-add .figu-none { color: var(--accent); font-size: 38px; }
.figu.is-add .figu-name { color: var(--accent); }
/* cartas between families (Amiguitos.jsx) */
.figu-mail { position: absolute; top: -10px; right: -6px; z-index: 1; font-size: 20px; filter: drop-shadow(0 1px 0 var(--ink)); }
.cartas-news { display: block; width: 100%; margin: 0 0 10px; padding: 8px 10px; background: #FFE7A8; border: 2px solid var(--ink); border-radius: 12px; font: inherit; font-weight: 900; color: var(--ink); text-align: left; cursor: pointer; }
.cartas { margin: 12px 0 4px; padding: 10px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; text-align: left; }
.cartas-head { display: block; margin-bottom: 6px; font-family: var(--hand); font-size: 21px; color: var(--accent); }
.carta { margin: 6px 0; padding: 7px 10px; border-radius: 12px; max-width: 88%; }
.carta p { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.carta small { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-soft); }
.carta.is-in { background: #FFF1D6; }
.carta.is-out { background: #E3F0DC; margin-left: auto; }
.carta-kind { display: block; font-size: 12px; font-weight: 900; color: var(--accent); }
.carta-reply { display: flex; gap: 6px; margin-top: 6px; }

/* the diarios this browser is inside (Ajustes, main.jsx) */
.diarios { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }

/* a friend's photo chosen from the diario's own (Amiguitos.jsx FriendForm) */
.amigo-pick-btn { display: block; }
.amigo-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-height: 40vh; overflow-y: auto; margin: 4px 0 8px; padding: 2px; }
.amigo-pick button { padding: 0; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; background: #fff; font: inherit; color: var(--ink); cursor: pointer; }
.amigo-pick img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.amigo-pick small { display: block; padding: 1px 2px; font-size: 10px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amigo-pick .is-on { outline: 3px solid var(--accent); outline-offset: 1px; }

/* ─── Scrollbars like the game (27/10, Joaco: "que las scroll bars sean más acordes a la estética del juego"): a soft
   brown thumb with round ends and a paper edge, on no track. Safari and Chrome draw these; Firefox (and any box that
   sets the standard scrollbar-width) takes the same colours from scrollbar-color. Phones show their own thin overlay. */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bar); border: 3px solid transparent; background-clip: padding-box; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background-color: #8C6A4E; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--bar) transparent; } }

/* ─── A phone lying down (28/10, Joaco: "estaría bueno poder jugar en horizontal en el celu") ───
   It takes the phone's compact look (the media queries above also match a short landscape screen), and its parts go in
   columns: the title and how they are at the left (--land-l), the buttons at the right (--land-r), the pets big in the
   middle (main.jsx: land, SW). At the end of the file so it wins. */
.is-land .top-stack {
  right: auto; bottom: 0; width: var(--land-l); overflow-y: auto; overscroll-behavior: contain;
  padding: calc(8px + env(safe-area-inset-top)) 4px 8px calc(8px + env(safe-area-inset-left)); scrollbar-width: none;
}
.is-land .top-stack::-webkit-scrollbar { display: none; }
.is-land .topbar { flex-wrap: wrap; gap: 6px; }
.is-land .title-card { flex: 1 1 100%; }
.is-land .top-right { flex-wrap: wrap; gap: 5px; }
.is-land .icon-btn { width: 36px; height: 36px; font-size: 16px; border-radius: 11px; }
/* a small phone lying down (667 x 375): the five buttons in one row, so the stats card fits under them (2/11) */
@media (max-width: 700px) { .is-land .icon-btn { width: 32px; height: 32px; font-size: 15px; } .is-land .top-right { gap: 4px; } }
.is-land .panel {
  left: auto; right: calc(8px + env(safe-area-inset-right)); top: calc(8px + env(safe-area-inset-top)); bottom: calc(8px + env(safe-area-inset-bottom));
  top: auto; max-height: calc(100% - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); /* at the bottom, where the thumb is */
  transform: none; width: calc(var(--land-r) - 12px); overflow-y: auto; overscroll-behavior: contain; justify-content: flex-start;
}
.is-land .mode-row { justify-content: center; }
.is-land .mode-switch { flex: 1 1 100%; }
.is-land .mode-btn { flex: 1; padding: 4px 2px; font-size: 12px; }
.is-land .panel .mode-note { flex-basis: 100%; text-align: center; -webkit-line-clamp: 2; }
.is-land .panel .acts, .is-land .panel .acts.tab-care, .is-land .panel .acts.tab-diary {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px 5px; overflow: visible; justify-content: stretch;
}
/* the routine's line keeps its ellipsis in the narrow column; the pets' hint stays over the middle */
.is-land .routine-pill { display: flex; }
.is-land .hint {
  left: calc((var(--land-l) + 100% - var(--land-r)) / 2); max-width: calc(100% - var(--land-l) - var(--land-r) - 12px);
  white-space: normal; text-align: center; font-size: 17px; line-height: 1.1;
}
.is-land .panel .act { width: auto; min-width: 0; }
.is-land .panel .act-label, .is-land .panel .acts.tab-care .act-label, .is-land .panel .acts.tab-diary .act-label {
  font-size: 11px; white-space: normal; overflow-wrap: normal; letter-spacing: -.2px; text-align: center;
}
.is-land .mode-row.has-tabs .tabs { flex-basis: 100%; gap: 3px; }
.is-land .mode-row.has-tabs .tab { flex: 1 1 0; min-width: 0; justify-content: center; padding: 3px 2px; font-size: 11.5px; gap: 2px; }

/* ─── The games that open with medals (src/juegos.jsx, 28/10) ─── */
.act.is-locked .act-emoji { filter: grayscale(1); opacity: .45; }
/* Memoria: cards that turn over */
.memo-grid { position: absolute; inset: 0; display: grid; gap: 10px; place-content: center; padding: 12px; }
.memo-card { position: relative; padding: 0; border: 0; background: none; perspective: 700px; cursor: pointer; }
.memo-face {
  position: absolute; inset: 0; display: grid; place-items: center; border: 2.5px solid var(--ink); border-radius: 12px;
  background: var(--paper); box-shadow: 0 3px 0 var(--ink); backface-visibility: hidden; transition: transform .35s ease; overflow: hidden;
}
.memo-face img { max-width: 86%; max-height: 86%; object-fit: contain; }
.memo-back { background: #F3E6C8; }
.memo-back img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: cover; }
.memo-front { transform: rotateY(180deg); }
.memo-card.is-up .memo-back { transform: rotateY(180deg); }
.memo-card.is-up .memo-front { transform: rotateY(360deg); }
.memo-card.is-found .memo-front { background: #E6F4DE; box-shadow: 0 0 0 3px rgba(94,156,90,.6), 0 3px 0 var(--ink); }
/* Burbujas */
.bub-pet { position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); pointer-events: none; filter: drop-shadow(0 6px 5px rgba(0,0,0,.2)); }
.bub { position: absolute; padding: 0; border: 0; background: none; transform: translate(-50%, -50%); cursor: pointer; touch-action: none; }
.bub img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; animation: bub-wob 1.4s ease-in-out infinite; }
.bub.is-gold img { filter: sepia(1) saturate(4) hue-rotate(5deg) brightness(1.05); }
@keyframes bub-wob { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.06, .95); } }
/* Frisbee */
.fris-dog { position: absolute; transform: translateX(-50%); pointer-events: none; filter: drop-shadow(0 6px 5px rgba(0,0,0,.2)); }
.fris-disc { position: absolute; pointer-events: none; filter: drop-shadow(0 4px 3px rgba(0,0,0,.25)); }
/* Rastro */
/* the prints lie on the ground: flattened, and smaller further back (--d) */
.trail-paw { position: absolute; width: calc(clamp(54px, 11vmin, 96px) * var(--d, 1)); height: calc(clamp(54px, 11vmin, 96px) * var(--d, 1)); padding: 0; border: 0; background: none;
  transform: translate(-50%, -50%) scaleY(.6); border-radius: 50%; cursor: pointer; touch-action: none; opacity: .5; transition: opacity .15s, transform .15s; mix-blend-mode: multiply; }
.trail-paw img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.trail-paw.is-lit { opacity: 1; transform: translate(-50%, -50%) scale(1.2, .72); filter: drop-shadow(0 0 10px rgba(255, 214, 90, .95)); mix-blend-mode: normal; }
/* a pet's shadow on the floor in the new games */
.mg-ground-shadow { position: absolute; aspect-ratio: 4 / 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(52, 38, 22, .38) 0%, rgba(52, 38, 22, .18) 50%, transparent 72%); }
.trail-pet { position: absolute; transform: translate(-50%, -92%); transition: left .45s ease, top .45s ease; pointer-events: none; filter: drop-shadow(0 6px 5px rgba(0,0,0,.2)); }

/* ─── The scene alone (2/11, Joaco: "quiero poder minimizar las ventanas para poder ver bien la escena") ───
   The cards fade out and the pets take the whole floor (main.jsx: bare); one button brings them back. The top cards
   are display: contents on a computer, so their own parts fade. */
.top-stack, .top-stack > *, .panel, .side-col { transition: opacity .25s ease, visibility .25s; }
.is-bare .top-stack, .is-bare .top-stack > *, .is-bare .panel, .is-bare .side-col { opacity: 0; visibility: hidden; pointer-events: none; }
.is-bare .side-col > * { pointer-events: none; }
/* the minimize button, with the icons at the top (2/11, Joaco: "debería estar acá junto con los demás, no en cada
   tarjeta"): a bar drawn, the way windows say it */
.icon-btn.min-btn { display: grid; place-items: center; }
.icon-btn.min-btn::before { content: ''; width: 14px; height: 3px; border-radius: 2px; background: var(--ink); transform: translateY(5px); }
.bare-back {
  position: absolute; z-index: 30; top: calc(10px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right));
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 2.5px solid var(--ink); border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 15px; color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--ink);
  animation: bare-in .25s ease;
}
@keyframes bare-in { from { opacity: 0; transform: translateY(-6px); } }
/* a walk's or a meal's time, changed from the routine (2/11): its hours are a button, two clocks open below */
.routine-time { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-decoration: underline dotted; cursor: pointer; }
.routine-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.routine-edit label { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; }
.routine-edit input[type="time"] { font: inherit; font-size: 15px; padding: 4px 6px; border: 2px solid var(--ink); border-radius: 8px; background: #fff; }


/* their own drawings, for them to approve (src/Dibujos.jsx) */
.dibujos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }
.dibujo-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; background: var(--paper, #FFF8E6); border: 2px solid var(--ink); border-radius: 14px; font: inherit; color: var(--ink); cursor: pointer; }
.dibujo-card .dibujo-pic { width: 100%; aspect-ratio: 1; display: flex; align-items: flex-end; justify-content: center; background: #F3E6C8; border-radius: 10px; overflow: hidden; }
.dibujo-card.is-room .dibujo-pic { aspect-ratio: 3 / 2; }
.dibujo-card .dibujo-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dibujo-card.is-room .dibujo-pic img { width: 100%; height: 100%; object-fit: cover; }
.dibujo-card small { font-weight: 700; color: #2E7D32; }
.dibujo-card.is-again { border-color: #C0392B; background: #FDECEA; }
.dibujo-card.is-again small { color: #C0392B; }

/* friends between families (src/Amistad.jsx, Amiguitos.jsx) */
.figu-pic.is-retrato img { object-fit: contain; padding: 6%; }
.amigo-msg.is-ok { color: #2E7D32; }
.amigo-when { display: flex; gap: 8px; }
.amigo-when .alta-input { flex: 1; min-width: 0; }
.plan-row { margin: 0 0 8px; padding: 8px 10px; background: #E8F5E9; border: 2px solid var(--ink); border-radius: 12px; }

/* the shop's places (Casa.jsx): as many rows as they need, never cut at the sides */
.tabs.casa-tabs { flex-wrap: wrap; justify-content: center; overflow: visible; gap: 6px; }
.tabs.casa-tabs .tab { white-space: nowrap; }

/* ─── The first-time tour (src/tutorial.js) ─── */
.tuto { position: fixed; inset: 0; z-index: 1000; }
.tuto-sin-foco { display: grid; place-items: center; padding: 16px; background: rgba(42, 31, 26, .72); }
.tuto-foco { position: fixed; border: 3px solid var(--gold); border-radius: 16px; box-shadow: 0 0 0 200vmax rgba(42, 31, 26, .72); pointer-events: none; transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease; }
.tuto-tarjeta { position: fixed; width: min(92vw, 380px); padding: 16px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow); }
.tuto-sin-foco .tuto-tarjeta { position: static; }
.tuto-cuenta { margin: 0; color: var(--ink-soft); font-size: 13px; font-weight: 900; }
.tuto-tarjeta h2 { margin: 4px 0 8px; font-size: 24px; }
.tuto-tarjeta p { margin: 0; font-weight: 700; }
.tuto-botones { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.tuto-botones button { padding: 9px 14px; font-weight: 900; background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: 12px; }
.tuto-botones .tuto-sigue { background: var(--accent); color: #fff; box-shadow: 0 3px 0 var(--ink); }
.tuto-saltar { margin-right: auto; }
@media (prefers-reduced-motion: reduce) { .tuto-foco { transition: none; } }
/* the "?" up top (19/11): a help button reads as a letter, not an emoji */
.ayuda-btn { font-weight: 900; font-size: 1.25em; }
.ayuda-faq { margin: 4px 0 10px; }
.ayuda-faq > summary { cursor: pointer; font-weight: 900; padding: 6px 0; }
.ayuda-faq details { border-top: 1.5px dashed rgba(42,31,26,.25); }
.ayuda-faq details summary { cursor: pointer; font-weight: 700; padding: 7px 0; }
.ayuda-faq details p { margin: 0 0 8px; opacity: .8; }
/* the weight month by month (19/11) */
.peso-chart { margin: 8px 0 12px; padding: 10px 12px; background: #fff; border: 2px solid var(--ink, #2A1F1A); border-radius: 12px; color: #3E7B3A; }
.peso-chart svg { width: 100%; height: auto; display: block; }
.peso-chart figcaption { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; color: #2A1F1A; font-size: 14px; }
.peso-chart em { font-style: normal; opacity: .75; }
/* "Para la vete" (19/11): one sheet, printable alone */
.resumen-vete .resumen-sec { margin: 10px 0; }
.resumen-vete h4 { margin: 0 0 4px; }
.resumen-vete dl { margin: 0; display: grid; gap: 3px; }
.resumen-vete dl > div { display: flex; gap: 6px; flex-wrap: wrap; }
.resumen-vete dt { font-weight: 800; }
.resumen-vete dt::after { content: ':'; }
.resumen-vete dd { margin: 0; }
@media print {
  body.imprimiendo-resumen * { visibility: hidden !important; }
  body.imprimiendo-resumen .resumen-vete, body.imprimiendo-resumen .resumen-vete * { visibility: visible !important; }
  body.imprimiendo-resumen .resumen-vete { position: absolute; inset: 0 auto auto 0; width: 100%; padding: 16px; background: #fff; color: #000; }
  body.imprimiendo-resumen .no-print { display: none !important; }
}
.ayuda-btn { position: relative; }
.ayuda-nuevo { margin: 2px 0 8px; padding-left: 18px; text-align: left; }
.ayuda-nuevo li { margin: 4px 0; }
/* narrow phones (19/11): with the "?" up top the title was cut to "Ringo y ..."; smaller buttons give it room */
@media (max-width: 400px) {
  .top-right { gap: 4px; }
  .top-right .icon-btn { width: 35px; height: 35px; font-size: 15px; border-radius: 10px; }
  .title-card { padding: 6px 9px 7px; }
  .title-card h1 { font-size: 15px; }
}
/* Gastos (19/11) */
.gastos-resumen { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.gastos-resumen > div { flex: 1 1 90px; background: #fff; border: 2px solid #2A1F1A; border-radius: 12px; padding: 7px 10px; display: grid; }
.gastos-resumen span { font-size: 12px; opacity: .75; }
.gastos-resumen b { font-size: 18px; }
.gastos-cats { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 3px; }
.gastos-cats li { display: flex; justify-content: space-between; border-bottom: 1.5px dashed rgba(42,31,26,.2); padding: 2px 0; }
.gastos-mes h4 { margin: 12px 0 4px; }
