:root {
  --bg: #0e1621;
  --sheet: #17212b;
  --card: #26384c;
  --text: #ffffff;
  --hint: #708499;
  --accent: #5288c1;
  --link: #6eb9ff;
  --line: #28384a;
  --btn-text: #ffffff;
  --soft: #c9d3de;
  --trace: #3a4c60;
  --piece: #1b2838;
  --veil: rgba(8, 12, 18, .82);
  --ok: #7be0a2;
  --go: #3ecf8e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
button, a { font: inherit; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

.top {
  position: relative; z-index: 5; background: var(--sheet);
  padding: 14px 12px 12px; border-bottom: 1px solid var(--line);
}
@media (min-width: 720px) and (min-height: 700px) { .top { position: sticky; top: 0; } }
.top h1 { margin: 0 0 10px; font-size: 18px; text-align: center; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 1100px; margin: 0 auto; }
.chip {
  flex: none; border: 0; border-radius: 999px; padding: 8px 13px; min-height: 38px;
  background: var(--card); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--accent); color: var(--btn-text); }
.chip.custom { background: rgba(62, 207, 142, .14); color: var(--go); box-shadow: inset 0 0 0 1.5px var(--go); }
.chip.custom[aria-pressed="true"] { background: var(--go); color: #0e1621; }
.vs {
  margin: 0 auto 12px; padding: 10px 14px; max-width: 1100px; text-align: center;
  background: var(--piece); border: 1px solid var(--line); border-radius: 12px; font-size: 13.5px; color: var(--soft);
}
.vs > * { margin: 0 7px; }
@media (max-width: 520px) { .vs { text-align: left; font-size: 12.5px; padding: 8px 10px; } .vs > * { margin: 0 10px 0 0; } }
.vs b { color: var(--text); font-weight: 700; }
.vs .guide { position: relative; display: inline-block; }
.vs .gb {
  border: 0; background: none; padding: 0; color: var(--link); font: inherit; text-decoration: underline;
  text-underline-offset: 2px; cursor: pointer;
}
.vs .gb .car { margin-left: 4px; font-size: 11px; opacity: .8; text-decoration: none; display: inline-block; }
.vs .gmenu {
  position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); z-index: 7; min-width: 190px;
  padding: 6px; border-radius: 12px; background: var(--sheet); box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(0,0,0,.35);
  text-align: left;
}
.vs .gmenu[hidden] { display: none; }
.vs .gmenu a {
  display: flex; align-items: center; min-height: 40px; padding: 9px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-weight: 600;
}
.vs .gmenu a:hover, .vs .gmenu a:focus-visible { background: var(--card); }
.cnt { margin: 8px 0 0; text-align: center; font-size: 12.5px; color: var(--soft); }

main { max-width: 1180px; margin: 0 auto; padding: 14px 12px 28px; }
.status { text-align: center; color: var(--hint); margin: 48px 16px; }
.status button { display: block; margin: 14px auto 0; }

.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; } }
.grid > li { display: flex; }

/* Una tarjeta por diseño: vista previa grande, selector de formato, precio, ahorro y fondo de Steam. */
.dcard {
  display: flex; flex-direction: column; width: 100%; overflow: hidden; cursor: pointer;
  background: var(--sheet); border: 1px solid var(--line); border-radius: 14px;
}
.cmedia { position: relative; aspect-ratio: 4 / 3; background: var(--piece); overflow: hidden; }
.cmi { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; background: var(--piece); }
.anim {
  position: absolute; left: 8px; top: 8px; display: inline-flex; gap: 5px; align-items: center;
  padding: 4px 9px 4px 7px; border-radius: 999px; background: var(--veil); font-size: 11.5px; font-weight: 700;
}
.anim svg { width: 10px; height: 10px; fill: var(--text); }
.kbadge {
  position: absolute; left: 8px; bottom: 8px; padding: 4px 9px; border-radius: 8px; background: var(--veil);
  border: 1px solid var(--kc); color: var(--kc); font-size: 11.5px; font-weight: 700;
}
.cbody { padding: 12px 12px 14px; flex: 1; display: flex; flex-direction: column; }
.cbody h3 { margin: 0 0 12px; font-size: 17px; font-weight: 700; line-height: 1.2; }
.segs { display: grid; gap: 10px 6px; }
.seg {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 58px; padding: 8px 4px 7px; border-radius: 12px; border: 1.5px solid var(--trace);
  background: var(--card); color: var(--text); cursor: pointer; text-align: center;
}
.seg[aria-pressed="true"] { border-color: var(--kc); background: var(--sheet); box-shadow: inset 0 0 0 1px var(--kc); }
.seg:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
/* Alternador de variante (pose fija / con poses): compacto, debajo de los formatos o solo en la vista por formato. */
.vars { display: grid; gap: 6px; margin-top: 8px; }
.vbtn {
  min-height: 32px; padding: 5px 6px; border-radius: 10px; border: 1.5px solid var(--trace); background: var(--card);
  color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.vbtn[aria-pressed="true"] { border-color: var(--kc); background: var(--sheet); box-shadow: inset 0 0 0 1px var(--kc); }
.vbtn:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.sl { font-size: 12px; font-weight: 700; color: var(--kc); line-height: 1.15; white-space: nowrap; }
.sv { font-size: 10.5px; color: var(--soft); line-height: 1.1; }
.sp { font-size: 15px; font-weight: 700; }
.su { font-size: 11px; color: var(--soft); }
.seg-off {
  position: absolute; top: -9px; right: -3px; padding: 2px 6px; border-radius: 999px;
  background: var(--ok); color: var(--bg); font-size: 10.5px; font-weight: 700;
}
.goes { margin: 10px 2px 0; font-size: 12.5px; font-weight: 600; color: var(--kc); }
.money { display: flex; align-items: baseline; gap: 8px; margin: 6px 2px 0; }
.big { font-size: 19px; font-weight: 700; }
.usd { color: var(--soft); font-size: 13px; }
.saving { margin: 3px 2px 0; font-size: 13px; color: var(--soft); }
.saving s { color: var(--soft); }
.saving strong { color: var(--ok); }
.saving.hint { font-size: 12.5px; }
.sbg {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 11px 0 12px; padding: 8px 10px;
  border: 1px dashed var(--trace); border-radius: 10px; background: var(--bg); font-size: 12px;
}
.sbl { color: var(--soft); font-weight: 600; }
.sbn { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
a.sbn { text-decoration: underline; text-decoration-color: var(--trace); text-underline-offset: 2px; }
a.sbn:hover { text-decoration-color: var(--link); }
.sbw { grid-column: 1 / 3; color: var(--soft); }
.cta {
  margin-top: auto; width: 100%; min-height: 42px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--accent); color: var(--btn-text); font-weight: 700; font-size: 15px;
}
/* The button stays pinned to the bottom of every card; 12px keeps it off the block above. */
.cbody > .sbg, .cbody > .saving, .cbody > .money { margin-bottom: 12px; }
/* The Steam-background box sits right above the button, so every card in a row ends the same way. */
.cbody > .sbg { margin-top: auto; }
.cbody > .sbg + .cta { margin-top: 0; }
.cbody > .spacer { flex: 1; }
.dcard:hover .cmi { filter: brightness(1.08); }
@media (prefers-reduced-motion: reduce) { .dcard:hover .cmi { filter: none; } }
.badge {
  position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px 4px 6px; border-radius: 8px; background: rgba(8, 12, 18, .82); color: var(--kc, #fff);
  font-size: 11.5px; font-weight: 700; line-height: 1.1; border: 1px solid var(--kc, #fff);
}
.kind .badge { position: static; display: inline-flex; font-size: 12.5px; margin-bottom: 8px; }
.kicon { display: inline-block; width: 22px; height: 16px; flex: none; }
.kicon svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.k-artwork { --kc: #5eb0ff; }
.k-workshop { --kc: #f0a93c; }
.k-perfil { --kc: #c08bff; }
.where { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.where-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: #c9d3de; }
.where-t strong { color: var(--kc); font-size: 14px; }
.diagram { flex: none; width: 128px; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram .frame { fill: #0e1621; stroke: #3a4c60; stroke-width: 1.5; }
.diagram .head { fill: #1b2838; }
.diagram .line { fill: #3a4c60; }
.diagram .off { fill: #2a3a4d; }
.diagram .on { fill: var(--kc); }

.overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--sheet); border-radius: 22px 22px 0 0; overflow: hidden; outline: none;
  animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
@media (min-width: 640px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 22px; max-height: 90dvh; }
  .grab { display: none; }
}
.grab { width: 48px; height: 5px; border-radius: 3px; background: #465668; margin: 8px auto 4px; flex: none; }
.close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 18px; cursor: pointer;
}
.media { flex: none; position: relative; background: #000; }
.track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.track::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: no-preference) { .track { scroll-behavior: smooth; } }
.slide { flex: 0 0 100%; height: 46dvh; max-height: 440px; min-height: 200px; scroll-snap-align: start; scroll-snap-stop: always; background: #000; }
.slide.s-piece { background: #1b2838; }
.slide video, .slide img { display: block; width: 100%; height: 100%; object-fit: contain; }
.nav {
  position: absolute; top: 50%; z-index: 2; width: 40px; height: 40px; margin-top: -20px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 26px; line-height: 38px; padding: 0 0 3px; cursor: pointer;
  display: none;
}
.nav.prev { left: 8px; }
.nav.next { right: 8px; }
@media (hover: hover) and (pointer: fine) { .nav { display: block; } .nav:hover { background: rgba(0, 0, 0, .8); } }
.dots {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 2; display: flex; gap: 2px;
  background: rgba(0, 0, 0, .5); border-radius: 999px; padding: 0 4px;
}
.dot { width: 24px; height: 24px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; }
.dot span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.dot[aria-current="true"] span { background: #fff; transform: scale(1.25); }
.body { padding: 14px 16px 8px; overflow-y: auto; flex: 1 1 auto; }
.body h2 { margin: 0 0 6px; font-size: 18px; line-height: 1.25; }
.desc { margin: 0 0 12px; color: #c9d3de; white-space: pre-line; }
.prices { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.prices li { background: var(--card); border-radius: 10px; padding: 7px 12px; font-weight: 600; font-size: 14px; }
.buy { padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex: none; }
.btn {
  display: block; width: 100%; text-align: center; text-decoration: none; border: 0; cursor: pointer;
  background: var(--accent); color: var(--btn-text); font-weight: 700; font-size: 17px;
  padding: 15px; border-radius: 14px;
}
.btn.ghost { background: var(--card); color: var(--text); width: auto; display: inline-block; padding: 10px 18px; font-size: 14px; }
.in-tg .buy { display: none; }

/* Selector de idioma: un botón con la bandera y el idioma; el menú lista los dos. */
.lang { position: absolute; right: 14px; top: 10px; z-index: 6; font-size: 13px; font-weight: 600; }
.lang .lb {
  display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 12px; border: 0; border-radius: 999px;
  background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer;
}
.lang .fl { display: block; width: 18px; height: 12px; border-radius: 2px; overflow: hidden; flex: none; }
.lang .fl svg { display: block; width: 100%; height: 100%; }
.lang .car { opacity: .7; font-size: 11px; }
.lang .menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 170px; padding: 6px; border-radius: 12px;
  background: var(--sheet); box-shadow: 0 0 0 1px var(--line);
}
.lang .menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 40px; padding: 9px 10px; border: 0;
  border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.lang .menu button[aria-pressed="true"] { background: var(--card); }
.lang .ok { margin-left: auto; color: var(--accent); }
.top h1 { padding: 0 150px; }

.dlg-overlay { z-index: 30; align-items: center; padding: 16px; }
.dialog {
  position: relative; width: 100%; max-width: 380px; max-height: 92dvh; overflow-y: auto; outline: none;
  background: var(--sheet); border-radius: 20px; padding: 20px 18px 16px;
  display: flex; flex-direction: column; gap: 10px; animation: up .18s ease-out;
}
@media (prefers-reduced-motion: reduce) { .dialog { animation: none; } }
.dialog h2 { margin: 0 0 4px; font-size: 18px; text-align: center; }
.dialog .btn { font-size: 15px; padding: 13px; }
.dialog .btn.ghost-wide { background: var(--card); color: var(--text); }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 4px; }
.qr { width: 176px; height: 176px; border-radius: 10px; overflow: hidden; background: #fff; }
.qr svg { display: block; width: 100%; height: 100%; }
.qr-label { margin: 0; font-size: 13px; color: var(--hint); text-align: center; }
.help { margin: 0; font-size: 13px; color: #c9d3de; text-align: center; }
.dialog .btn.ghost { align-self: center; }
.note { margin: 8px 2px 0; font-size: 12px; color: var(--hint); }
@media (max-width: 520px) { .top h1 { font-size: 16px; text-align: left; padding: 0 130px 0 2px; margin-bottom: 8px; } }

/* Compra en la web (fuera de Telegram, con el flag web_checkout) y página /pedido */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.checkout { max-width: 440px; gap: 12px; }
.checkout h2 { padding: 0 34px; }
.checkout .close { top: 8px; right: 8px; width: 36px; height: 36px; }
.co-body { display: flex; flex-direction: column; gap: 12px; }
.co-product { margin: 0; text-align: center; font-weight: 700; color: #c9d3de; font-size: 14px; }
.co-p { margin: 0; color: #c9d3de; }
.co-hint { margin: 0; font-size: 13px; color: var(--hint); }
.co-notice { margin: 0; padding: 10px 12px; border-radius: 10px; background: #3a2230; color: #ffd6df; font-size: 14px; }
.co-warn { margin: 0; padding: 10px 12px; border-radius: 10px; background: #3a3220; border: 1px solid #f0a93c; color: #ffe2a8; font-size: 14px; font-weight: 600; }
.co-methods { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.co-method {
  display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 56px; border-radius: 12px;
  background: var(--card); border: 2px solid transparent; cursor: pointer;
}
.co-method:has(input:checked) { border-color: var(--accent); }
.co-method:has(input:focus-visible) { outline: 3px solid var(--link); outline-offset: 2px; }
.co-method input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.co-m-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.co-sub { font-size: 12.5px; color: #c9d3de; }
.co-amt { flex: none; font-weight: 700; font-size: 14px; text-align: right; }
.co-copy { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); }
.co-copy-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.co-k { font-size: 12.5px; color: #c9d3de; }
.co-v { font-size: 17px; overflow-wrap: anywhere; user-select: all; }
.checkout .btn.ghost, .order .btn.ghost { align-self: center; }
.co-copy .btn.ghost { flex: none; }
.co-link { display: flex; gap: 8px; align-items: stretch; }
.co-link-input {
  flex: 1 1 auto; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #0e1621; color: var(--text); font: 13px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.co-link .btn { flex: none; width: auto; font-size: 14px; padding: 10px 14px; border-radius: 10px; }
.checkout .btn { font-size: 15px; padding: 13px; }
.checkout .btn.ghost-wide { background: var(--card); color: var(--text); }
.checkout .btn[disabled] { opacity: .6; cursor: default; }

.order { max-width: 560px; }
.order .o-title { margin: 6px 0 8px; font-size: 20px; text-align: center; }
.o-view { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; padding: 18px 16px; border-radius: 16px; background: var(--sheet); }
.o-view h3 { margin: 0; font-size: 18px; }
.o-view .o-ok { color: #7be0a2; }
.o-view .btn { font-size: 16px; }
.o-view .btn.ghost-wide { background: var(--card); color: var(--text); }
.o-view .btn[disabled] { opacity: .6; cursor: default; }
.o-link { margin: 14px 0; }
.o-link .co-hint { margin-bottom: 6px; }
.o-links { text-align: center; margin: 18px 0 0; }
.o-a { color: var(--link); }
.home { color: inherit; text-decoration: none; }
