# Referee card toast

> The whistle blows and a yellow card rises from the pocket over the grass; tap it and it flips to show the player.

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

## Where to use it

Match centre apps report bookings as one more line in a list, but a card held up on a striped pitch reads instantly. This toast lays a mowed grass pattern under a whistle with blinking sound lines, then a yellow card swings up from below and settles at a tilt. The card is a real button: pressing it flips it in 3D to show the shirt number and name.

The main color is the card, so red works for a sending off, and the second color is the grass. The flip uses aria-pressed and reveals an extra line in the status region; replace the player, minute and reason with your live data.

## Code

### HTML

```html
<div class="uvq09-ref"><button type="button" class="fire">Show again</button><div class="tt" role="status"><span class="ws" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 12.5a5 5 0 0 0 9.6 1.9l7.4-1.6V9.2H9.8"/><path d="M9.8 9.2V6.8h4.5v2.4"/><circle cx="8.5" cy="12.5" r="1.4"/></svg><i></i><i></i><i></i></span><button type="button" class="cd" aria-pressed="false" aria-label="Show the booked player"><span class="fc fr"></span><span class="fc bk"><b>8</b><small>Pedri</small></span></button><span class="tx"><b>Yellow card</b><small>Minute 54 · tactical foul</small><small class="dt">Pedri, number 8. One more and he is off</small></span></div></div>
```

### CSS

```css
.uvq09-ref {
  --c1: #facc15;
  --c2: #15803d;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq09-ref {
  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;
  position: relative;
  width: 21em;
  height: 15em;
}

.uvq09-ref .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 50%;
  top: 1.2em;
  translate: -50% 0;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-size: .82em;
  font-weight: 650;
  white-space: nowrap;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-ref .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq09-ref .fire:active {
  scale: .96;
}

.uvq09-ref .fire:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-ref .tt {
  position: absolute;
  left: 50%;
  bottom: 1em;
  width: 19em;
  translate: -50% 0;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.2em 2.4em -1em rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  gap: .75em;
  min-height: 5.6em;
  padding: .75em .9em;
  color: #f0fdf4;
  background: linear-gradient(rgba(255,255,255,.18),rgba(255,255,255,.18)) 72% 0/2px 100% no-repeat,repeating-linear-gradient(90deg,var(--c2) 0 1.6em,color-mix(in srgb,var(--c2) 82%,#000) 1.6em 3.2em);
  box-shadow: 0 0 0 1px rgba(0,0,0,.25),inset 0 1px rgba(255,255,255,.15),0 1.2em 2.4em -1em rgba(0,0,0,.5);
  transform: translateY(130%) scale(.92);
  opacity: 0;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-ref .tt.in {
  transform: none;
  opacity: 1;
}

.uvq09-ref .ws {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  color: #f8fafc;
  background: rgba(0,0,0,.22);
}

.uvq09-ref .ws svg {
  width: 1.4em;
  height: 1.4em;
}

.uvq09-ref .ws i {
  position: absolute;
  right: -.15em;
  top: .55em;
  width: .5em;
  height: .12em;
  border-radius: 1em;
  background: #f8fafc;
  transform-origin: left;
  opacity: 0;
}

.uvq09-ref .ws i:nth-of-type(1) {
  rotate: -35deg;
  top: .35em;
}

.uvq09-ref .ws i:nth-of-type(3) {
  rotate: 35deg;
  top: .8em;
}

.uvq09-ref .tt.in .ws i {
  animation: uvq09-ref-w calc(0.35s / var(--k)) steps(1) calc(0.25s / var(--k)) 4;
}

.uvq09-ref .cd {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  flex: none;
  width: 2.9em;
  height: 3.9em;
  perspective: 20em;
  border-radius: .3em;
}

.uvq09-ref .cd:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.uvq09-ref .fc {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  border-radius: .3em;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 .35em .6em -.2em rgba(0,0,0,.45);
  transition: transform calc(0.6s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq09-ref .fr {
  background: linear-gradient(150deg,color-mix(in srgb,var(--c1) 55%,#fff) 0 30%,var(--c1) 45%,color-mix(in srgb,var(--c1) 85%,#000));
}

.uvq09-ref .bk {
  color: #111827;
  background: #f8fafc;
  transform: rotateY(180deg);
}

.uvq09-ref .bk b {
  font-size: 1.5em;
  line-height: 1;
}

.uvq09-ref .bk small {
  font-size: .58em;
  font-weight: 700;
  color: #374151;
}

.uvq09-ref .cd[aria-pressed="true"] .fr {
  transform: rotateY(-180deg);
}

.uvq09-ref .cd[aria-pressed="true"] .bk {
  transform: none;
}

.uvq09-ref .tt.in .cd {
  animation: uvq09-ref-c calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1) calc(0.3s / var(--k)) both;
}

.uvq09-ref .cd:hover .fc {
  translate: 0 -.12em;
}

.uvq09-ref .cd:active {
  scale: .95;
}

.uvq09-ref .tx {
  display: grid;
  flex: 1;
  gap: .12em;
  min-width: 0;
}

.uvq09-ref .tx b {
  font-size: .95em;
}

.uvq09-ref small {
  font-size: .72em;
  color: rgba(240,253,244,.78);
}

.uvq09-ref .dt {
  display: none;
}

.uvq09-ref .tt:has([aria-pressed="true"]) .dt {
  display: block;
}

@keyframes uvq09-ref-c {
  0% {
    opacity: 0;
    transform: translateY(2.2em) rotate(-25deg);
  }
  60% {
    opacity: 1;
    transform: translateY(-.25em) rotate(-4deg);
  }
  80% {
    transform: rotate(-9deg);
  }
  100% {
    opacity: 1;
    transform: rotate(-7deg);
  }
}

@keyframes uvq09-ref-w {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq09-ref").forEach(el => {
  const t=el.querySelector(".tt"),f=el.querySelector(".fire");let tm=[];const clr=()=>{tm.forEach(clearTimeout);tm=[]};const later=(fn,ms)=>tm.push(setTimeout(fn,ms));
const show=()=>{clr();t.classList.remove("in","out");void t.offsetWidth;later(()=>{t.classList.add("in");c.setAttribute('aria-pressed','false')},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();const c=t.querySelector(".cd");c.addEventListener("click",()=>c.setAttribute("aria-pressed",c.getAttribute("aria-pressed")==="true"?"false":"true"));return clr
});
```

### 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 = `
.uvq09-ref {
  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;
  position: relative;
  width: 21em;
  height: 15em;
}

.uvq09-ref .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 50%;
  top: 1.2em;
  translate: -50% 0;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-size: .82em;
  font-weight: 650;
  white-space: nowrap;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-ref .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq09-ref .fire:active {
  scale: .96;
}

.uvq09-ref .fire:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-ref .tt {
  position: absolute;
  left: 50%;
  bottom: 1em;
  width: 19em;
  translate: -50% 0;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.2em 2.4em -1em rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  gap: .75em;
  min-height: 5.6em;
  padding: .75em .9em;
  color: #f0fdf4;
  background: linear-gradient(rgba(255,255,255,.18),rgba(255,255,255,.18)) 72% 0/2px 100% no-repeat,repeating-linear-gradient(90deg,var(--c2) 0 1.6em,color-mix(in srgb,var(--c2) 82%,#000) 1.6em 3.2em);
  box-shadow: 0 0 0 1px rgba(0,0,0,.25),inset 0 1px rgba(255,255,255,.15),0 1.2em 2.4em -1em rgba(0,0,0,.5);
  transform: translateY(130%) scale(.92);
  opacity: 0;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-ref .tt.in {
  transform: none;
  opacity: 1;
}

.uvq09-ref .ws {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  color: #f8fafc;
  background: rgba(0,0,0,.22);
}

.uvq09-ref .ws svg {
  width: 1.4em;
  height: 1.4em;
}

.uvq09-ref .ws i {
  position: absolute;
  right: -.15em;
  top: .55em;
  width: .5em;
  height: .12em;
  border-radius: 1em;
  background: #f8fafc;
  transform-origin: left;
  opacity: 0;
}

.uvq09-ref .ws i:nth-of-type(1) {
  rotate: -35deg;
  top: .35em;
}

.uvq09-ref .ws i:nth-of-type(3) {
  rotate: 35deg;
  top: .8em;
}

.uvq09-ref .tt.in .ws i {
  animation: uvq09-ref-w calc(0.35s / var(--k)) steps(1) calc(0.25s / var(--k)) 4;
}

.uvq09-ref .cd {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  flex: none;
  width: 2.9em;
  height: 3.9em;
  perspective: 20em;
  border-radius: .3em;
}

.uvq09-ref .cd:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.uvq09-ref .fc {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  border-radius: .3em;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 .35em .6em -.2em rgba(0,0,0,.45);
  transition: transform calc(0.6s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq09-ref .fr {
  background: linear-gradient(150deg,color-mix(in srgb,var(--c1) 55%,#fff) 0 30%,var(--c1) 45%,color-mix(in srgb,var(--c1) 85%,#000));
}

.uvq09-ref .bk {
  color: #111827;
  background: #f8fafc;
  transform: rotateY(180deg);
}

.uvq09-ref .bk b {
  font-size: 1.5em;
  line-height: 1;
}

.uvq09-ref .bk small {
  font-size: .58em;
  font-weight: 700;
  color: #374151;
}

.uvq09-ref .cd[aria-pressed="true"] .fr {
  transform: rotateY(-180deg);
}

.uvq09-ref .cd[aria-pressed="true"] .bk {
  transform: none;
}

.uvq09-ref .tt.in .cd {
  animation: uvq09-ref-c calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1) calc(0.3s / var(--k)) both;
}

.uvq09-ref .cd:hover .fc {
  translate: 0 -.12em;
}

.uvq09-ref .cd:active {
  scale: .95;
}

.uvq09-ref .tx {
  display: grid;
  flex: 1;
  gap: .12em;
  min-width: 0;
}

.uvq09-ref .tx b {
  font-size: .95em;
}

.uvq09-ref small {
  font-size: .72em;
  color: rgba(240,253,244,.78);
}

.uvq09-ref .dt {
  display: none;
}

.uvq09-ref .tt:has([aria-pressed="true"]) .dt {
  display: block;
}

@keyframes uvq09-ref-c {
  0% {
    opacity: 0;
    transform: translateY(2.2em) rotate(-25deg);
  }
  60% {
    opacity: 1;
    transform: translateY(-.25em) rotate(-4deg);
  }
  80% {
    transform: rotate(-9deg);
  }
  100% {
    opacity: 1;
    transform: rotate(-7deg);
  }
}

@keyframes uvq09-ref-w {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq09-ref,.uvq09-ref *,.uvq09-ref *::before,.uvq09-ref *::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 t=el.querySelector(".tt"),f=el.querySelector(".fire");let tm=[];const clr=()=>{tm.forEach(clearTimeout);tm=[]};const later=(fn,ms)=>tm.push(setTimeout(fn,ms));
const show=()=>{clr();t.classList.remove("in","out");void t.offsetWidth;later(()=>{t.classList.add("in");c.setAttribute('aria-pressed','false')},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();const c=t.querySelector(".cd");c.addEventListener("click",()=>c.setAttribute("aria-pressed",c.getAttribute("aria-pressed")==="true"?"false":"true"));return clr
}

export default function ToastRefereeCard() {
  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": "#facc15",
          "--c2": "#15803d",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq09-ref"><button type="button" className="fire">Show again</button><div className="tt" role="status"><span className="ws" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M3.5 12.5a5 5 0 0 0 9.6 1.9l7.4-1.6V9.2H9.8" /><path d="M9.8 9.2V6.8h4.5v2.4" /><circle cx="8.5" cy="12.5" r="1.4" /></svg><i></i><i></i><i></i></span><button type="button" className="cd" aria-pressed="false" aria-label="Show the booked player"><span className="fc fr"></span><span className="fc bk"><b>8</b><small>Pedri</small></span></button><span className="tx"><b>Yellow card</b><small>Minute 54 · tactical foul</small><small className="dt">Pedri, number 8. One more and he is off</small></span></div></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 “Referee card toast” block (Toasts) from AIMRAN Library to my project.

## What it is
The whistle blows and a yellow card rises from the pocket over the grass; tap it and it flips to show the player.

## Chosen settings
- Main color: #facc15
- Secondary color: #15803d
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Tarjeta amarilla"

## 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 = `
.uvq09-ref {
  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;
  position: relative;
  width: 21em;
  height: 15em;
}

.uvq09-ref .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 50%;
  top: 1.2em;
  translate: -50% 0;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-size: .82em;
  font-weight: 650;
  white-space: nowrap;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-ref .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq09-ref .fire:active {
  scale: .96;
}

.uvq09-ref .fire:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-ref .tt {
  position: absolute;
  left: 50%;
  bottom: 1em;
  width: 19em;
  translate: -50% 0;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.2em 2.4em -1em rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  gap: .75em;
  min-height: 5.6em;
  padding: .75em .9em;
  color: #f0fdf4;
  background: linear-gradient(rgba(255,255,255,.18),rgba(255,255,255,.18)) 72% 0/2px 100% no-repeat,repeating-linear-gradient(90deg,var(--c2) 0 1.6em,color-mix(in srgb,var(--c2) 82%,#000) 1.6em 3.2em);
  box-shadow: 0 0 0 1px rgba(0,0,0,.25),inset 0 1px rgba(255,255,255,.15),0 1.2em 2.4em -1em rgba(0,0,0,.5);
  transform: translateY(130%) scale(.92);
  opacity: 0;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-ref .tt.in {
  transform: none;
  opacity: 1;
}

.uvq09-ref .ws {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  color: #f8fafc;
  background: rgba(0,0,0,.22);
}

.uvq09-ref .ws svg {
  width: 1.4em;
  height: 1.4em;
}

.uvq09-ref .ws i {
  position: absolute;
  right: -.15em;
  top: .55em;
  width: .5em;
  height: .12em;
  border-radius: 1em;
  background: #f8fafc;
  transform-origin: left;
  opacity: 0;
}

.uvq09-ref .ws i:nth-of-type(1) {
  rotate: -35deg;
  top: .35em;
}

.uvq09-ref .ws i:nth-of-type(3) {
  rotate: 35deg;
  top: .8em;
}

.uvq09-ref .tt.in .ws i {
  animation: uvq09-ref-w calc(0.35s / var(--k)) steps(1) calc(0.25s / var(--k)) 4;
}

.uvq09-ref .cd {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  flex: none;
  width: 2.9em;
  height: 3.9em;
  perspective: 20em;
  border-radius: .3em;
}

.uvq09-ref .cd:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.uvq09-ref .fc {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  border-radius: .3em;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 .35em .6em -.2em rgba(0,0,0,.45);
  transition: transform calc(0.6s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq09-ref .fr {
  background: linear-gradient(150deg,color-mix(in srgb,var(--c1) 55%,#fff) 0 30%,var(--c1) 45%,color-mix(in srgb,var(--c1) 85%,#000));
}

.uvq09-ref .bk {
  color: #111827;
  background: #f8fafc;
  transform: rotateY(180deg);
}

.uvq09-ref .bk b {
  font-size: 1.5em;
  line-height: 1;
}

.uvq09-ref .bk small {
  font-size: .58em;
  font-weight: 700;
  color: #374151;
}

.uvq09-ref .cd[aria-pressed="true"] .fr {
  transform: rotateY(-180deg);
}

.uvq09-ref .cd[aria-pressed="true"] .bk {
  transform: none;
}

.uvq09-ref .tt.in .cd {
  animation: uvq09-ref-c calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1) calc(0.3s / var(--k)) both;
}

.uvq09-ref .cd:hover .fc {
  translate: 0 -.12em;
}

.uvq09-ref .cd:active {
  scale: .95;
}

.uvq09-ref .tx {
  display: grid;
  flex: 1;
  gap: .12em;
  min-width: 0;
}

.uvq09-ref .tx b {
  font-size: .95em;
}

.uvq09-ref small {
  font-size: .72em;
  color: rgba(240,253,244,.78);
}

.uvq09-ref .dt {
  display: none;
}

.uvq09-ref .tt:has([aria-pressed="true"]) .dt {
  display: block;
}

@keyframes uvq09-ref-c {
  0% {
    opacity: 0;
    transform: translateY(2.2em) rotate(-25deg);
  }
  60% {
    opacity: 1;
    transform: translateY(-.25em) rotate(-4deg);
  }
  80% {
    transform: rotate(-9deg);
  }
  100% {
    opacity: 1;
    transform: rotate(-7deg);
  }
}

@keyframes uvq09-ref-w {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq09-ref,.uvq09-ref *,.uvq09-ref *::before,.uvq09-ref *::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 t=el.querySelector(".tt"),f=el.querySelector(".fire");let tm=[];const clr=()=>{tm.forEach(clearTimeout);tm=[]};const later=(fn,ms)=>tm.push(setTimeout(fn,ms));
const show=()=>{clr();t.classList.remove("in","out");void t.offsetWidth;later(()=>{t.classList.add("in");c.setAttribute('aria-pressed','false')},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();const c=t.querySelector(".cd");c.addEventListener("click",()=>c.setAttribute("aria-pressed",c.getAttribute("aria-pressed")==="true"?"false":"true"));return clr
}

export default function ToastRefereeCard() {
  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": "#facc15",
          "--c2": "#15803d",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq09-ref"><button type="button" className="fire">Show again</button><div className="tt" role="status"><span className="ws" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M3.5 12.5a5 5 0 0 0 9.6 1.9l7.4-1.6V9.2H9.8" /><path d="M9.8 9.2V6.8h4.5v2.4" /><circle cx="8.5" cy="12.5" r="1.4" /></svg><i></i><i></i><i></i></span><button type="button" className="cd" aria-pressed="false" aria-label="Show the booked player"><span className="fc fr"></span><span className="fc bk"><b>8</b><small>Pedri</small></span></button><span className="tx"><b>Yellow card</b><small>Minute 54 · tactical foul</small><small className="dt">Pedri, number 8. One more and he is off</small></span></div></div>
      </div>
    </>
  );
}
```

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