:root {
  --bg: #111014;
  --panel: #1b1a20;
  --line: #2e2c35;
  --text: #f1ece2;
  --muted: #9d97a6;
  --red: #e63b2e;
  --gold: #f5c542;
  --green: #6fd08c;
  --blue: #5aa8ff;
  --pixel: "Pixelify Sans", monospace;
  --body: "Rubik", system-ui, sans-serif;
  --display: "Rubik", system-ui, sans-serif;
  /* Tipografía del nombre (ver tipografias.html) */
  --name-font: "Chewy", "Rubik", sans-serif;
  --name-weight: 400;
  --name-size: 11vw;
  --name-track: .01em;
  --name-lh: 1; /* deja sitio al acento de la Á */
  --gut: clamp(16px, 4vw, 56px);
  --notch: polygon(0 6px, 6px 6px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 6px), 0 calc(100% - 6px));
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 64px; }
body { background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.wrap { max-width: 1160px; margin: 0 auto; padding-inline: var(--gut); }
.px { font-family: var(--pixel); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--gold); color: var(--bg); padding: 8px 12px; }
.skip:focus { left: 8px; }

/* BOTONES (esquinas recortadas tipo pixel) */
.btn {
  display: inline-block; font-family: var(--body); font-weight: 600; font-size: 16px; padding: 12px 22px;
  background: var(--red); color: #fff; clip-path: var(--notch);
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.28); transition: transform .1s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(0,0,0,.28); }
.btn--ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--text); color: var(--text); }

/* NAV */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(17,16,20,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.logo svg { width: 15px; height: 24px; fill: var(--text); }
.logo svg .r, .boot__logo .r { fill: var(--red); }
.nav ul { display: flex; gap: 28px; list-style: none; font-weight: 500; font-size: 15px; color: var(--muted); }
.nav ul a { transition: color .15s; white-space: nowrap; }
@media (max-width: 1160px) { .nav ul { gap: 18px; } }
.nav ul a:hover, .nav ul a.is-on { color: var(--text); }
.nav ul a::before { content: "▶ "; color: var(--red); opacity: 0; }
.nav ul a:hover::before, .nav ul a.is-on::before { opacity: 1; }
.nav__r { display: flex; align-items: center; gap: 10px; }
.lang { display: flex; border: 2px solid var(--line); font-family: var(--pixel); font-size: 14px; }
.lang button { padding: 3px 9px; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.burger { display: none; width: 40px; height: 40px; position: relative; }
.burger span { position: absolute; left: 10px; right: 10px; height: 3px; background: var(--text); }
.burger span:nth-child(1) { top: 12px; } .burger span:nth-child(2) { top: 19px; } .burger span:nth-child(3) { top: 26px; }

/* TITLE */
.title { position: relative; min-height: calc(100svh - 64px); display: grid; place-items: center; text-align: center; overflow: hidden; padding: 64px 0; }
.title::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; opacity: .35;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
}
.title > * { position: relative; }
.coins { position: absolute; inset: 0; }
.coins i { position: absolute; width: 20px; height: 20px; background: var(--gold); box-shadow: inset -4px -4px 0 #c99a1f; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-12px); } }
.hello { display: inline-flex; align-items: center; gap: 10px; font-size: clamp(17px, 1.8vw, 20px); color: var(--muted); }
.hello [data-i18n-html] span { color: var(--gold); }
.title h1 { font-family: var(--name-font); font-weight: var(--name-weight); font-size: clamp(56px, var(--name-size), 168px); line-height: var(--name-lh); letter-spacing: var(--name-track); margin: 14px 0 18px; }
.title h1 .acc { color: var(--red); }
.name-top { position: relative; }
/* una sola chispa dorada que titila junto a "Tony" */
.twinkle { position: absolute; right: -.32em; top: .02em; width: .24em; height: .24em; fill: var(--gold); animation: twinkle 2.2s ease-in-out infinite; }
.role { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; font-size: clamp(15px, 1.5vw, 18px); color: var(--muted); }
.role__main { color: var(--text); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.role__sep { width: 6px; height: 6px; background: var(--red); }
.role__boost { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.role__boost b { color: var(--gold); font-weight: 600; }
/* chispa pixel que titila */
.spark { position: relative; width: 12px; height: 12px; margin-left: 2px; animation: twinkle 1.6s steps(2) infinite; }
.spark::before, .spark::after { content: ""; position: absolute; background: var(--gold); }
.spark::before { left: 4px; top: 0; width: 4px; height: 12px; }
.spark::after { left: 0; top: 4px; width: 12px; height: 4px; }
@keyframes twinkle { 50% { transform: scale(.55) rotate(45deg); opacity: .6; } }
.start { margin-top: 44px; font-family: var(--pixel); font-size: 22px; color: var(--gold); animation: blink 1.1s steps(2, start) infinite; display: inline-block; }
@keyframes blink { to { visibility: hidden; } }
.title .actions { margin-top: 26px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* SECTIONS */
section { padding: clamp(72px, 10vw, 128px) 0; }
section.tight { padding-top: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 36px; }
.head small { font-weight: 600; font-size: 13px; letter-spacing: .12em; color: var(--red); display: block; margin-bottom: 6px; }
.head h2 { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 5vw, 58px); line-height: 1; letter-spacing: -.03em; }
.head p { color: var(--muted); max-width: 380px; }

/* LEVELS */
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.level { background: var(--panel); border: 2px solid var(--line); display: flex; flex-direction: column; text-align: left; transition: border-color .15s, transform .15s; width: 100%; }
.level:hover, .level:focus-visible { border-color: var(--red); transform: translateY(-4px); outline: none; }
.level:hover .cover img { transform: scale(1.04); }
/* Todas las portadas del mismo tamaño: 3 columnas, sin tarjetas dobles */
.level--big { grid-column: auto; }
.cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.level .cover { aspect-ratio: 16 / 10; flex: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.cover .lv, .cover .wip { position: absolute; top: 12px; font-family: var(--pixel); font-size: 15px; padding: 2px 10px; }
.cover .lv { left: 12px; background: var(--bg); }
.cover .wip { right: 12px; background: var(--gold); color: var(--bg); }
.cover .play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(17,16,20,.55); font-family: var(--pixel); font-size: 22px; opacity: 0; transition: opacity .2s; }
.level:hover .play, .level:focus-visible .play { opacity: 1; }
.level .info { padding: 18px 20px 20px; }
.level h3 { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; }
.level .desc { color: var(--muted); font-size: 15px; margin: 6px 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 13px; padding: 3px 9px; border: 1px solid var(--line); color: var(--muted); }
.chips b { color: var(--text); font-weight: 500; }
/* En cada fila, título, texto, etiquetas y logro empiezan a la misma altura */
@supports (grid-template-rows: subgrid) {
  .levels { row-gap: 0; }
  .level { display: grid; grid-row: span 5; grid-template-rows: subgrid; margin-bottom: 20px; }
  .level .info { display: grid; grid-row: span 4; grid-template-rows: subgrid; align-items: start; }
}
.ach { margin-top: 14px; display: flex; gap: 10px; align-items: baseline; background: #24211a; border: 1px solid #4a3f1e; padding: 8px 12px; font-size: 14px; }
.ach i { font-style: normal; font-family: var(--pixel); color: var(--gold); white-space: nowrap; }

/* QUESTS */
.quests { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.quest { background: var(--panel); border: 2px solid var(--line); }
.quest .cover { aspect-ratio: 4 / 3; }
.quest .info { padding: 14px 16px 16px; }
.quest small { font-weight: 600; letter-spacing: .1em; color: var(--red); font-size: 12px; }
.quest--special { border-color: #4a3f1e; }
.quest--special small { color: var(--gold); }
.quest h3 { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.1; margin: 2px 0 6px; }
.quest p { color: var(--muted); font-size: 14px; }

/* CHARACTER SHEET */
.sheet { display: grid; grid-template-columns: 320px 1fr; gap: 36px; background: var(--panel); border: 2px solid var(--line); padding: clamp(20px, 3vw, 36px); }
.avatar { position: relative; aspect-ratio: 4 / 5; transform: perspective(700px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)); transition: transform .25s ease-out; }
.avatar .name { position: absolute; left: 10%; right: 10%; bottom: 0; background: var(--bg); border: 2px solid var(--text); padding: 6px 12px; font-family: var(--pixel); font-size: 18px; display: flex; justify-content: space-between; }
.avatar .name span { color: var(--gold); }
/* Contadores bajo la foto: juegos, game jams, idiomas */
.stats { margin-top: 18px; display: grid; gap: 8px; font-family: var(--pixel); font-size: 16px; }
.stats div { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 6px; border-bottom: 2px dashed var(--line); }
.stats dd { color: var(--gold); font-size: 22px; line-height: 1; }
.sheet h3 { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.05; letter-spacing: -.025em; }
.bio { color: var(--muted); margin: 14px 0 26px; max-width: 62ch; }
.bio b { color: var(--text); font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.label { font-weight: 600; font-size: 12px; letter-spacing: .12em; color: var(--red); margin-bottom: 10px; }
.skills { list-style: none; display: grid; gap: 9px; }
.skills li { display: grid; grid-template-columns: 1fr auto; gap: 10px; font-size: 15px; }
.pips { display: flex; gap: 3px; align-items: center; }
.pips i { width: 10px; height: 10px; background: var(--line); }
.pips i.on { background: var(--green); }
.langs { font-size: 15px; color: var(--muted); }
.inv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.inv span { aspect-ratio: 1; border: 2px solid var(--line); background: #000; display: grid; place-items: center; text-align: center; font-size: 11.5px; padding: 4px; line-height: 1.15; color: var(--muted); transition: border-color .15s, color .15s; }
.inv span:hover { border-color: var(--gold); color: var(--text); }

/* CONTACT */
.contact { text-align: center; }
.contact .box { border: 2px dashed var(--line); padding: clamp(40px, 7vw, 88px) var(--gut); }
.contact h2 { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 7vw, 88px); line-height: .92; letter-spacing: -.035em; }
.contact h2 span { color: var(--red); }
.contact p { color: var(--muted); margin: 16px auto 28px; max-width: 460px; }
.contact .actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.contact__mails { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 22px auto 0 !important; font-size: 15px; }
.contact__mails .link { color: var(--text); background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; }
footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer .px { color: var(--text); }
footer a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
footer a:hover { color: var(--text); text-decoration-color: var(--red); }

/* MODAL */
.modal { margin: auto; width: min(980px, calc(100% - 32px)); max-height: calc(100svh - 32px); background: var(--panel); color: var(--text); border: 2px solid var(--text); padding: 0; display: none; grid-template-columns: 1.25fr 1fr; overflow: auto; }
.modal[open] { display: grid; animation: pop .18s steps(3); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal::backdrop { background: rgba(8,8,10,.8); backdrop-filter: blur(3px); }
.modal__close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; background: var(--bg); border: 2px solid var(--text); font-size: 16px; }
.modal__close:hover { background: var(--red); }
.modal__gallery { background: #000; display: flex; flex-direction: column; justify-content: center; }
.modal__gallery > img { width: 100%; height: auto; max-height: 64svh; object-fit: contain; background: #000; }
.modal__thumbs { display: flex; gap: 6px; padding: 8px; }
.modal__thumbs:empty { display: none; }
.modal__thumbs button { width: 64px; height: 64px; border: 2px solid var(--line); overflow: hidden; }
.modal__thumbs button[aria-current="true"] { border-color: var(--gold); }
.modal__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.modal__body { padding: 28px 28px 30px; }
.modal__body small { color: var(--red); font-size: 15px; }
.modal__body h3 { font-family: var(--display); font-weight: 800; font-size: 36px; letter-spacing: -.025em; line-height: 1.05; margin: 4px 48px 10px 0; }
.modal__body > p { color: var(--muted); }
.modal dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 22px 0; font-size: 15px; }
.modal dt { color: var(--muted); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; padding-top: 2px; }
.modal #m-ach .ach { margin-top: 8px; }

/* TOAST (logro desbloqueado) */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, calc(100% + 40px)); visibility: hidden; transition: transform .3s steps(4), visibility 0s .3s; display: flex; gap: 12px; align-items: center; background: var(--bg); border: 2px solid var(--gold); padding: 10px 16px; font-size: 14px; width: max-content; max-width: calc(100% - 32px); }
.toast.is-on { transform: translate(-50%, 0); visibility: visible; transition: transform .3s steps(4); }
.toast b { font-family: var(--pixel); color: var(--gold); font-weight: 400; display: block; font-size: 15px; }
.toast .ico { font-size: 26px; }
.toast__quote { display: block; font-style: italic; color: var(--muted); margin-top: 2px; }
.pixel-coin { position: fixed; z-index: 49; background: var(--gold); box-shadow: inset -3px -3px 0 #c99a1f, 0 0 0 2px var(--bg); pointer-events: none; }

/* BOOT */
.boot { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-content: center; justify-items: center; gap: 18px; cursor: pointer; transition: opacity .4s steps(4); }
.boot.is-done { opacity: 0; pointer-events: none; }
.boot__logo { width: 70px; height: 112px; fill: var(--text); }
.boot__logo rect { opacity: 0; animation: block .01s forwards; }
.boot__logo .b1 { animation-delay: .15s; } .boot__logo .b2 { animation-delay: .4s; } .boot__logo .b3 { animation-delay: .65s; }
.boot__logo .b4 { animation-delay: .9s; } .boot__logo .b5 { animation-delay: 1.15s; }
@keyframes block { to { opacity: 1; } }
.boot__name { font-weight: 700; font-size: 20px; letter-spacing: .3em; opacity: 0; animation: block .01s 1.35s forwards; }
.boot__bar { width: 160px; height: 12px; border: 2px solid var(--text); }
.boot__bar i { display: block; height: 100%; width: 0; background: var(--gold); animation: load 1.9s steps(10) forwards; }
@keyframes load { to { width: 100%; } }

/* LOGROS */
.trophies__meter { min-width: 220px; }
.trophies__meter p { font-family: var(--pixel); color: var(--gold); font-size: 22px; text-align: right; }
.meter { height: 12px; border: 2px solid var(--text); background: #000; margin-top: 6px; }
.meter i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .6s steps(10); }
/* 14 logros: 7 × 2 en escritorio; con menos columnas la última fila queda centrada */
.trophies__grid { --cols: 7; list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.trophy { flex: 0 0 calc((100% - (var(--cols) - 1) * 10px) / var(--cols)); position: relative; background: var(--panel); border: 2px solid var(--line); padding: 12px 11px 11px; min-height: 112px; min-width: 0; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 4px; }
.trophy__ico { font-size: 24px; line-height: 1; height: 28px; display: flex; align-items: center; }
.trophy h3 { font-size: 14px; font-weight: 700; line-height: 1.2; }
.trophy p { font-size: 12px; color: var(--muted); line-height: 1.35; }
.trophy.is-on { border-color: #4a3f1e; background: linear-gradient(180deg, #24211a, var(--panel)); }
.trophy.is-on h3 { color: var(--gold); }
.trophy:not(.is-on) .trophy__ico { font-family: var(--pixel); font-size: 24px; color: var(--line); }
.trophy:not(.is-on) h3 { color: var(--muted); }
.trophy.is-new { animation: unlock .7s steps(4); }
@keyframes unlock { 30% { transform: scale(1.06); border-color: var(--gold); } }
.trophy__tag { position: absolute; top: 8px; right: 8px; font-family: var(--pixel); font-size: 11px; color: var(--red); }
.trophies__reset { margin-top: 16px; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.trophies__reset:hover { color: var(--text); }


/* POWER-UP CLAUDE AI, INTERESES */
.label--ai { color: var(--gold); }
.pips--ai i.on { background: var(--gold); }
.chips--soft { display: flex; flex-wrap: wrap; gap: 6px; }
.chips--soft span { font-size: 13px; padding: 3px 10px; border: 1px solid var(--line); color: var(--muted); }
.inv span.inv--ai { grid-column: 1 / -1; aspect-ratio: auto; border-color: #4a3f1e; color: var(--gold); background: #24211a; font-weight: 600; font-size: 13px; }

/* REGISTRO DE PARTIDA */
.log { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; }
.saves { list-style: none; display: grid; gap: 10px; }
.save { position: relative; background: var(--panel); border: 2px solid var(--line); padding: 14px 16px 14px 22px; }
.save::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--red); }
.saves#xp-study .save::before { background: var(--gold); }
.save__when { font-family: var(--pixel); font-size: 14px; color: var(--gold); }
.save h3 { font-size: 17px; font-weight: 700; line-height: 1.25; margin-top: 2px; }
.save__where { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.save p:not(.save__where) { font-size: 14px; color: var(--muted); margin-top: 6px; }
.modal__play { margin-top: 16px; }
@media (max-width: 960px) { .log { grid-template-columns: 1fr; } }

/* RETRATO EN PÍXELES (portada) — lo dibuja script.js en un canvas */
.hero-photo { position: absolute !important; right: max(-40px, calc(50% - 700px)); top: 50%; translate: 0 -50%; width: clamp(300px, 38vw, 540px); aspect-ratio: 5 / 6; pointer-events: none; }

/* FOTO "SOBRE MÍ": blanco y negro, zoom lento y glitch por franjas */
.glitch { position: absolute; inset: 0 0 42px; overflow: hidden; background: #000; clip-path: polygon(0 12px, 12px 12px, 12px 0, calc(100% - 12px) 0, calc(100% - 12px) 12px, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 12px calc(100% - 12px), 0 calc(100% - 12px)); }
.glitch img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15); animation: drift 14s ease-in-out infinite alternate; transform-origin: 40% 40%; }
@keyframes drift { from { transform: scale(1.06) translate(0, 0); } to { transform: scale(1.22) translate(-3%, -4%); } }
.glitch i { position: absolute; inset: 0; background: var(--img) center / cover; filter: grayscale(1) contrast(1.6) brightness(1.15); opacity: 0; animation: slice 4.2s steps(1) infinite; }
.glitch i:nth-of-type(1) { clip-path: inset(18% 0 70% 0); }
.glitch i:nth-of-type(2) { clip-path: inset(46% 0 40% 0); animation-delay: .12s; }
.glitch i:nth-of-type(3) { clip-path: inset(72% 0 12% 0); animation-delay: .24s; mix-blend-mode: difference; }
@keyframes slice {
  0%, 84%, 100% { opacity: 0; transform: none; }
  86% { opacity: 1; transform: translateX(-14px); }
  89% { opacity: 1; transform: translateX(18px); }
  92% { opacity: 1; transform: translateX(-6px); }
  95% { opacity: 0; }
}
.avatar:hover .glitch i { animation-duration: .9s; }
.glitch::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(transparent 0 3px, rgba(0,0,0,.18) 3px 4px); }

/* MONEDAS */
.coin { position: absolute; width: 22px; height: 22px; background: var(--gold); box-shadow: inset -4px -4px 0 #c99a1f; animation: bob 2.4s ease-in-out infinite; cursor: pointer; z-index: 2; }
.coin:hover { filter: brightness(1.15); }
.coin.is-got { animation: grab .45s steps(5) forwards; pointer-events: none; }
@keyframes grab { 50% { transform: translateY(-36px); opacity: 1; } to { transform: translateY(-48px) scale(.4); opacity: 0; } }
.coin--inline { position: relative; display: inline-block; width: 16px; height: 16px; margin-left: 10px; vertical-align: middle; box-shadow: inset -3px -3px 0 #c99a1f; }
.head > div { position: relative; }
.head .coin--inline { position: absolute; left: calc(100% + 16px); bottom: 10px; margin: 0; }
.score { display: inline-flex; align-items: center; gap: 6px; font-family: var(--pixel); font-size: 15px; color: var(--gold); }
.score i { width: 12px; height: 12px; background: var(--gold); box-shadow: inset -2px -2px 0 #c99a1f; }
.score.bump { animation: bump .3s steps(3); }
@keyframes bump { 50% { transform: scale(1.35); } }

/* TORO */
.bull { display: block; width: 88px; height: 76px; margin: 0 auto 18px; image-rendering: pixelated; cursor: pointer; }
.bull--mini { display: inline-block; width: 33px; height: 28.5px; margin: 0; }
.hello [data-i18n-html] { cursor: pointer; }
/* Toro sorpresa desde el borde inferior de la pantalla */
.peekaboo { position: fixed; bottom: 0; left: 40vw; z-index: 45; transform: translateY(115%); pointer-events: none; }
.peekaboo.go { animation: peek 2.4s cubic-bezier(.3,1.3,.5,1) forwards; pointer-events: auto; }
.peekaboo .bull { width: 132px; height: 114px; margin: 0; }
.peekaboo__bubble { position: absolute; bottom: calc(100% - 6px); left: 70%; white-space: nowrap; background: var(--text); color: var(--bg); font-family: var(--pixel); font-size: 18px; padding: 6px 12px; clip-path: var(--notch); opacity: 0; }
.peekaboo.flip .peekaboo__bubble { left: auto; right: 70%; }
.peekaboo.go .peekaboo__bubble { animation: say 2.4s steps(1) forwards; }
@keyframes peek { 0% { transform: translateY(115%); } 20% { transform: translateY(14%); } 26%, 74% { transform: translateY(20%); } 100% { transform: translateY(115%); } }
@keyframes say { 0%, 24% { opacity: 0; } 26%, 72% { opacity: 1; } 74%, 100% { opacity: 0; } }
/* recorta solo por debajo: el toro sube desde "el suelo" */
.bull-peek { display: inline-block; line-height: 0; clip-path: inset(-60% -60% 0 -60%); }
.bull--mini.rise { animation: rise 1s cubic-bezier(.3,1.5,.5,1) both; animation-delay: .25s; }
@keyframes rise { from { transform: translateY(105%); } 60% { transform: translateY(-12%); } to { transform: none; } }
.bull.charge { animation: charge .65s steps(6); }
@keyframes charge { 20% { transform: translateX(-4px) rotate(-6deg); } 40% { transform: translateX(4px) rotate(6deg); } 70% { transform: scale(1.35) translateY(4px); } }

/* LOGO: reconstrucción al hacer clic */
.logo.rebuild svg rect { animation: block-in .5s steps(3) both; }
.logo.rebuild svg rect:nth-child(2) { animation-delay: .08s; } .logo.rebuild svg rect:nth-child(3) { animation-delay: .16s; }
.logo.rebuild svg rect:nth-child(4) { animation-delay: .24s; } .logo.rebuild svg rect:nth-child(5) { animation-delay: .32s; }
.logo svg rect { transform-box: fill-box; }
@keyframes block-in { from { opacity: 0; transform: translateY(-60%); } }

/* MODO RETRO (código Konami) */
body.retro { filter: contrast(1.15) saturate(1.3); }
body.retro::after { content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; background: repeating-linear-gradient(transparent 0 2px, rgba(0,0,0,.28) 2px 3px); }

/* TEXTOS JUSTIFICADOS (con guiones según el idioma de la página) */
.bio, .level .desc, .quest p, .save p:not(.save__where), .modal__body > p { text-align: justify; hyphens: auto; }

/* REVEAL */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s, transform .5s steps(6); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* RESPONSIVE */
@media (max-width: 1100px) { .trophies__grid { --cols: 5; } }
@media (max-width: 960px) {
  .levels { grid-template-columns: 1fr 1fr; }
  .quests { grid-template-columns: 1fr 1fr; }
  .sheet { grid-template-columns: 1fr; }
  .avatar-col { max-width: 320px; }
  .modal { grid-template-columns: 1fr; }
  .modal__gallery > img { max-height: 46svh; }
}
@media (max-width: 1000px) {
  .burger { display: block; }
  .nav nav { position: fixed; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 2px solid var(--line); display: none; }
  .nav.is-open nav { display: block; }
  .nav ul { flex-direction: column; gap: 0; font-size: 22px; padding: 8px var(--gut) 16px; }
  .nav ul a { display: block; padding: 10px 0; color: var(--text); }
}
@media (max-width: 640px) {
  .levels, .quests, .grid2 { grid-template-columns: 1fr; }
  .level--big { grid-column: auto; }
  .level--big .cover { aspect-ratio: 16 / 9; min-height: 0; }
  .coins { display: none; }
  .role { flex-direction: column; gap: 4px; }
  .role__sep { display: none; }
  .trophies__grid { --cols: 3; gap: 8px; }
  .trophy { flex-basis: calc((100% - 16px) / 3); padding: 10px 8px 9px; min-height: 0; }
  .trophy h3 { font-size: 13px; }
  .trophy__tag { position: static; order: -1; margin-bottom: -2px; }
  .trophies__meter { min-width: 0; width: 100%; }
  .trophies__meter p { text-align: left; }
  .hero-photo { right: auto; left: 50%; translate: -50% -50%; width: 92vw; opacity: .45; }
  .head .coin--inline { left: auto; right: -26px; }
  .modal__body { padding: 20px; }
  .modal__body h3 { font-size: 30px; }
}
/* Con "reducir movimiento" activo se mantiene la diversión, pero sin desplazamientos grandes */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .glitch img { animation-duration: 30s; }
  .glitch i { animation-duration: 8s; }
}

/* PORTADA EN CELULAR Y TABLET EN VERTICAL: saludo, nombre y rol arriba sobre fondo
   oscuro; el retrato debajo en su propio espacio (sin tapar textos) y luego los botones */
@media (max-width: 900px) and (min-height: 541px) {
  .title { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-height: 0; padding: 22px 0 56px; }
  .title .wrap { display: contents; }
  .coins { display: none; }
  .title .wrap > * { position: relative; z-index: 1; }
  .hello { order: 1; margin: 0 var(--gut); flex-wrap: wrap; justify-content: center; }
  .title h1 { order: 2; margin: 14px 0 14px; }
  .role { order: 3; }
  .hero-photo { position: relative !important; order: 4; inset: auto; translate: none; width: min(84vw, 420px); opacity: 1; margin: 0 0 -40px; }
  .title .start { order: 5; margin-top: 28px; }
  .title .actions { order: 6; padding: 0 var(--gut); }
}

/* CELULAR EN HORIZONTAL: textos a la izquierda, retrato a la derecha */
@media (orientation: landscape) and (max-height: 540px) {
  .title { min-height: 0; padding: 28px 0 36px; place-items: center start; text-align: left; }
  .title .wrap { width: 100%; }
  .title .wrap > * { max-width: 56%; }
  .title h1 { font-size: clamp(44px, 15vh, 84px); margin: 8px 0 10px; }
  .role { justify-content: flex-start; }
  .title .start { margin-top: 18px; }
  .title .actions { justify-content: flex-start; margin-top: 16px; }
  .coins { display: none; }
  .hero-photo { right: var(--gut); left: auto; top: 50%; translate: 0 -50%; width: auto; height: min(90%, 420px); opacity: 1; }
}

/* MENÚ "ENVIAR CORREO": cuadro de elección estilo RPG debajo del botón */
.mailpick { position: relative; display: inline-flex; }
.mailmenu { position: absolute; top: calc(100% + 12px); left: 50%; translate: -50% 0; z-index: 20; min-width: 236px; display: flex; flex-direction: column; padding: 8px; background: var(--panel); text-align: left; box-shadow: 0 0 0 3px var(--text), 0 0 0 6px var(--bg), 0 0 0 8px var(--line), 0 18px 40px rgba(0,0,0,.5); animation: mailpop .18s steps(3); }
.mailmenu[hidden] { display: none; }
.mailmenu a, .mailmenu button { display: block; width: 100%; text-align: left; font-family: var(--pixel); font-size: 18px; color: var(--text); padding: 9px 12px 9px 30px; position: relative; }
.mailmenu a::before, .mailmenu button::before { content: "▶"; position: absolute; left: 10px; color: var(--gold); opacity: 0; }
.mailmenu a:hover, .mailmenu button:hover, .mailmenu a:focus-visible, .mailmenu button:focus-visible { background: var(--line); color: var(--gold); outline: none; }
.mailmenu a:hover::before, .mailmenu button:hover::before, .mailmenu a:focus-visible::before, .mailmenu button:focus-visible::before { opacity: 1; animation: blink 1.1s steps(2, start) infinite; }
@keyframes mailpop { from { transform: scale(.85); opacity: 0; } }
