# Retro console game cartridge

> A grey cartridge with a pixel art label: press it and it slides into the console while the green screen boots with a logo.

- Category: [Cards](https://library.aimran.es/components/cards)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-card-cartridge
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

A nostalgic card for games and creative launches. The cartridge has grip ridges, a clipped corner and a pixel art label drawn as a crisp SVG, and inserting it slides it behind the console body before the green screen lights up, drops the logo in steps and blinks a start prompt. Use it for game pages, hackathons, retro shops and portfolio easter eggs.

The main color is the label and the console buttons, the second the screen. Change the game title, redraw the 16 by 10 pixel scene, and press again to eject it.

## Code

### HTML

```html
<div class="uvq07-crt"><div class="st" aria-hidden="true"><div class="ct"><i class="gr"></i><span class="lb"><span class="art"><svg viewBox="0 0 16 10" shape-rendering="crispEdges" aria-hidden="true"><rect width="16" height="10" fill="#8fd3ff"/><rect x="12" y="1" width="2" height="2" fill="#ffe066"/><rect x="2" y="4" width="4" height="2" fill="#3b4b7a"/><rect x="3" y="3" width="2" height="1" fill="#3b4b7a"/><rect x="9" y="3" width="5" height="3" fill="#2f3d66"/><rect x="10" y="2" width="3" height="1" fill="#2f3d66"/><rect x="11" y="1" width="1" height="1" fill="#fff"/><rect y="6" width="16" height="4" fill="#4caf50"/><rect y="8" width="16" height="2" fill="#3a8a3e"/><rect x="6" y="5" width="1" height="1" fill="#ffcc99"/><rect x="6" y="6" width="1" height="2" fill="#e53935"/></svg></span><b>Adventure in Pixelia</b></span></div><div class="cn"><i class="sl"></i><span class="scr"><b>PIXELIA</b><span class="ps">Press START</span></span><i class="pw"></i><i class="dp"></i><i class="ab"></i></div></div><button type="button" aria-pressed="false" data-a="Insert cartridge" data-b="Eject cartridge">Insert cartridge</button></div>
```

### CSS

```css
.uvq07-crt {
  --c1: #6d4fd1;
  --c2: #9bbc0f;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq07-crt {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  display: grid;
  justify-items: center;
  gap: 1.1em;
  width: 17em;
}

.uvq07-crt .st {
  position: relative;
  width: 16em;
  height: 16em;
}

.uvq07-crt .ct {
  position: absolute;
  left: 50%;
  top: 0;
  width: 8.6em;
  height: 9.6em;
  margin-left: -4.3em;
  border-radius: .4em .4em .25em .25em;
  background: linear-gradient(90deg,#a9a9ae,#cacacf 12%,#bdbdc2 88%,#9d9da2);
  clip-path: polygon(0 0,86% 0,100% 7%,100% 100%,0 100%);
  transition: transform calc(0.7s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq07-crt .gr {
  position: absolute;
  left: .7em;
  right: 1.6em;
  top: .45em;
  height: 1.1em;
  background: repeating-linear-gradient(180deg,rgba(0,0,0,.18) 0 1px,rgba(255,255,255,.4) 1px 2px,transparent 2px 4px);
}

.uvq07-crt .lb {
  position: absolute;
  left: .7em;
  right: .7em;
  top: 2em;
  bottom: 1.6em;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: .45em;
  border-radius: .25em;
  color: #fff;
  background: linear-gradient(transparent 55%,rgba(0,0,0,.3)),var(--c1);
  box-shadow: inset 0 0 0 .15em rgba(0,0,0,.18);
}

.uvq07-crt .art {
  position: absolute;
  inset: .45em .45em 2.3em;
  overflow: hidden;
  border-radius: .15em;
}

.uvq07-crt .art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.uvq07-crt .lb b {
  position: relative;
  font: 800 .74em/1.1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  text-shadow: 0 1px 0 rgba(0,0,0,.4);
}

.uvq07-crt .cn {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: 7.4em;
  border-radius: .6em .6em 1.4em 1.4em;
  background: linear-gradient(180deg,#dcdad4,#c4c1ba);
  box-shadow: 0 1.2em 2em -1.2em rgba(0,0,0,.5),inset 0 .15em 0 rgba(255,255,255,.6),0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent);
}

.uvq07-crt .sl {
  position: absolute;
  left: 50%;
  top: -.28em;
  width: 9.4em;
  height: .56em;
  margin-left: -4.7em;
  border-radius: .3em;
  background: #2b2b2e;
  box-shadow: inset 0 .15em .2em #000;
}

.uvq07-crt .scr {
  position: absolute;
  left: 50%;
  top: 1.15em;
  width: 7.4em;
  height: 4.5em;
  margin-left: -3.7em;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .5em;
  overflow: hidden;
  border-radius: .25em;
  background: #3f4535;
  box-shadow: 0 0 0 .55em #5d5f6b,inset 0 .2em .4em rgba(0,0,0,.4);
  transition: background calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-crt .scr b {
  font: 900 1em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  letter-spacing: .08em;
  color: #0f380f;
  transform: translateY(-3.5em);
}

.uvq07-crt .scr .ps {
  font: 700 .5em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  letter-spacing: .06em;
  color: #0f380f;
  opacity: 0;
}

.uvq07-crt .pw {
  position: absolute;
  left: 1.15em;
  top: 2.6em;
  width: .4em;
  height: .4em;
  border-radius: 50%;
  background: #5b1d1d;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-crt .dp {
  position: absolute;
  left: 1em;
  bottom: 1em;
  width: 1.6em;
  height: 1.6em;
  background: linear-gradient(#2d2d30 0 0) 50%/.5em 100% no-repeat,linear-gradient(#2d2d30 0 0) 50%/100% .5em no-repeat;
}

.uvq07-crt .ab {
  position: absolute;
  right: 1em;
  bottom: 1.1em;
  width: .75em;
  height: .75em;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: -1.05em .45em 0 var(--c1);
}

.uvq07-crt.on .ct {
  transform: translateY(4.6em);
}

.uvq07-crt.on .scr {
  background: var(--c2);
  transition-delay: calc(0.6s / var(--k));
}

.uvq07-crt.on .scr b {
  animation: uvq07-crt calc(1.4s / var(--k)) steps(10,end) calc(0.8s / var(--k)) forwards;
}

.uvq07-crt.on .scr .ps {
  animation: uvq07-crt-b calc(1s / var(--k)) steps(1) calc(2.4s / var(--k)) infinite;
}

.uvq07-crt.on .pw {
  background: #ff3b3b;
  box-shadow: 0 0 .5em #ff3b3b;
}

.uvq07-crt button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .7em 1.25em;
  border-radius: 2em;
  font-weight: 700;
  color: #fff;
  background: var(--c1);
  box-shadow: 0 .5em 1em -.5em var(--c1);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq07-crt button:hover {
  transform: translateY(-2px);
}

.uvq07-crt button:active {
  transform: scale(.95);
}

.uvq07-crt button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq07-crt {
  to {
    transform: none;
  }
}

@keyframes uvq07-crt-b {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq07-crt,.uvq07-crt *,.uvq07-crt *::before,.uvq07-crt *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### JavaScript

```js
document.querySelectorAll(".uvq07-crt").forEach(el => {
  const b=el.querySelector("button");b.addEventListener("click",()=>{const on=b.getAttribute("aria-pressed")!=="true";b.setAttribute("aria-pressed",String(on));el.classList.toggle("on",on);b.textContent=on?b.dataset.b:b.dataset.a})
});
```

### React

```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq07-crt {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  display: grid;
  justify-items: center;
  gap: 1.1em;
  width: 17em;
}

.uvq07-crt .st {
  position: relative;
  width: 16em;
  height: 16em;
}

.uvq07-crt .ct {
  position: absolute;
  left: 50%;
  top: 0;
  width: 8.6em;
  height: 9.6em;
  margin-left: -4.3em;
  border-radius: .4em .4em .25em .25em;
  background: linear-gradient(90deg,#a9a9ae,#cacacf 12%,#bdbdc2 88%,#9d9da2);
  clip-path: polygon(0 0,86% 0,100% 7%,100% 100%,0 100%);
  transition: transform calc(0.7s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq07-crt .gr {
  position: absolute;
  left: .7em;
  right: 1.6em;
  top: .45em;
  height: 1.1em;
  background: repeating-linear-gradient(180deg,rgba(0,0,0,.18) 0 1px,rgba(255,255,255,.4) 1px 2px,transparent 2px 4px);
}

.uvq07-crt .lb {
  position: absolute;
  left: .7em;
  right: .7em;
  top: 2em;
  bottom: 1.6em;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: .45em;
  border-radius: .25em;
  color: #fff;
  background: linear-gradient(transparent 55%,rgba(0,0,0,.3)),var(--c1);
  box-shadow: inset 0 0 0 .15em rgba(0,0,0,.18);
}

.uvq07-crt .art {
  position: absolute;
  inset: .45em .45em 2.3em;
  overflow: hidden;
  border-radius: .15em;
}

.uvq07-crt .art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.uvq07-crt .lb b {
  position: relative;
  font: 800 .74em/1.1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  text-shadow: 0 1px 0 rgba(0,0,0,.4);
}

.uvq07-crt .cn {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: 7.4em;
  border-radius: .6em .6em 1.4em 1.4em;
  background: linear-gradient(180deg,#dcdad4,#c4c1ba);
  box-shadow: 0 1.2em 2em -1.2em rgba(0,0,0,.5),inset 0 .15em 0 rgba(255,255,255,.6),0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent);
}

.uvq07-crt .sl {
  position: absolute;
  left: 50%;
  top: -.28em;
  width: 9.4em;
  height: .56em;
  margin-left: -4.7em;
  border-radius: .3em;
  background: #2b2b2e;
  box-shadow: inset 0 .15em .2em #000;
}

.uvq07-crt .scr {
  position: absolute;
  left: 50%;
  top: 1.15em;
  width: 7.4em;
  height: 4.5em;
  margin-left: -3.7em;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .5em;
  overflow: hidden;
  border-radius: .25em;
  background: #3f4535;
  box-shadow: 0 0 0 .55em #5d5f6b,inset 0 .2em .4em rgba(0,0,0,.4);
  transition: background calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-crt .scr b {
  font: 900 1em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  letter-spacing: .08em;
  color: #0f380f;
  transform: translateY(-3.5em);
}

.uvq07-crt .scr .ps {
  font: 700 .5em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  letter-spacing: .06em;
  color: #0f380f;
  opacity: 0;
}

.uvq07-crt .pw {
  position: absolute;
  left: 1.15em;
  top: 2.6em;
  width: .4em;
  height: .4em;
  border-radius: 50%;
  background: #5b1d1d;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-crt .dp {
  position: absolute;
  left: 1em;
  bottom: 1em;
  width: 1.6em;
  height: 1.6em;
  background: linear-gradient(#2d2d30 0 0) 50%/.5em 100% no-repeat,linear-gradient(#2d2d30 0 0) 50%/100% .5em no-repeat;
}

.uvq07-crt .ab {
  position: absolute;
  right: 1em;
  bottom: 1.1em;
  width: .75em;
  height: .75em;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: -1.05em .45em 0 var(--c1);
}

.uvq07-crt.on .ct {
  transform: translateY(4.6em);
}

.uvq07-crt.on .scr {
  background: var(--c2);
  transition-delay: calc(0.6s / var(--k));
}

.uvq07-crt.on .scr b {
  animation: uvq07-crt calc(1.4s / var(--k)) steps(10,end) calc(0.8s / var(--k)) forwards;
}

.uvq07-crt.on .scr .ps {
  animation: uvq07-crt-b calc(1s / var(--k)) steps(1) calc(2.4s / var(--k)) infinite;
}

.uvq07-crt.on .pw {
  background: #ff3b3b;
  box-shadow: 0 0 .5em #ff3b3b;
}

.uvq07-crt button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .7em 1.25em;
  border-radius: 2em;
  font-weight: 700;
  color: #fff;
  background: var(--c1);
  box-shadow: 0 .5em 1em -.5em var(--c1);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq07-crt button:hover {
  transform: translateY(-2px);
}

.uvq07-crt button:active {
  transform: scale(.95);
}

.uvq07-crt button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq07-crt {
  to {
    transform: none;
  }
}

@keyframes uvq07-crt-b {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq07-crt,.uvq07-crt *,.uvq07-crt *::before,.uvq07-crt *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const b=el.querySelector("button");b.addEventListener("click",()=>{const on=b.getAttribute("aria-pressed")!=="true";b.setAttribute("aria-pressed",String(on));el.classList.toggle("on",on);b.textContent=on?b.dataset.b:b.dataset.a})
}

export default function CardCartridge() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#6d4fd1",
          "--c2": "#9bbc0f",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq07-crt"><div className="st" aria-hidden="true"><div className="ct"><i className="gr"></i><span className="lb"><span className="art"><svg viewBox="0 0 16 10" shapeRendering="crispEdges" aria-hidden="true"><rect width="16" height="10" fill="#8fd3ff" /><rect x="12" y="1" width="2" height="2" fill="#ffe066" /><rect x="2" y="4" width="4" height="2" fill="#3b4b7a" /><rect x="3" y="3" width="2" height="1" fill="#3b4b7a" /><rect x="9" y="3" width="5" height="3" fill="#2f3d66" /><rect x="10" y="2" width="3" height="1" fill="#2f3d66" /><rect x="11" y="1" width="1" height="1" fill="#fff" /><rect y="6" width="16" height="4" fill="#4caf50" /><rect y="8" width="16" height="2" fill="#3a8a3e" /><rect x="6" y="5" width="1" height="1" fill="#ffcc99" /><rect x="6" y="6" width="1" height="2" fill="#e53935" /></svg></span><b>Adventure in Pixelia</b></span></div><div className="cn"><i className="sl"></i><span className="scr"><b>PIXELIA</b><span className="ps">Press START</span></span><i className="pw"></i><i className="dp"></i><i className="ab"></i></div></div><button type="button" aria-pressed="false" data-a="Insert cartridge" data-b="Eject cartridge">Insert cartridge</button></div>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Retro console game cartridge” block (Cards) from AIMRAN Library to my project.

## What it is
A grey cartridge with a pixel art label: press it and it slides into the console while the green screen boots with a logo.

## Chosen settings
- Main color: #6d4fd1
- Secondary color: #9bbc0f
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Aventura en Pixelia"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq07-crt {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  display: grid;
  justify-items: center;
  gap: 1.1em;
  width: 17em;
}

.uvq07-crt .st {
  position: relative;
  width: 16em;
  height: 16em;
}

.uvq07-crt .ct {
  position: absolute;
  left: 50%;
  top: 0;
  width: 8.6em;
  height: 9.6em;
  margin-left: -4.3em;
  border-radius: .4em .4em .25em .25em;
  background: linear-gradient(90deg,#a9a9ae,#cacacf 12%,#bdbdc2 88%,#9d9da2);
  clip-path: polygon(0 0,86% 0,100% 7%,100% 100%,0 100%);
  transition: transform calc(0.7s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq07-crt .gr {
  position: absolute;
  left: .7em;
  right: 1.6em;
  top: .45em;
  height: 1.1em;
  background: repeating-linear-gradient(180deg,rgba(0,0,0,.18) 0 1px,rgba(255,255,255,.4) 1px 2px,transparent 2px 4px);
}

.uvq07-crt .lb {
  position: absolute;
  left: .7em;
  right: .7em;
  top: 2em;
  bottom: 1.6em;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: .45em;
  border-radius: .25em;
  color: #fff;
  background: linear-gradient(transparent 55%,rgba(0,0,0,.3)),var(--c1);
  box-shadow: inset 0 0 0 .15em rgba(0,0,0,.18);
}

.uvq07-crt .art {
  position: absolute;
  inset: .45em .45em 2.3em;
  overflow: hidden;
  border-radius: .15em;
}

.uvq07-crt .art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.uvq07-crt .lb b {
  position: relative;
  font: 800 .74em/1.1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  text-shadow: 0 1px 0 rgba(0,0,0,.4);
}

.uvq07-crt .cn {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: 7.4em;
  border-radius: .6em .6em 1.4em 1.4em;
  background: linear-gradient(180deg,#dcdad4,#c4c1ba);
  box-shadow: 0 1.2em 2em -1.2em rgba(0,0,0,.5),inset 0 .15em 0 rgba(255,255,255,.6),0 0 0 1px color-mix(in srgb,var(--fg) 8%,transparent);
}

.uvq07-crt .sl {
  position: absolute;
  left: 50%;
  top: -.28em;
  width: 9.4em;
  height: .56em;
  margin-left: -4.7em;
  border-radius: .3em;
  background: #2b2b2e;
  box-shadow: inset 0 .15em .2em #000;
}

.uvq07-crt .scr {
  position: absolute;
  left: 50%;
  top: 1.15em;
  width: 7.4em;
  height: 4.5em;
  margin-left: -3.7em;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .5em;
  overflow: hidden;
  border-radius: .25em;
  background: #3f4535;
  box-shadow: 0 0 0 .55em #5d5f6b,inset 0 .2em .4em rgba(0,0,0,.4);
  transition: background calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-crt .scr b {
  font: 900 1em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  letter-spacing: .08em;
  color: #0f380f;
  transform: translateY(-3.5em);
}

.uvq07-crt .scr .ps {
  font: 700 .5em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  letter-spacing: .06em;
  color: #0f380f;
  opacity: 0;
}

.uvq07-crt .pw {
  position: absolute;
  left: 1.15em;
  top: 2.6em;
  width: .4em;
  height: .4em;
  border-radius: 50%;
  background: #5b1d1d;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-crt .dp {
  position: absolute;
  left: 1em;
  bottom: 1em;
  width: 1.6em;
  height: 1.6em;
  background: linear-gradient(#2d2d30 0 0) 50%/.5em 100% no-repeat,linear-gradient(#2d2d30 0 0) 50%/100% .5em no-repeat;
}

.uvq07-crt .ab {
  position: absolute;
  right: 1em;
  bottom: 1.1em;
  width: .75em;
  height: .75em;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: -1.05em .45em 0 var(--c1);
}

.uvq07-crt.on .ct {
  transform: translateY(4.6em);
}

.uvq07-crt.on .scr {
  background: var(--c2);
  transition-delay: calc(0.6s / var(--k));
}

.uvq07-crt.on .scr b {
  animation: uvq07-crt calc(1.4s / var(--k)) steps(10,end) calc(0.8s / var(--k)) forwards;
}

.uvq07-crt.on .scr .ps {
  animation: uvq07-crt-b calc(1s / var(--k)) steps(1) calc(2.4s / var(--k)) infinite;
}

.uvq07-crt.on .pw {
  background: #ff3b3b;
  box-shadow: 0 0 .5em #ff3b3b;
}

.uvq07-crt button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .7em 1.25em;
  border-radius: 2em;
  font-weight: 700;
  color: #fff;
  background: var(--c1);
  box-shadow: 0 .5em 1em -.5em var(--c1);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq07-crt button:hover {
  transform: translateY(-2px);
}

.uvq07-crt button:active {
  transform: scale(.95);
}

.uvq07-crt button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq07-crt {
  to {
    transform: none;
  }
}

@keyframes uvq07-crt-b {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq07-crt,.uvq07-crt *,.uvq07-crt *::before,.uvq07-crt *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const b=el.querySelector("button");b.addEventListener("click",()=>{const on=b.getAttribute("aria-pressed")!=="true";b.setAttribute("aria-pressed",String(on));el.classList.toggle("on",on);b.textContent=on?b.dataset.b:b.dataset.a})
}

export default function CardCartridge() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#6d4fd1",
          "--c2": "#9bbc0f",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq07-crt"><div className="st" aria-hidden="true"><div className="ct"><i className="gr"></i><span className="lb"><span className="art"><svg viewBox="0 0 16 10" shapeRendering="crispEdges" aria-hidden="true"><rect width="16" height="10" fill="#8fd3ff" /><rect x="12" y="1" width="2" height="2" fill="#ffe066" /><rect x="2" y="4" width="4" height="2" fill="#3b4b7a" /><rect x="3" y="3" width="2" height="1" fill="#3b4b7a" /><rect x="9" y="3" width="5" height="3" fill="#2f3d66" /><rect x="10" y="2" width="3" height="1" fill="#2f3d66" /><rect x="11" y="1" width="1" height="1" fill="#fff" /><rect y="6" width="16" height="4" fill="#4caf50" /><rect y="8" width="16" height="2" fill="#3a8a3e" /><rect x="6" y="5" width="1" height="1" fill="#ffcc99" /><rect x="6" y="6" width="1" height="2" fill="#e53935" /></svg></span><b>Adventure in Pixelia</b></span></div><div className="cn"><i className="sl"></i><span className="scr"><b>PIXELIA</b><span className="ps">Press START</span></span><i className="pw"></i><i className="dp"></i><i className="ab"></i></div></div><button type="button" aria-pressed="false" data-a="Insert cartridge" data-b="Eject cartridge">Insert cartridge</button></div>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
