*{box-sizing:border-box;margin:0;padding:0}
html,body{overflow-x:hidden}
body{font-family:system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif;color:#23262b;min-height:100vh;
 background:radial-gradient(circle at 10% 0,#fff 0,transparent 45%),linear-gradient(#e8f4f8,#f7f6f4 45%,#fff);
 touch-action:manipulation;-webkit-user-select:none;user-select:none}
.top{text-align:center;padding:10px 12px 4px}
.links{display:flex;justify-content:space-between;gap:8px;max-width:1100px;margin:0 auto 4px}
.links a{font-weight:600;color:#C8102E;text-decoration:none;background:#fff;padding:8px 16px;border-radius:999px;box-shadow:0 3px 0 #C8102E55;font-size:16px}
.links a:hover,.links a:focus-visible{background:#fbe9ec}
.gtitle{font-weight:700;line-height:.95;font-size:clamp(30px,4.6vw,56px);-webkit-text-stroke:.06em #fff;paint-order:stroke fill;
 text-shadow:0 .03em 0 #fff,0 .07em 0 rgba(40,20,90,.35),0 .1em .2em rgba(0,0,0,.2)}
.gtitle .line{display:inline}.gtitle .w{display:inline-block;white-space:nowrap}
.sub{font-weight:600;color:#C8102E;font-size:clamp(17px,2vw,22px)}
main{max-width:1100px;margin:0 auto;padding:6px 10px 20px}
.hud{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px 14px;margin:6px 0 10px;font-size:18px}
.hud span{background:#fff;border-radius:14px;padding:6px 12px;box-shadow:0 3px 0 #00b3ff44}
.btn{font:inherit;font-weight:700;border:0;cursor:pointer;color:#fff;border-radius:999px;padding:8px 18px;min-height:44px;
 background:linear-gradient(90deg,#C8102E,#C8102E);box-shadow:0 4px 0 #4b2bb0}
.btn:active{transform:translateY(2px)}
.btn.big{font-size:22px;padding:12px 32px}
.btn.alt{background:linear-gradient(90deg,#00b3ff,#C8102E);box-shadow:0 4px 0 #2654a8}
.win{position:fixed;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;background:rgba(191,233,255,.85);padding:16px;overflow:auto}
.win[hidden]{display:none}
.panel{position:relative;z-index:2;background:#fff;border-radius:28px;padding:20px 26px 26px;text-align:center;max-width:440px;width:100%;
 border:5px solid #C8102E;box-shadow:0 10px 0 #C8102E,0 20px 40px rgba(0,0,0,.2);animation:in .5s cubic-bezier(.3,1.5,.5,1)}
@keyframes in{from{transform:scale(.5);opacity:0}}
.panel img{width:min(200px,46vw);height:auto;animation:bob 1.2s ease-in-out infinite alternate}
@keyframes bob{to{transform:translateY(-10px) rotate(4deg)}}
.panel h2{color:#C8102E;font-size:clamp(22px,5vw,32px)}
.cheer{font-size:20px;font-weight:600;color:#C8102E;margin:4px 0 10px}
.how{font-size:16px;line-height:1.35;margin:0 0 16px;color:#23262b}
.stats{font-size:18px;margin-bottom:16px}
.confetti i{position:absolute;top:-20px;width:10px;height:16px;border-radius:2px;animation:fall linear infinite}
@keyframes fall{to{transform:translateY(110vh) rotate(720deg)}}
@media (max-width:640px){
 .hud{font-size:15px;gap:6px}
 .links a{font-size:14px;padding:7px 12px}
}
@media (prefers-reduced-motion:reduce){.panel,.panel img,.confetti i{animation:none}}


.play{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-start;gap:18px}
.side{text-align:center}
.side img{width:140px;height:140px;object-fit:contain;background:#fff;border-radius:20px;border:4px solid #ff7ad9;box-shadow:0 6px 0 #ff4fd888}
.preview-label{font-size:14px;font-weight:600;color:#C8102E;margin-top:6px}
.board{display:grid;grid-template-columns:repeat(var(--n),1fr);gap:6px;width:min(420px,86vw);aspect-ratio:1;
 background:#C8102E;padding:6px;border-radius:18px;box-shadow:0 8px 0 #4b2bb0}
.tile{position:relative;overflow:hidden;border:0;border-radius:12px;cursor:pointer;min-width:44px;min-height:44px;
 background:#fbe9ec;box-shadow:0 3px 0 rgba(0,0,0,.15);padding:0}
.tile .pic{position:absolute;background-repeat:no-repeat;background-size:100% 100%;pointer-events:none}
.tile:focus-visible{outline:4px solid #ffd000;outline-offset:1px}
.tile.blank{background:#5a38c4!important;cursor:default;box-shadow:inset 0 0 0 2px #9b7dff55}
.sizes{display:flex;justify-content:center;gap:8px;margin:0 0 12px;flex-wrap:wrap}
.btn.pick{font-size:16px;padding:8px 16px;opacity:.7}
.btn.pick.on{opacity:1;outline:3px solid #ffd000}
.pick-label{font-weight:600;color:#C8102E;margin:4px 0 8px}
.picker{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;margin:0 0 16px}
.picker button{border:3px solid transparent;background:#fff;border-radius:12px;padding:2px;cursor:pointer;min-height:44px}
.picker button img{width:100%;height:auto;display:block;aspect-ratio:1;object-fit:contain}
.picker button.on{border-color:#ff4fd8;box-shadow:0 3px 0 #ff4fd888}
.picker button:focus-visible{outline:3px solid #C8102E}
@media (max-width:640px){
 .side img{width:88px;height:88px}
 .board{width:min(340px,92vw);gap:4px;padding:4px}
 .picker{grid-template-columns:repeat(6,1fr);gap:4px}
}


.brand{display:inline-flex;align-items:center;margin:4px 0}
.brand img{height:44px;width:auto;display:block}
.sub{font-weight:700;color:#C8102E;font-size:clamp(17px,2vw,22px)}
.btn,.btn.big{background:#C8102E;color:#fff;border:0;border-radius:999px;padding:12px 24px;font:inherit;font-weight:700;cursor:pointer}
.btn:hover{background:#9d0c24}
