/* Valores en Ruta styles: Banco Internacional (Manual gráfico) */
:root{
  /* brand */
  --navy:#2C256C; --indigo:#413BBC; --purple:#953CBA; --cyan:#00DFF7;
  --agilidad:#88A9FD; --valentia:#B1DB6E; --excelencia:#F98C8C; --transparencia:#6FD8D8; --empatia:#D68EFD;
  /* surfaces */
  --page:#ECEAF7; --page-ink:#2C256C;
  --screen:#2C256C; --raised:#362F82; --field:#211B57; --line:#4F48A8;
  --ink:#FFFFFF; --muted:#C3BEF0; --danger:#F98C8C;
  --font:"Open Sans","Segoe UI",Arial,sans-serif;
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){ --page:#15113D; --page-ink:#FFFFFF; }
}
:root[data-theme="dark"]{ --page:#15113D; --page-ink:#FFFFFF; }
html{height:100%;scroll-padding-top:env(safe-area-inset-top,0px)}
*,*::before,*::after{box-sizing:inherit}
body{
  margin:0;height:100%;background:var(--page);color:var(--page-ink);
  font-family:var(--font);font-size:16px;line-height:1.45;
  display:flex;align-items:center;justify-content:center;overflow:hidden;
}
.cabinet{
  position:relative;background:var(--screen);color:var(--ink);
  border-radius:22px;padding:10px 14px 10px;
  box-shadow:0 18px 60px rgba(44,37,108,.35);
  display:flex;flex-direction:column;align-items:center;max-width:100%;
}

/* HUD */
.hud{width:100%;display:grid;grid-template-columns:1fr auto 1fr;align-items:end;gap:10px;padding:0 2px 8px}
.hud .cell{display:flex;flex-direction:column;gap:1px;min-width:0}
.hud .mid{align-items:center}
.hud .right{align-items:flex-end}
.hud .k{font-size:12px;font-weight:600;color:var(--muted)}
.hud .v{font-size:22px;font-weight:700;line-height:1.05}
.hud .score .v{font-size:28px;font-weight:800;font-style:italic;color:var(--cyan);font-variant-numeric:tabular-nums}
.lives{display:flex;gap:3px;height:26px;align-items:flex-end}
.lives img{width:17px;height:26px;image-rendering:pixelated}
.stage{position:relative;touch-action:none;border-radius:10px;overflow:hidden}
canvas{display:block}

/* footer: collected values + controls */
.foot{width:100%;display:flex;justify-content:space-between;align-items:center;gap:8px;padding-top:8px}
.foot .btns{display:flex;gap:6px;flex-shrink:0;align-items:center}
.vstrip{display:flex;gap:5px;min-width:0}
.vstrip .vdot{
  width:26px;height:26px;border-radius:50%;display:grid;place-items:center;
  border:1.5px solid var(--line);transition:background-color .3s,border-color .3s;
}
.vstrip .vdot img{width:18px;height:18px;object-fit:contain;opacity:.28;transition:opacity .3s}
.vstrip .vdot.on{background:var(--vc);border-color:var(--vc)}
.vstrip .vdot.on img{opacity:1}
@media (max-width:420px){ .vstrip{gap:3px} .vstrip .vdot{width:22px;height:22px} .vstrip .vdot img{width:15px;height:15px} }
.iconbtn{
  font-family:var(--font);font-size:13px;font-weight:600;color:var(--ink);background:var(--raised);
  border:1.5px solid var(--line);border-radius:999px;padding:5px 12px;cursor:pointer;white-space:nowrap;
}
.iconbtn:focus-visible,.btn:focus-visible,input:focus-visible,.char:focus-visible{outline:3px solid var(--cyan);outline-offset:2px}

/* Panels (title, value cards, game over) */
.panel{
  position:absolute;inset:0;z-index:5;background:var(--screen);
  border-radius:22px;overflow-y:auto;overflow-x:hidden;padding:20px 22px 26px;
  display:none;
}
.panel.show{display:block}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}
.brand{height:34px;width:auto;display:block}

/* Title lockup: two typefaces, two colors, cyan pill (Manual: "Títulos gráficos") */
.logo{margin:0;line-height:1.05;font-size:clamp(38px,8.5vw,60px);letter-spacing:-.01em}
.logo .t1{display:block;font-weight:600;color:var(--ink)}
.logo .t2{
  display:inline-block;margin-top:.12em;font-weight:800;font-style:italic;color:var(--navy);
  background:var(--cyan);border-radius:999px;padding:.02em .42em .06em .34em;
}
.tag{color:var(--muted);margin:12px 0 0;max-width:40ch}

/* attract parade: the hero leading the five values */
.parade{position:relative;height:66px;margin:14px 0 4px;overflow:hidden;border-bottom:2px solid var(--line)}
.parade .runner{position:absolute;bottom:2px;display:flex;gap:10px;align-items:flex-end;animation:run 11s linear infinite}
.parade img{height:56px;width:auto}
.parade img.px{image-rendering:pixelated;height:52px}
@keyframes run{from{transform:translateX(620px)}to{transform:translateX(-520px)}}
@media (prefers-reduced-motion:reduce){ .parade .runner{animation:none;left:10px} }

.cols{display:grid;grid-template-columns:1.1fr 1fr;gap:28px;margin-top:18px}
@media (max-width:620px){ .cols{grid-template-columns:1fr} }
h2{font-size:17px;margin:0 0 10px;color:var(--ink);font-weight:700}

/* character picker */
.chars{display:flex;gap:10px;margin-bottom:16px}
.char{
  display:flex;flex-direction:column;align-items:center;gap:4px;width:92px;padding:10px 6px 8px;
  font-family:var(--font);font-size:15px;font-weight:600;color:var(--muted);
  background:var(--field);border:2px solid var(--line);border-radius:14px;cursor:pointer;
}
.char img{width:40px;height:62px;image-rendering:pixelated}
.char[aria-checked="true"]{border-color:var(--cyan);color:var(--ink);background:var(--raised)}

label.name{display:block;color:var(--muted);margin-bottom:6px;font-weight:600}
.namerow{display:flex;gap:8px;flex-wrap:wrap}
input#name{
  flex:1;min-width:140px;font-family:var(--font);font-size:20px;font-weight:700;text-transform:uppercase;
  background:var(--field);color:var(--ink);border:2px solid var(--line);border-radius:12px;padding:8px 12px;
  letter-spacing:.08em;caret-color:var(--cyan);
}
.btn{
  font-family:var(--font);font-size:16px;font-weight:800;font-style:italic;color:var(--navy);
  background:var(--cyan);border:0;border-radius:999px;padding:10px 22px;cursor:pointer;
  box-shadow:0 3px 0 #009fb1;
}
.btn:active{transform:translateY(2px);box-shadow:0 1px 0 #009fb1}
.btn.ghost{background:transparent;color:var(--ink);box-shadow:inset 0 0 0 2px var(--line);font-style:normal;font-weight:700}
.btn.dark{background:var(--navy);color:#fff;box-shadow:0 3px 0 #17124a}
.err{color:var(--danger);min-height:1.4em;margin:6px 0 0;font-weight:600}
.howto{margin-top:14px}
.howto p{margin:0 0 9px;max-width:46ch;color:#E9E7FB}
.howto strong{color:var(--cyan);font-weight:700}
.points{display:grid;grid-template-columns:36px 1fr auto;gap:7px 10px;align-items:center;margin:12px 0 10px}
.points img{width:28px;height:28px;object-fit:contain;justify-self:center}
.points img.px{image-rendering:pixelated}
.points .pts{color:var(--cyan);font-weight:800;font-style:italic;font-variant-numeric:tabular-nums}
.sw{display:inline-block;width:8px;height:8px;border-radius:50%;background:#fff;justify-self:center}
.arrow{width:28px;height:20px;justify-self:center}
kbd{font-family:var(--font);font-size:12px;font-weight:700;background:var(--raised);border:1px solid var(--line);border-radius:5px;padding:0 5px}

/* leaderboard */
.board{list-style:none;margin:0;padding:0}
.board li{
  display:grid;grid-template-columns:30px 1fr auto;gap:8px;align-items:center;
  padding:5px 6px;border-bottom:1px solid var(--line);border-radius:8px;
}
.board .rk{font-size:13px;font-weight:700;color:var(--muted);display:flex;justify-content:center}
.board .rk svg{width:24px;height:24px;display:block}
.board .n{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:.04em;font-weight:600}
.board .s{font-weight:800;font-style:italic;color:var(--cyan);font-variant-numeric:tabular-nums}
.board .lv{color:var(--muted);font-size:13px;margin-left:6px}
.board .vv{display:inline-flex;gap:2px;margin-left:6px;vertical-align:1px}
.board .vv i{width:6px;height:6px;border-radius:50%;background:var(--line)}
.board .vv i.on{background:var(--vc)}
.board li.p1{background:linear-gradient(90deg,rgba(245,197,24,.2),rgba(245,197,24,0) 75%)}
.board li.p2{background:linear-gradient(90deg,rgba(201,211,224,.16),rgba(201,211,224,0) 75%)}
.board li.p3{background:linear-gradient(90deg,rgba(205,127,50,.18),rgba(205,127,50,0) 75%)}
.board li.p1 .n{color:#ffd84a;font-size:18px}
.board li.p2 .n{color:#dfe6f0}
.board li.p3 .n{color:#e8a466}
.board li.p1 .rk svg{width:28px;height:28px;filter:drop-shadow(0 0 6px rgba(245,197,24,.6))}
.board li.me{box-shadow:inset 0 0 0 2px var(--cyan)}
.board .empty{display:block;color:var(--muted);border:0}
.rank-trophy{display:inline-block;width:26px;height:26px;vertical-align:-6px;margin-left:6px}

/* language switch */
.langswitch{display:inline-flex;border:1.5px solid var(--line);border-radius:999px;overflow:hidden}
.langswitch button{font-family:var(--font);font-size:13px;font-weight:700;color:var(--muted);background:transparent;border:0;padding:5px 10px;cursor:pointer}
.langswitch button.on{background:var(--cyan);color:var(--navy)}
.langswitch button:focus-visible{outline:3px solid var(--cyan);outline-offset:-3px}
.status{color:var(--muted);font-size:14px;margin-top:8px}

/* Value cards: the "Fondo Valores" look (value color + soft circles) */
.vpanel{
  --vc:var(--agilidad);
  display:none;place-items:center;padding:20px;
  background:
    radial-gradient(circle at -8% -22%, rgba(255,255,255,.22) 0 40%, transparent 40.3%),
    radial-gradient(circle at 112% -48%, rgba(255,255,255,.22) 0 42%, transparent 42.3%),
    radial-gradient(circle at 116% 118%, rgba(255,255,255,.22) 0 38%, transparent 38.3%),
    radial-gradient(circle at -14% 140%, rgba(255,255,255,.22) 0 40%, transparent 40.3%),
    var(--vc);
}
.vpanel.show{display:grid}
.vpanel.all{
  background:
    radial-gradient(circle at -8% -22%, rgba(255,255,255,.12) 0 40%, transparent 40.3%),
    radial-gradient(circle at 112% -48%, rgba(255,255,255,.12) 0 42%, transparent 42.3%),
    radial-gradient(circle at 116% 118%, rgba(255,255,255,.12) 0 38%, transparent 38.3%),
    radial-gradient(circle at -14% 140%, rgba(255,255,255,.12) 0 40%, transparent 40.3%),
    var(--navy);
}
.vcard{max-width:420px;text-align:center;color:var(--navy);display:flex;flex-direction:column;align-items:center}
.vpanel.all .vcard{color:#fff}
.vcount{margin:0 0 6px;font-weight:700;font-size:14px;opacity:.75}
.mascot{height:clamp(110px,28vh,170px);width:auto;filter:drop-shadow(0 8px 0 rgba(44,37,108,.18))}
.pill{
  display:inline-flex;align-items:center;gap:8px;margin:14px 0 0;
  background:var(--navy);color:#fff;border-radius:999px;padding:6px 18px 6px 10px;
  font-size:22px;font-weight:600;
}
.pill img{width:28px;height:28px;object-fit:contain}
.vtitle{font-size:clamp(22px,4.6vw,30px);font-weight:800;font-style:italic;color:inherit;margin:14px 0 6px;line-height:1.15}
.vmsg{margin:0;font-size:17px;font-weight:600;max-width:34ch}
.veffect{margin:12px 0 18px;font-size:14px;font-weight:600;opacity:.8}
.vpanel.all .veffect{color:var(--cyan);opacity:1;font-weight:800;font-style:italic;font-size:17px}
.purpose{margin:0;font-size:18px;font-weight:600;max-width:30ch}
.squad{display:flex;gap:8px;align-items:flex-end;justify-content:center;flex-wrap:wrap}
.squad img{height:clamp(56px,13vh,84px);width:auto}
.squad.small img{height:44px}
.squad.small img.off{opacity:.22;filter:grayscale(1)}
/* one orchestrated moment: the mascot arrives */
.vpanel.show .mascot,.vpanel.show .squad img{animation:pop .5s cubic-bezier(.3,1.6,.5,1) both}
.vpanel.show .squad img:nth-child(2){animation-delay:.06s}
.vpanel.show .squad img:nth-child(3){animation-delay:.12s}
.vpanel.show .squad img:nth-child(4){animation-delay:.18s}
.vpanel.show .squad img:nth-child(5){animation-delay:.24s}
@keyframes pop{from{transform:translateY(18px) scale(.6);opacity:0}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){ .vpanel.show .mascot,.vpanel.show .squad img{animation:none} }

/* game over */
.big-score{font-size:64px;font-weight:800;font-style:italic;color:var(--cyan);line-height:1;margin:8px 0 4px;font-variant-numeric:tabular-nums}
.over-title{font-size:clamp(28px,6vw,40px);font-weight:600;margin:0;color:var(--ink)}
.over-title.win{color:var(--cyan)}
.overvalores{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:14px 0 0}
.overvalores p{margin:0;font-weight:600}
.rankline{margin:12px 0 0;font-weight:600}
.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
.overboard{margin-top:22px;max-width:440px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* focus ring stays visible on the light value colors */
.vpanel:not(.all) .btn:focus-visible{outline-color:var(--navy)}

/* small screens: screens open full-viewport, footer keeps only what fits */
@media (max-width:620px){
  .panel{
    position:fixed;inset:0;border-radius:0;
    padding-top:calc(16px + env(safe-area-inset-top,0px));
    padding-bottom:calc(22px + env(safe-area-inset-bottom,0px));
  }
}
@media (max-width:520px){ .foot .btns .langswitch{display:none} }
