/* MuADMINS - css/memes.css (owner 2026-11-24, s20261124-memes): MU MEME FACTORY, gifs/index.php.
   The site look (css/mugps-pro.css tokens --mx-*, also redefined by css/skin-dark.css), a brighter header, a grid of
   posters (the GIF plays on hover, focus or tap: js/memes.js), the big view (a <dialog>: modal with JavaScript, a plain
   block at the top of the page without it). Mobile first: one column at 390 px, more on wider screens, nothing sideways. */

.mm-main { max-width: 1200px; padding-left: 20px; padding-right: 20px; }
.mm-page .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- the header ---- */
.mm-hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 26px 24px 22px; margin: 0 0 18px;
  border: 1px solid var(--mx-line-2, rgba(255, 255, 255, .34)); box-shadow: var(--mx-shadow, none);
  background:
    radial-gradient(120% 150% at 0% 0%, rgba(255, 214, 120, .42), rgba(255, 214, 120, 0) 55%),
    radial-gradient(110% 140% at 100% 100%, rgba(255, 120, 196, .34), rgba(255, 120, 196, 0) 58%),
    radial-gradient(80% 120% at 85% 0%, rgba(120, 255, 214, .22), rgba(120, 255, 214, 0) 60%),
    var(--mx-panel, rgba(5, 28, 92, .14));
}
.mm-hero-fx { position: absolute; inset: 0; pointer-events: none; }
.mm-hero-fx span { position: absolute; font-size: 30px; opacity: .3; filter: saturate(1.2); animation: mm-bob 5s ease-in-out infinite; }
.mm-hero-fx span:nth-child(1) { right: 6%; top: 14%; }
.mm-hero-fx span:nth-child(2) { right: 18%; top: 58%; animation-delay: -1s; font-size: 26px; }
.mm-hero-fx span:nth-child(3) { right: 31%; top: 10%; animation-delay: -2s; font-size: 24px; }
.mm-hero-fx span:nth-child(4) { right: 3%; top: 64%; animation-delay: -3s; font-size: 24px; }
.mm-hero-fx span:nth-child(5) { right: 42%; top: 62%; animation-delay: -1.5s; font-size: 22px; }
.mm-hero-fx span:nth-child(6) { right: 12%; top: 34%; animation-delay: -2.5s; font-size: 28px; opacity: .4; }
.mm-hero-fx span:nth-child(7) { right: 25%; top: 32%; animation-delay: -.5s; font-size: 20px; }
@keyframes mm-bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-7px) rotate(6deg); } }
.mm-h1 {
  position: relative; margin: 0 0 6px; font-family: var(--font-display); font-weight: 800; letter-spacing: -.01em;
  font-size: clamp(30px, 6.2vw, 48px); line-height: 1.05; color: var(--mx-ink, #fff); text-shadow: 0 2px 18px rgba(4, 22, 70, .35);
}
.mm-lead { position: relative; margin: 0 0 18px; max-width: 640px; font-size: 15px; line-height: 1.55; color: var(--mx-text, #d9e5f8); }
.mm-hero-row { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.mm-random {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; border-radius: 14px; text-decoration: none;
  background: #fff; color: var(--mx-on, #0c4cb8); font-weight: 800; font-size: 17px; letter-spacing: .01em;
  box-shadow: 0 10px 28px -12px rgba(2, 24, 80, .7), 0 0 0 4px rgba(255, 255, 255, .16);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.mm-random:hover { background: var(--mx-accent-fill, #dcf1ff); transform: translateY(-1px); box-shadow: 0 14px 30px -12px rgba(2, 24, 80, .75), 0 0 0 5px rgba(255, 255, 255, .22); }
.mm-random:focus-visible { outline: 3px solid var(--mx-accent, #a3e6ff); outline-offset: 3px; }
.mm-dice { font-size: 22px; line-height: 1; display: inline-block; transition: transform .3s; }
.mm-random:hover .mm-dice { transform: rotate(160deg) scale(1.1); }

/* ---- search and chips ---- */
.mm-tools { margin: 0 0 10px; }
.mm-search { position: relative; display: flex; gap: 8px; margin: 0 0 12px; }
.mm-search-ic { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; fill: none; stroke: var(--mx-dim, #c4d7f5); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.mm-search input[type=search] {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px 0 42px; border-radius: 12px; font: inherit; font-size: 15px;
  background: var(--mx-field, rgba(5, 28, 92, .16)); color: var(--mx-ink, #fff); border: 1px solid var(--mx-line-2, rgba(255, 255, 255, .34));
}
.mm-search input[type=search]::placeholder { color: var(--mx-dim, #c4d7f5); opacity: .85; }
.mm-search input[type=search]:focus { outline: 2px solid var(--mx-accent, #a3e6ff); outline-offset: 1px; }
.mm-js .mm-go { display: none; }
.mm-row { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; min-width: 0; }
.mm-row-h { flex: none; width: 74px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mx-label, #bcd9ff); }
.mm-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.mm-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  font-size: 13px; color: var(--mx-ink, #fff); background: var(--mx-panel, rgba(5, 28, 92, .14)); border: 1px solid rgba(255, 255, 255, .3);
  transition: background .15s, border-color .15s;
}
.mm-chip small { font-size: 11px; opacity: .72; }
.mm-chip:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .6); }
.mm-chip[aria-current="true"] { background: #fff; color: var(--mx-on, #0c4cb8); border-color: #fff; font-weight: 600; }
.mm-chip:focus-visible { outline: 2px solid var(--mx-accent, #a3e6ff); outline-offset: 2px; }
.mm-count { margin: 4px 0 12px; font-size: 13px; color: var(--mx-dim, #c4d7f5); }

/* ---- the grid ---- */
.mm-grid { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.mm-card {
  container-type: inline-size; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-radius: 16px;
  background: var(--mx-panel, rgba(5, 28, 92, .14)); border: 1px solid var(--mx-line, rgba(200, 226, 255, .2)); box-shadow: var(--mx-shadow, none);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  content-visibility: auto; contain-intrinsic-size: auto 340px;
}
.mm-card[hidden] { display: none; }
.mm-card:hover, .mm-card:focus-within { transform: translateY(-2px); border-color: var(--mx-line-2, rgba(210, 232, 255, .34)); box-shadow: var(--mx-shadow-h, none); }
.mm-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #061a44; overflow: hidden; cursor: pointer; }
.mm-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.mm-thumb .mm-anim { opacity: 0; transition: opacity .2s; }
.mm-card.is-playing .mm-anim { opacity: 1; }
.mm-badge, .mm-new {
  position: absolute; top: 8px; padding: 2px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; line-height: 1.5;
  color: #fff; background: rgba(4, 18, 52, .72); border: 1px solid rgba(255, 255, 255, .28);
}
.mm-badge { left: 8px; }
.mm-new { right: 8px; background: #ffd98f; color: #4a2a00; border-color: #ffd98f; text-transform: uppercase; }
.mm-playic {
  position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .92); box-shadow: 0 4px 14px rgba(2, 16, 50, .45); transition: opacity .2s, transform .2s;
}
.mm-playic svg { width: 14px; height: 14px; margin-left: 2px; fill: var(--mx-on, #0c4cb8); }
.mm-card.is-playing .mm-playic { opacity: 0; transform: scale(.7); }
.mm-card.is-loading .mm-thumb::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: mm-spin .8s linear infinite;
}
@keyframes mm-spin { to { transform: rotate(360deg); } }
.mm-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.mm-title { margin: 0; font-family: var(--font-display); font-size: 15.5px; font-weight: 700; line-height: 1.3; color: var(--mx-ink, #fff); }
.mm-title a { color: inherit; text-decoration: none; }
.mm-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mm-title a:focus-visible { outline: 2px solid var(--mx-accent, #a3e6ff); outline-offset: 2px; border-radius: 3px; }
.mm-cap { margin: 0; font-size: 13px; line-height: 1.45; color: var(--mx-text, #d9e5f8); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mm-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 0; }
.mm-tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; line-height: 1.6; color: var(--mx-text, #d9e5f8); background: var(--mx-frost, rgba(255, 255, 255, .06)); border: 1px solid var(--mx-line, rgba(200, 226, 255, .2)); white-space: nowrap; }
.mm-tag-c { color: var(--mx-ink, #fff); border-color: rgba(255, 217, 143, .55); background: rgba(255, 217, 143, .12); }
.mm-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.mm-act {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 7px 11px; border-radius: 10px;
  font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none; cursor: pointer;
  color: var(--mx-ink, #fff); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .42); transition: background .15s, color .15s, border-color .15s;
}
.mm-act svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mm-act:hover { background: #fff; color: var(--mx-on, #0c4cb8); border-color: #fff; }
.mm-act:focus-visible { outline: 2px solid var(--mx-accent, #a3e6ff); outline-offset: 2px; }
.mm-act.mm-dl { background: #fff; color: var(--mx-on, #0c4cb8); border-color: #fff; }
.mm-act.mm-dl:hover { background: var(--mx-accent-fill, #dcf1ff); border-color: var(--mx-accent-fill, #dcf1ff); }
.mm-acts .mm-act { flex: 1 1 auto; }
/* a narrow card (a small phone, some in-between widths): one row, Share as an icon, long words cut with ... (the full text is the tooltip) */
@container (max-width: 300px) {
  .mm-acts { flex-wrap: nowrap; gap: 5px; }
  .mm-acts .mm-act { flex: 1 1 0; min-width: 0; padding: 7px 8px; gap: 5px; }
  .mm-acts .mm-act span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .mm-acts .mm-act[data-share] { flex: 0 0 auto; }
  .mm-acts .mm-act[data-share] span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---- the big view ---- */
dialog.mm-big {
  width: min(760px, calc(100vw - 24px)); max-width: none; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
  padding: 0; margin: auto; border-radius: 18px; overflow: auto; overscroll-behavior: contain;
  color: var(--mx-ink, #fff); background: var(--mx-solid, #1c55b9); border: 1px solid var(--mx-line-2, rgba(210, 232, 255, .34));
  box-shadow: 0 30px 80px -20px rgba(1, 10, 34, .8);
}
dialog.mm-big::backdrop { background: rgba(2, 12, 40, .66); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
/* without JavaScript (?m= from the server): a box at the top of the page, the same size as the big view, nothing cut */
dialog.mm-big[open]:not(:modal) { position: static; display: block; width: auto; max-width: 760px; max-height: none; overflow: visible; margin: 0 auto 18px; }
.mm-big-in { position: relative; }
.mm-x-f { position: absolute; right: 10px; top: 10px; z-index: 2; margin: 0; }
.mm-x {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; line-height: 1; cursor: pointer;
  color: #fff; background: rgba(4, 18, 52, .7); border: 1px solid rgba(255, 255, 255, .35);
}
.mm-x:hover { background: #fff; color: var(--mx-on, #0c4cb8); }
.mm-x:focus-visible { outline: 2px solid var(--mx-accent, #a3e6ff); outline-offset: 2px; }
.mm-big-fig { position: relative; margin: 0; aspect-ratio: 16 / 9; background: #061a44 center / contain no-repeat; }
.mm-big-fig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.mm-big-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  background: #fff; color: var(--mx-on, #0c4cb8); border: 0; box-shadow: 0 8px 24px rgba(2, 16, 50, .5);
}
.mm-big-play svg { width: 14px; height: 14px; fill: currentColor; }
.mm-big-play:focus-visible { outline: 3px solid var(--mx-accent, #a3e6ff); outline-offset: 3px; }
.mm-big-play[hidden] { display: none; }
.mm-big-info { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.mm-big-t { margin: 0; padding-right: 8px; font-family: var(--font-display); font-size: clamp(20px, 4vw, 26px); font-weight: 800; line-height: 1.2; color: var(--mx-ink, #fff); }
.mm-big-cap { margin: 0; font-size: 16px; font-weight: 600; color: var(--mx-ink, #fff); }
.mm-big-desc { margin: 0; font-size: 14px; line-height: 1.55; color: var(--mx-text, #d9e5f8); }
.mm-big-tags, .mm-big-meta { margin: 0; font-size: 12.5px; color: var(--mx-dim, #c4d7f5); }
.mm-big-cap[hidden], .mm-big-desc[hidden], .mm-big-tags[hidden] { display: none; }
.mm-acts-big { padding-top: 8px; }
.mm-acts-big .mm-act { flex: 0 1 auto; min-height: 42px; padding: 9px 15px; font-size: 13.5px; }
.mm-act.mm-another { background: rgba(255, 217, 143, .16); border-color: rgba(255, 217, 143, .7); }
.mm-act.mm-another:hover { background: #ffd98f; color: #4a2a00; border-color: #ffd98f; }

/* ---- the other states ---- */
.mm-none, .mm-soon { text-align: center; padding: 28px 22px; }
.mm-none-e, .mm-soon-e { font-size: 44px; line-height: 1; margin: 0 0 10px; }
.mm-soon h2 { font-size: 20px; margin: 0 0 8px; }
.mm-soon p:last-child { max-width: 560px; margin: 0 auto; }
.mm-none .mm-act { display: inline-flex; margin-top: 6px; }
.mm-how h2 { margin-bottom: 8px; }
.mm-how ul { margin: 0; padding-left: 18px; color: var(--mx-text, #d9e5f8); font-size: 13.5px; line-height: 1.7; }
.mm-how b { color: var(--mx-ink, #fff); }
.mm-admin summary { cursor: pointer; font-weight: 600; color: var(--mx-ink, #fff); }
.mm-admin ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--mx-text, #d9e5f8); }
.mm-admin code { font-size: 12px; color: var(--mx-code, #ffd98f); }
.mm-toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 50; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px);
  padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--mx-on, #0c4cb8); background: #fff;
  box-shadow: 0 12px 32px -10px rgba(2, 16, 50, .6);
}
.mm-toast[hidden] { display: none; }
.mm-toast input { display: block; width: min(420px, calc(100vw - 64px)); margin: 8px 0 2px; padding: 8px 10px; border-radius: 8px; border: 1px solid #9bb8e6; font: inherit; font-size: 13px; font-weight: 400; color: #0b2a66; background: #f3f8ff; }
.mm-toast button { margin-top: 6px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--mx-on, #0c4cb8); background: transparent; color: var(--mx-on, #0c4cb8); font: inherit; font-size: 13px; cursor: pointer; }
dialog.mm-big .mm-toast { position: sticky; bottom: 12px; left: auto; transform: none; margin: 0 auto 12px; }

/* ---- tablets: the emojis nearest the text step aside ---- */
@media (max-width: 1000px) {
  .mm-hero-fx span:nth-child(3), .mm-hero-fx span:nth-child(5), .mm-hero-fx span:nth-child(7) { display: none; }
}

/* ---- phones ---- */
@media (max-width: 600px) {
  .mm-main { padding-left: 16px; padding-right: 16px; }
  .mm-hero { padding: 20px 16px 18px; border-radius: 16px; }
  .mm-hero-fx span { font-size: 22px !important; opacity: .3; }
  .mm-hero-fx span:nth-child(n+2) { display: none; } /* one emoji in the corner: the others would sit on the text */
  .mm-lead { font-size: 14px; }
  .mm-random { flex: 1 1 100%; justify-content: center; padding: 14px 18px; }
  .mm-row { align-items: flex-start; flex-direction: column; gap: 6px; }
  .mm-row-h { width: auto; }
  .mm-chips { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .mm-chips::-webkit-scrollbar { display: none; }
  .mm-chip { padding: 8px 13px; }
  .mm-grid { gap: 14px; }
  dialog.mm-big { width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border-radius: 16px; }
  .mm-big-info { padding: 14px 14px 16px; }
  .mm-acts-big .mm-act { flex: 1 1 auto; }
}

/* ---- calm motion: no bobbing, no lifting (posters stay until a click: js/memes.js) ---- */
@media (prefers-reduced-motion: reduce) {
  .mm-hero-fx span { animation: none; }
  .mm-card, .mm-card:hover, .mm-card:focus-within, .mm-random:hover, .mm-random:hover .mm-dice { transform: none; transition: none; }
  .mm-card.is-loading .mm-thumb::after { animation: none; border-top-color: rgba(255, 255, 255, .3); }
}
