/* ===== My Mini Cat - Story Time (matches the site's pastel candy theme; all classes prefixed st-) =====
 * Uses the site's CSS variables when present (style.css), with the same values as fallbacks so it also works alone.
 * Layout uses logical properties (inline-start/end), so it mirrors for right-to-left languages (fa, ar). */
.st-root { --st-ink: var(--ink, #4A2E3E); --st-soft: var(--ink-soft, #7A5A6C); --st-shadow: var(--shadow, 0 10px 30px rgba(170,100,160,.18), 0 2px 6px rgba(170,100,160,.12));
  --st-radius: var(--radius, 28px); --st-card: var(--card, rgba(255,255,255,.86)); --st-sticky-top: 76px;
  font-family: var(--font, 'Fredoka', 'Baloo 2', 'Nunito', 'Comic Sans MS', system-ui, sans-serif); color: var(--st-ink); max-width: 1180px; margin: 0 auto; }
.st-root *, .st-root *::before, .st-root *::after { box-sizing: border-box; }
.st-root :where(button) { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
.st-root [hidden] { display: none !important; }
.st-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.st-root :focus-visible { outline: 4px solid var(--sky, #5CC0F5); outline-offset: 3px; border-radius: 14px; }

/* candy title (same rainbow letters as the site; this copy is used when style.css isn't loaded) */
.st-candy { font-weight: 700; letter-spacing: .5px; margin: 0; line-height: 1.05; font-size: clamp(34px, 6vw, 54px); }
.st-candy b { display: inline-block; text-shadow: 0 3px 0 #fff, 0 -2px 0 #fff, 2px 0 0 #fff, -2px 0 0 #fff, 0 6px 14px rgba(170,100,160,.25); }
.st-candy b:nth-of-type(6n+1) { color: var(--coral, #FF7A8A); } .st-candy b:nth-of-type(6n+2) { color: var(--orange, #FFA552); } .st-candy b:nth-of-type(6n+3) { color: #F5B800; }
.st-candy b:nth-of-type(6n+4) { color: #3CC995; } .st-candy b:nth-of-type(6n+5) { color: var(--sky, #5CC0F5); } .st-candy b:nth-of-type(6n) { color: var(--lilac, #AE8CFF); }

/* ---------- library ---------- */
.st-lib, .st-reader { animation: st-in .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes st-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.st-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 6px 0 12px; flex-wrap: wrap; }
.st-sub { margin: 6px 0 0; font-size: 19px; color: var(--st-soft); font-weight: 600; }
.st-pick { display: flex; align-items: center; gap: 8px; padding: 6px 22px 6px 8px; min-height: 76px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 24px;
  background: linear-gradient(135deg, var(--coral, #FF7A8A), var(--orange, #FFA552)); box-shadow: var(--st-shadow), inset 0 -6px 0 rgba(0,0,0,.12); transition: transform .15s; animation: st-pulse 2.4s ease-in-out infinite; }
.st-pick-img { width: 68px; height: 68px; object-fit: contain; margin: -12px 0 -6px; filter: drop-shadow(0 4px 6px rgba(120,60,100,.25)); }
.st-pick-emoji { font-size: 44px; line-height: 1; }
.st-pick:active { transform: scale(.94); }
.st-pick.st-wiggle .st-pick-img { animation: st-wig .5s; }
@keyframes st-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes st-wig { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

.st-searchrow { margin: 0 0 10px; }
.st-search { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 6px 8px 6px 18px; box-shadow: var(--st-shadow); border: 4px solid transparent; transition: border-color .2s; }
.st-search:focus-within { border-color: var(--lilac, #AE8CFF); box-shadow: 0 0 0 5px #EEE4FF, var(--st-shadow); }
.st-search-ico { font-size: 24px; }
.st-q { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 22px; font-weight: 600; color: var(--st-ink); padding: 10px 0; }
.st-q::-webkit-search-cancel-button { display: none; }
.st-q::placeholder { color: #B79AB0; }
.st-clear { width: 44px; height: 44px; border-radius: 50%; background: #F6EDF3; font-size: 18px; flex: none; }

.st-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; scroll-snap-type: x proximity; }
.st-chips::-webkit-scrollbar { display: none; }
.st-chip { flex: none; scroll-snap-align: start; display: flex; align-items: center; gap: 6px; padding: 10px 18px; min-height: 52px; border-radius: 999px; background: #fff; font-weight: 700; font-size: 18px;
  box-shadow: 0 3px 8px rgba(170,100,160,.15); border: 3px solid transparent; transition: transform .15s, background .2s; white-space: nowrap; }
.st-chip:active { transform: scale(.94); }
.st-chip.on { background: linear-gradient(135deg, var(--pink, #FF9EC4), var(--lilac, #AE8CFF)); color: #fff; box-shadow: var(--st-shadow); }
.st-chip[style].on { background: var(--c); }
.st-count { margin: 0 4px 10px; font-size: 17px; font-weight: 600; color: var(--st-soft); }

.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.st-card { position: relative; animation: st-in .4s cubic-bezier(.2,1.4,.4,1) backwards; }
.st-open { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: start; padding: 16px 16px 14px; border-radius: 26px;
  background: #fff; box-shadow: var(--st-shadow); border-top: 8px solid var(--c, #FF9EC4); transition: transform .15s; min-height: 168px; }
.st-open:hover { transform: translateY(-3px); }
.st-open:active { transform: scale(.96); }
.st-emoji { font-size: 46px; line-height: 1.05; filter: drop-shadow(0 3px 4px rgba(120,60,100,.18)); }
.st-ctitle { font-size: 22px; font-weight: 700; line-height: 1.2; padding-inline-end: 34px; }
.st-cmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; font-size: 15px; font-weight: 600; color: var(--st-soft); }
.st-catpill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 12px; border-radius: 999px; font-weight: 700; font-size: 15px; color: var(--st-ink);
  background: color-mix(in srgb, var(--c, #FF9EC4) 22%, #fff); }
.st-stars { display: flex; gap: 4px; }
.st-star { color: #fff; font-weight: 700; font-size: 14px; padding: 2px 10px; border-radius: 999px; }
.st-star-fuzz { background: linear-gradient(135deg, var(--fuzz, #8A5A3B), var(--fuzz-2, #C48A58)); }
.st-star-cola { background: linear-gradient(135deg, var(--cola, #22BFC0), var(--cola-2, #8FDDF0)); }
.st-fav { position: absolute; top: 12px; inset-inline-end: 10px; width: 48px; height: 48px; border-radius: 50%; font-size: 24px; display: grid; place-items: center; background: rgba(255,255,255,.9); }
.st-fav.st-beat { animation: st-beat .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes st-beat { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.st-empty { text-align: center; padding: 26px 10px; background: var(--st-card); border-radius: var(--st-radius); box-shadow: var(--st-shadow); max-width: 520px; margin: 10px auto; }
.st-empty-emoji { font-size: 64px; }
.st-empty p { font-size: 22px; font-weight: 700; margin: 6px 0 0; }

/* ---------- reader ---------- */
.st-rbar { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.st-rbar .st-rcat { margin-inline-start: auto; font-size: 17px; padding: 6px 16px; }
.st-iconbtn { width: 56px; height: 56px; border-radius: 50%; background: #fff; box-shadow: var(--st-shadow); font-size: 24px; display: grid; place-items: center; flex: none; font-weight: 700; transition: transform .15s; }
.st-iconbtn:active { transform: scale(.9); }
.st-rbar .st-fav { position: static; width: 56px; height: 56px; box-shadow: var(--st-shadow); }
.st-size small { font-size: .65em; }
.st-story { background: var(--st-card); border-radius: 32px; box-shadow: var(--st-shadow); padding: 20px clamp(16px, 4vw, 48px) 26px; max-width: 900px; margin: 0 auto; border-top: 10px solid var(--c, #FF9EC4); }
.st-remoji { font-size: 72px; text-align: center; line-height: 1.1; animation: st-bob 3s ease-in-out infinite; }
@keyframes st-bob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.st-rtitle { text-align: center; font-size: clamp(30px, 5.4vw, 46px); margin: 2px 0 4px; line-height: 1.15; }
.st-rmeta { text-align: center; margin: 0 0 12px; color: var(--st-soft); font-weight: 600; font-size: 18px; }
.st-note, .st-msg { text-align: center; margin: 0 auto 10px; font-size: 17px; font-weight: 600; background: #FFF6D6; border-radius: 18px; padding: 8px 14px; max-width: 640px; }

.st-controls { position: sticky; top: var(--st-sticky-top); z-index: 12; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 10px; margin: 0 -6px 16px;
  background: rgba(255,255,255,.94); border-radius: 26px; box-shadow: 0 6px 18px rgba(170,100,160,.16); }
.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 60px; padding: 8px 22px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 22px;
  box-shadow: var(--st-shadow), inset 0 -5px 0 rgba(0,0,0,.12); transition: transform .15s, opacity .2s; }
.st-btn:active { transform: scale(.94); }
.st-btn .st-bi { font-size: 1.2em; line-height: 1; }
.st-play { background: linear-gradient(135deg, var(--mint, #5FD8A9), #3CC0C9); min-width: 200px; animation: st-pulse 2.2s ease-in-out infinite; }
.st-play.on { background: linear-gradient(135deg, var(--sky, #5CC0F5), var(--lilac, #AE8CFF)); animation: none; }
.st-stop { background: linear-gradient(135deg, #C8B8D8, #B3A3C8); }
.st-stop:disabled { opacity: .4; box-shadow: none; }
.st-seg { display: inline-flex; background: #F4ECF2; border-radius: 999px; padding: 4px; gap: 2px; }
.st-segbtn { min-height: 52px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 18px; white-space: nowrap; }
.st-segbtn.on { background: #fff; box-shadow: 0 3px 8px rgba(170,100,160,.2); }
.st-toggle { min-height: 52px; padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: 18px; background: #F4ECF2; white-space: nowrap; }
.st-toggle.on { background: linear-gradient(135deg, #FFE27A, #FFB86B); }

.st-text { font-size: clamp(24px, 3.2vw, 30px); line-height: 1.7; letter-spacing: .2px; }
.st-text.st-size-0, .st-ending p.st-size-0 { font-size: clamp(20px, 2.6vw, 24px); }
.st-text.st-size-2 { font-size: clamp(30px, 4.4vw, 38px); line-height: 1.65; }
.st-text p { margin: 0 0 .8em; }
.st-w { border-radius: 10px; padding: 0 2px; margin: 0 -2px; transition: background-color .15s, color .15s, box-shadow .15s; position: relative; }
.st-playing .st-w.st-done { color: var(--st-soft); }
.st-w.st-on { background: #FFE27A; color: var(--st-ink); box-shadow: 0 0 0 3px #FFE27A, 0 4px 10px rgba(245,184,0,.35); }
.st-cue { cursor: pointer; text-decoration: underline wavy color-mix(in srgb, var(--c, #FF9EC4) 70%, #fff); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.st-cue::after { content: attr(data-emoji); font-size: .62em; vertical-align: super; margin-inline-start: 2px; }
.st-burst { position: absolute; inset-inline-start: 50%; bottom: 70%; font-size: 40px; pointer-events: none; animation: st-burst 1.2s ease-out forwards; text-decoration: none; }
@keyframes st-burst { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.4); } 20% { opacity: 1; transform: translate(-50%, -10px) scale(1.25); } 100% { opacity: 0; transform: translate(-50%, -60px) scale(1); } }
.st-rtitle .st-w.st-on, .st-rentitle .st-w.st-on { box-shadow: 0 0 0 4px #FFE27A; }
.st-rentitle { text-align: center; margin: 0 0 6px; color: var(--st-soft); font-weight: 700; font-size: clamp(18px, 2.6vw, 22px); }

.st-ending { margin: 18px 0 8px; background: linear-gradient(135deg, #FFF6D6, #FFE6F0); border-radius: 26px; padding: 14px 18px; box-shadow: var(--st-shadow); }
.st-ending.st-end-catfact { background: linear-gradient(135deg, #E6FAEF, #E3F6FF); }
.st-ending.st-end-fact { background: linear-gradient(135deg, #E3F6FF, #EFE6FF); }
.st-ending h3 { margin: 0 0 4px; font-size: 22px; }
.st-ending p { margin: 0; font-size: clamp(21px, 2.8vw, 26px); line-height: 1.55; }
.st-theend { text-align: center; font-size: 28px; font-weight: 700; color: var(--coral, #FF7A8A); margin: 16px 0 6px; }
.st-theend.st-pop { animation: st-beat .6s cubic-bezier(.2,1.6,.4,1); }
.st-after { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.st-again { background: linear-gradient(135deg, var(--coral, #FF7A8A), var(--orange, #FFA552)); }
.st-lib-btn { background: linear-gradient(135deg, var(--sky, #5CC0F5), var(--lilac, #AE8CFF)); }

/* ---------- phones & tablets ---------- */
@media (max-width: 760px) {
  .st-root { --st-sticky-top: 70px; }
  .st-head { gap: 8px; }
  .st-pick { font-size: 20px; min-height: 64px; padding-inline-end: 16px; }
  .st-pick-img { width: 56px; height: 56px; }
  .st-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .st-open { min-height: 150px; padding: 12px; }
  .st-ctitle { font-size: 19px; padding-inline-end: 26px; }
  .st-emoji { font-size: 38px; }
  .st-fav { width: 42px; height: 42px; font-size: 20px; top: 14px; inset-inline-end: 6px; }
  .st-story { padding: 14px 14px 20px; border-radius: 26px; }
  .st-controls { gap: 6px; padding: 8px; margin-inline: -4px; }
  .st-btn { min-height: 54px; font-size: 19px; padding: 6px 16px; }
  .st-play { min-width: 0; flex: 1 1 160px; }
  .st-segbtn, .st-toggle { font-size: 16px; min-height: 46px; padding: 4px 12px; }
  .st-iconbtn { width: 50px; height: 50px; }
  .st-tl { display: none; }
}
@media (max-width: 380px) { .st-grid { grid-template-columns: 1fr 1fr; } .st-catpill { font-size: 13px; padding: 2px 8px; } }
@media (prefers-reduced-motion: reduce) { .st-root *, .st-root *::before, .st-root *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } }

/* The Stories tab makes 5 tabs in the site's phone bottom bar: let them shrink on narrow phones (only applies when this file is loaded). */
@media (max-width: 420px) { .tabs a { min-width: 0; flex: 1 1 0; padding: 6px 4px; font-size: 13px; } }
