/* ════════════════════════════════════════════════════════════════════════
   ALIENS (inc/aliens.php, page-alien-maker.php, js/code-buddy.js, the
   Alien step in js/main.js). Alien pictures are pixel art: always drawn
   with crisp pixels, never smoothed.
   ════════════════════════════════════════════════════════════════════════ */
.tomo-alien-img,
.tomo-buddy-alien img,
.tomo-alien-stage-preview img { image-rendering: pixelated; }

/* ── The Alien Maker page: top bar + the game, centred, nothing else ── */
.tomo-alien-maker-page { overflow-x: hidden; }
.tomo-alien-page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--nav-h, 72px));
  min-height: calc(100dvh - var(--nav-h, 72px));
  padding: 16px 8px;
  box-sizing: border-box;
}
.tomo-alien-frame {
  --alien-scale: 1;
  width: calc(400px * var(--alien-scale));
  height: calc(660px * var(--alien-scale));
  flex-shrink: 0;
}
.tomo-alien-frame iframe {
  display: block; width: 400px; height: 660px; border: 0;
  background: transparent; color-scheme: normal;
  transform: scale(var(--alien-scale)); transform-origin: 0 0;
}

/* ── Widget: the GIF linking to the page ──────────────────────────── */
.tomo-alien-widget {
  display: block; text-decoration: none; color: var(--ink);
  border: var(--card-border, 2.5px) solid var(--border); border-radius: 18px;
  overflow: hidden; background: #fff;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.tomo-alien-widget:hover { transform: translateY(-3px) rotate(-1deg); }
.tomo-alien-widget:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.tomo-alien-widget img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.tomo-alien-widget-text {
  display: block; padding: 10px 14px;
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 0.95rem;
}
[data-theme="dark"] .tomo-alien-widget { background: #1a1a22; border-color: var(--border-soft); }

/* ── Aliens in the code buddy's bubble ────────────────────────────── */
.tomo-buddy-aliens {
  list-style: none; margin: 0 0 10px; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.tomo-buddy-alien { position: relative; }
.tomo-buddy-alien > a,
.tomo-buddy-alien > span,
.tomo-buddy-alien-pick {
  display: block; width: 100%; aspect-ratio: 1; padding: 0;
  border: var(--card-border, 4px) solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--border-soft, #eee); cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.tomo-buddy-alien img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tomo-buddy-alien > a:hover,
.tomo-buddy-alien-pick:hover { transform: scale(1.05) rotate(-2deg); border-color: #FF4B9F; }
.tomo-buddy-alien > a:focus-visible,
.tomo-buddy-alien-pick:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.tomo-buddy-alien.is-news > a,
.tomo-buddy-alien.is-news > span { border-color: #FF4B9F; box-shadow: 0 0 0 3px rgba(255,75,159,0.35); }
.tomo-buddy-alien-noimg { display: block; width: 100%; height: 100%; }
.tomo-buddy-alien-forget {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; padding: 0; border-radius: 50%;
  border: 2px solid #fff; background: var(--ink); color: #fff;
  font-size: 0.85rem; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity 0.15s;
}
.tomo-buddy-alien:hover .tomo-buddy-alien-forget,
.tomo-buddy-alien-forget:focus-visible { opacity: 1; }
@media (hover: none) { .tomo-buddy-alien-forget { opacity: 0.85; } }
[data-theme="dark"] .tomo-buddy-alien-forget { color: #1a1a22; border-color: #23232e; }
.tomo-buddy-alien-go,
.tomo-buddy-maker-link {
  display: inline-block; margin: 0 0 6px; padding: 6px 14px; border-radius: 100px;
  background: #FF4B9F; color: #fff; text-decoration: none;
  font-weight: 700; font-size: 0.88rem;
}
.tomo-buddy-alien-go:hover,
.tomo-buddy-maker-link:hover { filter: brightness(1.08); }
.tomo-buddy-more { margin-top: 2px; }

/* ── The Alien step on the sticker product (js/main.js) ─────────────
   Every alien the buddy holds is a tile; ticked ones get the pink
   border, the same thickness as the option buttons (--card-border). */
.tomo-alien-stage { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.tomo-alien-stage-note { margin: 0; font-size: 0.92rem; color: var(--muted); }
.tomo-alien-stage-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px; width: 100%;
}
.tomo-alien-tile {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0;
  border: var(--card-border, 4px) solid var(--border); border-radius: 18px;
  background: var(--border-soft, #f2f2f2); overflow: hidden; cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), border-color 0.14s;
}
.tomo-alien-tile img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.tomo-alien-tile:hover { transform: rotate(-2deg) scale(1.04); }
.tomo-alien-tile:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.tomo-alien-tile.is-picked { border-color: #FF4B9F; }
.tomo-alien-tile.is-focus.is-picked { animation: tomo-alien-hello 0.6s cubic-bezier(0.34,1.56,0.64,1); }
.tomo-alien-tile-tick {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #FF4B9F; color: #fff;
  font-size: 0.85rem; font-weight: 700; line-height: 24px; text-align: center;
  transform: scale(0); transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.tomo-alien-tile.is-picked .tomo-alien-tile-tick { transform: scale(1); }
@keyframes tomo-alien-hello { 0% { transform: scale(1); } 40% { transform: scale(1.1) rotate(-4deg); } 100% { transform: scale(1); } }
.tomo-alien-stage-more { font-weight: 700; font-size: 0.9rem; color: #e0408a; text-decoration: none; }
.tomo-alien-stage-more:hover { text-decoration: underline; }
[data-theme="dark"] .tomo-alien-stage-more { color: #FF4B9F; }
.tomo-alien-stage-paste { width: 100%; }
.tomo-alien-stage-paste summary { cursor: pointer; font-size: 0.88rem; color: var(--muted); }
.tomo-alien-stage-paste textarea { margin-top: 6px; width: 100%; box-sizing: border-box; font-family: monospace; font-size: 0.8rem; }
@media (prefers-reduced-motion: reduce) { .tomo-alien-tile, .tomo-alien-tile-tick { transition: none; animation: none !important; } }

/* ── Basket / checkout thumbnail ──────────────────────────────────── */
.tomo-alien-thumb { border-radius: 10px; }

/* ── Drop shadows (same as the product cards and buttons) ─────────── */
.tomo-alien-widget,
.tomo-alien-tile,
.tomo-buddy-alien > a,
.tomo-buddy-alien > span,
.tomo-buddy-alien-pick,
.tomo-buddy-alien-go,
.tomo-buddy-maker-link,
.tomo-buddy-alien-forget,
.tomo-buddy-use,
.tomo-alien-thumb { box-shadow: var(--tomo-shadow); }
.tomo-alien-tile { transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), border-color 0.14s, box-shadow 0.18s; }
.tomo-alien-widget:hover,
.tomo-alien-tile:hover,
.tomo-buddy-alien > a:hover,
.tomo-buddy-alien-pick:hover { box-shadow: var(--tomo-shadow-hover); }
