:root {
  --bg: #12101c;
  --bg2: #1c1930;
  --panel: #231f3a;
  --panel2: #2c2748;
  --line: #3a3460;
  --text: #ece9f7;
  --muted: #a39dc2;
  --gold: #f2c14e;
  --accent: #7c5cff;
  --good: #3fcf8e;
  --bad: #ff5d6c;
  --cw: 150px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #2a2150 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 15px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
h1, h2 { margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
small { font-size: .75em; }

/* ---- botones y controles ---- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  padding: .55em 1em; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(180deg, #8f72ff, #6342f0); border-color: #9b84ff; }
.btn.danger { background: #5a1f2a; border-color: var(--bad); }
.btn.ghost { background: transparent; }
.btn small { font-weight: 400; color: var(--muted); }
.btn.primary small { color: #e2dcff; }
select, input[type=text], input:not([type]), textarea {
  background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: .5em .7em; font: inherit;
}
.row { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin-top: .8rem; }
.pill { display: inline-block; font-size: .72rem; padding: 1px 8px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); vertical-align: middle; margin-left: 4px; }
.pill.ok { color: var(--good); border-color: var(--good); }
.pill.warn { color: var(--gold); border-color: var(--gold); }
.check { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }

/* ---- arranque ---- */
.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 16px; text-align: center; }
.boot-logo { font-size: 4rem; animation: bob 2s ease-in-out infinite; }
.boot-title { font-size: 1.8rem; font-weight: 800; letter-spacing: .02em; }
.boot-msg { color: var(--muted); }
.guest-form { display: flex; flex-direction: column; gap: .6rem; align-items: center; max-width: 320px; }
.guest-form input { width: 100%; text-align: center; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }

/* ---- estructura ---- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 8px 16px;
  background: rgba(18, 16, 28, .88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; white-space: nowrap; }
.tabs { display: flex; gap: 4px; flex: 1; justify-content: center; }
.tabs button {
  background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  display: flex; gap: 6px; align-items: center;
}
.tabs button.active { background: var(--panel2); color: var(--text); }
.wallet { font-weight: 800; color: var(--gold); background: var(--panel); padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.view { padding: 16px; max-width: 1200px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.panel .btn { margin: 4px 4px 0 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.grid2 .panel { margin: 0; }
.grid2 + .panel, .warn + .grid2 { margin-top: 16px; }
.big-num { font-size: 2rem; font-weight: 800; margin: .2em 0; color: var(--gold); }
.big-num small { font-size: .5em; color: var(--muted); }
.warn { background: #3d2f12; border: 1px solid var(--gold); color: #ffe7ad; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }

.hero { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.avatar { --h: 260; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem;
  background: linear-gradient(135deg, hsl(var(--h) 70% 55%), hsl(calc(var(--h) + 50) 70% 40%)); flex: none; }
.avatar.sm { width: 36px; height: 36px; font-size: .9rem; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); }
.ranking { margin: 0; padding-left: 1.4em; }
.ranking li { padding: 3px 0; }
.ranking li span:last-child { float: right; color: var(--muted); font-size: .9em; }
.rules p, .rules li { margin: .35em 0; }

/* ---- cartas ---- */
.card {
  --ec: #888; --ec2: #444;
  position: relative; width: var(--cw); aspect-ratio: 63 / 88; font-size: calc(var(--cw) / 14);
  border-radius: calc(var(--cw) / 14); padding: calc(var(--cw) / 28);
  background: linear-gradient(160deg, var(--ec) 0%, var(--ec2) 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45), inset 0 0 0 calc(var(--cw) / 50) rgba(255, 255, 255, .25);
  display: flex; flex-direction: column; gap: calc(var(--cw) / 60); color: #1b1726; overflow: hidden; cursor: pointer; flex: none;
  transition: transform .15s;
}
.card:hover { transform: translateY(-3px); }
.card.faded { opacity: .4; filter: grayscale(.7); }
.el-fuego { --ec: #ff8a5b; --ec2: #c4361b; }
.el-agua { --ec: #7cc3ff; --ec2: #2463c9; }
.el-planta { --ec: #8fe08a; --ec2: #2c8a3a; }
.el-rayo { --ec: #ffe46b; --ec2: #d19a12; }
.el-tierra { --ec: #d9a874; --ec2: #7d4f24; }
.el-sombra { --ec: #b48cf0; --ec2: #4b2a86; }
.el-luz { --ec: #fffbe0; --ec2: #d8c46e; }
.card.item { --ec: #d6dbe6; --ec2: #7d8699; }
.c-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; }
.c-name { font-size: 1.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-hp { font-size: 1.1em; color: #b3121f; white-space: nowrap; }
.c-hp small { font-size: .55em; margin-right: 1px; }
.c-kind { font-size: .7em; letter-spacing: .1em; opacity: .7; }
.c-stage { font-size: .62em; font-weight: 600; opacity: .8; margin-top: -.2em; }
.c-art {
  flex: 0 0 38%; border-radius: .4em; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .85), rgba(255, 255, 255, .25) 60%, rgba(0, 0, 0, .1));
  box-shadow: inset 0 0 0 .12em rgba(0, 0, 0, .25);
}
.card.item .c-art { flex-basis: 45%; }
.c-art img { width: 100%; height: 100%; object-fit: cover; }
.c-emoji { font-size: 3.4em; filter: drop-shadow(0 .1em .1em rgba(0, 0, 0, .3)); line-height: 1; }
.c-attacks { flex: 1; display: flex; flex-direction: column; gap: .25em; background: rgba(255, 255, 255, .55); border-radius: .4em; padding: .25em .35em; overflow: hidden; }
.atk-row { display: flex; align-items: center; gap: .3em; font-weight: 700; font-size: .85em; }
.atk-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dmg { font-weight: 800; font-size: 1.1em; }
.atk-fx { font-size: .58em; line-height: 1.15; opacity: .85; }
.cost { display: inline-flex; gap: 1px; }
.pip { display: inline-block; width: .7em; height: .7em; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6b0, #e2a40b 70%); box-shadow: 0 0 0 .07em rgba(0, 0, 0, .35); }
.pip.free { background: #ccc; font-size: .6em; width: 1.1em; height: 1.1em; display: inline-grid; place-items: center; font-weight: 700; color: #444; }
.c-foot { display: flex; justify-content: space-between; font-size: .58em; font-weight: 600; opacity: .85; }
.c-text { background: rgba(255, 255, 255, .6); border-radius: .4em; padding: .4em; font-size: .78em; font-weight: 600; }
.c-flavor { font-size: .6em; font-style: italic; opacity: .75; }
.c-rarity { position: absolute; right: .4em; bottom: .25em; font-size: .8em; opacity: .8; }
.r-rara .c-rarity { color: #1c4fbf; opacity: 1; }
.r-epica { box-shadow: 0 0 14px rgba(190, 120, 255, .55), inset 0 0 0 calc(var(--cw) / 40) rgba(220, 180, 255, .9); }
.r-epica .c-rarity { color: #7a1fd1; opacity: 1; }
.r-legendaria { box-shadow: 0 0 18px rgba(255, 200, 60, .75), inset 0 0 0 calc(var(--cw) / 35) #ffd34d; }
.r-legendaria .c-rarity { color: #b07800; opacity: 1; }
.r-legendaria::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .45) 45%, transparent 60%);
  background-size: 250% 100%; animation: holo 3.5s linear infinite;
}
@keyframes holo { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.c-count { position: absolute; top: -1px; right: -1px; background: #1b1726; color: #fff; font-weight: 800; font-size: .8em; padding: .1em .45em; border-bottom-left-radius: .5em; }
.c-new { position: absolute; top: 40%; left: -2em; right: -2em; text-align: center; transform: rotate(-12deg); background: var(--gold); color: #3b2500; font-weight: 900; font-size: .9em; letter-spacing: .05em; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.card.locked { background: repeating-linear-gradient(45deg, #2a2545, #2a2545 6px, #262140 6px, #262140 12px); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); cursor: default; }
.card.locked .c-art { background: rgba(0, 0, 0, .2); flex: 1; }
.card.locked .c-emoji { opacity: .4; }
.locked-name { text-align: center; font-weight: 700; font-size: .8em; }
.card.big { --cw: min(320px, 78vw); }
.zoom { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.zoom .card { cursor: default; }
.zoom .card:hover { transform: none; }
.flavor { color: var(--muted); font-style: italic; margin: 0; text-align: center; max-width: 320px; }

.card-grid { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.card-grid.small { --cw: 120px; }

/* ---- colección ---- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.progress { position: relative; flex: 1 1 160px; height: 28px; background: var(--bg2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.progress div { height: 100%; background: linear-gradient(90deg, #6342f0, #c46bff); }
.progress span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }

/* ---- sobres ---- */
.packs-head { margin-bottom: 14px; color: var(--muted); }
.pack-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.pack-shop { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.pack-info { display: flex; flex-direction: column; gap: 6px; justify-content: center; flex: 1; }
.pack-art, .pack-big {
  --pc: #c2463f;
  width: 96px; aspect-ratio: 5 / 8; border-radius: 10px; flex: none; position: relative; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--pc) 70%, white), var(--pc) 45%, color-mix(in srgb, var(--pc) 60%, black));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5), inset 0 0 0 2px rgba(255, 255, 255, .3);
}
.pack-art::before, .pack-big::before { content: ""; position: absolute; left: 0; right: 0; top: 8%; height: 3px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .6) 0 6px, transparent 6px 10px); }
.pack-art span { font-size: 2.4rem; }
.pack-label { font-weight: 800; font-size: .7rem; text-align: center; padding: 0 4px; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.opening { display: flex; flex-direction: column; align-items: center; gap: 16px; min-height: 300px; justify-content: center; }
.pack-big { width: 180px; cursor: pointer; animation: shake 1.2s ease-in-out infinite; }
.pack-big span { font-size: 4.5rem; }
.pack-big .pack-label { font-size: 1rem; }
.tear-hint { position: absolute; bottom: 10px; font-size: .75rem; font-weight: 700; background: rgba(0, 0, 0, .35); padding: 2px 8px; border-radius: 99px; }
.pack-big.torn { animation: tear .55s ease-in forwards; }
@keyframes shake { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-3deg); } 20% { transform: rotate(3deg); } 30% { transform: rotate(-2deg); } 40% { transform: rotate(0); } }
@keyframes tear { 40% { transform: scale(1.12); filter: brightness(1.8); } 100% { transform: scale(1.6); opacity: 0; filter: brightness(3); } }
.reveal { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; --cw: 150px; }
.flip { width: var(--cw); aspect-ratio: 63 / 88; perspective: 900px; cursor: pointer; animation: dealIn .35s backwards; }
.flip:nth-child(2) { animation-delay: .08s; } .flip:nth-child(3) { animation-delay: .16s; } .flip:nth-child(4) { animation-delay: .24s; } .flip:nth-child(5) { animation-delay: .32s; }
@keyframes dealIn { from { transform: translateY(40px) scale(.8); opacity: 0; } }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .55s; transform-style: preserve-3d; }
.flip.done .flip-inner { transform: rotateY(180deg); }
.flip-back, .flip-front { position: absolute; inset: 0; backface-visibility: hidden; }
.flip-front { transform: rotateY(180deg); }
.flip-back { border-radius: calc(var(--cw) / 14); display: grid; place-items: center; font-size: 3rem;
  background: repeating-linear-gradient(45deg, #3b2f7a, #3b2f7a 8px, #33296b 8px, #33296b 16px); box-shadow: inset 0 0 0 4px #c9b8ff55, 0 4px 14px rgba(0, 0, 0, .45); }
.flip-back.r-epica { box-shadow: inset 0 0 0 4px #c9b8ff55, 0 0 22px #b86bff; }
.flip-back.r-legendaria { box-shadow: inset 0 0 0 4px #ffd34d, 0 0 28px #ffc23d; animation: pulse 1s infinite; }
@keyframes pulse { 50% { filter: brightness(1.4); } }
.flip.shine { animation: shine 1s; }
@keyframes shine { 30% { transform: scale(1.1); filter: drop-shadow(0 0 20px gold); } }

/* ---- mazo ---- */
.deck-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.deck-side { position: sticky; top: 64px; margin: 0; }
.deck-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; }
.deck-row { display: flex; gap: 8px; align-items: center; background: linear-gradient(90deg, color-mix(in srgb, var(--ec, #888) 35%, var(--panel2)), var(--panel2)); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 5px 8px; font: inherit; cursor: pointer; text-align: left; }
.deck-row.el-item { --ec: #7d8699; }
.deck-row:hover { border-color: var(--bad); }
.dr-emoji { font-size: 1.2em; }
.dr-name { flex: 1; font-weight: 600; }
.dr-meta { color: var(--muted); font-size: .8em; }
.problems { color: #ffb4bc; padding-left: 1.2em; margin: .6em 0; font-size: .9em; }
.ok-text { color: var(--good); font-weight: 600; }

/* ---- lobby ---- */
.ai-levels { display: flex; gap: 8px; flex-wrap: wrap; }
.players { display: flex; flex-direction: column; gap: 8px; }
.player { display: flex; align-items: center; gap: 10px; background: var(--panel2); padding: 8px 10px; border-radius: 10px; }
.p-name { flex: 1; font-weight: 600; }

/* ---- modal, hoja y avisos ---- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(6, 4, 14, .78); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; max-width: 440px; width: 100%; max-height: 92vh; overflow: auto; text-align: center; }
.modal-box.wide { max-width: 900px; }
.modal-box .rules { text-align: left; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(6, 4, 14, .55); display: flex; align-items: flex-end; justify-content: center; }
.sheet-box { background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; padding: 14px; width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 8px; animation: up .18s; max-height: 80vh; overflow: auto; }
.sheet-box .btn { width: 100%; }
.sheet-title { font-weight: 800; text-align: center; padding-bottom: 4px; }
@keyframes up { from { transform: translateY(100%); } }
.toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { background: #2f2950; border: 1px solid var(--line); padding: 8px 14px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); transition: opacity .4s, transform .4s; max-width: 100%; text-align: center; }
.toast.error { border-color: var(--bad); }
.toast.good { border-color: var(--good); }
.toast.out { opacity: 0; transform: translateY(-10px); }

/* ---- combate ---- */
.battle { position: fixed; inset: 0; z-index: 40; overflow-x: hidden; overflow-y: auto; background: radial-gradient(900px 500px at 50% 50%, #2b2252, #120f1f 75%); }
.b-board {
  min-height: 100%; max-width: 900px; margin: 0 auto; padding: 8px 12px; display: grid; gap: 6px;
  grid-template-rows: auto auto auto 1fr auto auto auto auto auto;
}
.b-player { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .9rem; }
.b-name { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.b-meta { color: var(--muted); font-size: .85rem; }
.glow { color: var(--gold); font-weight: 700; }
.dim { opacity: .6; }
.pts { display: inline-flex; gap: 3px; }
.pts i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--gold); }
.pts i.on { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.b-bench, .b-active { display: flex; justify-content: center; gap: 8px; }
.b-mid { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; min-height: 34px; overflow: hidden; }
.b-banner { padding: 4px 14px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: .9rem; text-align: center; }
.b-banner.mine { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 12px rgba(242, 193, 78, .3); }
.b-log { font-size: .78rem; color: var(--muted); text-align: center; line-height: 1.3; }
.b-log .new { color: var(--text); animation: fade .4s; }
.unit {
  --uw: 92px; position: relative; width: var(--uw); border-radius: 10px; padding: 4px; cursor: pointer;
  background: linear-gradient(160deg, var(--ec, #555), var(--ec2, #222)); box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; align-items: center; color: #1b1726; font-size: .72rem; transition: transform .15s;
}
.unit.active { --uw: 118px; font-size: .8rem; }
.unit.empty { background: rgba(255, 255, 255, .04); border: 1px dashed var(--line); box-shadow: none; color: var(--muted); min-height: 96px; justify-content: center; cursor: default; }
.unit.active.empty { min-height: 128px; }
.u-art { width: 100%; aspect-ratio: 4 / 3; border-radius: 6px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle, rgba(255, 255, 255, .85), rgba(255, 255, 255, .25) 70%); }
.u-art img { width: 100%; height: 100%; object-fit: cover; }
.u-art .c-emoji { font-size: 2.2rem; }
.unit.active .u-art .c-emoji { font-size: 2.9rem; }
.u-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.u-hpbar { width: 100%; height: 6px; background: rgba(0, 0, 0, .35); border-radius: 99px; overflow: hidden; }
.u-hpbar div { height: 100%; background: #3fcf6e; transition: width .4s; }
.u-hpbar div.mid { background: #f2c14e; }
.u-hpbar div.low { background: #ff5d6c; }
.u-hp { font-weight: 700; font-size: .9em; }
.u-energy { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; min-height: .75em; }
.u-energy .pip { width: 9px; height: 9px; }
.u-status { position: absolute; top: 2px; left: 4px; font-size: 1rem; }
.unit.hit { animation: hit .45s; }
@keyframes hit { 20% { transform: translateX(-6px) rotate(-3deg); filter: brightness(2) saturate(0); } 50% { transform: translateX(5px); } }
.float { position: absolute; top: 20%; left: 50%; transform: translateX(-50%); font-weight: 900; font-size: 1.6rem; pointer-events: none; animation: floatUp 1.1s forwards; text-shadow: 0 2px 4px #000; }
.float.hurt { color: #ff5d6c; }
.float.heal { color: #3fcf8e; }
@keyframes floatUp { to { transform: translate(-50%, -50px); opacity: 0; } }
.b-actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.atk-btn { flex-direction: row; gap: 6px; }
.atk-btn .pip { width: 9px; height: 9px; }
.b-hand { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 6px; --cw: 92px; justify-content: safe center; }
.hand-card .card:hover { transform: translateY(-8px); }
.turn-flash { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); font-size: 2.4rem; font-weight: 900; color: var(--gold); text-shadow: 0 4px 18px #000; pointer-events: none; animation: flash 1.3s forwards; z-index: 5; }
@keyframes flash { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 80% { opacity: 1; } 100% { opacity: 0; } }
.b-over { position: absolute; inset: 0; background: rgba(6, 4, 14, .72); display: grid; place-items: center; z-index: 6; animation: fade .3s; }
.b-over-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px 32px; text-align: center; }
.b-over.won .b-over-box { border-color: var(--gold); box-shadow: 0 0 40px rgba(242, 193, 78, .35); }
.b-over-icon { font-size: 3.5rem; }
.full-log { text-align: left; max-height: 60vh; overflow: auto; font-size: .88rem; background: var(--bg2); padding: 10px; border-radius: 8px; margin-bottom: 10px; }
.full-log div { padding: 2px 0; border-bottom: 1px solid rgba(255, 255, 255, .04); }

/* ---- pantallas pequeñas ---- */
@media (max-width: 760px) {
  .brand span, .tabs button span { display: none; }
  .tabs button { font-size: 1.25rem; padding: 6px 10px; }
  .topbar { padding: 6px 16px; gap: 6px; }
  .view { padding: 12px 16px; }
  .deck-layout { grid-template-columns: 1fr; }
  .deck-side { position: static; }
  .card-grid { --cw: 132px; gap: 8px; }
  .card-grid.small { --cw: 104px; }
  .reveal { --cw: 112px; gap: 8px; }
}
@media (max-height: 720px) {
  .unit { --uw: 74px; font-size: .64rem; }
  .unit.active { --uw: 96px; }
  .u-art .c-emoji { font-size: 1.7rem; }
  .unit.active .u-art .c-emoji { font-size: 2.2rem; }
  .unit.empty { min-height: 78px; }
  .unit.active.empty { min-height: 104px; }
  .b-hand { --cw: 78px; }
  .b-board { gap: 4px; padding: 6px 12px; }
}
@media (max-height: 560px) {
  .b-log { display: none; }
  .b-hand { --cw: 66px; }
}
@media (max-width: 500px) {
  .unit { --uw: 78px; font-size: .64rem; }
  .unit.active { --uw: 100px; }
  .u-art .c-emoji { font-size: 1.7rem; }
  .unit.active .u-art .c-emoji { font-size: 2.3rem; }
  .unit.empty { min-height: 80px; }
  .unit.active.empty { min-height: 106px; }
  .b-hand { --cw: 80px; justify-content: flex-start; }
  .b-board { padding: 6px 10px; gap: 4px; }
  .b-player { font-size: .8rem; }
  .b-meta { font-size: .75rem; }
  .atk-btn { font-size: .85rem; padding: .45em .7em; }
}
