/* Color Clash: estilos de la mesa, las cartas y la interfaz (2D con DOM). */
:root {
  --bg: #1b1140; --bg2: #120b2e; --panel: #2a1a5e; --panel2: #3a2780; --line: rgba(205,185,255,.2); --text: #fbf8ff; --muted: #c2b5ea;
  --accent: #ffd23f; --accent2: #ff9a3c; --accent-text: #2a1a05; --mint: #3ee08a; --mint2: #1fae62; --danger: #ff4f5e; --gem: #4ff0ff;
  --r: #ff4f5e; --y: #ffc23c; --g: #22c96f; --b: #3d8bff;
  --font: 'Fredoka', 'Baloo 2', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --cw: 70px; --pw: 80px; --cur: #ffd23f;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overflow: hidden; }
#app { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(120% 90% at 50% 45%, #4a2fa8 0%, #2a1a6a 45%, #170d3a 100%); touch-action: manipulation; }
#bg { position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(circle at 15% 20%, rgba(255,79,94,.25), transparent 30%), radial-gradient(circle at 85% 25%, rgba(61,139,255,.25), transparent 30%), radial-gradient(circle at 20% 85%, rgba(34,201,111,.2), transparent 30%), radial-gradient(circle at 85% 85%, rgba(255,194,60,.2), transparent 30%); }
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--accent2); outline-offset: 3px; }
a { color: var(--accent); }
/* ---------- botones ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 52px; padding: .45em 1.3em; border-radius: 18px; font-size: 1.12rem; font-weight: 700; letter-spacing: .02em; color: var(--accent-text); text-decoration: none;
  background: linear-gradient(180deg, #fff1a6, var(--accent) 55%, #f2a922); box-shadow: 0 5px 0 #b77812, 0 10px 22px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.6); transition: transform .08s, box-shadow .08s, filter .15s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #b77812, inset 0 2px 0 rgba(255,255,255,.6); }
.btn svg { width: 1.25em; height: 1.25em; flex: none; }
.btn span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.btn small { font-size: .62em; font-weight: 600; opacity: .8; letter-spacing: 0; margin-top: .15em; }
.btn.mint { color: #06301a; background: linear-gradient(180deg, #b9ffc9, var(--mint) 55%, var(--mint2)); box-shadow: 0 5px 0 #157233, 0 10px 22px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.6); }
.btn.mint:active { box-shadow: 0 1px 0 #157233, inset 0 2px 0 rgba(255,255,255,.6); }
.btn.ghost { color: var(--text); background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:active { transform: translateY(2px); }
.btn.big { min-height: 64px; font-size: 1.45rem; padding: .4em 1.6em; border-radius: 22px; }
.btn.small { min-height: 40px; font-size: .92rem; padding: .3em .9em; border-radius: 13px; }
.btn[disabled] { filter: grayscale(.7) brightness(.85); pointer-events: none; }
.icon-btn { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; color: var(--text); background: rgba(27,17,64,.78); box-shadow: inset 0 0 0 2px var(--line), 0 4px 12px rgba(0,0,0,.2); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.icon-btn svg { width: 26px; height: 26px; }
.icon-btn:active { transform: scale(.94); }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(0,0,0,.25); font-weight: 700; }
.pill svg { width: 20px; height: 20px; fill: var(--gem); }

/* ---------- pantallas ---------- */
#screens { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.screen { position: absolute; inset: 0; pointer-events: auto; display: flex; flex-direction: column; align-items: center; animation: in .25s ease-out both; padding: calc(14px + var(--safe-t)) calc(14px + var(--safe-r)) calc(14px + var(--safe-b)) calc(14px + var(--safe-l)); }
.screen.out { animation: out .2s ease-in both; pointer-events: none; }
@keyframes in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes out { to { opacity: 0; transform: scale(.98); } }
.overlay { justify-content: center; background: rgba(14,8,34,.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.box { width: min(420px, 100%); max-height: 100%; overflow: auto; padding: 22px 20px; border-radius: 26px; background: linear-gradient(180deg, var(--panel2), var(--panel)); box-shadow: inset 0 0 0 2px var(--line), 0 20px 50px rgba(0,0,0,.4); text-align: center; display: flex; flex-direction: column; gap: 14px; }
.box h2 { margin: 0; font-size: 1.9rem; line-height: 1.1; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.box .sub { margin: 0; color: var(--muted); font-size: 1rem; }
.box.scroll { max-height: min(86vh, 720px); }

/* avisos */
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.pop { position: absolute; transform: translate(-50%, -50%); font-weight: 700; font-size: 1.15rem; color: #fff; -webkit-text-stroke: 2px rgba(0,0,0,.5); paint-order: stroke fill; animation: popup 1.05s ease-out forwards; white-space: nowrap; }
.pop.gold { color: var(--accent); font-size: 1.5rem; }
.pop.gem { color: var(--gem); font-size: 1.35rem; }
.pop.lasso { color: #ffe066; font-size: 1.9rem; }
.pop.bad { color: #ff6a6a; }
@keyframes popup { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
.banner { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 700; color: #fff; -webkit-text-stroke: 3px rgba(0,0,0,.45); paint-order: stroke fill; text-align: center; white-space: nowrap; animation: banner 1.7s ease-out forwards; }
.banner.gold { color: var(--accent); } .banner.mint { color: #8affa0; } .banner.red { color: #ff7a7a; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } 22% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%); } }
#toasts { position: absolute; left: 0; right: 0; top: calc(110px + var(--safe-t)); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 30; }
.toast { padding: 8px 16px; border-radius: 14px; background: rgba(27,17,64,.94); box-shadow: inset 0 0 0 2px var(--line), 0 6px 16px rgba(0,0,0,.3); font-weight: 600; animation: in .25s both; max-width: 90vw; text-align: center; }
.toast.gold { background: linear-gradient(180deg, #fff1a6, var(--accent)); color: var(--accent-text); }
.toast.red { background: #b8302a; }
.toast.out { animation: out .3s both; }
/* ajustes, cómo se juega, ranking */
.settings { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 14px; background: rgba(255,255,255,.06); font-weight: 600; }
.setting select, .setting input { font-family: inherit; font-size: 1rem; font-weight: 600; padding: 7px 10px; border-radius: 10px; border: 0; background: #170e3a; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); max-width: 55%; }
.tog { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 99px; background: rgba(0,0,0,.3); font-weight: 700; min-width: 74px; }
.tog i { width: 26px; height: 26px; border-radius: 50%; background: #5a5478; transition: .2s; }
.tog.on i { background: var(--mint); transform: translateX(2px); }
.links { margin-top: 6px; }
.howto-body { text-align: left; }
.howto-body .t1 { font-size: 1.35rem; font-weight: 700; margin: 0 0 .4em; color: var(--accent); }
.howto-body h2 { font-size: 1.15rem; margin: 1em 0 .3em; }
.howto-body ul { padding-left: 1.2em; margin: .3em 0; }
.howto-body li { margin: .25em 0; line-height: 1.35; }
.howto-body p { line-height: 1.4; }
/* anuncio de prueba */
.dev-ad { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0,0,0,.75); }
.dev-ad-box { width: min(340px, 90%); padding: 20px; border-radius: 20px; background: #111; color: #fff; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.dev-ad-tag { font-size: .8rem; color: #aaa; }
.dev-ad-art { width: 100%; aspect-ratio: 16/9; border-radius: 12px; display: grid; place-items: center; background: repeating-linear-gradient(45deg, #333 0 12px, #2a2a2a 12px 24px); font-size: 2rem; font-weight: 700; }


/* ---------- cartas ---------- */
.card { --w: var(--cw); position: absolute; left: 0; top: 0; width: var(--w); height: calc(var(--w) * 1.48); font-size: calc(var(--w) / 10); border-radius: 1.3em; background: #fff; box-shadow: 0 .15em 0 rgba(0,0,0,.12), 0 .5em 1.2em rgba(10,4,30,.35); transform-origin: 50% 100%; will-change: transform; }
.card .face { position: absolute; inset: .42em; border-radius: 1em; overflow: hidden; background: var(--cc); }
.c-r { --cc: var(--r); --cd: #a8102a; } .c-y { --cc: var(--y); --cd: #a35a00; } .c-g { --cc: var(--g); --cd: #08703a; } .c-b { --cc: var(--b); --cd: #1a3fae; } .c-w { --cc: #261b52; --cd: #0d0820; }
.card .rays { position: absolute; inset: -40%; background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.14) 0 8deg, rgba(255,255,255,0) 8deg 16deg); }
.card .face::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 35%, rgba(0,0,0,.2)); pointer-events: none; }
.card .gem { position: absolute; left: 50%; top: 50%; width: 6em; height: 6em; transform: translate(-50%, -50%) rotate(45deg); border-radius: 1.5em; background: #fff; box-shadow: inset 0 -.35em 0 rgba(0,0,0,.1), 0 .3em .7em rgba(0,0,0,.28); z-index: 1; overflow: hidden; }
.card .gl { position: absolute; inset: 0; transform: rotate(-45deg); display: grid; place-items: center; color: var(--cc); }
.card .num { font-size: 4.5em; font-weight: 700; line-height: 1; color: var(--cc); -webkit-text-stroke: .05em var(--cd); paint-order: stroke fill; text-shadow: 0 .06em 0 var(--cd); letter-spacing: -.03em; }
.card .num.ul { text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .05em; }
.card .num.plus { font-size: 3.5em; }
.card .sym svg { width: 4.3em; height: 4.3em; display: block; color: var(--cc); filter: drop-shadow(0 .1em 0 var(--cd)); }
.card .idx { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: .12em; font-weight: 700; font-size: 2.1em; line-height: 1; color: #fff; text-shadow: 0 .08em 0 var(--cd), 0 0 .2em rgba(0,0,0,.25); }
.card .idx.tl { left: .3em; top: .28em; } .card .idx.br { right: .3em; bottom: .28em; transform: rotate(180deg); }
.card .idx .shape { width: .62em; height: .62em; fill: #fff; filter: drop-shadow(0 .06em 0 var(--cd)); }
.card .idx .isym svg { width: 1em; height: 1em; display: block; color: #fff; }
.card.wild .gem { background: conic-gradient(var(--r) 0 90deg, var(--y) 90deg 180deg, var(--g) 180deg 270deg, var(--b) 270deg 360deg); }
.card.wild .num { color: #fff; -webkit-text-stroke: .06em #261b52; text-shadow: 0 .07em 0 #261b52; }
.card.wild .rays { background: repeating-conic-gradient(from 0deg, rgba(255,79,94,.35) 0 8deg, rgba(255,194,60,.35) 8deg 16deg, rgba(34,201,111,.35) 16deg 24deg, rgba(61,139,255,.35) 24deg 32deg); }
.card.back .face { background: linear-gradient(140deg, #4b2bb3, #1d1150); }
.card.back .bk { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.card.back .s { position: absolute; left: -20%; width: 140%; height: 1.15em; transform: rotate(-32deg); }
.card.back .s.r { top: 30%; background: var(--r); } .card.back .s.y { top: 41%; background: var(--y); } .card.back .s.g { top: 52%; background: var(--g); } .card.back .s.b { top: 63%; background: var(--b); }
.card.back b { position: relative; font-size: 1.9em; line-height: .95; text-align: center; color: #fff; -webkit-text-stroke: .14em #1d1150; paint-order: stroke fill; transform: rotate(-12deg); font-weight: 700; }
.card.ok { cursor: pointer; }
.card.dim { filter: brightness(.62) saturate(.7); }
.card.hintc { box-shadow: 0 0 0 .35em var(--accent), 0 0 2.2em .4em rgba(255,210,63,.85); animation: hintp 1s ease-in-out infinite; }
@keyframes hintp { 50% { box-shadow: 0 0 0 .5em #fff3b0, 0 0 3em .7em rgba(255,210,63,.95); } }
.card.newc { animation: cardin .35s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes cardin { from { opacity: 0; translate: 0 30px; } }

/* ---------- mesa ---------- */
#table { position: absolute; inset: 0; }
.topbar { position: absolute; left: 0; right: 0; top: 0; padding: calc(8px + var(--safe-t)) calc(10px + var(--safe-r)) 0 calc(10px + var(--safe-l)); display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; z-index: 4; }
.topbar > * { pointer-events: auto; }
.icon-btn { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: var(--text); background: rgba(27,17,64,.72); box-shadow: inset 0 0 0 2px var(--line), 0 4px 12px rgba(0,0,0,.2); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:active { transform: scale(.94); }
.round-tag { position: absolute; left: 50%; transform: translateX(-50%); top: calc(10px + var(--safe-t)); padding: 4px 12px; border-radius: 99px; background: rgba(27,17,64,.6); font-weight: 600; font-size: .85rem; color: var(--muted); white-space: nowrap; pointer-events: none; }
.hint-btn { display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 12px 0 10px; border-radius: 15px; font-weight: 700; color: #2a1a05; background: linear-gradient(180deg, #fff1a6, var(--accent) 60%, #f2a922); box-shadow: 0 4px 0 #b77812, 0 8px 16px rgba(0,0,0,.25); }
.hint-btn svg { width: 22px; height: 22px; }
.hint-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b77812; }
.hint-btn[disabled] { filter: grayscale(.8) brightness(.8); opacity: .7; }
.opps { position: absolute; left: 0; right: 0; display: flex; justify-content: space-evenly; align-items: flex-start; padding: 0 calc(58px + var(--safe-r)) 0 calc(58px + var(--safe-l)); pointer-events: none; }
.opp { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 104px; pointer-events: auto; }
.opp .aw { position: relative; width: var(--av, 56px); height: var(--av, 56px); border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,255,255,.18), 0 6px 14px rgba(0,0,0,.35); transition: box-shadow .25s, transform .25s; }
.opp .aw svg.ava { width: 100%; height: 100%; display: block; }
.opp.turn .aw { box-shadow: 0 0 0 4px var(--accent), 0 0 22px 4px rgba(255,210,63,.65); transform: scale(1.08); }
.opp .nm { font-weight: 700; font-size: .92rem; line-height: 1.05; text-shadow: 0 2px 0 rgba(0,0,0,.3); white-space: nowrap; max-width: 104px; overflow: hidden; text-overflow: ellipsis; }
.opp .lv { font-size: .68rem; font-weight: 600; color: var(--muted); line-height: 1; }
.opp .cnt { position: absolute; right: 12px; top: calc(var(--av, 56px) - 18px); min-width: 28px; height: 28px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; font-weight: 700; font-size: 1rem; color: #2a1a05; background: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.25); z-index: 2; }
.opp .cnt.one { background: var(--danger); color: #fff; animation: bump .5s ease-in-out infinite alternate; }
.opp .minis { position: relative; height: 26px; width: 80px; margin-top: 1px; }
.opp .minis .card { --w: 17px; border-radius: 3px; box-shadow: 0 1px 2px rgba(0,0,0,.4); padding: 0; }
.opp .minis .card .face { inset: 1px; border-radius: 2px; }
.opp .minis .card b { display: none; }
.opp .pts { font-size: .72rem; font-weight: 700; color: var(--accent); line-height: 1; }
.opp.skipped .aw { animation: shake .45s; }
.opp .catch { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); z-index: 5; padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: .95rem; color: #fff; background: linear-gradient(180deg, #ff8a95, var(--danger)); box-shadow: 0 4px 0 #a8102a, 0 6px 16px rgba(0,0,0,.35); white-space: nowrap; animation: pulse .6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.1); } }
@keyframes shake { 20%, 60% { translate: -6px 0; } 40%, 80% { translate: 6px 0; } }
@keyframes bump { 40% { transform: scale(1.18); } }
.bubble { position: absolute; top: calc(var(--av, 56px) + 2px); left: 50%; z-index: 6; transform: translateX(-50%); padding: 6px 11px; border-radius: 14px; background: #fff; color: #2a1a5e; font-weight: 700; font-size: .92rem; white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.35); animation: bub 1.9s ease-out forwards; pointer-events: none; }
.bubble::before { content: ''; position: absolute; left: 50%; top: -7px; margin-left: -7px; border: 7px solid transparent; border-top: 0; border-bottom-color: #fff; }
.bubble.clash { background: linear-gradient(180deg, #fff1a6, var(--accent)); color: #2a1a05; font-size: 1.1rem; }
.bubble.clash::before { border-bottom-color: #fff1a6; }
@keyframes bub { 0% { opacity: 0; transform: translateX(-50%) scale(.5); } 10% { opacity: 1; transform: translateX(-50%) scale(1.1); } 18% { transform: translateX(-50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
.center { position: absolute; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: calc(var(--pw) * .35); }
.pile { position: relative; width: var(--pw); height: calc(var(--pw) * 1.48); }
.pile .card { --w: var(--pw); }
.deck { cursor: pointer; }
.deck .card:nth-child(1) { transform: translate(-3px, 4px) rotate(-3deg); } .deck .card:nth-child(2) { transform: translate(-1px, 2px) rotate(-1deg); }
.deck.can .card:last-child { box-shadow: 0 0 0 4px var(--accent), 0 0 24px rgba(255,210,63,.7); animation: deckp 1.2s ease-in-out infinite; }
@keyframes deckp { 50% { transform: translateY(-5px); } }
.deck .dn { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); padding: 1px 8px; border-radius: 99px; background: rgba(27,17,64,.85); font-size: .78rem; font-weight: 700; color: var(--muted); z-index: 3; }
.ring { position: absolute; left: 50%; top: 50%; width: calc(var(--pw) * 2.05); height: calc(var(--pw) * 2.05); margin: calc(var(--pw) * -1.025) 0 0 calc(var(--pw) * -1.025); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--cur) 40%, transparent) 0%, transparent 62%); box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--cur) 85%, transparent), 0 0 30px color-mix(in srgb, var(--cur) 50%, transparent); transition: background .4s, box-shadow .4s; }
.dirarrows { position: absolute; left: 50%; top: 50%; width: calc(var(--pw) * 2.55); height: calc(var(--pw) * 2.55); margin: calc(var(--pw) * -1.275) 0 0 calc(var(--pw) * -1.275); pointer-events: none; opacity: .55; animation: spin 14s linear infinite; transition: transform .6s; }
.dirarrows.ccw { animation-direction: reverse; }
.dirarrows svg { width: 100%; height: 100%; }
@keyframes spin { to { rotate: 360deg; } }
.discard .card.under { filter: brightness(.9); }
.discard .chosen { position: absolute; z-index: 5; right: -10px; top: -10px; width: 30px; height: 30px; border-radius: 50%; background: var(--cur); border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.4); display: grid; place-items: center; }
.discard .chosen svg { width: 15px; height: 15px; fill: #fff; }
.pend { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); z-index: 6; padding: 3px 10px; border-radius: 99px; background: var(--danger); color: #fff; font-weight: 700; box-shadow: 0 3px 0 #a8102a; animation: bump .5s ease-in-out infinite alternate; white-space: nowrap; }
.status { position: absolute; left: 50%; transform: translateX(-50%); padding: 5px 16px; border-radius: 99px; background: rgba(27,17,64,.78); box-shadow: inset 0 0 0 2px var(--line); font-weight: 700; font-size: 1.02rem; white-space: nowrap; transition: background .25s; pointer-events: none; }
.status.me { background: linear-gradient(180deg, #fff1a6, var(--accent)); color: #2a1a05; box-shadow: 0 4px 14px rgba(255,210,63,.45); }
.act { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 84px; height: 84px; border-radius: 50%; font-weight: 700; font-size: .95rem; line-height: 1; transform: translate(-50%, -50%); transition: opacity .2s, filter .2s; }
.act svg { width: 30px; height: 30px; }
.act-draw { color: #fff; background: radial-gradient(circle at 35% 30%, #8f7bff, #5a3fd6 60%, #3b25a0); box-shadow: 0 5px 0 #24156b, 0 10px 20px rgba(0,0,0,.35); }
.act-draw:active { transform: translate(-50%, calc(-50% + 4px)); box-shadow: 0 1px 0 #24156b; }
.act-clash { color: #2a1a05; font-size: 1.15rem; background: radial-gradient(circle at 35% 30%, #fff6c2, var(--accent) 55%, #f29a22); box-shadow: 0 5px 0 #b06a10, 0 10px 20px rgba(0,0,0,.35); }
.act-clash.live { animation: clashp .7s ease-in-out infinite; }
@keyframes clashp { 50% { box-shadow: 0 5px 0 #b06a10, 0 0 0 10px rgba(255,210,63,.35), 0 0 30px rgba(255,210,63,.9); scale: 1.08; } }
.act-clash:active { transform: translate(-50%, calc(-50% + 4px)); box-shadow: 0 1px 0 #b06a10; }
.act.off { opacity: .35; filter: grayscale(.7); pointer-events: none; }
.act-clash.off { opacity: 0; }
.hand { position: absolute; left: 0; right: 0; bottom: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; touch-action: pan-x; padding-bottom: var(--safe-b); }
.hand::-webkit-scrollbar { display: none; }
.hand-in { position: relative; margin: 0 auto; }
.hand .card { transition: transform .28s cubic-bezier(.3,1.3,.5,1), filter .2s, box-shadow .2s; }
.hand.mine .card.ok:hover { z-index: 50 !important; }
.hand.hidden-cards .card { visibility: hidden; }
.me-tag { position: absolute; display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 99px; background: rgba(27,17,64,.78); font-weight: 700; font-size: .9rem; pointer-events: none; }
.me-tag svg.ava { width: 30px; height: 30px; }
.me-tag .pts { color: var(--accent); font-size: .8rem; }
#fly { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
#fly .card { position: absolute; }
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 9; overflow: hidden; }
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 12; }
.burst { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 6px solid var(--bc, #fff); animation: burst .7s ease-out forwards; }
@keyframes burst { to { transform: scale(7); opacity: 0; border-width: 1px; } }
.flash { position: absolute; inset: 0; background: var(--fc, #fff); animation: flash .5s ease-out forwards; }
@keyframes flash { from { opacity: .35; } to { opacity: 0; } }
.pop { position: absolute; transform: translate(-50%, -50%); font-weight: 700; font-size: 1.6rem; color: #fff; -webkit-text-stroke: 3px rgba(20,8,50,.7); paint-order: stroke fill; animation: popup 1.2s ease-out forwards; white-space: nowrap; }
.pop.bad { color: #ff8a95; } .pop.gold { color: var(--accent); font-size: 2rem; }
@keyframes popup { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -170%) scale(1); } }
.banner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 700; color: #fff; -webkit-text-stroke: 4px rgba(20,8,50,.6); paint-order: stroke fill; text-align: center; white-space: nowrap; animation: banner 1.5s ease-out forwards; }
.banner.gold { color: var(--accent); } .banner.red { color: #ff8a95; } .banner.mint { color: #8affc0; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } 22% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%); } }

/* ---------- pantallas propias ---------- */
.title-screen { justify-content: space-between; }
.logo { text-align: center; margin-top: 3vh; position: relative; }
.logo .fan { position: relative; height: 120px; width: 220px; margin: 0 auto -18px; }
.logo .fan .card { --w: 70px; left: 75px; top: 6px; transform-origin: 50% 120%; }
.logo .h1 { display: flex; flex-direction: column; align-items: center; line-height: .86; font-weight: 700; position: relative; }
.logo .l1, .logo .l2 { font-size: clamp(3.2rem, 15vw, 6rem); -webkit-text-stroke: 4px #1b1140; paint-order: stroke fill; letter-spacing: -.01em; }
.logo .l1 { transform: rotate(-4deg); text-shadow: 0 6px 0 #1b1140; }
.logo .l1 span:nth-child(4n+1) { color: var(--r); } .logo .l1 span:nth-child(4n+2) { color: var(--y); } .logo .l1 span:nth-child(4n+3) { color: var(--g); } .logo .l1 span:nth-child(4n+4) { color: var(--b); }
.logo .l2 { color: #fff; transform: rotate(3deg); text-shadow: 0 6px 0 #1b1140, 0 0 30px rgba(255,210,63,.6); margin-top: .02em; }
.logo .l2 i { font-style: normal; color: var(--accent); }
.logo p { margin: .8em auto 0; display: inline-block; padding: .3em .9em; border-radius: 99px; background: rgba(27,17,64,.75); font-weight: 600; font-size: 1.02rem; }
.title-bottom { display: flex; flex-direction: column; gap: 12px; align-items: stretch; width: min(360px, 100%); margin-bottom: 1vh; }
.title-bottom .btn.big { justify-content: flex-start; }
.portal-link { position: absolute; left: calc(12px + var(--safe-l)); top: calc(12px + var(--safe-t)); display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 99px; background: rgba(27,17,64,.7); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; }
.portal-link svg { width: 28px; height: 28px; }
.seg { display: flex; gap: 6px; padding: 4px; border-radius: 16px; background: rgba(0,0,0,.25); }
.seg button { flex: 1; min-height: 44px; padding: 4px 6px; border-radius: 12px; font-weight: 700; font-size: 1rem; color: var(--muted); line-height: 1.1; }
.seg button.on { color: #2a1a05; background: linear-gradient(180deg, #fff1a6, var(--accent)); box-shadow: 0 3px 0 #b77812; }
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field > span { font-weight: 700; font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.field .note { font-size: .85rem; color: var(--muted); min-height: 1.1em; }
.who { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.who .w1 { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 700; font-size: .85rem; }
.who svg.ava { width: 52px; height: 52px; }
.who small { font-weight: 600; color: var(--muted); font-size: .72rem; }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.names input { width: 100%; font-family: inherit; font-size: 1rem; font-weight: 600; padding: 9px 10px; border-radius: 12px; border: 0; background: #170e3a; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.colors button { height: 84px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 700; color: #fff; font-size: 1.05rem; text-shadow: 0 2px 0 rgba(0,0,0,.3); box-shadow: 0 5px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.4); }
.colors button svg { width: 28px; height: 28px; fill: #fff; }
.colors button:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.colors .k-r { background: var(--r); } .colors .k-y { background: var(--y); } .colors .k-g { background: var(--g); } .colors .k-b { background: var(--b); }
.colors button.sug { outline: 4px solid #fff; outline-offset: 3px; }
.color-p .box { background: linear-gradient(180deg, var(--panel2), var(--panel)); }
.scores { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.sc-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 14px; background: rgba(255,255,255,.06); font-weight: 700; }
.sc-row svg.ava { width: 36px; height: 36px; flex: none; }
.sc-row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-row .g { color: var(--mint); font-size: .95rem; }
.sc-row .tot { min-width: 54px; text-align: right; font-size: 1.15rem; }
.sc-row.win { background: rgba(255,210,63,.2); box-shadow: inset 0 0 0 2px rgba(255,210,63,.5); }
.sc-row .bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); margin-top: 4px; overflow: hidden; }
.sc-row .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 3px; }
.win-ava svg.ava { width: 96px; height: 96px; animation: cardin .6s cubic-bezier(.3,1.6,.5,1) both; filter: drop-shadow(0 8px 16px rgba(0,0,0,.4)); }
.handoff { justify-content: center; background: radial-gradient(circle at 50% 40%, #3a2780, #120b2e); }
.handoff .box { gap: 16px; }
.handoff svg.ava { width: 92px; height: 92px; margin: 0 auto; }
.handoff .big-name { font-size: 2rem; font-weight: 700; }
.stats-list { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.stats-list .setting b { color: var(--accent); }
.howto-src { display: none; }
#loader { position: absolute; inset: 0; display: grid; place-items: center; z-index: 60; background: var(--bg); transition: opacity .4s; }
#loader.out { opacity: 0; pointer-events: none; }
.loader-cards { display: flex; gap: 8px; }
.loader-cards i { width: 22px; height: 32px; border-radius: 5px; animation: lc .9s ease-in-out infinite; }
.loader-cards i:nth-child(1) { background: var(--r); } .loader-cards i:nth-child(2) { background: var(--y); animation-delay: .1s; } .loader-cards i:nth-child(3) { background: var(--g); animation-delay: .2s; } .loader-cards i:nth-child(4) { background: var(--b); animation-delay: .3s; }
@keyframes lc { 50% { transform: translateY(-12px); } }
.noscript { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; }
.over .row .btn, .done .row .btn { flex: 1 1 0; min-width: 0; padding-left: .6em; padding-right: .6em; font-size: 1rem; }
.over .row, .done .row { flex-wrap: nowrap; }
.howto-body { text-align: left; }
.howto-body .t1 { font-size: 1.3rem; font-weight: 700; margin: 0 0 .4em; color: var(--accent); }
.howto-body h2 { font-size: 1.12rem; margin: 1em 0 .3em; }
.howto-body ul { padding-left: 1.2em; margin: .3em 0; }
.howto-body li { margin: .25em 0; line-height: 1.35; }
.howto-body p { line-height: 1.4; }
.howto-demo { position: relative; height: 110px; margin: 4px 0 8px; }
.howto-demo .card { --w: 62px; }
@media (max-height: 520px) {
  .logo .fan { display: none; } .logo .l1, .logo .l2 { font-size: 3.2rem; } .logo p { font-size: .9rem; }
  .title-screen { flex-direction: row; align-items: center; justify-content: space-around; }
  .btn.big { min-height: 52px; font-size: 1.2rem; }
  .box h2 { font-size: 1.5rem; }
  .settings { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .setting { padding: 4px 8px; } .settings .links, .settings .full { grid-column: 1 / -1; }
  .settings-p .box, .setup-p .box { width: min(760px, 100%); }
  .setup-p .setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .colors button { height: 64px; }
  .act { width: 72px; height: 72px; font-size: .85rem; } .act svg { width: 24px; height: 24px; }
  #toasts { top: calc(60px + var(--safe-t)); }
}
.setup-grid { display: flex; flex-direction: column; gap: 12px; }
@media (prefers-reduced-motion: reduce) { .dirarrows, .act-clash.live, .deck.can .card:last-child, .card.hintc { animation: none; } }
.go-row { flex-wrap: nowrap; }
.go-row .b-go { flex: 1; }
.go-row .b-back { min-width: 64px; min-height: 64px; padding: 0; border-radius: 22px; }

@media (max-height: 520px) { .setup-p .box { gap: 10px; padding: 14px 16px; } .go-row .b-back { min-height: 52px; } .setup-p .field .note { min-height: 0; } }
.colors button span { text-transform: capitalize; }

/* fichas.py: ficha del juego bajo la pantalla de juego (visible al desplazarse; al jugar la página vuelve arriba y no se mueve) */
html, body { height: auto !important; min-height: 100%; overflow-x: hidden !important; overflow-y: auto !important; }
html:has(body.playing), body.playing { overflow: hidden !important; }
body:not(.playing) { touch-action: pan-y; }
body:not(.playing) #wrap, body:not(.playing) #app, body:not(.playing) #app canvas, body:not(.playing) #app .screen { touch-action: pan-y !important; }   /* fuera de la partida se puede bajar a la ficha deslizando sobre el juego */
#wrap, #app { position: relative !important; inset: auto !important; width: 100% !important; height: 100vh !important; height: 100dvh !important; }
.game-info { max-width: 860px; margin: 0 auto; padding: 26px 18px 40px; font-family: Fredoka, ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif; color: #f4f0ff; line-height: 1.55; user-select: text; -webkit-user-select: text; }
.game-info .crumbs { font-size: .92rem; color: #b9b0d8; margin-bottom: 10px; } .game-info .crumbs a { color: #b9b0d8; } .game-info .crumbs span { margin: 0 6px; opacity: .6; }
.game-info .howto-src { display: block; } .game-info .howto { background: none; color: inherit; padding: 0; border-radius: 0; box-shadow: none; border: 0; }
.game-info h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); line-height: 1.15; margin: 0 0 10px; color: #fff; }
.game-info h2 { font-size: 1.3rem; margin: 26px 0 8px; color: #ffd23f; }
.game-info p, .game-info li { color: #e8e2fa; } .game-info ul { padding-left: 1.2em; } .game-info a { color: #ffd23f; }
.game-info details { margin: 8px 0; padding: 12px 16px; border-radius: 14px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1.5px rgba(190,160,255,.22); }
.game-info summary { cursor: pointer; font-weight: 600; } .game-info details p { margin: 6px 0 0; }
.game-info .more { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.game-info .more a { display: block; border-radius: 16px; overflow: hidden; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1.5px rgba(190,160,255,.22); text-decoration: none; color: #fff; }
.game-info .more img { display: block; width: 100%; height: auto; aspect-ratio: 40 / 21; object-fit: cover; } .game-info .more b { display: block; padding: 8px 10px 0; } .game-info .more span { display: block; padding: 0 10px 10px; font-size: .88rem; color: #c9c0e6; }
.game-info .foot { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 34px; padding-top: 16px; border-top: 1px solid rgba(190,160,255,.22); font-size: .92rem; } .game-info .foot a { color: #b9b0d8; }
.howto .t1 { font-size: 1.25rem; font-weight: 700; margin: .67em 0; }
