/* Fredoka, self-hosted (SIL Open Font License: assets/fonts/OFL.txt).
   Variable font: one file per alphabet covers weights 300-700. */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(../assets/fonts/fredoka-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(../assets/fonts/fredoka-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Lilita One, self-hosted (SIL Open Font License: assets/fonts/OFL-LilitaOne.txt): the face for all text.
   It has one (heavy) weight, so bold styles use it as-is instead of a smeared fake bold (font-synthesis). */
@font-face {
  font-family: 'Lilita One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/lilita-one-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --pink: #ec5f89;        /* 3.2:1 with white button text */
  --pink-d: #c43d5c;      /* 5:1 for headings and small text */
  --ink: #5a3d4a;
  --ink-soft: #76626c;    /* 5.3:1 secondary text */
  --cream: #fff7f9;
  --line: #f6dde5;
  --mint: #33a272;        /* 3.2:1 with white button text */
  --mint-soft: #d6f4e8;
  --gold: #8f6300;        /* 5:1 coin/score numbers */
  --red: #ff6b8a;
  --shadow: 0 6px 18px rgba(90, 61, 74, 0.12);
  /* Lilita One everywhere; Fredoka only fills in characters Lilita lacks (e.g. typed names with rare accents) */
  --font: "Lilita One", "Fredoka", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --display: var(--font);
}

* { box-sizing: border-box; }

/* Drawn icons (js/icons.js) replace emoji inline; sized by the surrounding text */
.ico { display: inline-block; width: 1.3em; height: 1.3em; vertical-align: -0.3em; }
.help-ico .ico { width: 34px; height: 34px; vertical-align: middle; }
.tip-ico .ico { width: 22px; height: 22px; }

/* Browser surfaces in the café palette */
::selection { background: #ffd3df; color: var(--ink); }
:focus-visible { outline: 3px solid var(--pink-d); outline-offset: 2px; }
.panel, .level-grid, .sticker-grid { scrollbar-width: thin; scrollbar-color: #f2b8c8 transparent; }

html { font-synthesis: none; }
/* With one weight, emphasis in running text is carried by colour instead of bold */
.help-steps b, .help-tips b, .hint b, .go-relaxed b, .quit-confirm b { color: var(--pink-d); }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #fde7ed;
  color: var(--ink);
  font-family: var(--font);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation; /* no double-tap zoom delay; pinch-zoom still works on menus */
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.hidden { display: none !important; }
.bump { animation: bump 0.35s cubic-bezier(.34, 1.56, .64, 1); }

/* ---------- HUD (top) ---------- */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 10px) 0 calc(env(safe-area-inset-left) + 10px);
  pointer-events: none;
  z-index: 5;
}
.hud-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 14px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 11px;
  box-shadow: var(--shadow);
}
.hud-bar button { pointer-events: auto; }
.spacer { flex: 1; }

.stat { display: flex; align-items: center; gap: 6px; line-height: 1.05; }
.stat b { font-size: 19px; font-weight: 700; }
.coins b { color: var(--gold); }
.coin {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #ffc94d;
  box-shadow: inset 0 0 0 2.5px #e3a400, inset 3px 3px 0 2px #ffe08a;
}
.score { flex-direction: column; align-items: flex-start; gap: 0; }
.score .sub { font-size: 12px; color: var(--ink-soft); font-weight: 600; letter-spacing: 0.2px; }

/* Level badge with progress ring (--p = 0..1) */
.lvl {
  --p: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--pink) calc(var(--p) * 1turn), #f6e1e7 0);
  transition: --p 0.4s;
}
.lvl b {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  color: var(--pink-d);
}

.paws { display: flex; justify-content: center; gap: 4px; margin-top: 6px; }
.paw svg { width: 16px; height: 16px; display: block; fill: rgba(255, 255, 255, 0.85); stroke: rgba(90, 61, 74, 0.12); stroke-width: 1; }
.paw.on svg { fill: var(--red); stroke: none; animation: pop 0.3s cubic-bezier(.34, 1.56, .64, 1); }

/* ---------- Tray (bottom, thumb zone) ---------- */
#tray {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 calc(env(safe-area-inset-right) + 10px) calc(env(safe-area-inset-bottom) + 10px) calc(env(safe-area-inset-left) + 10px);
  display: flex;
  gap: 10px;
  z-index: 5;
}
.tray-items {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 11px;
  box-shadow: var(--shadow);
}
.tray-item { display: flex; align-items: center; gap: 6px; font-size: 18px; }
.tray-item img { width: 30px; height: 30px; }
.tray-item.full b { color: #24865b; }
.tray-items.compact { padding: 6px 4px; }
.tray-items.compact .tray-item { gap: 1px; font-size: 16px; }
.tray-items.compact .tray-item img { width: 26px; height: 26px; }

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: 9px;
  padding: 12px 22px;
  min-height: 48px;
  font: 700 19px var(--font); /* bold 19px+ counts as large text: 3:1 contrast */
  color: #fff;
  background: var(--pink);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.1s, filter 0.1s;
}
.btn:active { transform: scale(0.96); filter: brightness(0.95); }
.btn.big { font-family: var(--display); font-weight: 400; font-size: 24px; letter-spacing: 0.3px; padding: 14px 40px; } /* 24px regular = large text */
.btn.secondary { background: var(--cream); color: var(--ink); box-shadow: none; border: 2px solid var(--line); }
.btn.mint { background: var(--mint); }
.btn-upgrade { min-height: 54px; padding: 10px 22px; border-radius: 11px; font-size: 20px; background: #24865b; } /* regular weight: needs 4.5:1 */
.toggle[aria-pressed="false"] { background: #fff; border-style: dashed; } /* off, not disabled */
.toggle[aria-pressed="false"] .ico { opacity: 0.45; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--cream);
  cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; fill: var(--ink); }
.icon-btn:active { transform: scale(0.92); }

/* ---------- Screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 16px) calc(env(safe-area-inset-right) + 16px) calc(env(safe-area-inset-bottom) + 16px) calc(env(safe-area-inset-left) + 16px);
  background: rgba(253, 231, 237, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10;
}
.screen.active { display: flex; animation: fade 0.25s ease-out; }

.panel {
  position: relative;
  width: min(380px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 26px 20px 22px;
  background: #fff;
  border-radius: 14px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: pop 0.4s cubic-bezier(.34, 1.56, .64, 1);
}
.panel.wide { width: min(440px, 100%); }
.panel h2 { margin: 2px 0 14px; font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: 0.3px; color: var(--pink-d); }
.panel h3 { margin: 16px 0 6px; font-size: 16px; color: var(--ink-soft); }

.close-x {
  position: absolute;
  top: 12px; right: 12px;
  width: 44px; height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font: 600 18px var(--font);
  cursor: pointer;
}
.close-x:active { transform: scale(0.9); }

.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.hint { font-size: 13px; color: var(--ink-soft); line-height: 1.45; margin: 16px 4px 0; }

/* Menu: secondary actions in an even two-column grid; a lone last button spans both */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-grid .btn { padding-inline: 8px; font-size: 17px; white-space: nowrap; }
.menu-grid .btn.mint { background: #24865b; } /* 17px is small text: needs 4.5:1 */
.menu-grid > .btn:has(+ .hidden), .menu-grid > .btn:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; min-width: 50%; }
.logo { margin: 0; font-family: var(--display); font-size: 54px; line-height: 1; font-weight: 400; letter-spacing: 0.5px; }
.logo span { color: var(--pink); }
.logo .katz { color: #e07a10; }
#menu-cat { display: block; position: relative; left: -30px; margin: 0 auto; width: 210px; height: 268px; cursor: pointer; border-radius: 9px; } /* canvas leaves tail room on the left; shift so the cat itself is centred */
.tagline { margin: 2px 0 16px; color: var(--ink-soft); }
.best { font-size: 17px; margin: 16px 0; }
.best b { color: var(--gold); }

/* Help */
.help-steps { list-style: none; padding: 0; margin: 0; text-align: left; }
.help-steps li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--cream);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.35;
}
.help-ico { font-size: 26px; flex: none; width: 34px; text-align: center; }
.help-tips { padding: 0 4px; margin: 0 0 16px; list-style: none; text-align: left; font-size: 14px; line-height: 1.5; }
.help-tips li { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.tip-ico { flex: none; width: 22px; text-align: center; } /* emoji column: wrapped lines align with the text */
.dedication {
  margin: 0 0 16px;
  padding: 14px 12px;
  border-radius: 10px;
  background: #fff0f4;
  border: 2px dashed var(--pink);
}
.dedication p { margin: 4px 0 0; font-size: 17px; color: var(--pink-d); line-height: 1.4; }
.dedication b { font-size: 22px; }
.dedication-hearts { font-size: 20px; letter-spacing: 4px; }

/* Daily bonus */
.daily-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.daily-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 2px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--cream);
}
.daily-day .dd-label { font-size: 12px; color: var(--ink-soft); }
.daily-day b { font-size: 15px; color: var(--gold); }
.daily-day.done { background: var(--mint-soft); }
.daily-day.done b { color: #2f9e6e; }
.daily-day.today { border-color: var(--pink); background: #fff0f4; animation: pulse 0.8s 6 alternate; }
.daily-day.big { grid-column: span 2; }
.daily-day.big b { font-size: 19px; }

/* Character select */
.char-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.char {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px 10px;
  border: 3px solid transparent;
  border-radius: 10px;
  background: var(--cream);
  font: 600 15px var(--font);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.1s;
}
.char canvas { width: 100%; aspect-ratio: 1; }
.char:active { transform: scale(0.95); }
.char.selected { border-color: var(--pink); background: #fff0f4; }
.char.locked canvas { opacity: 0.55; }
.char.locked.score canvas { filter: grayscale(1) brightness(0.9); opacity: 0.4; }
.char-tag {
  white-space: nowrap;
  margin-top: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #24865b; /* 4.5:1 for small white text */
  color: #fff;
  font-size: 13px;
}
.char-tag.poor { background: #e4dadf; color: var(--ink-soft); }
.char-tag.score { background: #fff1c2; color: #8a6200; }
.char.bought { animation: bought 0.5s cubic-bezier(.34, 1.56, .64, 1); }
.char.poor { animation: shake 0.35s; }
.unlock { margin: 4px 0 8px; font-weight: 600; color: #24865b; }
.char.selected .char-name::after { content: " ✓"; color: var(--pink-d); }

/* Upgrades */
.coins-big { font-size: 24px; margin: -6px 0 14px; }
.coins-big b { color: var(--gold); }
.upg {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 14px;
  background: var(--cream);
  border-radius: 10px;
  text-align: left;
}
.upg-ico { font-size: 28px; text-align: center; }
.upg-name { font-weight: 700; font-size: 16px; }
.upg-desc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.3; }
.upg-lvl { font-size: 13px; margin-top: 4px; }
.bar { display: flex; gap: 4px; margin-top: 7px; }
.seg { flex: 1; height: 7px; border-radius: 4px; background: #f3e3e8; }
.seg.on { background: var(--pink); }
.btn.buy { min-width: 82px; min-height: 44px; padding: 8px 12px; font-size: 16px; background: #24865b; } /* small text: 4.5:1 */
.btn.buy.poor { background: #e4dadf; color: #9a8590; box-shadow: none; }
.btn.buy.max { background: #ffe39a; color: #8a6200; box-shadow: none; cursor: default; }
.upg.bought { animation: bought 0.5s cubic-bezier(.34, 1.56, .64, 1); }
.upg.poor { animation: shake 0.35s; }
.confetti {
  position: absolute;
  left: 50%; top: 50%;
  width: 8px; height: 8px;
  border-radius: 2px;
  pointer-events: none;
  animation: confetti 0.8s ease-out forwards;
}

/* Game over */
.panel h2.gameover { margin-bottom: 2px; font-size: 34px; }
#go-cat { display: block; width: 180px; height: 120px; margin: -6px auto 0; }
.go-sub { margin: 0 0 10px; color: var(--ink-soft); }
.go-relaxed { margin: 12px 0 0; padding: 10px 12px; background: #fff0f4; border-radius: 9px; }
.go-relaxed p { margin: 0 0 8px; }
.newbest { color: var(--gold); font-weight: 700; font-size: 17px; animation: pulse 0.8s 6 alternate; }
.stats { display: flex; gap: 10px; }
.stats div { flex: 1; padding: 12px 8px; background: var(--cream); border-radius: 9px; }
.stats span { display: block; font-size: 13px; color: var(--ink-soft); }
.stats b { font-size: 30px; color: var(--gold); }
.scores { list-style: none; padding: 0; margin: 0 0 12px; }
.scores li { display: flex; justify-content: space-between; padding: 8px 16px; margin: 4px 0; background: var(--cream); border-radius: 7px; }
.scores li.me { background: #fff1c2; font-weight: 700; }
.scores .pos { width: 26px; text-align: left; }
.scores .who { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }

/* Name entry on Game Over */
.name-form { margin: 14px 0 4px; padding: 12px; background: #fff1c2; border-radius: 9px; text-align: left; }
.name-form label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; color: #8a6200; }
.name-row { display: flex; gap: 8px; }
.name-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 2px solid #f2d78a;
  border-radius: 7px;
  font: 600 18px var(--font);
  color: var(--ink);
  background: #fff;
  user-select: text;
  -webkit-user-select: text;
}
.name-row input:focus { outline: 3px solid var(--pink-d); outline-offset: 1px; border-color: var(--pink); }
.btn.save-name { min-width: 84px; padding: 8px 14px; font-size: 17px; background: #24865b; } /* small text: 4.5:1 */
.name-msg { margin: 6px 2px 0; min-height: 18px; font-size: 13px; color: #24865b; }
.name-msg.error { color: #c43d5c; }

/* Banner */
#banner {
  position: fixed;
  top: 38%;
  left: 50%;
  max-width: 90vw;
  padding: 12px 22px;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 19px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 20;
}
#banner.show { animation: banner 2.4s ease-out forwards; }

/* Missed-customer edge flash */
#miss-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  box-shadow: inset 0 0 70px 18px rgba(255, 70, 100, 0.55);
}
#miss-flash.on { animation: missflash 0.7s ease-out; }
@keyframes missflash { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }

/* Debug */
#debug-panel {
  position: fixed;
  left: calc(env(safe-area-inset-left) + 6px);
  top: calc(env(safe-area-inset-top) + 92px);
  max-width: min(70vw, 420px);
  max-height: 55vh;
  overflow: auto;
  padding: 6px;
  background: rgba(30, 20, 30, 0.82);
  color: #bff;
  border-radius: 5px;
  z-index: 30;
}
#debug-panel summary { cursor: pointer; font: 600 12px var(--font); padding: 2px 4px; }
#debug-panel pre { margin: 0 0 6px; font: 11px/1.35 monospace; white-space: pre-wrap; }
.debug-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.debug-btns button { padding: 6px 8px; border: none; border-radius: 3px; background: #ffd166; color: #2b2230; font: 600 12px var(--font); cursor: pointer; }

/* ---------- Animations ---------- */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(0.8); opacity: 0; } }
@keyframes bump { 50% { transform: scale(1.18); } }
@keyframes bought { 40% { transform: scale(1.04); background: #e9fff3; } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pulse { to { transform: scale(1.08); } }
@keyframes confetti {
  to { transform: translate(var(--dx), var(--dy)) rotate(360deg); opacity: 0; }
}
@keyframes banner {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  25%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(1); }
}

@media (max-width: 360px) {
  .stat b { font-size: 17px; }
  .logo { font-size: 42px; }
  .btn-upgrade { padding: 10px 16px; }
}

/* replaces inline style attributes (blocked by the Content Security Policy) */
.hint.hint-tight { margin: -6px 0 14px; }
.hint.hint-top0 { margin-top: 0; }

/* Settings: difficulty chips + scene picker */
.chips { display: flex; gap: 8px; }
.chip, .scene-chip {
  flex: 1;
  min-height: 48px;
  padding: 8px 6px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  font: 600 15px var(--font);
  cursor: pointer;
}
.chip[aria-pressed="true"], .scene-chip[aria-pressed="true"] { border-color: var(--pink); background: #fff0f4; }
.chip:active, .scene-chip:active { transform: scale(0.96); }
.scene-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.scene-chip { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.swatch { width: 100%; height: 26px; border-radius: 5px; border: 1px solid rgba(90,61,74,0.12); }
.sw-strawberry { background: linear-gradient(90deg, #fde7ed 0 55%, #ff8fab 55% 75%, #f8eadb 75%); }
.sw-matcha { background: linear-gradient(90deg, #e4f2df 0 55%, #6cc788 55% 75%, #f2e8d5 75%); }
.sw-seaside { background: linear-gradient(90deg, #dcefff 0 55%, #ff9f8a 55% 75%, #f5efe4 75%); }
.sw-moonlight { background: linear-gradient(90deg, #3d3566 0 55%, #b39ddb 55% 75%, #5b4b60 75%); }

/* Level picker */
.level-grid { display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.level-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 9px;
  background: var(--cream);
  color: var(--ink);
  font: 600 15px var(--font);
  text-align: left;
  cursor: pointer;
}
.level-card.top-level { border-color: var(--pink); background: #fff0f4; }
.level-card:active { transform: scale(0.97); }
.lv-num {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-size: 19px; font-weight: 700;
}
.lv-info { display: flex; flex-direction: column; gap: 3px; }
.lv-foods { display: flex; gap: 2px; }
.lv-foods img { width: 22px; height: 22px; }
.level-card.locked { opacity: 0.55; border-style: dashed; }
.level-card.locked .lv-num { background: #d8cbd1; }
.pets-title { margin: 18px 0 10px; }

/* Sticker book */
.sticker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 2px; }
.sticker { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 8px; background: #f4eef1; color: var(--ink-soft); text-align: center; }
.sticker b { font-size: 12.5px; color: var(--ink); line-height: 1.2; }
.sticker small { font-size: 11px; line-height: 1.25; }
.sticker-badge { width: 52px; height: 52px; }
.sticker:not(.got) b { color: var(--ink-soft); }
.sticker.got { background: #fff1c2; box-shadow: inset 0 0 0 2px #f2d78a; }
/* Wardrobe */
.outfit-row {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px;
  scroll-snap-type: x proximity; scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 85%, transparent); /* fade hints there is more to scroll */
}
.outfit-row::-webkit-scrollbar { display: none; }
.outfit { scroll-snap-align: start; }
.outfit { flex: none; width: 76px; min-height: 84px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 2px solid var(--line); border-radius: 8px; background: var(--cream); color: var(--ink); font: 600 11px var(--font); cursor: pointer; }
.outfit-icon { font-size: 30px; line-height: 1; }
.outfit .outfit-cat { width: 44px; height: 44px; }
.outfit b { font-size: 11.5px; line-height: 1.1; }
.outfit small { font-size: 11px; color: var(--ink-soft); }
.outfit.worn small { color: var(--pink-d); }
.outfit.worn { border-color: var(--pink); background: #fff0f4; }
.outfit.locked .ico, .outfit.locked .outfit-cat { opacity: 0.7; }
.outfit.poor small { color: var(--ink-soft); }
.outfit:active { transform: scale(0.95); }
.chips { flex-wrap: wrap; }

/* Help: extra tips tucked behind a disclosure */
.more-tips { margin: 14px 0 0; text-align: left; }
.more-tips summary { cursor: pointer; padding: 10px 12px; border: 2px solid var(--line); border-radius: 9px; background: var(--cream); font-weight: 700; text-align: center; }
.more-tips[open] summary { margin-bottom: 4px; }
.more-tips h3, #tab-wardrobe h3 { margin: 12px 0 4px; font-size: 14px; color: var(--ink-soft); text-align: left; }

/* Choose cat: Cats / Wardrobe tabs */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 12px; padding: 4px; background: #f6eef1; border-radius: 9px; }
.tab { min-height: 44px; border: none; border-radius: 7px; background: transparent; color: var(--ink-soft); font: 700 16px var(--font); cursor: pointer; }
.tab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(90, 61, 74, 0.12); }

/* Pause: confirm before quitting */
.quit-confirm { margin-top: 12px; padding: 12px; border-radius: 9px; background: #fff0f4; }
.quit-confirm p { margin: 0 0 10px; font-weight: 600; }
.quit-confirm .btn:not(.secondary) { background: var(--pink-d); } /* 17px text needs 4.5:1 */

/* Players who ask for less motion: no pops, pulses, shakes or the red flash */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  #miss-flash { display: none; }
}

/* Settings: save backup */
.code-box {
  display: block; width: 100%; margin: 8px 0 0; padding: 10px 12px;
  border: 2px solid #f2d78a; border-radius: 7px; background: #fff; color: var(--ink);
  font: 400 13px/1.35 ui-monospace, Menlo, Consolas, monospace; word-break: break-all; resize: vertical;
  user-select: text; -webkit-user-select: text;
}
.code-box:focus { outline: 3px solid var(--pink-d); outline-offset: 1px; border-color: var(--pink); }
.restore-box { margin-top: 12px; padding: 12px; border-radius: 9px; background: #fff0f4; text-align: left; }
.restore-box label { font-weight: 700; }
.restore-box .btn { width: 100%; margin-top: 4px; }
