/* Alterego - UI RPG (pack), paleta pizarra. Móvil vertical (una mano). */
@font-face {
  font-family: 'Alata';
  src: url('../assets/ui/fonts/Alata-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'PlayNum'; /* números de combate (la fuente de los "+100"/"Critical!" del pack) */
  src: url('../assets/ui/fonts/Play-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Josefin'; /* display del pack (logo/títulos grandes) */
  src: url('../assets/ui/fonts/JosefinSans-Bold.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #17141d;
  --bg2: #1f1b28;
  --panel: #2a2533;
  --panel2: #332d3f;
  --ink: #f2eef7;
  --ink-dim: #a89fb5;
  --gold: #f2a93b;
  --wood: #5a3d28;
  --grass: #6fae3a;
  --hp: #62c93f;
  --hp-low: #e04a3a;
  --line: rgba(255, 255, 255, 0.09);
  --p0: #3f8ce0;
  --p1: #8a7ff0;
  --crit: #f0b429;
  --font-ui: 'Alata', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Alata', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; /* tipografía del pack en todo el juego */
  overscroll-behavior: none;
}
.app { min-height: 100dvh; display: flex; justify-content: center; }
.screen {
  width: 100%; max-width: 460px; min-height: 100dvh;
  display: flex; flex-direction: column; background: var(--bg);
  position: relative;
}

/* ---------- MENU ---------- */
.menu { padding: 28px 20px 24px; gap: 18px; display: flex; flex-direction: column; }
.title { text-align: center; }
.title h1 { margin: 0; font-size: 42px; letter-spacing: 6px; color: var(--gold); font-weight: 700; font-family: 'Josefin', var(--font-ui); }
.title p { margin: 6px 0 0; color: var(--ink-dim); font-size: 13px; }
.pick-label { text-align: center; color: var(--ink-dim); font-size: 13px; margin-top: 4px; }
.champ-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  border-left: 5px solid var(--accent);
}
.champ-head { display: flex; align-items: center; gap: 12px; }
.champ-orb {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: var(--accent); display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #fff;
}
.champ-head h2 { margin: 0; font-size: 20px; }
.champ-head .blurb { margin: 2px 0 0; font-size: 12px; color: var(--ink-dim); }
.statline { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { background: var(--bg2); border: 0; border-radius: 8px; padding: 5px 10px; font-size: 12px; color: var(--ink-dim); cursor: pointer; font-family: inherit; }
.stat b { color: var(--ink); }
.stat.on { background: var(--gold); color: #2a1d04; }
.stat.on b { color: #2a1d04; }
.stat-info { font-size: 11px; color: var(--ink-dim); margin-top: 5px; min-height: 14px; }

/* tutorial intro (escenas visuales con assets del juego) */
.intro { position: relative; overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none; }
.in-bg { position: absolute; inset: 0; background: url('../assets/ui/bg/quiz.png') center / cover no-repeat; }
.in-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(23,20,29,0.45), rgba(23,20,29,0.92) 80%); }
.in-slide { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 20px 18px 8px; animation: slidein 0.45s cubic-bezier(0.2,1,0.4,1); }
@keyframes slidein { from { opacity: 0; transform: translateY(16px); } }
.in-visual { position: relative; height: 240px; display: flex; align-items: center; justify-content: center; border-style: solid; border-width: 14px; border-radius: 6px; border-image: url('../assets/ui/panel/popup.png') 30 / 14px stretch; background: radial-gradient(ellipse at 50% 80%, #2a2018, #16121e 78%); background-clip: padding-box; overflow: hidden; }
.in-title { margin: 0; font-family: 'Josefin', var(--font-ui); font-size: 21px; letter-spacing: 1.5px; color: var(--gold); text-align: center; text-shadow: 0 2px 4px rgba(0,0,0,0.6); }
.in-txt { margin: 0; font-size: 14.5px; line-height: 1.55; text-align: center; color: #e6dff0; min-height: 68px; }
.in-txt b { color: var(--gold); }
.in-pips { position: relative; z-index: 2; display: flex; gap: 7px; justify-content: center; padding: 4px 0 6px; }
.in-pp { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.18); }
.in-pp.cur { background: var(--gold); box-shadow: 0 0 8px rgba(242,169,59,0.8); }
.in-pp.done { background: rgba(242,169,59,0.45); }
.in-foot { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 0 18px calc(16px + env(safe-area-inset-bottom)); }
.in-skip { background: none; border: 1px solid rgba(255,255,255,0.22); color: var(--ink-dim); border-radius: 10px; padding: 9px 16px; font-family: var(--font-ui); font-size: 12.5px; cursor: pointer; }
.in-hint { font-size: 11px; color: #8b8199; animation: hintpulse 1.6s ease-in-out infinite; }
@keyframes hintpulse { 50% { opacity: 0.35; } }
.in-gold { align-self: center; background: none; color: #5a3400; cursor: pointer; border-style: solid; border-width: 12px 16px; border-image: url('../assets/ui/btn/rect_yellow.png') 30 34 fill / 12px 16px stretch; padding: 2px 14px; font-size: 14px; font-family: var(--font-ui); text-shadow: 0 1px 0 rgba(255,255,255,0.25); }
/* escena 1: arena viva */
.in-arena { position: absolute; inset: 0; }
.in-arena .ground { position: absolute; left: 12%; right: 12%; bottom: 26px; height: 14px; background: var(--wood); border-top: 6px solid var(--grass); border-radius: 9px; }
.in-arena .vs { position: absolute; top: 18px; left: 0; right: 0; text-align: center; font-size: 30px; animation: vsbeat 1.4s ease-in-out infinite; }
@keyframes vsbeat { 50% { transform: scale(1.12); } }
.in-cap { position: absolute; left: 20%; bottom: 40px; width: 44px; height: 56px; }
.in-cap.R { left: auto; right: 20%; }
.in-cap .fcv { position: absolute; left: 50%; bottom: 0; pointer-events: none; filter: drop-shadow(0 6px 6px rgba(0,0,0,0.55)); }
/* dados de las escenas */
.in-dicerow { display: flex; gap: 14px; align-items: center; }
.in-dicerow .face, .in-col .face { width: 74px; height: 74px; }
.in-slide .face { position: relative; animation: facein 0.5s cubic-bezier(0.2,1.4,0.4,1) backwards; }
.in-slide .face:nth-child(2) { animation-delay: 0.12s; }
.in-slide .face:nth-child(3) { animation-delay: 0.24s; }
@keyframes facein { from { opacity: 0; transform: scale(0.4) rotate(-14deg); } }
.in-slide .face.lit::after { content: ''; position: absolute; inset: -16px; z-index: 0; background: radial-gradient(circle, rgba(255,200,80,0.85), rgba(255,160,40,0.25) 55%, transparent 72%); animation: litpulse 1.1s ease-in-out infinite; }
@keyframes litpulse { 50% { opacity: 0.55; transform: scale(0.92); } }
.in-slide .selring { position: absolute; inset: -8px; background: url('../assets/ui/frame/if_focus.png') center / 100% 100% no-repeat; z-index: 3; animation: selpulse 1.2s ease-in-out infinite; }
@keyframes selpulse { 50% { transform: scale(1.05); } }
.in-slide .x2tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); z-index: 4; font-family: 'PlayNum', var(--font-ui); font-size: 15px; color: #ffd873; text-shadow: 0 0 8px rgba(255,180,60,0.9), 0 2px 2px rgba(0,0,0,0.7); }
.in-slide .cdov { position: absolute; inset: 6px; z-index: 2; border-radius: 10px; background: rgba(10,8,16,0.62); display: grid; place-items: center; }
.in-slide .cdov svg { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); transform: rotate(-90deg); }
.in-slide .cdov circle { fill: none; stroke-width: 3.4; }
.in-slide .cdov .tr { stroke: rgba(255,255,255,0.16); }
.in-slide .cdov .pr { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 100.5 100.5; animation: cdspin 4s linear infinite; }
@keyframes cdspin { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 100.5; } }
.in-slide .cdov b { font-family: 'PlayNum', var(--font-ui); font-size: 24px; color: #ffe9c2; text-shadow: 0 2px 4px #000; }
.in-col { display: flex; flex-direction: column; align-items: center; }
.in-abcard { display: flex; gap: 11px; align-items: center; width: 86%; padding: 10px 12px; margin-top: 14px; background: #241f30; border: 1px solid rgba(255,255,255,0.14); border-left: 4px solid var(--c, var(--gold)); border-radius: 12px; animation: cardin 0.4s 0.25s cubic-bezier(0.2,1.2,0.4,1) backwards; }
@keyframes cardin { from { opacity: 0; transform: translateY(12px); } }
.in-abcard img { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; }
.in-abcard h4 { margin: 0; font-size: 13.5px; }
.in-abcard h4 span { font-size: 10px; color: var(--ink-dim); font-weight: normal; margin-left: 5px; }
.in-abcard p { margin: 3px 0 0; font-size: 10.5px; color: var(--ink-dim); line-height: 1.35; }
/* palabras de estado */
.in-words { position: relative; width: 100%; height: 100%; }
.in-words .w { position: absolute; font-family: 'PlayNum', var(--font-ui); font-weight: bold; background-clip: text; -webkit-background-clip: text; color: transparent; animation: wpop 2.6s ease-in-out infinite; }
@keyframes wpop { 0% { opacity: 0; transform: scale(0.5); } 12% { opacity: 1; transform: scale(1.15); } 20% { transform: scale(1); } 78% { opacity: 1; } 95%, 100% { opacity: 0; transform: translateY(-12px); } }
.in-words .w1 { top: 22%; left: 9%; font-size: 25px; background-image: linear-gradient(180deg,#c6ff8e,#3fa33c); filter: drop-shadow(0 0 6px rgba(90,200,60,0.6)) drop-shadow(0 2px 1px #000); }
.in-words .w2 { top: 46%; right: 8%; font-size: 25px; background-image: linear-gradient(180deg,#dff4ff,#58a8e0); filter: drop-shadow(0 0 7px rgba(110,190,255,0.7)) drop-shadow(0 2px 1px #000); animation-delay: 0.5s; }
.in-words .w3 { top: 13%; right: 19%; font-size: 22px; background-image: linear-gradient(180deg,#fff3b0,#e8a13c); filter: drop-shadow(0 0 6px rgba(255,200,80,0.7)) drop-shadow(0 2px 1px #000); animation-delay: 1s; }
.in-words .w4 { bottom: 24%; left: 16%; font-size: 22px; background-image: linear-gradient(180deg,#ffc9c9,#d23c3c); filter: drop-shadow(0 0 6px rgba(255,90,80,0.6)) drop-shadow(0 2px 1px #000); animation-delay: 1.5s; }
.in-mstats { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; gap: 14px; justify-content: center; font-size: 13px; }
.in-mstats span { color: var(--ink-dim); }
.in-mstats b { font-family: 'PlayNum', var(--font-ui); }
.in-mstats .up b { color: #7ee787; animation: statblink2 1.2s steps(2) infinite; }
.in-mstats .dn b { color: #ff6b6b; animation: statblink2 1.2s steps(2) infinite 0.3s; }
@keyframes statblink2 { 50% { opacity: 0.45; } }
/* oráculo */
.in-oracle img.gd { height: 200px; filter: drop-shadow(0 8px 12px rgba(0,0,0,0.6)); animation: guidefloat 3s ease-in-out infinite; }
@keyframes guidefloat { 50% { transform: translateY(-7px); } }
.in-oracle .halo { position: absolute; top: 26px; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, rgba(242,169,59,0.35), transparent 68%); animation: halopulse 2.4s ease-in-out infinite; }
@keyframes halopulse { 50% { opacity: 0.4; transform: scale(1.12); } }
.abilities { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.ab-row { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-dim); }
.ab-face { width: 18px; height: 18px; border-radius: 5px; background: var(--bg2); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink); flex: none; }
button.play {
  margin-top: 4px; background: var(--accent); color: #fff; border: 0; border-radius: 12px;
  padding: 12px; font-size: 15px; font-weight: 700; cursor: pointer;
}
button.play:active { transform: scale(0.98); }
button.quickplay {
  width: 100%; margin-top: 7px; background: none; color: var(--ink-dim);
  border: 1px dashed var(--line); border-radius: 10px; padding: 9px; font-size: 13px; font-weight: 600; cursor: pointer;
}
button.quickplay:hover { color: var(--gold); border-color: var(--gold); }
button.quickplay:active { transform: scale(0.98); }
.mirror { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-dim); font-size: 13px; }
.oppsel { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-dim); font-size: 13px; margin-top: 10px; }
.oppsel select { background: var(--bg2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 13px; }
.rigtune { position: fixed; top: 44px; right: 4px; z-index: 50; background: rgba(0,0,0,.82); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--ink-dim); }
.rigtune.hidden { display: none; }
#rigtune-btn { font-size: 13px; }
.rigtune .rt-h { font-size: 10px; opacity: .8; }
.rt-row { display: flex; align-items: center; gap: 6px; }
.rt-row span { width: 56px; }
.rt-row input[type=range] { width: 90px; }
.rt-row b { width: 26px; text-align: right; color: var(--ink); }

/* ---------- DRAFT ---------- */
.draft { padding: 18px 16px 24px; gap: 12px; display: flex; flex-direction: column; }
.draft-head { text-align: center; }
.draft-title { font-size: 18px; font-weight: 700; }
.pips { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
/* progreso del draft: nodos de etapa del pack (hecho / actual / pendiente) */
.pp { width: 22px; height: 22px; border-radius: 0; background: url('../assets/ui/frame/stage_def.png') center / contain no-repeat; }
.pp.done { background-image: url('../assets/ui/frame/stage_done.png'); }
.pp.cur { background-image: url('../assets/ui/frame/stage_cur.png'); }
.draft-sub { text-align: center; color: var(--ink-dim); font-size: 13px; margin: 2px 0 14px; }
.opt-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.opt-card { text-align: left; background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--c, #888); border-radius: 14px; padding: 13px 14px; display: flex; gap: 12px; align-items: center; cursor: pointer; color: var(--ink); }
.opt-card:active { transform: scale(0.99); }
.opt-card .ci { width: 46px; height: 46px; border-radius: 11px; background: #0d0a07; display: grid; place-items: center; color: var(--c, #ccc); flex: none; }
.opt-card h4 { margin: 0; font-size: 15px; }
.opt-card p { margin: 4px 0 0; font-size: 12px; color: var(--ink-dim); line-height: 1.4; }
.crit-cap { font-size: 9.5px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.4px; margin: 9px 0 5px; }
.crit-ladder { display: flex; gap: 6px; }
.crit-tier { flex: 1; border: 1px solid rgba(255,255,255,0.10); border-radius: 8px; padding: 5px 3px; text-align: center; }
.crit-tier .m { display: flex; justify-content: center; align-items: center; gap: 2px; color: var(--ink-dim); min-height: 14px; }
.crit-tier .m .icn { width: 12px; height: 12px; }
.crit-tier .v { display: block; font-size: 12.5px; font-weight: 700; color: #cdbfa8; margin-top: 2px; line-height: 1.2; }
.crit-tier .vsub { display: block; font-size: 9px; font-weight: 700; color: #cdbfa8; line-height: 1.2; }
.crit-tier.c2 .vsub { color: #e9c069; }
.crit-tier.c3 .vsub { color: var(--crit); }
.crit-tier.c2 { border-color: rgba(215,161,59,0.5); background: rgba(215,161,59,0.10); }
.crit-tier.c2 .m { color: var(--gold); }
.crit-tier.c2 .v { color: #e9c069; }
.crit-tier.c3 { border-color: rgba(215,161,59,0.9); background: rgba(215,161,59,0.20); }
.crit-tier.c3 .m { color: #e9c069; }
.crit-tier.c3 .v { color: var(--crit); }
.crit-note { font-size: 10px; color: var(--ink-dim); margin-top: 6px; line-height: 1.4; }
.crit-passive { font-size: 11px; color: var(--ink-dim); margin-top: 8px; font-style: italic; }
.draft-back { align-self: center; margin-top: 6px; background: none; border: 1px solid var(--line); color: var(--ink-dim); border-radius: 10px; padding: 9px 18px; font-size: 13px; cursor: pointer; }
.draft-cube-wrap { width: 76px; height: 76px; perspective: 540px; margin: 18px auto 20px; }
.cf.empty { background: #2a2620; }
.cf .faceicon { font-size: 24px; font-weight: 800; color: rgba(255,255,255,0.45); display: grid; place-items: center; }
.cf .faceicon .icn { width: 36px; height: 36px; }
.flyicon { position: fixed; width: 36px; height: 36px; z-index: 60; pointer-events: none; display: grid; place-items: center; }

/* ---------- BATTLE ---------- */
.battle { flex: 1; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--bg2); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-dim);
}
.topbar .round { color: var(--gold); font-weight: 400; letter-spacing: 1px; font-family: var(--font-ui); font-size: 15px; }
.topbar button { background: none; border: 1px solid var(--line); color: var(--ink-dim); border-radius: 8px; padding: 4px 10px; font-size: 12px; }

.fighters { display: flex; gap: 8px; padding: 10px 12px 6px; }
.fighter {
  flex: 1; padding: 10px 11px; border-style: solid; border-width: 12px;
  border-image: url('../assets/ui/panel/popup.png') 30 / 12px stretch; /* marco pizarra del pack (9-slice) */
  background: var(--panel); background-clip: padding-box; border-radius: 6px;
}
.fighter.right { text-align: right; }
.f-head { display: flex; align-items: center; gap: 9px; margin-bottom: 2px; }
.fighter.right .f-head { flex-direction: row-reverse; }
.fighter.right .f-mid { text-align: right; }
.fighter.right .hpline { flex-direction: row-reverse; }
.f-mid { flex: 1; min-width: 0; }
/* retrato del campeón en mini-marco metálico */
.f-portrait { position: relative; width: 50px; height: 50px; flex: none; }
.f-portrait canvas { position: absolute; inset: 4px; width: 42px; height: 42px; border-radius: 8px; background: #1c1826; }
.f-portrait::after { content: ''; position: absolute; inset: 0; border: 7px solid transparent; border-image: url('../assets/ui/frame/dieframe.png') 40 / 7px stretch; pointer-events: none; }
.f-name { font-size: 15px; font-weight: 400; font-family: var(--font-ui); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hpline { display: flex; align-items: center; gap: 5px; }
.hpline .hp-ico { width: 15px; height: 15px; flex: none; }
.hpline .hptext { font-family: 'PlayNum', var(--font-ui); font-size: 11px; color: #dfe8d5; flex: none; }
.hpline .hpbar { flex: 1; margin: 0; }
.hpbar { position: relative; height: 13px; border-radius: 7px; background: #14111b; overflow: hidden; margin: 7px 0 3px; border: 1px solid rgba(255,255,255,0.14); box-shadow: inset 0 2px 3px rgba(0,0,0,0.55); }
.hpghost, .hpfill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 6px; }
.hpghost { background: var(--hp-low); transition: width 0.55s ease 0.18s; }
.hpfill { background: linear-gradient(180deg, #8ade5c 0%, var(--hp) 45%, #3f9a28 100%); transition: width 0.12s linear; }
.hpfill.low { background: linear-gradient(180deg, #f07a5e 0%, var(--hp-low) 45%, #a82f20 100%); }
.fighter.right .hpghost, .fighter.right .hpfill { left: auto; right: 0; }
.hptext { font-size: 11px; color: var(--ink-dim); }
/* stats de la tarjeta: ATK/DEF/VEL — verde si buffados, rojo si debuffados, parpadeo al cambiar */
.ministats { display: flex; gap: 11px; margin-top: 6px; }
.fighter.right .ministats { justify-content: flex-end; }
.mstat { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--ink-dim); letter-spacing: 0.4px; }
.mstat b { font-family: 'PlayNum', var(--font-ui); font-size: 13px; color: var(--ink); }
.mstat.up b { color: #7ee465; text-shadow: 0 0 7px rgba(110,220,90,0.5); }
.mstat.down b { color: #ff5a4a; text-shadow: 0 0 7px rgba(255,80,60,0.5); }
.mstat.msflash { animation: msblink 0.55s ease; }
@keyframes msblink { 0%, 100% { filter: none; } 25% { filter: brightness(2.4); } 50% { filter: brightness(1); } 75% { filter: brightness(1.9); } }
.status-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; min-height: 20px; }
.fighter.right .status-row { justify-content: flex-end; }
.stbadge { display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px; border-radius: 9px; font-size: 11px; font-weight: 700; line-height: 1; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.stbadge svg { width: 12px; height: 12px; opacity: 0.92; }
.stbadge i { font-style: normal; }
.stbadge b { font-style: normal; font-weight: 700; font-size: 8.5px; opacity: 0.6; margin-left: 1px; }
.stbadge.good { color: #b9e6a0; border-color: rgba(185, 230, 160, 0.32); }
.stbadge.bad { color: #ffb3a6; border-color: rgba(255, 179, 166, 0.32); }
.stbadge.poison { color: #cda6ff; border-color: rgba(205, 166, 255, 0.36); }
.histline { display: flex; gap: 3px; margin-top: 7px; flex-wrap: wrap; min-height: 16px; }
.fighter.right .histline { justify-content: flex-end; }
.hist-label { font-size: 9px; color: var(--ink-dim); width: 100%; }
.hpip { width: 16px; height: 16px; border-radius: 4px; background: var(--bg2); font-size: 9px; display: grid; place-items: center; color: var(--ink-dim); position: relative; }
.hpip.crit { outline: 1px solid var(--crit); color: var(--crit); }
.hpip { cursor: pointer; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.62); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
.detail { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; max-width: 320px; width: 100%; }
.detail-ab { display: flex; gap: 11px; align-items: center; border-left: 4px solid var(--c, #888); padding-left: 10px; }
.detail-ab .ci { width: 42px; height: 42px; border-radius: 10px; background: #0d0a07; display: grid; place-items: center; color: var(--c, #ccc); flex: none; }
.detail-ab h4 { margin: 0; font-size: 15px; }
.detail-ab p { margin: 3px 0 0; font-size: 12px; color: var(--ink-dim); line-height: 1.4; }
.detail-out { font-size: 13px; color: var(--ink-dim); margin-top: 13px; border-top: 1px solid var(--line); padding-top: 11px; line-height: 1.5; }
.detail-out b { color: var(--ink); }
.detail-close { width: 100%; margin-top: 14px; background: var(--gold); color: #2a1d04; border: 0; border-radius: 10px; padding: 11px; font-weight: 800; cursor: pointer; }

/* registro de combate */
.top-actions { display: flex; align-items: center; gap: 8px; }
.iconbtn { background: none; border: 1px solid var(--line); color: var(--ink-dim); border-radius: 8px; padding: 4px 8px; display: grid; place-items: center; cursor: pointer; }
.iconbtn .icn { width: 16px; height: 16px; }
.detail.clog { max-width: 360px; }
.clog-head h4 { margin: 0 0 6px; font-size: 15px; }
.clog-body { max-height: 64vh; overflow-y: auto; }
.clog-empty { color: var(--ink-dim); font-size: 13px; padding: 12px 0; }
.clog-round { border-top: 1px solid var(--line); padding: 9px 0; }
.clog-rh { font-size: 12px; font-weight: 700; color: var(--gold); margin-bottom: 4px; }
.clog-line { font-size: 11.5px; color: var(--ink); line-height: 1.5; margin: 2px 0; }
.clog-snap { font-size: 10.5px; color: var(--ink-dim); margin-top: 5px; background: var(--bg2); border-radius: 6px; padding: 5px 7px; line-height: 1.6; }
.cl-dmg { color: #ff8a7a; font-weight: 700; }
.cl-heal { color: #9fe0a0; font-weight: 700; }
.cl-buff { color: #e7c06a; }
.cl-miss { color: #7cc7ff; }
.cl-frost { color: #8fd3ff; }
.hpip sup { font-size: 7px; line-height: 1; }
.feedback .icn { vertical-align: -4px; margin-right: 2px; }
.frozen-msg { text-align: center; padding: 16px 10px; }
.frozen-msg .big { font-size: 15px; font-weight: 700; color: #8fd3ff; }
.frozen-msg .sub { font-size: 12px; color: var(--ink-dim); margin-top: 4px; }

.stage { position: relative; flex: 1; min-height: 120px; overflow: hidden; }
.vfx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.totem-wrap { position: absolute; transform: translateX(-50%); z-index: 4; pointer-events: none; }
.totem-sprite { position: absolute; left: 0; bottom: 0; filter: drop-shadow(0 4px 5px rgba(0,0,0,0.55)); }
.totem-charms { position: absolute; left: 50%; bottom: 78%; transform: translateX(-50%) scale(var(--tscale, 1)); transform-origin: center bottom; display: flex; gap: 5px; align-items: flex-end; pointer-events: none; }
.totem-charm { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; position: relative; animation: tcFloat 2.4s ease-in-out infinite; }
.totem-charm svg { width: 15px; height: 15px; stroke: #fff; }
.tc-dmg    { background: radial-gradient(circle, rgba(255,150,70,0.95), rgba(200,40,30,0.45)); box-shadow: 0 0 calc(5px + var(--lvl,1) * 2px) calc(1px + var(--lvl,1) * 0.6px) rgba(255,90,40,0.85); }
.tc-heal   { background: radial-gradient(circle, rgba(130,240,150,0.95), rgba(30,160,70,0.45)); box-shadow: 0 0 10px 2px rgba(70,220,110,0.8); }
.tc-thorns { background: radial-gradient(circle, rgba(240,205,125,0.95), rgba(180,120,30,0.45)); box-shadow: 0 0 10px 2px rgba(230,170,60,0.8); }
.tc-frost  { background: radial-gradient(circle, rgba(160,225,255,0.95), rgba(40,140,210,0.45)); box-shadow: 0 0 10px 2px rgba(90,190,255,0.85); }
.tc-num { position: absolute; bottom: -7px; right: -7px; font-size: 11px; font-weight: 800; background: #c8281e; color: #fff; border-radius: 8px; padding: 0 4px; line-height: 14px; box-shadow: 0 1px 2px rgba(0,0,0,0.5); }
@keyframes tcFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
/* Esbirro de Vexira: prop animado (rig de vídeo) + número de daño */
.esbirro-wrap { position: absolute; bottom: 34px; width: 44px; height: 56px; overflow: visible; z-index: 4; pointer-events: none; transform: translateX(-50%); }
.esbirro-wrap .fcv { position: absolute; left: 50%; bottom: 0; pointer-events: none; filter: drop-shadow(0 4px 5px rgba(0,0,0,0.55)); }
.esbirro-num { position: absolute; left: 50%; transform: translateX(-50%); z-index: 5; font-size: 12px; font-weight: 800; background: #6e3a8a; color: #fff; border-radius: 9px; padding: 0 6px; line-height: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.55); border: 1px solid rgba(180,140,210,0.6); }
.platform { position: absolute; left: 10%; right: 10%; bottom: 16px; height: 22px; background: var(--wood); border-top: 7px solid var(--grass); border-radius: 10px; }
.capsules { position: absolute; left: 0; right: 0; bottom: 34px; display: flex; justify-content: space-around; align-items: flex-end; padding: 0 18%; }
.cap { width: 40px; height: 56px; border-radius: 18px; background: var(--accent); position: relative; transition: transform 0.12s ease; }
.cap.rigged { background: transparent; width: 44px; height: 56px; overflow: visible; }
.cap.rigged .fcv { position: absolute; left: 50%; bottom: 0; pointer-events: none; filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5)); }
.cap.hurt { animation: shake 0.3s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.feedback { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-size: 14px; color: var(--gold); min-height: 18px; font-family: var(--font-ui); }
/* números y palabras de combate: fuente Play + degradados con contorno (estilo pack) */
.pop {
  position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  font-family: 'PlayNum', var(--font-ui); letter-spacing: 0.5px;
  pointer-events: none; white-space: nowrap; z-index: 8;
  display: flex; flex-direction: column; align-items: center;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
/* daño normal: rojo con punch-rebote */
.pop.dmg { font-size: 30px;
  background-image: linear-gradient(180deg, #ffd2c2 0%, #ff5040 45%, #a81f10 100%);
  filter: drop-shadow(0 2px 0 #3d0705) drop-shadow(0 -1px 0 #3d0705) drop-shadow(2px 0 0 #3d0705) drop-shadow(-2px 0 0 #3d0705) drop-shadow(0 4px 7px rgba(0,0,0,0.6));
  animation: punch 1.05s cubic-bezier(0.2,0.9,0.3,1) forwards; }
.pop.dmg.big { font-size: 38px; }
/* curación: verde con flote */
.pop.heal { font-size: 26px;
  background-image: linear-gradient(180deg, #dfffc8 0%, #7ee465 45%, #2f9a28 100%);
  filter: drop-shadow(0 2px 0 #0d3a10) drop-shadow(0 -1px 0 #0d3a10) drop-shadow(2px 0 0 #0d3a10) drop-shadow(-2px 0 0 #0d3a10) drop-shadow(0 4px 7px rgba(0,0,0,0.55));
  animation: healFloat 1.3s ease forwards; }
/* crítico de lujo: glow + onda + rótulo + número fuego */
.pop.crit { animation: punch 1.25s cubic-bezier(0.2,0.9,0.3,1) forwards; -webkit-text-fill-color: initial; background: none; }
.pop.crit .num { font-size: 40px; font-family: 'PlayNum', var(--font-ui);
  background-image: linear-gradient(180deg, #ffe9a8 0%, #ffb53e 40%, #ff5a1e 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #4a0a06) drop-shadow(0 -2px 0 #4a0a06) drop-shadow(2px 0 0 #4a0a06) drop-shadow(-2px 0 0 #4a0a06) drop-shadow(0 5px 9px rgba(0,0,0,0.65)); }
.pop.crit.big .num { font-size: 48px; }
.pop.crit .pcl { width: 92px; height: auto; display: block; margin-bottom: -4px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5)); }
.pop.crit .glow { position: absolute; top: 50%; left: 50%; width: 150px; height: 150px; transform: translate(-50%,-50%); z-index: -1;
  background: #ff9a2e; -webkit-mask: url('../assets/ui/label/glow.png') center / 100% 100% no-repeat; mask: url('../assets/ui/label/glow.png') center / 100% 100% no-repeat;
  animation: glowPulse 1.25s ease forwards; }
.pop.crit .ring { position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; border: 3px solid rgba(255,200,90,0.9); border-radius: 50%; transform: translate(-50%,-50%); z-index: -1; animation: ringX 0.6s ease-out forwards; }
/* palabras de estado: punch suave, una paleta por familia */
.pop.wd { font-size: 17px; letter-spacing: 0.8px; animation: wordPop 1.35s cubic-bezier(0.25,0.9,0.3,1) forwards; }
.pop.w-poison { background-image: linear-gradient(180deg, #e4ff9e 0%, #8de23c 45%, #3f7a12 100%);
  filter: drop-shadow(0 2px 0 #1c3a04) drop-shadow(0 -1px 0 #1c3a04) drop-shadow(2px 0 0 #1c3a04) drop-shadow(-2px 0 0 #1c3a04) drop-shadow(0 3px 6px rgba(0,0,0,0.55)); }
.pop.w-froze { background-image: linear-gradient(180deg, #eafaff 0%, #6fd2f5 45%, #1e7fb8 100%);
  filter: drop-shadow(0 2px 0 #082c44) drop-shadow(0 -1px 0 #082c44) drop-shadow(2px 0 0 #082c44) drop-shadow(-2px 0 0 #082c44) drop-shadow(0 3px 6px rgba(0,0,0,0.55)); }
.pop.w-stun { background-image: linear-gradient(180deg, #fff6c8 0%, #ffd23e 45%, #c78a08 100%);
  filter: drop-shadow(0 2px 0 #4a3202) drop-shadow(0 -1px 0 #4a3202) drop-shadow(2px 0 0 #4a3202) drop-shadow(-2px 0 0 #4a3202) drop-shadow(0 3px 6px rgba(0,0,0,0.55)); }
.pop.w-bleed { background-image: linear-gradient(180deg, #ff9a8a 0%, #e03a28 45%, #7a0e04 100%);
  filter: drop-shadow(0 2px 0 #330502) drop-shadow(0 -1px 0 #330502) drop-shadow(2px 0 0 #330502) drop-shadow(-2px 0 0 #330502) drop-shadow(0 3px 6px rgba(0,0,0,0.55)); }
.pop.w-buff { background-image: linear-gradient(180deg, #e4ffd8 0%, #7ee465 45%, #2f9a28 100%);
  filter: drop-shadow(0 2px 0 #0d3a10) drop-shadow(0 -1px 0 #0d3a10) drop-shadow(2px 0 0 #0d3a10) drop-shadow(-2px 0 0 #0d3a10) drop-shadow(0 3px 6px rgba(0,0,0,0.55)); }
.pop.w-debuff { background-image: linear-gradient(180deg, #f4d8ff 0%, #c86ef0 45%, #7a28b0 100%);
  filter: drop-shadow(0 2px 0 #2e0a48) drop-shadow(0 -1px 0 #2e0a48) drop-shadow(2px 0 0 #2e0a48) drop-shadow(-2px 0 0 #2e0a48) drop-shadow(0 3px 6px rgba(0,0,0,0.55)); }
.pop.w-shield { background-image: linear-gradient(180deg, #e2f2ff 0%, #6fb2f0 45%, #2358a8 100%);
  filter: drop-shadow(0 2px 0 #0a2244) drop-shadow(0 -1px 0 #0a2244) drop-shadow(2px 0 0 #0a2244) drop-shadow(-2px 0 0 #0a2244) drop-shadow(0 3px 6px rgba(0,0,0,0.55)); }
.pop.w-absorb { font-size: 15px; background-image: linear-gradient(180deg, #f2f2f2 0%, #b8b4c4 50%, #6e6a7a 100%);
  filter: drop-shadow(0 2px 0 #26222e) drop-shadow(0 -1px 0 #26222e) drop-shadow(2px 0 0 #26222e) drop-shadow(-2px 0 0 #26222e) drop-shadow(0 3px 6px rgba(0,0,0,0.5)); }
.pop.w-miss { font-size: 19px; font-style: italic;
  background-image: linear-gradient(180deg, #eef2ff 0%, #a8c4e8 50%, #5a7ba8 100%);
  filter: drop-shadow(0 2px 0 #16283d) drop-shadow(0 -1px 0 #16283d) drop-shadow(2px 0 0 #16283d) drop-shadow(-2px 0 0 #16283d) drop-shadow(0 3px 6px rgba(0,0,0,0.55));
  animation: missSlide 1.1s ease forwards; }
@keyframes punch {
  0% { opacity: 0; transform: translate(-50%,14px) scale(0.25); }
  16% { opacity: 1; transform: translate(-50%,-8px) scale(1.45); }
  30% { transform: translate(-50%,-12px) scale(1); }
  72% { opacity: 1; transform: translate(-50%,-30px) scale(1); }
  100% { opacity: 0; transform: translate(-50%,-52px) scale(0.9); }
}
@keyframes healFloat { 0%{opacity:0; transform:translate(-50%,10px) scale(0.5)} 18%{opacity:1; transform:translate(-50%,-6px) scale(1.15)} 30%{transform:translate(-50%,-8px) scale(1)} 100%{opacity:0; transform:translate(-50%,-42px) scale(1)} }
@keyframes wordPop {
  0% { opacity: 0; transform: translate(-50%,10px) scale(0.4); }
  14% { opacity: 1; transform: translate(-50%,-5px) scale(1.18); }
  26% { transform: translate(-50%,-8px) scale(1); }
  74% { opacity: 1; transform: translate(-50%,-24px) scale(1); }
  100% { opacity: 0; transform: translate(-50%,-40px) scale(0.94); }
}
@keyframes missSlide {
  0% { opacity: 0; transform: translate(calc(-50% - 14px),4px) scale(0.6) rotate(-5deg); }
  18% { opacity: 1; transform: translate(calc(-50% + 6px),-8px) scale(1.1) rotate(3deg); }
  70% { opacity: 1; transform: translate(calc(-50% + 12px),-20px) scale(1) rotate(3deg); }
  100% { opacity: 0; transform: translate(calc(-50% + 18px),-34px) scale(0.95) rotate(3deg); }
}
@keyframes glowPulse { 0%{opacity:0; transform:translate(-50%,-50%) scale(0.4)} 18%{opacity:0.95; transform:translate(-50%,-50%) scale(1.15)} 60%{opacity:0.5} 100%{opacity:0; transform:translate(-50%,-50%) scale(1.3)} }
@keyframes ringX { 0%{opacity:1; width:16px; height:16px} 100%{opacity:0; width:120px; height:120px} }

/* énfasis de crítico: va en el pop (Critical! + número); sin banner central */
.speedlines { position: absolute; inset: 0; pointer-events: none; z-index: 5; background: repeating-conic-gradient(from 0deg at 50% 46%, rgba(255,220,140,0) 0deg, rgba(255,220,140,0) 6deg, rgba(255,220,140,0.20) 7deg, rgba(255,220,140,0) 9deg); }
.ko-flash { position: fixed; inset: 0; background: #fff; z-index: 60; pointer-events: none; }
.ko-banner { position: absolute; top: 40%; left: 50%; transform: translate(-50%,-50%); font-size: 54px; font-weight: 900; color: #fff; text-shadow: 0 3px 0 #000, 0 0 22px rgba(255,255,255,0.5); z-index: 7; letter-spacing: 4px; pointer-events: none; }

.log { padding: 6px 14px; background: var(--bg2); border-top: 1px solid var(--line); min-height: 40px; }
.log .line { font-size: 11.5px; color: var(--ink-dim); padding: 1px 0; }
.log .line:first-child { color: var(--ink); }

.controls { padding: 8px 12px 16px; background: var(--panel); border-top: 1px solid var(--line); }

/* carta de habilidad seleccionada */
.cardarea { min-height: 78px; margin-bottom: 8px; }
.cardhint { color: var(--ink-dim); font-size: 12.5px; text-align: center; padding: 26px 0; }
.abcard { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--c, #888); border-radius: 12px; padding: 9px 12px; display: flex; gap: 11px; align-items: center; }
.abcard .ci { width: 40px; height: 40px; border-radius: 10px; background: #0d0a07; display: grid; place-items: center; color: var(--c, #ccc); flex: none; }
.abcard .ctxt { min-width: 0; }
.abcard h4 { margin: 0; font-size: 14px; }
.lado { display: inline-block; font-size: 10px; font-weight: 800; padding: 1px 8px; border-radius: 8px; background: var(--gold); color: #2a1d04; vertical-align: middle; margin-left: 6px; }
.abcard p { margin: 3px 0 0; font-size: 11.5px; color: var(--ink-dim); line-height: 1.35; }
.abcard .meta { font-size: 10.5px; color: var(--ink-dim); margin-top: 4px; }
.abcard .meta.proj { color: var(--ink); font-size: 12px; }
.hl { color: #ff9a6b; font-weight: 700; }
.crit-tag { color: var(--crit); font-weight: 800; }

/* bandeja de madera + dados 3D */
.tray {
  padding: 16px 10px; display: flex; justify-content: center; position: relative;
  border-style: solid; border-width: 14px;
  border-image: url('../assets/ui/panel/popup.png') 30 / 14px stretch; /* bandeja = marco pizarra del pack */
  background: #211d2b; background-clip: padding-box; border-radius: 6px;
}
.tray-info { position: absolute; top: 6px; right: 8px; z-index: 3; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.20); color: #f3e9da; display: grid; place-items: center; cursor: pointer; padding: 0; }
.tray-info:hover { background: rgba(0,0,0,0.55); border-color: var(--gold); color: var(--gold); }
.tray-info .icn { width: 14px; height: 14px; }
.dice { display: flex; gap: 16px; justify-content: center; }
.cube-wrap { width: 76px; height: 76px; perspective: 540px; position: relative; cursor: pointer; }
.cube-wrap.blocked { cursor: not-allowed; }
.cube { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; }
.cf { position: absolute; width: 76px; height: 76px; border-radius: 12px; background: var(--c, #555); color: #fff; display: grid; place-items: center; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.14), inset 0 -6px 10px rgba(0,0,0,0.28); }
.cf .icn { width: 38px; height: 38px; }
.cf .cost { position: absolute; top: 5px; left: 7px; font-size: 12px; font-weight: 800; opacity: 0.92; text-shadow: 0 1px 1px rgba(0,0,0,0.5); }
.cf-front  { transform: translateZ(38px); }
.cf-back   { transform: rotateY(180deg) translateZ(38px); }
.cf-right  { transform: rotateY(90deg) translateZ(38px); }
.cf-left   { transform: rotateY(-90deg) translateZ(38px); }
.cf-top    { transform: rotateX(90deg) translateZ(38px); }
.cf-bottom { transform: rotateX(-90deg) translateZ(38px); }
.cube-wrap.blocked .cf { filter: grayscale(1) brightness(0.78); }
/* dado seleccionado: borde de foco amarillo + check dorado (ItemFrame del pack) */
.cube-wrap.selected::after {
  content: ''; position: absolute; inset: -8px; pointer-events: none; z-index: 3;
  background: url('../assets/ui/frame/if_check.png') right 0 bottom 0 / 26px auto no-repeat,
              url('../assets/ui/frame/if_focus.png') center / 100% 100% no-repeat;
}
.cd-overlay { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.cd-ring { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-90deg); width: 60px; height: 60px; }
.cd-ring circle { fill: none; stroke-width: 3.5; }
.cd-track { stroke: rgba(255,255,255,0.16); }
.cd-prog { stroke: var(--gold); stroke-linecap: round; }
.cd-num { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 22px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.85); }
/* pop-up estado de dados */
.ds-detail h4 { margin: 0 0 4px; font-size: 15px; }
.ds-leg { font-size: 10.5px; color: var(--ink-dim); margin-bottom: 10px; }
.ds-tbl { width: 100%; border-collapse: collapse; }
.ds-tbl th { font-size: 10px; color: var(--ink-dim); font-weight: 500; padding: 0 0 6px; text-align: center; }
.ds-tbl th.l { text-align: left; }
.ds-row td { padding: 5px 0; border-top: 0.5px solid var(--line); }
.ds-ab { display: flex; align-items: center; gap: 8px; }
.ds-ic { width: 26px; height: 26px; border-radius: 7px; background: #14111b; display: grid; place-items: center; color: var(--c, #ccc); flex: none; overflow: hidden; box-shadow: 0 0 0 1px var(--c, #555); }
.ds-ic .icn { width: 16px; height: 16px; }
.ds-ic .spico { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.ds-nm { font-size: 12px; color: var(--ink); }
.ds-cell { text-align: center; width: 42px; }
.ds-free { color: #57c25a; display: inline-flex; }
.ds-free .icn { width: 18px; height: 18px; }
.ds-cd { position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; }
.ds-ring { width: 28px; height: 28px; transform: rotate(-90deg); }
.ds-ring circle { fill: none; stroke-width: 4; }
.ds-cdn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 12px; font-weight: 800; color: var(--gold); }
/* dado multiplicado: brillo pulsante detrás (glow del pack) — dorado ×2, naranja y mayor ×3 */
.cube-wrap.lit::before {
  content: ''; position: absolute; inset: -18px; z-index: -1; pointer-events: none;
  background: #ffc63e;
  -webkit-mask: url('../assets/ui/label/glow.png') center / 100% 100% no-repeat;
  mask: url('../assets/ui/label/glow.png') center / 100% 100% no-repeat;
  animation: dieGlow 1.3s ease-in-out infinite;
}
.cube-wrap.lit3::before { background: #ff8a2e; inset: -26px; animation-duration: 0.9s; }
@keyframes dieGlow { 0%, 100% { opacity: 0.65; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.08); } }
button.confirm {
  width: 100%; margin-top: 11px; background: none; color: #5a3400; cursor: pointer;
  border-style: solid; border-width: 14px 18px;
  border-image: url('../assets/ui/btn/rect_yellow.png') 30 34 fill / 14px 18px stretch; /* botón dorado biselado del pack */
  padding: 3px; font-size: 16px; font-family: var(--font-ui); letter-spacing: 0.5px; text-shadow: 0 1px 0 rgba(255,255,255,0.25);
}
button.confirm:disabled { border-image-source: url('../assets/ui/btn/rect_gray.png'); color: #6b6b74; text-shadow: none; cursor: default; }
button.confirm:active:not(:disabled) { transform: scale(0.985) translateY(1px); }

/* ---------- GAME OVER ---------- */
.over { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 30px; text-align: center; }
.over h1 { font-size: 34px; margin: 0; font-family: var(--font-ui); font-weight: 400; letter-spacing: 2px; }
.over h1.win { color: var(--hp); }
.over h1.lose { color: var(--hp-low); }
.over p { color: var(--ink-dim); margin: 0; }
.over button { background: var(--gold); color: #2a1d04; border: 0; border-radius: 12px; padding: 13px 26px; font-size: 15px; font-weight: 800; }
.over h1.draw { color: var(--gold); }
.over-banner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.over-orb { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 24px; color: #fff; }
.over-sub { color: var(--ink-dim); margin: 0; font-size: 13px; }
.over-stats { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; width: 100%; max-width: 290px; }
.os-row { display: flex; align-items: center; font-size: 14px; padding: 3px 0; }
.os-row b { flex: 0 0 56px; color: var(--ink); }
.os-row b:first-child { text-align: left; }
.os-row b:last-child { text-align: right; }
.os-row span { flex: 1; text-align: center; font-size: 11px; color: var(--ink-dim); }
.os-row.os-head { border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 4px; }
.os-row.os-head span, .os-row.os-head b { font-size: 11px; color: var(--ink-dim); font-weight: 500; flex: 1; text-align: center; }
.os-row.os-head b:first-child { text-align: left; }
.os-row.os-head b:last-child { text-align: right; }

/* onboarding */
.help-btn { align-self: center; background: none; border: 1px solid var(--line); color: var(--ink-dim); border-radius: 10px; padding: 9px 18px; font-size: 13px; cursor: pointer; }
.detail.help h4 { margin: 0 0 10px; font-size: 16px; }
.help-list { margin: 0; padding-left: 18px; }
.help-list li { font-size: 12.5px; color: var(--ink-dim); line-height: 1.5; margin: 6px 0; }
.help-list b { color: var(--ink); }

/* auras de estado */
.cap.au-frozen::before, .cap.au-furia::before, .cap.au-bleed::before { content: ''; position: absolute; inset: -5px; border-radius: 20px; pointer-events: none; }
.cap.au-frozen { filter: saturate(0.6) brightness(1.12); }
.cap.au-frozen::before { box-shadow: 0 0 14px 4px rgba(110,180,240,0.85); }
.cap.au-furia::before { box-shadow: 0 0 13px 3px rgba(226,87,76,0.85); animation: aurapulse 0.9s ease-in-out infinite; }
.cap.au-bleed::before { box-shadow: 0 7px 14px 0 rgba(190,40,40,0.8); }
.cap.au-shield::after { content: ''; position: absolute; inset: -7px; border-radius: 22px; border: 2px solid rgba(90,200,235,0.85); pointer-events: none; }
@keyframes aurapulse { 0%,100% { opacity: 0.45 } 50% { opacity: 1 } }

/* ---------- PANTALLA DE CARGA ---------- */
.screen.loading { position: relative; overflow: hidden; justify-content: space-between; }
.load-bg { position: absolute; inset: 0; background: url('../assets/ui/bg/title.png') center / cover no-repeat; }
.load-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23,20,29,0.25) 0%, rgba(23,20,29,0) 35%, rgba(23,20,29,0.88) 88%); }
.load-mid { position: relative; text-align: center; margin-top: 16vh; }
.load-logo { margin: 0; font-family: 'Josefin', var(--font-ui); font-weight: 700; font-size: 46px; letter-spacing: 7px; color: #ffd873; text-shadow: 0 3px 0 rgba(60,30,0,0.55), 0 0 26px rgba(255,200,80,0.45); }
.load-sub { margin: 8px 0 0; color: rgba(255,255,255,0.75); font-size: 13px; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.load-bottom { position: relative; padding: 0 26px calc(30px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.load-ring { width: 44px; height: 44px; animation: spin 1.1s linear infinite; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
@keyframes spin { to { transform: rotate(360deg); } }
.load-bar { width: 100%; max-width: 340px; height: 14px; border-radius: 8px; background: rgba(10,8,14,0.72); border: 1px solid rgba(255,255,255,0.22); box-shadow: inset 0 2px 4px rgba(0,0,0,0.6); overflow: hidden; }
.load-fill { height: 100%; width: 0%; border-radius: 7px; background: linear-gradient(180deg, #ffe9a8 0%, #f2a93b 50%, #b86a10 100%); transition: width 0.25s ease; box-shadow: 0 0 10px rgba(255,190,80,0.55); }
.load-pct { font-family: 'PlayNum', var(--font-ui); font-size: 13px; color: #ffd873; text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.load-tip { font-size: 11.5px; color: rgba(255,255,255,0.62); text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,0.6); }

/* ---------- TEST DEL ORÁCULO ---------- */
.screen.quiz { position: relative; overflow: hidden; }
.qz-bg { position: absolute; inset: 0; background: url('../assets/ui/bg/quiz.png') center / cover no-repeat; }
.qz-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23,20,29,0.30) 0%, rgba(23,20,29,0.05) 40%, rgba(23,20,29,0.92) 82%); }
.qz-prog { position: relative; display: flex; gap: 5px; justify-content: center; padding: 14px 0 0; z-index: 2; }
.qz-prog .qq { width: 16px; height: 16px; background: url('../assets/ui/frame/stage_def.png') center / contain no-repeat; }
.qz-prog .qq.done { background-image: url('../assets/ui/frame/stage_done.png'); }
.qz-prog .qq.cur { background-image: url('../assets/ui/frame/stage_cur.png'); }
.qz-scene { position: relative; flex: 1; display: flex; align-items: flex-end; z-index: 1; min-height: 30vh; }
.qz-guide { position: absolute; left: 6px; bottom: -6px; width: 185px; transform: scaleX(-1); filter: drop-shadow(0 8px 10px rgba(0,0,0,0.55)); }
.qz-guide.talk { animation: qzTalk 0.34s ease; }
@keyframes qzTalk { 0%, 100% { transform: scaleX(-1) translateY(0); } 50% { transform: scaleX(-1) translateY(-7px); } }
.qz-panelzone { position: relative; z-index: 2; padding: 0 12px calc(16px + env(safe-area-inset-bottom)); }
.qz-flag { display: inline-block; background: url('../assets/ui/label/flag_purple.png') center / 100% 100% no-repeat; font-family: 'Josefin', var(--font-ui); font-size: 14px; color: #fff; padding: 8px 26px 13px; margin: 0 0 -9px 14px; position: relative; z-index: 3; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.qz-dialog { position: relative; border-style: solid; border-width: 14px; border-radius: 6px; border-image: url('../assets/ui/panel/popup.png') 30 / 14px stretch; background: #241f30; background-clip: padding-box; padding: 12px 12px 10px; min-height: 88px; }
.qz-text { font-size: 14.5px; line-height: 1.55; min-height: 44px; }
.qz-text .hl { color: var(--gold); }
.qz-next { display: block; margin: 8px 0 0 auto; background: none; border: 0; color: var(--gold); font-family: var(--font-ui); font-size: 13px; cursor: pointer; animation: qzBlink 1.1s ease-in-out infinite; }
@keyframes qzBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.qz-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.qz-opt { text-align: left; background: #2e2839; border: 1px solid rgba(255,255,255,0.14); border-radius: 11px; color: var(--ink); font-family: var(--font-ui); font-size: 13.5px; padding: 11px 13px; cursor: pointer; }
.qz-opt:hover { background: #3a3348; border-color: var(--gold); }
.qz-opt:active { transform: scale(0.985); }
.qz-reveal { position: absolute; inset: 0; z-index: 5; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(15,12,20,0.90); text-align: center; padding: 20px; }
.qz-reveal.show { display: flex; animation: qzFade 0.5s ease; }
@keyframes qzFade { from { opacity: 0; } to { opacity: 1; } }
.qz-sub { color: var(--ink-dim); font-size: 14px; letter-spacing: 1px; }
.qz-portrait { position: relative; width: 170px; height: 170px; }
.qz-portrait canvas { position: absolute; inset: 12px; width: 146px; height: 146px; border-radius: 16px; background: #1c1826; }
.qz-portrait::after { content: ''; position: absolute; inset: 0; border: 16px solid transparent; border-image: url('../assets/ui/frame/dieframe.png') 40 / 16px stretch; }
.qz-glow { position: absolute; top: 50%; left: 50%; width: 340px; height: 340px; transform: translate(-50%,-50%); z-index: -1; background: var(--accent, #f2a93b); -webkit-mask: url('../assets/ui/label/glow.png') center / 100% 100% no-repeat; mask: url('../assets/ui/label/glow.png') center / 100% 100% no-repeat; animation: qzPulse 1.6s ease-in-out infinite; opacity: 0.8; }
@keyframes qzPulse { 0%, 100% { transform: translate(-50%,-50%) scale(0.94); } 50% { transform: translate(-50%,-50%) scale(1.06); } }
.qz-name { font-family: 'Josefin', var(--font-ui); font-size: 38px; letter-spacing: 3px; color: var(--accent, #f2a93b); margin: 0; text-shadow: 0 3px 0 rgba(0,0,0,0.45); }
.qz-blurb { max-width: 320px; font-size: 12.5px; color: #c9c2d4; line-height: 1.5; }
.qz-retry { background: none; border: 1px dashed rgba(255,255,255,0.25); color: var(--ink-dim); border-radius: 9px; padding: 8px 16px; font-size: 12px; font-family: var(--font-ui); cursor: pointer; }

/* ---------- HUB DEL HÉROE ---------- */
.screen.hub { padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); gap: 12px; display: flex; flex-direction: column; }
.hub-title { font-family: 'Josefin', var(--font-ui); font-size: 22px; letter-spacing: 3px; color: var(--gold); text-align: center; margin: 2px 0 0; }
.hub-stage { position: relative; height: 220px; border-style: solid; border-width: 14px; border-radius: 6px; border-image: url('../assets/ui/panel/popup.png') 30 / 14px stretch; background: radial-gradient(ellipse at 50% 82%, #2a2018, #16121e 75%); background-clip: padding-box; }
.hub-ground { position: absolute; left: 10%; right: 10%; bottom: 18px; height: 16px; background: var(--wood); border-top: 6px solid var(--grass); border-radius: 9px; }
.hub-cap { position: absolute; left: 50%; bottom: 34px; width: 44px; height: 56px; }
.hub-cap .fcv { position: absolute; left: 50%; bottom: 0; pointer-events: none; filter: drop-shadow(0 5px 6px rgba(0,0,0,0.5)); }
.hub-name { position: absolute; top: 10px; left: 0; right: 0; text-align: center; font-family: 'Josefin', var(--font-ui); font-size: 19px; letter-spacing: 1.5px; color: var(--ink); text-shadow: 0 2px 3px rgba(0,0,0,0.6); }
.hub-die { display: flex; gap: 7px; justify-content: center; }
.hub-die .face, .bd-die .face { position: relative; width: 56px; height: 56px; }
.face img.sp { position: absolute; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); border-radius: 9px; object-fit: cover; }
.face::before { content: ''; position: absolute; inset: 0; border: 8px solid transparent; border-image: url('../assets/ui/frame/dieframe.png') 40 / 8px stretch; z-index: 1; pointer-events: none; }
.face .fflag { position: absolute; z-index: 2; top: -1px; right: 2px; width: 15px; height: 23px; padding-top: 3px; background: var(--c, #666); -webkit-mask: url('../assets/ui/frame/flag_white.png') center / 100% 100% no-repeat; mask: url('../assets/ui/frame/flag_white.png') center / 100% 100% no-repeat; text-align: center; font-family: 'PlayNum', var(--font-ui); font-size: 10px; color: #fff; }
.hub-vs { border-style: solid; border-width: 12px; border-radius: 6px; border-image: url('../assets/ui/panel/popup.png') 30 / 12px stretch; background: var(--panel); background-clip: padding-box; padding: 10px 12px; }
.hub-vs h3 { margin: 0 0 8px; font-size: 12px; color: var(--ink-dim); letter-spacing: 1px; text-transform: uppercase; }
.hub-vs .row { display: flex; gap: 8px; }
.hub-vs input { flex: 1; background: #1c1826; border: 1px solid rgba(255,255,255,0.16); border-radius: 10px; color: var(--ink); font-family: var(--font-ui); font-size: 13px; padding: 10px 12px; outline: none; }
.hub-vs input:focus { border-color: var(--gold); }
.hub-vs .soon { font-size: 10.5px; color: var(--ink-dim); margin-top: 6px; }
.hub-btns { display: flex; flex-direction: column; gap: 9px; }
.hub-gold { background: none; color: #5a3400; cursor: pointer; border-style: solid; border-width: 14px 18px; border-image: url('../assets/ui/btn/rect_yellow.png') 30 34 fill / 14px 18px stretch; padding: 3px; font-size: 16px; font-family: var(--font-ui); letter-spacing: 0.5px; text-shadow: 0 1px 0 rgba(255,255,255,0.25); }
.hub-gold:active { transform: scale(0.985) translateY(1px); }
.hub-sec { background: var(--panel2); border: 1px solid rgba(255,255,255,0.16); color: var(--ink); border-radius: 11px; padding: 11px; font-family: var(--font-ui); font-size: 14px; cursor: pointer; }
.hub-sec:active { transform: scale(0.985); }

/* ---------- PVP: red del hub y temporizador ---------- */
.hub-me { font-size: 11.5px; color: var(--ink-dim); margin-bottom: 7px; }
.hub-me b { color: var(--gold); font-family: 'PlayNum', var(--font-ui); letter-spacing: 0.5px; }
.hub-mini { padding: 5px 10px !important; font-size: 11px !important; border-width: 8px 12px !important; vertical-align: middle; margin-left: 4px; }
.hub-inc-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 8px 10px; background: #2e2734; border: 1px solid var(--gold); border-radius: 11px; font-size: 12.5px; box-shadow: 0 0 10px rgba(242, 169, 59, 0.22); animation: incPulse 1.6s ease-in-out infinite; }
.hub-inc-row b { color: var(--gold); }
.hub-inc-row .hi-btns { margin-left: auto; display: flex; gap: 5px; align-items: center; }
@keyframes incPulse { 0%, 100% { box-shadow: 0 0 6px rgba(242, 169, 59, 0.18); } 50% { box-shadow: 0 0 14px rgba(242, 169, 59, 0.40); } }
.pvp-timer { text-align: center; font-family: 'PlayNum', var(--font-ui); font-size: 13px; color: var(--ink-dim); padding: 2px 0 4px; }
.pvp-timer b { color: var(--gold); font-size: 15px; }
.pvp-timer.urgent b { color: #ff5d5d; animation: urgentBlink 0.5s steps(2) infinite; }
@keyframes urgentBlink { 50% { opacity: 0.35; } }

/* ---------- DICE BUILDER ---------- */
.screen.builder { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); display: block; }
.bd-title { font-family: 'Josefin', var(--font-ui); font-size: 20px; letter-spacing: 2px; color: var(--gold); text-align: center; margin: 2px 0 12px; }
.bd-h2 { font-size: 12px; color: var(--ink-dim); letter-spacing: 1.2px; margin: 16px 0 8px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.bd-h2::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.12); }
.bd-roster { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; }
.bd-slot { position: relative; width: 56px; height: 56px; flex: none; }
.bd-slot canvas, .bd-slot .rlock { position: absolute; inset: 5px; width: 46px; height: 46px; border-radius: 9px; background: #1c1826; }
.bd-slot::after { content: ''; position: absolute; inset: 0; border: 7px solid transparent; border-image: url('../assets/ui/frame/dieframe.png') 40 / 7px stretch; pointer-events: none; }
.bd-slot.active::before { content: ''; position: absolute; inset: -5px; background: url('../assets/ui/frame/if_focus.png') center / 100% 100% no-repeat; z-index: 2; }
.bd-slot .rlock { display: grid; place-items: center; z-index: 1; }
.bd-slot .rlock img { width: 22px; opacity: 0.85; }
.bd-slot.locked canvas { filter: grayscale(1) brightness(0.4); }
.bd-champbar { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 12px; border-style: solid; border-width: 12px; border-radius: 6px; border-image: url('../assets/ui/panel/popup.png') 30 / 12px stretch; background: var(--panel); background-clip: padding-box; }
.bd-champbar .n { font-family: 'Josefin', var(--font-ui); font-size: 19px; letter-spacing: 1px; }
.bd-champbar .s { display: flex; gap: 10px; margin-top: 3px; }
.bd-champbar .s span { font-size: 10px; color: var(--ink-dim); }
.bd-champbar .s b { font-family: 'PlayNum', var(--font-ui); font-size: 12px; color: var(--ink); margin-left: 3px; }
.bd-die { display: flex; gap: 7px; justify-content: center; }
.bd-group { margin-bottom: 10px; }
.bd-gtitle { font-size: 11px; color: #8b8199; margin: 0 0 5px 2px; }
.bd-pair { display: flex; gap: 8px; }
.bd-card { flex: 1; position: relative; display: flex; gap: 9px; align-items: center; padding: 8px 9px; cursor: pointer; background: #241f30; border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; }
.bd-card:hover { background: #2e2839; }
.bd-card.equip { border-color: var(--gold); background: #2e2734; box-shadow: 0 0 0 1px var(--gold), 0 0 12px rgba(242,169,59,0.25); }
.bd-card.equip::after { content: ''; position: absolute; top: -7px; right: -6px; width: 22px; height: 20px; background: url('../assets/ui/frame/if_check.png') center / contain no-repeat; }
.bd-card .ci2 { position: relative; width: 38px; height: 38px; flex: none; border-radius: 8px; }
.bd-card .ci2 img.sp2 { width: 100%; height: 100%; border-radius: 8px; object-fit: cover; }
.bd-card .ci2 img.fr2 { position: absolute; inset: -2px; width: calc(100% + 4px); height: calc(100% + 4px); }
.bd-card h4 { margin: 0; font-size: 12.5px; line-height: 1.15; }
.bd-card p { margin: 2px 0 0; font-size: 10px; color: var(--ink-dim); line-height: 1.3; }
.bd-bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; justify-content: center; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(23,20,29,0) 0%, var(--bg) 40%); z-index: 5; }

/* transiciones */
.screen.fade { animation: screenfade 0.28s ease; }
@keyframes screenfade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ========== RESKIN UI RPG (pack) — capa de overrides ========== */
/* tipografía del pack en cabeceras y títulos */
.draft-title, .champ-head h2, .intro-title, .detail h4, .clog-head h4, .opt-card h4, .detail-ab h4 { font-family: var(--font-ui); font-weight: 400; }

/* botones circulares del pack (topbar, info de bandeja) */
.iconbtn, .tray-info {
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: url('../assets/ui/btn/circle_gray.png') center / contain no-repeat;
  color: #e8e4f0; display: grid; place-items: center; cursor: pointer;
}
.iconbtn:hover, .tray-info:hover { filter: brightness(1.18); }
.tray-info { position: absolute; top: 6px; right: 8px; z-index: 3; width: 26px; height: 26px; }
.topbar #speed { font-size: 12px; font-weight: 700; }
.topbar #tomenu { background: var(--panel2); border: 1px solid rgba(255,255,255,0.16); border-radius: 9px; padding: 5px 12px; color: var(--ink); font-family: var(--font-ui); font-size: 12px; cursor: pointer; }

/* menú: tarjetas de campeón con el marco de carta del pack (esquinas metálicas) */
.champ-card {
  position: relative; border-style: solid; border-width: 16px; border-radius: 4px;
  border-image: url('../assets/ui/frame/cardframe_01_bordergray.png') 42 / 16px stretch;
  background: var(--panel); background-clip: padding-box;
  padding: 8px 10px;
}
.champ-card::before, .champ-card::after { content: ''; position: absolute; width: 42px; height: 42px; pointer-events: none; z-index: 1; }
.champ-card::before { top: -13px; left: -13px; background: url('../assets/ui/frame/cardframe_01_bordergray_decoleft.png') center / contain no-repeat; }
.champ-card::after { bottom: -13px; right: -13px; background: url('../assets/ui/frame/cardframe_01_bordergray_decoright.png') center / contain no-repeat; }
.stat { background: #1e1a28; border: 1px solid rgba(255,255,255,0.10); border-radius: 9px; padding: 5px 10px; }
.stat b { font-family: 'PlayNum', var(--font-ui); }
/* retrato del campeón en la tarjeta del menú (mini-marco metálico, como en combate) */
.champ-portrait { position: relative; width: 56px; height: 56px; flex: none; }
.champ-portrait canvas { position: absolute; inset: 5px; width: 46px; height: 46px; border-radius: 9px; background: #1c1826; }
.champ-portrait::after { content: ''; position: absolute; inset: 0; border: 8px solid transparent; border-image: url('../assets/ui/frame/dieframe.png') 40 / 8px stretch; pointer-events: none; }
button.play {
  border: 0; border-radius: 11px; font-family: var(--font-ui); font-size: 15px; letter-spacing: 0.4px;
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.28), inset 0 -4px 0 rgba(0,0,0,0.28), 0 2px 4px rgba(0,0,0,0.4); /* bisel convexo (estilo pack) */
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
button.quickplay { border-radius: 9px; }

/* draft: tarjetas de opción */
.opt-card { border-radius: 11px; box-shadow: inset 0 2px 0 rgba(255,255,255,0.05); }

/* overlays: panel del pack + botones dorados */
.detail { border-style: solid; border-width: 12px; border-radius: 6px; border-image: url('../assets/ui/panel/popup.png') 30 / 12px stretch; background: var(--panel); background-clip: padding-box; }
.detail-close, .intro-next, .over button {
  background: none; color: #5a3400; cursor: pointer;
  border-style: solid; border-width: 12px 16px;
  border-image: url('../assets/ui/btn/rect_yellow.png') 30 34 fill / 12px 16px stretch;
  padding: 3px 12px; font-size: 14px; font-family: var(--font-ui); letter-spacing: 0.4px; text-shadow: 0 1px 0 rgba(255,255,255,0.25);
}
.detail-close:active, .intro-next:active, .over button:active { transform: scale(0.985) translateY(1px); }

/* fin de partida: banderines del pack */
.over h1 { background: url('../assets/ui/label/flag_purple.png') center / 100% 100% no-repeat; padding: 16px 52px 26px; font-size: 26px; text-shadow: 0 2px 3px rgba(0,0,0,0.5); }
.over h1.win, .over h1.lose, .over h1.draw { color: #fff; }
.over h1.lose { background-image: url('../assets/ui/label/flag_red.png'); }
.over h1.draw { background-image: url('../assets/ui/label/flag_orange.png'); }
.over-stats { border-style: solid; border-width: 12px; border-radius: 6px; border-image: url('../assets/ui/panel/popup.png') 30 / 12px stretch; background: var(--panel); background-clip: padding-box; }

/* insignias de estado sobre pizarra */
.stbadge { background: var(--panel2); border: 1px solid rgba(255,255,255,0.14); }

/* iconos de hechizo del pack (habilidades) */
.spico { display: block; border-radius: 9px; }
.ci { position: relative; overflow: visible; }
.ci .spico { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.ci .spframe { position: absolute; inset: -2px; width: calc(100% + 4px); height: calc(100% + 4px); pointer-events: none; } /* marco de rareza por tipo */
/* dados: icono a cara completa + marco metálico del pack + banderín con el número (teñido del color del tipo) */
.cf { overflow: hidden; border: none; }
.cf .spico { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; box-shadow: none; }
.cf::before {
  content: ''; position: absolute; inset: 0; border: 9px solid transparent;
  border-image: url('../assets/ui/frame/dieframe.png') 40 / 9px stretch; /* marco de carta del pack (con muescas) */
  z-index: 1; pointer-events: none;
}
.cf::after { content: ''; position: absolute; inset: 0; border-radius: 10px; box-shadow: inset 0 0 9px rgba(0,0,0,0.4); pointer-events: none; }
.cf .cost {
  z-index: 2; top: -1px; left: auto; right: 3px; width: 19px; height: 28px; padding-top: 3px;
  background: var(--c, #666);
  -webkit-mask: url('../assets/ui/frame/flag_white.png') center / 100% 100% no-repeat;
  mask: url('../assets/ui/frame/flag_white.png') center / 100% 100% no-repeat;
  text-align: center; font-family: 'PlayNum', var(--font-ui); font-size: 12px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.55);
}
.cf .faceicon { position: absolute; inset: 0; display: block; }
.cf .faceicon .spico { position: absolute; inset: 0; width: 100%; height: 100%; }
