*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{width:100%;height:100%;overflow:hidden;background:#123d2a;touch-action:none;user-select:none;-webkit-user-select:none;
  font-family:"Trebuchet MS","Arial Rounded MT Bold",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:#13213a}
canvas{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none}
button{font:inherit;cursor:pointer;border:0;color:inherit}
.panel{position:fixed;inset:0;display:none;align-items:center;justify-content:center;padding:10px;z-index:5;
  background:rgba(10,40,30,.62) url(img/crowd.webp) center/cover no-repeat;background-blend-mode:multiply}
.panel.show{display:flex}
#result,#copa,#pause{background:rgba(8,30,22,.78)}
.card{width:min(560px,100%);max-height:100%;overflow:auto;background:#fffaf0;border:4px solid #13213a;border-radius:24px;
  padding:12px 16px 14px;text-align:center;box-shadow:0 7px 0 #13213a,0 18px 40px rgba(0,0,0,.4);position:relative}
.top{display:flex;align-items:center;gap:10px;justify-content:center}
.top img{width:120px;height:88px;object-fit:contain;flex:none;filter:drop-shadow(0 3px 0 rgba(0,0,0,.25))}
h1{font-size:36px;line-height:1;font-weight:900;color:#ffd21f;letter-spacing:.3px;
  text-shadow:2px 2px 0 #13213a,-2px 2px 0 #13213a,2px -2px 0 #13213a,-2px -2px 0 #13213a,0 5px 0 #13213a}
.sub{font-size:19px;font-weight:900;color:#1f9d4c;margin-top:5px}
.intro{font-size:13px;line-height:1.35;margin:8px 0 2px;color:#3b4a5e}
.big{display:block;width:100%;margin:8px 0 8px;padding:12px 0;font-size:30px;font-weight:900;color:#fff;border-radius:18px;
  background:linear-gradient(#34d06c,#1c9d4b);border:4px solid #13213a;box-shadow:0 6px 0 #13213a;letter-spacing:1px;text-shadow:0 3px 0 #13213a}
.big:active,.mode:active,.small:active{transform:translateY(3px);box-shadow:0 2px 0 #13213a}
.big small{display:block;font-size:13px;letter-spacing:0;text-shadow:none;opacity:.95;margin-top:2px}
.modes{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.mode{padding:8px 4px;border-radius:14px;border:3px solid #13213a;box-shadow:0 4px 0 #13213a;font-weight:900;font-size:16px;line-height:1.1;background:#fff}
.mode i{display:block;font-style:normal;font-size:11.5px;font-weight:700;color:#3b4a5e;margin-top:2px}
.mode.copa{background:#ffe27a}.mode.p2{background:#bfe0ff}.mode.pen{background:#ffd0c2}
.opts{margin-top:10px;display:grid;grid-template-columns:auto 1fr;gap:6px 8px;align-items:center;text-align:left}
.opts b{font-size:13.5px}
.seg{display:flex;gap:5px;flex-wrap:wrap}
.opt{padding:5px 9px;border-radius:11px;background:#fff;border:2.5px solid #13213a;font-weight:900;font-size:13px}
.opt.sel{background:#ffd21f}
.keys{display:flex;gap:8px;justify-content:center;margin-top:10px;flex-wrap:wrap;font-size:12.5px;font-weight:700}
.kp{display:flex;align-items:center;gap:3px;padding:4px 7px;border-radius:11px;border:2px solid #13213a;background:#eaf6ee}
.k{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 4px;border-radius:6px;background:#fff;border:2px solid #13213a;
  box-shadow:0 2px 0 #13213a;font-weight:900;font-size:12px}
.touch{font-size:12.5px;font-weight:700;margin-top:6px;color:#3b4a5e}
.stats{font-size:12.5px;font-weight:900;color:#1f9d4c;margin-top:6px}
.small{margin:6px 4px 0;padding:8px 20px;font-size:16px;font-weight:900;border-radius:14px;background:#fff;border:3px solid #13213a;box-shadow:0 3px 0 #13213a}
.rt{font-size:34px;font-weight:900;color:#ffd21f;text-shadow:2px 2px 0 #13213a,-2px 2px 0 #13213a,2px -2px 0 #13213a,-2px -2px 0 #13213a,0 4px 0 #13213a}
.rt.lose{color:#ff8a65}
#rImg{width:130px;height:130px;object-fit:contain;display:block;margin:4px auto 0;animation:bob 1.2s ease-in-out infinite}
@keyframes bob{50%{transform:translateY(-8px) rotate(3deg)}}
.score{display:flex;align-items:center;justify-content:center;gap:10px;font-size:34px;font-weight:900;margin:6px 0}
.score img{width:38px;height:44px}
.score .tn{font-size:13px;font-weight:900;max-width:110px;line-height:1.1}
.rs{font-size:14px;font-weight:700;color:#3b4a5e}
.bracket{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:6px;align-items:center;margin:8px 0;font-size:12px;font-weight:900;text-align:left}
.col{display:flex;flex-direction:column;gap:6px;justify-content:space-around;height:100%}
.col h4{font-size:12px;color:#1f9d4c;text-align:center}
.m{border:2px solid #13213a;border-radius:9px;background:#fff;overflow:hidden}
.m div{display:flex;align-items:center;gap:4px;padding:2px 5px;white-space:nowrap;overflow:hidden}
.m div img{width:14px;height:16px;flex:none}
.m div span{overflow:hidden;text-overflow:ellipsis;flex:1}
.m div em{font-style:normal}
.m .w{background:#fff2b3}.m .us{color:#1f7a3d}
.m.now{outline:3px solid #ff7a1a}
.ctitle{font-size:28px}
#hud{position:fixed;z-index:6;display:flex;gap:6px;top:8px;right:8px}
.round{width:38px;height:38px;border-radius:50%;background:#fff;border:3px solid #13213a;display:grid;place-items:center;box-shadow:0 3px 0 #13213a;padding:0}
.round svg{width:20px;height:20px;fill:none;stroke:#13213a;stroke-width:2.4;stroke-linejoin:round;stroke-linecap:round}
.round.off{opacity:.55}
#btnMute .off,#btnMute.muted .on{display:none}#btnMute.muted .off{display:inline}
#btnHome.hide{display:none}
@media (min-width:700px) and (min-height:560px){ .card{padding:16px 22px} h1{font-size:44px} .top img{width:150px;height:110px} }
@media (max-height:520px) and (min-width:600px){
  #menu .card{width:min(780px,100%);display:grid;grid-template-columns:1fr 1fr;gap:0 16px;text-align:center;padding:10px 14px}
  .card{padding:10px 14px} #rImg{width:96px;height:96px}
  #menu .top{grid-column:1} #menu .left{grid-column:1} #menu .right{grid-column:2;grid-row:1/span 2}
  .top img{width:90px;height:66px} h1{font-size:30px} .intro{font-size:12px}
}
@media (pointer:coarse){ .keys{display:none} }
@media (pointer:fine){ .touch{display:none} }
@media (max-width:600px) and (orientation:portrait){
  #menu .card{display:flex;flex-direction:column}
  #menu .top{order:0} #menu .right{order:1} #menu .left{order:2}
  #menu .opts{margin-top:8px}
  #menu.panel{align-items:flex-start;padding-top:54px}
}
@media (max-height:520px) and (min-width:600px){ .panel{padding:8px 54px 8px 8px} }
/* very short frames (small store embed, zoomed laptops): compact menu so every button fits without scrolling */
@media (max-height:420px) and (min-width:600px){
  .card{padding:8px 12px;border-radius:18px;box-shadow:0 5px 0 #13213a,0 12px 30px rgba(0,0,0,.4)}
  .top{gap:6px} .top img{width:58px;height:46px} h1{font-size:24px} .sub{font-size:14px;margin-top:2px}
  #menu .intro{display:none}
  .big{margin:6px 0;padding:7px 0;font-size:22px;border-radius:14px;border-width:3px;box-shadow:0 4px 0 #13213a} .big small{font-size:11px}
  .modes{gap:6px} .mode{padding:5px 3px;font-size:13.5px;border-radius:11px;box-shadow:0 3px 0 #13213a} .mode i{font-size:10px}
  .opts{margin-top:2px;gap:4px 6px} .opts b{font-size:12px} .opt{padding:3px 8px;font-size:12px;border-radius:9px;border-width:2px}
  .keys{margin-top:6px;gap:5px;font-size:11px} .kp{padding:2px 5px} .k{min-width:18px;height:18px;font-size:10.5px}
  .touch{font-size:11px;margin-top:4px} .stats{font-size:11px;margin-top:4px}
  .rt{font-size:26px} .ctitle{font-size:22px} #rImg{width:72px;height:72px} .score{font-size:28px;margin:2px 0} .small{padding:6px 16px;font-size:14px;margin-top:2px}
  #btnCopaGo{display:inline-block;width:calc(100% - 118px);vertical-align:middle;font-size:18px} #btnCopaMenu{width:104px;vertical-align:middle;margin:0 0 0 6px}
  #result .big{display:inline-block;width:calc(100% - 118px);vertical-align:middle} #btnMenu{width:104px;vertical-align:middle;margin:0 0 0 6px;padding:6px 4px}
  .bracket{margin:4px 0;gap:4px} .m div{padding:1px 5px}
}
