# Quake-style drop-down console

> A text console that drops from the top with the backquote key, keeps a command history and answers a few commands.

- Category: [Overlays](https://library.aimran.es/components/overlays)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-ov-quake-console
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Old shooters hid their console behind the key left of 1, and this overlay brings it back for web apps. The panel slides down over the top two thirds with scanlines and amber monospace text, the log scrolls as you type and the arrow keys walk through the history. Good for debug panels, admin tools and playful developer pages.

Use the two colors for the amber text and the dark glass, and rename the console with the text field. Add your own answers inside the hidden library list, and Escape or the same key fold it away again.

## Code

### HTML

```html
<div class="uvq13-qk"><div class="pg" aria-hidden="true"><i class="h"></i><i></i><i></i><i></i><i></i><i class="s"></i></div><button type="button" class="fire" aria-haspopup="dialog" aria-keyshortcuts="Backquote"><kbd>º</kbd><span>Console</span></button><p class="hn">Press the key left of 1 to open or close the console</p><div class="cn" role="dialog" aria-modal="true" aria-label="Console"><b class="tt" aria-hidden="true">Consola · v27</b><div class="lg" role="log" aria-live="polite"><p class="sys">AIMRAN 27.0.1</p><p>Type help to see the commands</p></div><label class="ln"><span aria-hidden="true">]</span><input aria-label="Command" autocomplete="off" spellcheck="false"></label><div class="lib" hidden><p data-c="help">Commands: help, clear, god, noclip, fps, quit</p><p data-c="god">God mode on</p><p data-c="noclip">Walk through walls: yes</p><p data-c="fps">125 frames per second</p><p data-c="?">Unknown command</p></div></div></div>
```

### CSS

```css
.uvq13-qk {
  --c1: #f5a524;
  --c2: #1a120c;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq13-qk {
  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: 22em;
  height: 18em;
  border-radius: 1.2em;
  overflow: hidden;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-qk .pg {
  position: absolute;
  inset: 0;
  padding: 1.2em;
  display: grid;
  align-content: start;
  gap: .55em;
}

.uvq13-qk .pg i {
  height: .6em;
  border-radius: 1em;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
}

.uvq13-qk .pg .h {
  width: 45%;
  height: 1em;
  margin-bottom: .4em;
  background: color-mix(in srgb,var(--fg) 12%,transparent);
}

.uvq13-qk .pg .s {
  width: 60%;
}

.uvq13-qk .scr {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(10,12,20,.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-qk.open .scr {
  opacity: 1;
  pointer-events: auto;
}

.uvq13-qk .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  right: 1em;
  top: 1em;
  z-index: 1;
  padding: .55em .95em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 650;
  color: var(--bg);
  background: var(--fg);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-qk .fire:active {
  transform: scale(.96);
}

.uvq13-qk button:focus-visible,.uvq13-qk a:focus-visible,.uvq13-qk input:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq13-qk .fire {
  display: flex;
  align-items: center;
  gap: .5em;
}

.uvq13-qk .fire kbd {
  font: 700 .9em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  padding: .2em .4em;
  border-radius: .3em;
  background: color-mix(in srgb,var(--bg) 22%,transparent);
}

.uvq13-qk .hn {
  position: absolute;
  left: 1.2em;
  right: 1.2em;
  bottom: 1em;
  margin: 0;
  font-size: .74em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-qk.god .pg i {
  background: color-mix(in srgb,var(--c1) 45%,transparent);
}

.uvq13-qk .cn {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 5;
  height: 66%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: .8em 1em .6em;
  color: var(--c1);
  font: 500 .72em/1.5 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  background: repeating-linear-gradient(0deg,rgba(0,0,0,.28) 0 1px,transparent 1px 3px),radial-gradient(130% 100% at 50% 0,color-mix(in srgb,var(--c1) 18%,var(--c2)),var(--c2) 70%);
  border-bottom: 2px solid var(--c1);
  box-shadow: 0 .8em 2em -.4em rgba(0,0,0,.55);
  transform: translateY(-104%);
  transition: transform calc(0.32s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-qk.open .cn {
  transform: none;
}

.uvq13-qk .tt {
  position: absolute;
  right: 1em;
  top: .8em;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .45;
}

.uvq13-qk .lg {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.uvq13-qk .lg p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: 0 0 .5em color-mix(in srgb,var(--c1) 55%,transparent);
}

.uvq13-qk .lg .sys {
  opacity: .55;
}

.uvq13-qk .lg .me {
  color: color-mix(in srgb,var(--c1) 45%,#fff);
}

.uvq13-qk .ln {
  display: flex;
  align-items: center;
  gap: .5em;
  margin-top: .3em;
  padding-top: .45em;
  border-top: 1px solid color-mix(in srgb,var(--c1) 30%,transparent);
  cursor: text;
}

.uvq13-qk .ln input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: #fff7e6;
  caret-color: var(--c1);
}

.uvq13-qk .ln:focus-within {
  border-top-color: var(--c1);
}

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

### JavaScript

```js
document.querySelectorAll(".uvq13-qk").forEach(el => {
  const fire=el.querySelector(".fire"),scr=el.querySelector(".scr"),pnl=el.querySelector(".cn");let tms=[];const later=(f,ms)=>tms.push(setTimeout(f,ms));
const foc=(t,ms)=>later(()=>{const n=typeof t==="string"?el.querySelector(t):t;n&&n.focus({preventScroll:true})},ms||0);
const isOpen=()=>el.classList.contains("open");
const open=u=>{if(isOpen())return;el.classList.add("open");pnl.inert=false;fire&&fire.setAttribute("aria-expanded","true");u?foc(inp,360):demo()};
const close=()=>{if(!isOpen())return;el.classList.remove("open");pnl.inert=true;fire&&fire.setAttribute("aria-expanded","false");inp.blur();fire&&fire.focus({preventScroll:true})};
fire&&fire.addEventListener("click",()=>isOpen()?close():open(true));scr&&scr.addEventListener("click",()=>close());
el.addEventListener("keydown",e=>{if(!isOpen())return;if(e.key==="Escape"){e.preventDefault();e.stopPropagation();close()}else if(e.key==="Tab"){const f=[...pnl.querySelectorAll('button:not([disabled]),input:not([disabled]),textarea,a[href],[tabindex="0"]')].filter(x=>x.getClientRects().length);if(!f.length){e.preventDefault();return}const a=f[0],z=f[f.length-1],ac=document.activeElement;if(e.shiftKey&&(ac===a||!pnl.contains(ac))){e.preventDefault();z.focus()}else if(!e.shiftKey&&(ac===z||!pnl.contains(ac))){e.preventDefault();a.focus()}}});
pnl.inert=true;later(()=>open(false),500);const inp=el.querySelector(".cn input"),lg=el.querySelector(".lg"),lib=el.querySelector(".lib");const hist=[];let hi=0,shown=false;
const say=(t,c)=>{const p=document.createElement("p");p.textContent=t;if(c)p.className=c;lg.appendChild(p);while(lg.children.length>40)lg.firstElementChild.remove();lg.scrollTop=lg.scrollHeight};
const run=v=>{const c=v.trim().toLowerCase();if(!c)return;say("] "+v.trim(),"me");hist.push(v.trim());hi=hist.length;if(c==="clear"){lg.textContent="";return}if(c==="quit"||c==="exit"){close();return}if(c==="god")el.classList.toggle("god");const m=[...lib.children].find(p=>p.dataset.c===c)||lib.querySelector("[data-c='?']");say(m.textContent+(m.dataset.c==="?"?": "+c:""))};
const demo=()=>{if(shown)return;shown=true;let i=0;const s="help";const ty=()=>{if(i<s.length){inp.value+=s[i++];later(ty,110)}else later(()=>{run(inp.value);inp.value=""},260)};later(ty,700)};
inp.addEventListener("keydown",e=>{if(e.key==="Enter"){e.preventDefault();run(inp.value);inp.value=""}else if(e.key==="ArrowUp"&&hist.length){e.preventDefault();hi=Math.max(0,hi-1);inp.value=hist[hi]}else if(e.key==="ArrowDown"&&hist.length){e.preventDefault();hi=Math.min(hist.length,hi+1);inp.value=hist[hi]||""}});
el.addEventListener("keydown",e=>{if(e.code==="Backquote"||e.key==="º"||e.key==="ª"){e.preventDefault();isOpen()?close():open(true)}});return()=>tms.forEach(clearTimeout)
});
```

### 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 = `
.uvq13-qk {
  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: 22em;
  height: 18em;
  border-radius: 1.2em;
  overflow: hidden;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-qk .pg {
  position: absolute;
  inset: 0;
  padding: 1.2em;
  display: grid;
  align-content: start;
  gap: .55em;
}

.uvq13-qk .pg i {
  height: .6em;
  border-radius: 1em;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
}

.uvq13-qk .pg .h {
  width: 45%;
  height: 1em;
  margin-bottom: .4em;
  background: color-mix(in srgb,var(--fg) 12%,transparent);
}

.uvq13-qk .pg .s {
  width: 60%;
}

.uvq13-qk .scr {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(10,12,20,.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-qk.open .scr {
  opacity: 1;
  pointer-events: auto;
}

.uvq13-qk .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  right: 1em;
  top: 1em;
  z-index: 1;
  padding: .55em .95em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 650;
  color: var(--bg);
  background: var(--fg);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-qk .fire:active {
  transform: scale(.96);
}

.uvq13-qk button:focus-visible,.uvq13-qk a:focus-visible,.uvq13-qk input:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq13-qk .fire {
  display: flex;
  align-items: center;
  gap: .5em;
}

.uvq13-qk .fire kbd {
  font: 700 .9em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  padding: .2em .4em;
  border-radius: .3em;
  background: color-mix(in srgb,var(--bg) 22%,transparent);
}

.uvq13-qk .hn {
  position: absolute;
  left: 1.2em;
  right: 1.2em;
  bottom: 1em;
  margin: 0;
  font-size: .74em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-qk.god .pg i {
  background: color-mix(in srgb,var(--c1) 45%,transparent);
}

.uvq13-qk .cn {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 5;
  height: 66%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: .8em 1em .6em;
  color: var(--c1);
  font: 500 .72em/1.5 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  background: repeating-linear-gradient(0deg,rgba(0,0,0,.28) 0 1px,transparent 1px 3px),radial-gradient(130% 100% at 50% 0,color-mix(in srgb,var(--c1) 18%,var(--c2)),var(--c2) 70%);
  border-bottom: 2px solid var(--c1);
  box-shadow: 0 .8em 2em -.4em rgba(0,0,0,.55);
  transform: translateY(-104%);
  transition: transform calc(0.32s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-qk.open .cn {
  transform: none;
}

.uvq13-qk .tt {
  position: absolute;
  right: 1em;
  top: .8em;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .45;
}

.uvq13-qk .lg {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.uvq13-qk .lg p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: 0 0 .5em color-mix(in srgb,var(--c1) 55%,transparent);
}

.uvq13-qk .lg .sys {
  opacity: .55;
}

.uvq13-qk .lg .me {
  color: color-mix(in srgb,var(--c1) 45%,#fff);
}

.uvq13-qk .ln {
  display: flex;
  align-items: center;
  gap: .5em;
  margin-top: .3em;
  padding-top: .45em;
  border-top: 1px solid color-mix(in srgb,var(--c1) 30%,transparent);
  cursor: text;
}

.uvq13-qk .ln input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: #fff7e6;
  caret-color: var(--c1);
}

.uvq13-qk .ln:focus-within {
  border-top-color: var(--c1);
}

@media (prefers-reduced-motion:reduce) {
  .uvq13-qk,.uvq13-qk *,.uvq13-qk *::before,.uvq13-qk *::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 fire=el.querySelector(".fire"),scr=el.querySelector(".scr"),pnl=el.querySelector(".cn");let tms=[];const later=(f,ms)=>tms.push(setTimeout(f,ms));
const foc=(t,ms)=>later(()=>{const n=typeof t==="string"?el.querySelector(t):t;n&&n.focus({preventScroll:true})},ms||0);
const isOpen=()=>el.classList.contains("open");
const open=u=>{if(isOpen())return;el.classList.add("open");pnl.inert=false;fire&&fire.setAttribute("aria-expanded","true");u?foc(inp,360):demo()};
const close=()=>{if(!isOpen())return;el.classList.remove("open");pnl.inert=true;fire&&fire.setAttribute("aria-expanded","false");inp.blur();fire&&fire.focus({preventScroll:true})};
fire&&fire.addEventListener("click",()=>isOpen()?close():open(true));scr&&scr.addEventListener("click",()=>close());
el.addEventListener("keydown",e=>{if(!isOpen())return;if(e.key==="Escape"){e.preventDefault();e.stopPropagation();close()}else if(e.key==="Tab"){const f=[...pnl.querySelectorAll('button:not([disabled]),input:not([disabled]),textarea,a[href],[tabindex="0"]')].filter(x=>x.getClientRects().length);if(!f.length){e.preventDefault();return}const a=f[0],z=f[f.length-1],ac=document.activeElement;if(e.shiftKey&&(ac===a||!pnl.contains(ac))){e.preventDefault();z.focus()}else if(!e.shiftKey&&(ac===z||!pnl.contains(ac))){e.preventDefault();a.focus()}}});
pnl.inert=true;later(()=>open(false),500);const inp=el.querySelector(".cn input"),lg=el.querySelector(".lg"),lib=el.querySelector(".lib");const hist=[];let hi=0,shown=false;
const say=(t,c)=>{const p=document.createElement("p");p.textContent=t;if(c)p.className=c;lg.appendChild(p);while(lg.children.length>40)lg.firstElementChild.remove();lg.scrollTop=lg.scrollHeight};
const run=v=>{const c=v.trim().toLowerCase();if(!c)return;say("] "+v.trim(),"me");hist.push(v.trim());hi=hist.length;if(c==="clear"){lg.textContent="";return}if(c==="quit"||c==="exit"){close();return}if(c==="god")el.classList.toggle("god");const m=[...lib.children].find(p=>p.dataset.c===c)||lib.querySelector("[data-c='?']");say(m.textContent+(m.dataset.c==="?"?": "+c:""))};
const demo=()=>{if(shown)return;shown=true;let i=0;const s="help";const ty=()=>{if(i<s.length){inp.value+=s[i++];later(ty,110)}else later(()=>{run(inp.value);inp.value=""},260)};later(ty,700)};
inp.addEventListener("keydown",e=>{if(e.key==="Enter"){e.preventDefault();run(inp.value);inp.value=""}else if(e.key==="ArrowUp"&&hist.length){e.preventDefault();hi=Math.max(0,hi-1);inp.value=hist[hi]}else if(e.key==="ArrowDown"&&hist.length){e.preventDefault();hi=Math.min(hist.length,hi+1);inp.value=hist[hi]||""}});
el.addEventListener("keydown",e=>{if(e.code==="Backquote"||e.key==="º"||e.key==="ª"){e.preventDefault();isOpen()?close():open(true)}});return()=>tms.forEach(clearTimeout)
}

export default function OvQuakeConsole() {
  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": "#f5a524",
          "--c2": "#1a120c",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq13-qk"><div className="pg" aria-hidden="true"><i className="h"></i><i></i><i></i><i></i><i></i><i className="s"></i></div><button type="button" className="fire" aria-haspopup="dialog" aria-keyshortcuts="Backquote"><kbd>º</kbd><span>Console</span></button><p className="hn">Press the key left of 1 to open or close the console</p><div className="cn" role="dialog" aria-modal="true" aria-label="Console"><b className="tt" aria-hidden="true">Consola · v27</b><div className="lg" role="log" aria-live="polite"><p className="sys">AIMRAN 27.0.1</p><p>Type help to see the commands</p></div><label className="ln"><span aria-hidden="true">]</span><input aria-label="Command" autoComplete="off" spellCheck="false" /></label><div className="lib" hidden={true}><p data-c="help">Commands: help, clear, god, noclip, fps, quit</p><p data-c="god">God mode on</p><p data-c="noclip">Walk through walls: yes</p><p data-c="fps">125 frames per second</p><p data-c="?">Unknown command</p></div></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 “Quake-style drop-down console” block (Overlays) from AIMRAN Library to my project.

## What it is
A text console that drops from the top with the backquote key, keeps a command history and answers a few commands.

## Chosen settings
- Main color: #f5a524
- Secondary color: #1a120c
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Consola"

## 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 = `
.uvq13-qk {
  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: 22em;
  height: 18em;
  border-radius: 1.2em;
  overflow: hidden;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 9%,transparent);
}

.uvq13-qk .pg {
  position: absolute;
  inset: 0;
  padding: 1.2em;
  display: grid;
  align-content: start;
  gap: .55em;
}

.uvq13-qk .pg i {
  height: .6em;
  border-radius: 1em;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
}

.uvq13-qk .pg .h {
  width: 45%;
  height: 1em;
  margin-bottom: .4em;
  background: color-mix(in srgb,var(--fg) 12%,transparent);
}

.uvq13-qk .pg .s {
  width: 60%;
}

.uvq13-qk .scr {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(10,12,20,.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-qk.open .scr {
  opacity: 1;
  pointer-events: auto;
}

.uvq13-qk .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  right: 1em;
  top: 1em;
  z-index: 1;
  padding: .55em .95em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 650;
  color: var(--bg);
  background: var(--fg);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-qk .fire:active {
  transform: scale(.96);
}

.uvq13-qk button:focus-visible,.uvq13-qk a:focus-visible,.uvq13-qk input:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq13-qk .fire {
  display: flex;
  align-items: center;
  gap: .5em;
}

.uvq13-qk .fire kbd {
  font: 700 .9em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  padding: .2em .4em;
  border-radius: .3em;
  background: color-mix(in srgb,var(--bg) 22%,transparent);
}

.uvq13-qk .hn {
  position: absolute;
  left: 1.2em;
  right: 1.2em;
  bottom: 1em;
  margin: 0;
  font-size: .74em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq13-qk.god .pg i {
  background: color-mix(in srgb,var(--c1) 45%,transparent);
}

.uvq13-qk .cn {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 5;
  height: 66%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: .8em 1em .6em;
  color: var(--c1);
  font: 500 .72em/1.5 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  background: repeating-linear-gradient(0deg,rgba(0,0,0,.28) 0 1px,transparent 1px 3px),radial-gradient(130% 100% at 50% 0,color-mix(in srgb,var(--c1) 18%,var(--c2)),var(--c2) 70%);
  border-bottom: 2px solid var(--c1);
  box-shadow: 0 .8em 2em -.4em rgba(0,0,0,.55);
  transform: translateY(-104%);
  transition: transform calc(0.32s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq13-qk.open .cn {
  transform: none;
}

.uvq13-qk .tt {
  position: absolute;
  right: 1em;
  top: .8em;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .45;
}

.uvq13-qk .lg {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.uvq13-qk .lg p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: 0 0 .5em color-mix(in srgb,var(--c1) 55%,transparent);
}

.uvq13-qk .lg .sys {
  opacity: .55;
}

.uvq13-qk .lg .me {
  color: color-mix(in srgb,var(--c1) 45%,#fff);
}

.uvq13-qk .ln {
  display: flex;
  align-items: center;
  gap: .5em;
  margin-top: .3em;
  padding-top: .45em;
  border-top: 1px solid color-mix(in srgb,var(--c1) 30%,transparent);
  cursor: text;
}

.uvq13-qk .ln input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: #fff7e6;
  caret-color: var(--c1);
}

.uvq13-qk .ln:focus-within {
  border-top-color: var(--c1);
}

@media (prefers-reduced-motion:reduce) {
  .uvq13-qk,.uvq13-qk *,.uvq13-qk *::before,.uvq13-qk *::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 fire=el.querySelector(".fire"),scr=el.querySelector(".scr"),pnl=el.querySelector(".cn");let tms=[];const later=(f,ms)=>tms.push(setTimeout(f,ms));
const foc=(t,ms)=>later(()=>{const n=typeof t==="string"?el.querySelector(t):t;n&&n.focus({preventScroll:true})},ms||0);
const isOpen=()=>el.classList.contains("open");
const open=u=>{if(isOpen())return;el.classList.add("open");pnl.inert=false;fire&&fire.setAttribute("aria-expanded","true");u?foc(inp,360):demo()};
const close=()=>{if(!isOpen())return;el.classList.remove("open");pnl.inert=true;fire&&fire.setAttribute("aria-expanded","false");inp.blur();fire&&fire.focus({preventScroll:true})};
fire&&fire.addEventListener("click",()=>isOpen()?close():open(true));scr&&scr.addEventListener("click",()=>close());
el.addEventListener("keydown",e=>{if(!isOpen())return;if(e.key==="Escape"){e.preventDefault();e.stopPropagation();close()}else if(e.key==="Tab"){const f=[...pnl.querySelectorAll('button:not([disabled]),input:not([disabled]),textarea,a[href],[tabindex="0"]')].filter(x=>x.getClientRects().length);if(!f.length){e.preventDefault();return}const a=f[0],z=f[f.length-1],ac=document.activeElement;if(e.shiftKey&&(ac===a||!pnl.contains(ac))){e.preventDefault();z.focus()}else if(!e.shiftKey&&(ac===z||!pnl.contains(ac))){e.preventDefault();a.focus()}}});
pnl.inert=true;later(()=>open(false),500);const inp=el.querySelector(".cn input"),lg=el.querySelector(".lg"),lib=el.querySelector(".lib");const hist=[];let hi=0,shown=false;
const say=(t,c)=>{const p=document.createElement("p");p.textContent=t;if(c)p.className=c;lg.appendChild(p);while(lg.children.length>40)lg.firstElementChild.remove();lg.scrollTop=lg.scrollHeight};
const run=v=>{const c=v.trim().toLowerCase();if(!c)return;say("] "+v.trim(),"me");hist.push(v.trim());hi=hist.length;if(c==="clear"){lg.textContent="";return}if(c==="quit"||c==="exit"){close();return}if(c==="god")el.classList.toggle("god");const m=[...lib.children].find(p=>p.dataset.c===c)||lib.querySelector("[data-c='?']");say(m.textContent+(m.dataset.c==="?"?": "+c:""))};
const demo=()=>{if(shown)return;shown=true;let i=0;const s="help";const ty=()=>{if(i<s.length){inp.value+=s[i++];later(ty,110)}else later(()=>{run(inp.value);inp.value=""},260)};later(ty,700)};
inp.addEventListener("keydown",e=>{if(e.key==="Enter"){e.preventDefault();run(inp.value);inp.value=""}else if(e.key==="ArrowUp"&&hist.length){e.preventDefault();hi=Math.max(0,hi-1);inp.value=hist[hi]}else if(e.key==="ArrowDown"&&hist.length){e.preventDefault();hi=Math.min(hist.length,hi+1);inp.value=hist[hi]||""}});
el.addEventListener("keydown",e=>{if(e.code==="Backquote"||e.key==="º"||e.key==="ª"){e.preventDefault();isOpen()?close():open(true)}});return()=>tms.forEach(clearTimeout)
}

export default function OvQuakeConsole() {
  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": "#f5a524",
          "--c2": "#1a120c",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq13-qk"><div className="pg" aria-hidden="true"><i className="h"></i><i></i><i></i><i></i><i></i><i className="s"></i></div><button type="button" className="fire" aria-haspopup="dialog" aria-keyshortcuts="Backquote"><kbd>º</kbd><span>Console</span></button><p className="hn">Press the key left of 1 to open or close the console</p><div className="cn" role="dialog" aria-modal="true" aria-label="Console"><b className="tt" aria-hidden="true">Consola · v27</b><div className="lg" role="log" aria-live="polite"><p className="sys">AIMRAN 27.0.1</p><p>Type help to see the commands</p></div><label className="ln"><span aria-hidden="true">]</span><input aria-label="Command" autoComplete="off" spellCheck="false" /></label><div className="lib" hidden={true}><p data-c="help">Commands: help, clear, god, noclip, fps, quit</p><p data-c="god">God mode on</p><p data-c="noclip">Walk through walls: yes</p><p data-c="fps">125 frames per second</p><p data-c="?">Unknown command</p></div></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.
````
