*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
body{margin:0;font-family:system-ui,Roboto,sans-serif;background:#14123a;color:#fff6e4;min-height:100vh}
.screen{display:none;padding:14px 14px 28px;max-width:560px;margin:0 auto}.screen.on{display:block}
h1{font-size:46px;text-align:center;margin:48px 0 4px;color:#f2c14e;letter-spacing:1px}h1 small{font-size:26px;color:#fff6e4}
.tag{text-align:center;opacity:.8;margin-bottom:40px}.foot{text-align:center;opacity:.5;font-size:12px;margin-top:40px}
button{font:inherit;border:0;border-radius:14px;cursor:pointer;color:#1b1340;background:#f2c14e}
button:active{transform:scale(.97)}button:disabled{opacity:.4}
.big{display:block;width:100%;padding:16px;font-size:20px;font-weight:700;margin:10px 0}
.big.alt{background:#e2557a;color:#fff}.mid{padding:12px 6px;font-size:15px;font-weight:600;flex:1}.small{padding:8px 12px;font-size:13px;background:#3b3778;color:#fff}
header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}header b{font-size:19px}
.back{background:none;color:#f2c14e;font-size:32px;padding:0 10px}.pill{background:#3b3778;border-radius:20px;padding:4px 12px;font-weight:700}
#cardWrap{text-align:center}
.card{width:190px;height:270px;margin:0 auto;border-radius:16px;border:5px solid #c9a14a;background:linear-gradient(160deg,var(--c1,#2d2a6e),var(--c2,#5a2a6e));
 display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:10px;box-shadow:0 8px 24px #0008;transition:transform .25s}
.card.pop{animation:pop .35s}@keyframes pop{0%{transform:scale(.85) rotate(-3deg)}100%{transform:none}}
.card .num{background:#c9a14a;color:#1b1340;border-radius:50%;width:40px;height:40px;line-height:40px;font-weight:800;font-size:18px}
.card .art{font-size:76px}.card .name{background:#fff1d6;color:#1b1340;border-radius:8px;padding:6px 10px;font-weight:800;font-size:18px;width:100%}
.card.sm{width:96px;height:132px;padding:5px;border-width:3px;margin:0}.card.sm .num{width:28px;height:28px;line-height:28px;font-size:13px}.card.sm .name{font-size:12px;padding:3px}
.verso{min-height:44px;font-style:italic;opacity:.9;margin:10px 4px}
.ctrls{display:flex;flex-wrap:wrap;gap:8px}.ctrls .big{flex-basis:100%;margin:0}
.row{margin:12px 2px}.row input[type=range]{width:100%;accent-color:#f2c14e}.opts{display:flex;gap:14px;align-items:center;flex-wrap:wrap}
h3{margin:16px 0 8px;color:#f2c14e}h3 small{color:#fff6e4;opacity:.6;font-weight:400}
.grid{display:grid;grid-template-columns:repeat(6,1fr);gap:4px}
.hc{background:#2d2a6e;border-radius:6px;padding:3px 1px;text-align:center;font-size:9px;line-height:1.15;min-height:34px}
.hc b{display:block;font-size:13px;color:#f2c14e}.hc.last{outline:2px solid #f2c14e}
.panel label{display:block;padding:7px 0;font-size:16px}
.mini{display:flex;gap:12px;align-items:center}.miniCtl{flex:1;display:flex;flex-direction:column;gap:8px}
.tabs{display:flex;gap:6px;margin:10px 0;flex-wrap:wrap}.tabs button{padding:6px 10px;background:#3b3778;color:#fff;font-size:13px}.tabs button.on{background:#f2c14e;color:#1b1340}
.tabs button.win{background:#3fb37f}
.tabla{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;background:#c9a14a;padding:6px;border-radius:12px}
.cell{aspect-ratio:3/4;border-radius:7px;background:linear-gradient(160deg,var(--c1),var(--c2));display:flex;flex-direction:column;align-items:center;justify-content:space-between;
 padding:3px;font-size:10px;font-weight:700;text-align:center;position:relative;color:#fff}.cell .n{font-size:12px;color:#f2c14e}.cell .e{font-size:26px}
.cell.mk::after{content:"";position:absolute;width:46%;aspect-ratio:1;border-radius:50%;top:27%;background:radial-gradient(circle at 35% 35%,#c98a4a,#6b3b16);box-shadow:0 2px 4px #000a}
.cell.hl{outline:3px solid #3fb37f}.cell.bad{outline:3px solid #ff4d4d}
.loteria{background:#e2557a;color:#fff;font-size:24px;margin-top:14px}.msg{text-align:center;min-height:24px;font-weight:700}
#toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:#000c;padding:10px 16px;border-radius:12px;display:none;z-index:9}

/* full-bleed art; frame, number and name drawn in code */
.card.hasart{background:var(--art),#222;position:relative;overflow:hidden;box-shadow:inset 0 0 0 2px #fff6,0 6px 18px #0008}
.card.hasart .art{display:none}.card.hasart .num{position:absolute;top:8px;left:50%;transform:translateX(-50%);box-shadow:0 2px 6px #0009;border:2px solid #fff1d6}
.card.hasart .name{position:absolute;left:8px;right:8px;bottom:8px;width:auto;box-shadow:0 2px 6px #0009;border:2px solid #c9a14a}
.card.sm.hasart .num{top:4px}.card.sm.hasart .name{left:4px;right:4px;bottom:4px}
.hc{background:var(--art),#2d2a6e;aspect-ratio:2/3;min-height:0;display:flex;flex-direction:column;justify-content:space-between;padding:2px;overflow:hidden}
.hc b{background:#1b1340cc;border-radius:50%;width:20px;height:20px;line-height:20px;margin:0 auto;font-size:11px}
.hc span{background:#fff1d6;color:#1b1340;border-radius:3px;font-weight:700;font-size:8px;padding:1px}
.cell{background:var(--art),linear-gradient(160deg,var(--c1),var(--c2));border:2px solid #fff1d6;padding:2px}
.cell .n{background:#1b1340cc;border-radius:50%;width:20px;height:20px;line-height:20px;font-size:11px}
.cell .nm{background:#fff1d6;color:#1b1340;border-radius:3px;width:100%;font-size:9px;padding:1px 0;line-height:1.1}
.card.sm.hasart .num{width:24px;height:24px;line-height:24px;font-size:12px;padding:0;margin:0;text-align:center}
/* classic Lotería numeral: plain bold number, top-left, no badge */
.card.hasart .num,.card.sm.hasart .num,.hc b,.cell .n{position:absolute;top:4px;left:7px;right:auto;transform:none;background:none;border:0;box-shadow:none;border-radius:0;width:auto;height:auto;margin:0;padding:0;line-height:1;text-align:left;
 color:#fff;font-weight:900;font-family:Georgia,'Times New Roman',serif;text-shadow:0 0 3px #000,0 1px 2px #000,1px 1px 0 #000}
.card.hasart .num{font-size:30px;top:8px;left:12px}.card.sm.hasart .num{font-size:16px;top:4px;left:6px}
.hc{position:relative}.hc b{font-size:13px;top:2px;left:4px}.cell{position:relative}.cell .n{font-size:15px;top:3px;left:5px}
.hc,.cell{justify-content:flex-end}
/* ---- home: title art background + logo drawn in code (falls back to gradient if title.jpg missing) ---- */
#home.on{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;position:relative;max-width:none;padding:14px max(14px,calc(50% - 266px)) 24px}
#home{background:linear-gradient(180deg,#14123acc 0%,#14123a33 38%,#14123a00 55%,#14123add 100%),url('art/title.jpg') center top/cover,radial-gradient(ellipse at 50% 20%,#3b2a7a,#14123a 70%)}
#home .lang{position:absolute;top:12px;right:12px;z-index:2}
.logo{text-align:center;margin:44px 0 0;position:relative}
.logo .l1{display:block;font-family:Georgia,'Times New Roman',serif;font-weight:900;font-size:64px;line-height:1;color:#fff;letter-spacing:1px;
 text-shadow:3px 3px 0 #ce1126,6px 6px 0 #006847,0 0 18px #000a}
.logo .l2{display:block;margin-top:14px;font-weight:700;font-size:16px;letter-spacing:2px;text-transform:uppercase;color:#fff;text-shadow:0 1px 4px #000}
.logo .tri{display:flex;justify-content:center;gap:0;margin:10px auto 0;width:120px;height:6px;border-radius:3px;overflow:hidden;box-shadow:0 1px 4px #0008}
.logo .tri b{flex:1}.logo .tri b:nth-child(1){background:#006847}.logo .tri b:nth-child(2){background:#fff}.logo .tri b:nth-child(3){background:#ce1126}
.homeBtns{margin-top:auto}
.hb{text-align:left;padding:14px 16px;box-shadow:0 4px 14px #0007}.hb small{display:block;font-size:13px;font-weight:500;margin-top:4px;opacity:.85;line-height:1.3}
.hb.grp{background:#006847;color:#fff}
#home .foot{margin-top:10px;opacity:.7;text-shadow:0 1px 3px #000}
/* caller empty state: card back instead of placeholder emoji */
.card.empty{background:repeating-linear-gradient(45deg,#ce1126 0 10px,#b00f20 10px 20px);justify-content:center}
.card.empty .art{display:none}.card.empty .num{visibility:hidden}
.card.empty .name{font-family:Georgia,serif;font-size:20px}
/* group game */
.roomBar{display:flex;justify-content:space-between;align-items:center;gap:8px;background:#006847;border-radius:12px;padding:8px 10px;margin-bottom:10px}
.roomBar b{font-size:24px;letter-spacing:2px;font-family:ui-monospace,monospace;color:#fff}.vf{background:#fff;color:#006847;font-weight:700}
.help{opacity:.85;font-size:14px;line-height:1.35}.panel{margin-bottom:14px}
.txt{display:block;width:100%;margin-top:6px;padding:12px;font-size:22px;border-radius:10px;border:2px solid #c9a14a;background:#fff6e4;color:#1b1340;text-transform:uppercase;letter-spacing:2px}
.vrow{display:flex;gap:8px}.vrow .txt{margin:0;flex:1}.vrow .mid{flex:0 0 120px}
.cell.dim{filter:grayscale(.85) brightness(.45)}.msg.ok{color:#5be39a}.msg.no{color:#ff8a8a}
.center{display:block;margin:12px auto 0}.resume{display:flex;flex-direction:column;gap:8px;margin-bottom:8px}.resume .small{font-size:15px;padding:12px}
.roomBar>span{font-size:13px}.roomBar b{display:block;white-space:nowrap;font-size:28px}
/* numbers ~half size (Hugo, Oct 27) */
.card.hasart .num{font-size:16px;top:7px;left:9px}.card.sm.hasart .num{font-size:10px;top:4px;left:5px}
.hc b{font-size:9px;top:2px;left:3px}.cell .n{font-size:9px;top:3px;left:4px}
/* hero selfie under the logo */
.hero{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:16px;border:3px solid #fff6e4;box-shadow:0 0 0 3px #006847,0 8px 24px #000a;margin:18px 0 6px}
.logo{margin-top:30px}
/* landscape/wide screens (iPad): 'cover' cropped the portrait title art to its empty sky; show the whole picture instead */
@media (min-aspect-ratio:1/1){#home{background:linear-gradient(180deg,#14123acc 0%,#14123a33 38%,#14123a00 55%,#14123add 100%),url('art/title.jpg') center/auto 100% no-repeat,radial-gradient(ellipse at 50% 20%,#3b2a7a,#14123a 70%)}}
[hidden]{display:none!important}.hero{height:auto;max-height:42vh}

.restart{background:#c0392b;color:#fff;font-weight:bold;margin-left:6px}
.rsModal{position:fixed;inset:0;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;z-index:999}.rsModal[hidden]{display:none}.rsBox{background:#fff;color:#222;padding:20px;border-radius:12px;text-align:center;font-size:1.2em}

.setBox{border:2px solid #e0b030;border-radius:12px;padding:8px 12px;margin:10px 8px;background:rgba(255,255,255,.08)}
.setBox h4{margin:0 0 6px;font-size:1.15em}
.setBox #sec{flex:1;min-width:0}.secV{font-size:1.4em;min-width:2ch;text-align:center}
.vToggle{display:flex;gap:8px}.vBtn{flex:1;padding:12px 6px;font-size:1.05em;border-radius:10px;border:2px solid #888;background:#fff;color:#333}
.vBtn.on{background:#7b2cbf;border-color:#7b2cbf;color:#fff;font-weight:bold}
.newGame{display:block;width:calc(100% - 16px);margin:12px 8px;padding:16px;font-size:1.3em;font-weight:bold;background:#0a7d3b;color:#fff;border:none;border-radius:12px;box-shadow:0 3px 0 #064d24}

.setBox.compact{padding:6px 10px;margin:6px 8px}.setBox.compact h4{font-size:1em;margin-bottom:4px}.setBox.compact .vBtn{padding:8px 4px;font-size:.95em}

.autoBtn{display:block;width:100%;margin-top:8px;padding:12px 6px;font-size:1.05em;font-weight:bold;border-radius:10px;border:2px solid #0a7d3b;background:#fff;color:#0a7d3b}
.autoBtn.on{background:#0a7d3b;color:#fff}
.setBox #bSec{flex:1;min-width:0}
.resBox{max-width:340px;width:86%}.resTitle{font-size:2em;font-weight:900;margin:6px 0 10px}.resBox p{font-size:1.15em;margin:0 0 10px}
