*{box-sizing:border-box}body{margin:0}button,a{touch-action:manipulation;-webkit-tap-highlight-color:transparent}button,select{font:inherit;color:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.45}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid #296ec5;outline-offset:4px}a{color:inherit}.game-shell{margin-left:auto;margin-right:auto}.game-bar{display:flex;align-items:center;gap:12px;border:2px solid #302d28;background:#fff;box-shadow:0 5px #302d28;min-height:60px}.game-bar strong{flex:1}.home{display:flex;align-items:center;gap:6px;text-decoration:none;padding:8px;font-size:14px;min-height:44px}.tools{display:flex;gap:6px}.tools button{width:44px;height:44px;border:2px solid #302d28;background:#fff;border-radius:14px}.brand-avatar{border-radius:50%}main{margin-top:30px;margin-bottom:30px}.title-view{text-align:center}.hero-art{display:block;height:auto}.eyebrow{font-size:14px;letter-spacing:2px;color:#716457;margin:12px 0}h1 mark{background:linear-gradient(transparent 45%,#ffda4c 45%,#ffda4c 94%,transparent 94%);color:inherit;padding:0 8px}.tagline{line-height:1.7}.setup{max-width:480px;margin:26px auto;background:#fffdf7;border:2px solid #302d28;border-radius:22px;padding:24px;text-align:left;box-shadow:0 5px #302d28}.setup fieldset{border:0;padding:0;margin:0 0 20px}.setup legend,.setup label{font-size:14px;display:block;margin-bottom:9px}.choices{display:flex;gap:8px}.choice,.secondary{min-height:44px;border:2px solid #302d28;border-radius:12px;background:#fff;padding:8px 15px}.choice{flex:1}.choice[aria-pressed=true]{background:#302d28;color:#ffdf45}.setup select{width:100%;padding:10px 12px;border:2px solid #302d28;border-radius:12px;background:#fff;min-height:48px}.setup-row{display:grid;grid-template-columns:1fr 1fr;gap:15px}.primary{min-height:48px;padding:12px 20px;border:2px solid #302d28;border-radius:13px;box-shadow:0 5px #302d28;background:#ffdf45;font:inherit;cursor:pointer}.start-button{display:block;width:100%;margin-top:10px}.how-link{background:none;border:0;min-height:44px;text-decoration:underline;text-underline-offset:4px;font-size:14px}.note{font-size:14px;color:#716457;line-height:1.7}.play-top{display:flex;justify-content:space-between;align-items:center;color:#716457;font-size:14px;margin-bottom:15px}.scores{display:grid;grid-template-columns:1fr 1fr;gap:12px}.score{display:flex;align-items:center;gap:10px;padding:13px 16px;background:#fff;border:2px solid #b9afa1;border-radius:18px;transition:background .2s}.score.active{border-color:var(--player);background:var(--tint);box-shadow:0 4px var(--player)}.score img{width:36px;height:36px}.score.orange img,.owner.p1 img{filter:hue-rotate(125deg) saturate(1.7)}.score b{font-size:30px;margin-left:auto}.score span{font-size:14px}.p0,.purple{--player:#8253bd;--tint:#eee2fa}.p1,.orange{--player:#bc5715;--tint:#ffebd6}.turn{min-height:32px;margin:20px 0 14px;text-align:center;font-size:18px}.board-paper{background:#fffdf7;border:2px solid #302d28;border-radius:24px;box-shadow:0 6px #302d28;position:relative;padding:8px}.board{position:relative;width:100%;aspect-ratio:1;--step:calc((100% - 48px)/var(--size));isolation:isolate}.dot{position:absolute;left:calc(24px + var(--x)*var(--step));top:calc(24px + var(--y)*var(--step));width:10px;height:10px;border-radius:50%;background:#302d28;transform:translate(-50%,-50%);pointer-events:none;z-index:4}.edge{position:absolute;border:0;background:transparent;padding:0;transform:translate(-50%,-50%);border-radius:8px;z-index:2;opacity:1!important}.edge.h{width:max(44px,calc(var(--step) - 4px));height:44px;left:calc(24px + (var(--x) + .5)*var(--step));top:calc(24px + var(--y)*var(--step))}.edge.v{width:44px;height:max(44px,calc(var(--step) - 4px));left:calc(24px + var(--x)*var(--step));top:calc(24px + (var(--y) + .5)*var(--step))}.edge:before{content:'';position:absolute;border-radius:6px;background:#e6e1d8;pointer-events:none}.edge.h:before{height:5px;left:0;right:0;top:calc(50% - 2.5px)}.edge.v:before{width:5px;top:0;bottom:0;left:calc(50% - 2.5px)}.edge.taken{pointer-events:none}.edge.taken:before{background:var(--player)}.edge.last:before{box-shadow:0 0 0 3px var(--tint);animation:blink 1s ease}.owner{position:absolute;left:calc(24px + var(--x)*var(--step));top:calc(24px + var(--y)*var(--step));width:var(--step);height:var(--step);background:var(--tint);display:grid;place-items:center;border-radius:7px;z-index:0}.owner img{width:48%;max-width:38px;opacity:.8}.owner.new{animation:claim .35s ease-out}.play-actions{display:flex;justify-content:space-between;gap:12px;margin:24px 0 12px}.play-actions button{font-size:14px}.progress{height:6px;background:#ded5c6;border-radius:6px;overflow:hidden;margin-top:20px}.progress span{display:block;height:100%;background:#8253bd}.result{margin:25px 0;text-align:center;border:2px solid #302d28;border-radius:22px;background:#fff4c6;padding:25px;box-shadow:0 5px #302d28}.result h1{font-size:30px;margin:10px 0 15px}.result .actions{display:flex;flex-wrap:wrap;justify-content:center;gap:13px}.result .note{margin-bottom:20px}.status{font-size:14px;min-height:24px;margin-top:15px}footer{text-align:center;color:#716457;font-size:14px;padding:20px 16px 30px}dialog{width:min(92vw,480px);max-height:85vh;overflow:auto;border:2px solid #302d28;border-radius:22px;background:#fffdf7;padding:26px;color:inherit}dialog::backdrop{background:#302d2866}dialog h2{margin-top:0}dialog p,dialog li{font-size:16px;line-height:1.8}dialog form button{width:100%}.dialog-actions{display:flex;gap:12px;margin-top:20px}.dialog-actions button{flex:1}dialog ol{padding-left:22px}@media(hover:hover){.edge:not(:disabled):hover:before{background:#b898dc}.primary:hover{background:#ffe77c}.secondary:hover{background:#fff1b7}}@keyframes blink{0%,50%{opacity:.4}25%,100%{opacity:1}}@keyframes claim{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:scale(1)}}@media(max-width:520px){.game-bar{gap:6px}.game-bar strong{font-size:14px}.home span{display:none}.home{font-size:24px}.game-bar .brand-avatar{width:26px;height:26px}.tools button{width:44px;height:44px}.setup{padding:20px;margin-top:22px}.setup-row{gap:10px}.score{padding:10px;gap:6px}.score img{width:28px;height:28px}.score b{font-size:26px}.score span{font-size:14px}.board-paper{padding:0}.turn{font-size:16px}.tagline{font-size:16px}.hero-art{max-width:85%;width:285px}.eyebrow{font-size:12px}.play-top{font-size:14px}main{margin-top:30px}.result{padding:22px 14px}.result h1{font-size:26px}}@media(prefers-reduced-motion:reduce){*,*:before{animation:none!important;transition:none!important}}

/* Nối cặp hình */
.setup{text-align:center}.setup .start-button{margin:12px auto 0}.record{margin:0 0 6px;font-size:15px}
.play{position:relative}
.hud{display:flex;gap:8px;align-items:center;justify-content:space-between}
.chip{display:inline-flex;align-items:center;gap:6px;border:2px solid #302d28;border-radius:999px;background:#fff;padding:4px 12px;font-size:14px;min-height:36px;white-space:nowrap}
.chip b{font-size:16px}.chip.time{background:#fff4c6}.chip.time.low{background:#ffd6cf;animation:pulse 1s infinite}
.timebar{height:6px;background:#ded5c6;border-radius:6px;overflow:hidden;margin-top:8px}.timebar span{display:block;height:100%;background:#8253bd;transition:width 1s linear}
.turn{min-height:24px;line-height:24px;margin:6px 0;text-align:center;font-size:14px;color:#5d574f}
.gravity{display:inline-block;margin-left:6px;padding:0 8px;border-radius:999px;background:#302d28;color:#ffdf45;font-size:13px}
.board-wrap{display:flex;justify-content:center}
.board{position:relative;background:#fffdf7;border:2px solid #302d28;border-radius:18px;box-shadow:0 4px #302d28;flex-shrink:0;touch-action:manipulation}
.tile{position:absolute;left:calc(var(--pad) + var(--col)*var(--w));top:calc(var(--pad) + var(--row)*var(--h));width:var(--w);height:var(--h);padding:2px;border:0;background:transparent;display:block}
.tile:before{content:'';position:absolute;inset:2px;border-radius:10px;background:var(--bg);border:2px solid #302d28;box-shadow:0 3px #302d28;transition:transform .12s}
.tile svg{position:relative;display:block;width:100%;height:100%;padding:12%;pointer-events:none}
.tile.picked:before{background:#ffdf45;transform:translateY(-2px);box-shadow:0 5px #302d28,0 0 0 3px #8253bd}
.tile.hint:before{animation:glow .7s ease-in-out 3 alternate;box-shadow:0 3px #302d28,0 0 0 3px #29a36a}
.tile.gone{animation:pop .28s ease-in forwards;pointer-events:none}
.tile.shake{animation:shake .3s}
.tile:focus-visible{outline:3px solid #296ec5;outline-offset:-1px;z-index:2}
.lines{position:absolute;inset:-2px;pointer-events:none;overflow:visible;z-index:3}
.path polyline{fill:none;stroke-linecap:round;stroke-linejoin:round}
.path .under{stroke:#302d28;stroke-width:9}.path .over{stroke:#ffdf45;stroke-width:5}
.path.link{animation:fade .52s ease-in forwards}
.path.hint .under{stroke:#29a36a;stroke-width:6;stroke-dasharray:2 10;opacity:.7}.path.hint .over{display:none}
.play-actions{display:flex;justify-content:center;gap:8px;margin:12px 0 0}
.play-actions button{font-size:14px;padding:6px 12px;white-space:nowrap}
.play-actions b{display:inline-grid;place-items:center;min-width:22px;height:22px;margin-left:4px;border-radius:999px;background:#302d28;color:#ffdf45;font-size:13px}
.result-layer{position:fixed;inset:0;z-index:20;background:#302d2866;display:grid;place-items:center;padding:14px;overflow:auto}
.result-layer .result{width:min(100%,520px);margin:auto;max-height:none}
body:has(.play) .game-bar{margin-top:10px}
body:has(.play) footer,body:has(.play) .under-guide{display:none}
main:has(.play){width:min(calc(100% - 24px),1000px);margin-top:12px;margin-bottom:12px}
@keyframes pop{to{opacity:0;transform:scale(.4)}}
@keyframes fade{0%,55%{opacity:1}100%{opacity:0}}
@keyframes glow{to{filter:brightness(1.15);transform:translateY(-2px)}}
@keyframes shake{25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}
@keyframes pulse{50%{transform:scale(1.05)}}
@media(max-width:520px){.chip{padding:3px 9px;font-size:13px;min-height:32px}.chip b{font-size:15px}.play-actions button{padding:6px 9px;font-size:13px}.tile:before{border-radius:8px;border-width:1.5px;box-shadow:0 2px #302d28}.tile svg{padding:9%}.result h1{font-size:26px}}
.under-guide{width:min(calc(100% - 28px),620px);margin:48px auto 36px;padding-top:26px;border-top:2px dashed #c7bcac}.under-guide h2{font-size:24px;margin:4px 0 22px}.guide-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.guide-steps article{background:#fffdf7;border:2px solid #d5cabb;border-radius:16px;padding:17px}.guide-steps b{font-size:16px}.guide-steps p,.under-guide details p{font-size:14px;line-height:1.8;color:#62594f}.guide-steps p{margin-bottom:0}.under-guide summary{cursor:pointer;font-size:16px;min-height:44px;padding:12px 0}.under-guide details{margin-top:16px}@media(max-width:520px){.guide-steps{grid-template-columns:1fr;gap:10px}.under-guide{margin-top:40px}.guide-steps article{padding:16px}.under-guide h2{font-size:22px}}
.game-bar{min-height:0}
.home{border:2px solid #302d28;border-radius:999px;padding:0 12px;min-height:40px;font-size:13px;background:#fff}
.tools button{width:40px;height:40px}
.start-button{font-size:17px;font-weight:900}
@media(max-width:520px){.home{font-size:22px;line-height:1;padding:0;width:40px;justify-content:center}.tools button{width:40px;height:40px}}
.support-ant{margin:22px auto 0;max-width:560px;padding:16px 18px;border:2px dashed #cbbfae;border-radius:18px;background:#fffdf6;color:#211d24;text-align:center;font-size:15px;line-height:1.6}.support-ant p{margin:0 0 12px}.support-ant strong{display:block;font-size:17px}.support-ant div{display:flex;flex-wrap:wrap;justify-content:center;gap:9px}.support-ant a{display:inline-flex;align-items:center;min-height:42px;padding:0 15px;border:2px solid #27232c;border-radius:14px;background:#fff;color:#17141c;font-size:15px;font-weight:800;text-decoration:none}.support-ant a:first-child{background:#ffd93f}.support-ant small{display:block;margin-top:10px;color:#6d6772;font-size:13px}
.hud,.timebar{max-width:640px;margin-left:auto;margin-right:auto}
@media(max-height:500px) and (min-aspect-ratio:1/1){body:has(.play) .game-bar{margin-top:6px;padding-top:3px;padding-bottom:3px}main:has(.play){margin-top:6px}.play .turn{margin:2px 0}.play .timebar{margin-top:4px}.play .play-actions{margin-top:6px}.chip{min-height:30px;padding:2px 10px}}
.turn{position:relative;height:24px;white-space:nowrap}
.toast{position:absolute;left:50%;top:0;transform:translateX(-50%);z-index:6;width:max-content;max-width:100%;white-space:normal;line-height:1.4;padding:2px 12px;border:2px solid #302d28;border-radius:12px;background:#fff4c6;color:#22201e;font-size:13px;box-shadow:0 3px #302d28;animation:toast-in .15s ease-out}
@keyframes toast-in{from{opacity:0;transform:translate(-50%,-4px)}}
