*{box-sizing:border-box}body{margin:0}button,input{font:inherit;color:inherit}button{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;font-size:14px}button:disabled{cursor:default}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #296ec5;outline-offset:2px;z-index:3}a{color:inherit}
/* Thanh đầu trang: cùng kiểu với các game khác của Hub. */
.game-shell{margin-left:auto;margin-right:auto}
.game-bar{display:flex;align-items:center;gap:10px;border:2px solid #302d28;background:#fff;box-shadow:0 4px #302d28}.game-bar strong{flex:1;font-size:15px}
.home{border:2px solid #302d28;border-radius:999px;padding:0 12px;min-height:40px;font-size:13px;background:#fff;text-decoration:none;display:flex;align-items:center;gap:5px}
.tools{display:flex;gap:6px}.tools button{width:40px;height:40px;background:#fff;border:2px solid #302d28;border-radius:14px}
main{margin:28px auto}footer{text-align:center;font-size:14px;color:#62594f;padding:15px}
/* Màn mở */
.title-view{text-align:center}.hero-art{display:block;width:340px;max-width:90%;height:auto;margin:auto}.eyebrow{font-size:12px;letter-spacing:2px;color:#62594f;margin:18px 0 8px}h1 mark{background:linear-gradient(transparent 45%,#ffdf45 45%,#ffdf45 94%,transparent 94%);color:inherit;padding:0 8px}.tagline{font-size:17px;line-height:1.7}.note{font-size:14px;color:#62594f;line-height:1.6}
.badge{display:inline-block;font-size:12px;border:2px solid #302d28;border-radius:999px;padding:2px 10px;background:#eee2fa}
.setup{max-width:400px;text-align:left;margin:20px auto 10px;background:#fffdf7;border:2px solid #302d28;border-radius:22px;padding:20px;box-shadow:0 5px #302d28;display:grid;gap:12px}
.setup label{display:block;font-size:15px}.setup input{width:100%;min-height:48px;border:2px solid #302d28;border-radius:12px;padding:10px;background:#fff;margin-top:6px;font-size:16px}
.setup h2{font-size:16px;margin:0}.setup hr{border:0;border-top:2px dashed #b9afa1;margin:4px 0;width:100%}
.join-row{display:flex;gap:8px}.join-row input{flex:1;min-width:0;margin:0;text-transform:uppercase;letter-spacing:2px}
.primary,.secondary{border:2px solid #302d28;border-radius:13px;padding:9px 16px;min-height:44px;background:#fff}.primary{background:#ffdf45;box-shadow:0 4px #302d28}.primary:disabled{background:#e3ddcf;color:#71685b;box-shadow:none}.secondary:hover{background:#fff1b7}.primary:not(:disabled):hover{background:#ffe77c}
.setup .primary,.setup .secondary{width:100%;min-height:48px;font-size:16px}.setup .primary{font-size:17px;font-weight:900}.join-row .secondary{width:auto}
.text-button{min-height:44px;background:none;border:0;text-decoration:underline;text-underline-offset:4px;padding:5px 10px}.privacy{max-width:340px;margin:10px auto}
.form-notice{font-size:14px;color:#97340e;min-height:20px;margin:0}
/* Phòng chờ */
.lobby{max-width:440px;margin:0 auto;text-align:center}.room-card{background:#fffdf7;border:2px solid #302d28;border-radius:22px;padding:18px;box-shadow:0 5px #302d28;margin:14px 0}
.room-code{font-family:ui-monospace,Consolas,monospace;font-size:28px;letter-spacing:4px;font-weight:700;margin:4px 0 10px}
.seats{list-style:none;padding:0;margin:14px 0;display:grid;gap:6px;text-align:left}.seats li{display:flex;align-items:center;gap:8px;border:2px solid #b9afa1;border-radius:12px;padding:8px 12px;background:#fff;font-size:15px}.seats li.me{border-color:#7045a6;background:#eee2fa}.seats .tag{margin-left:auto;font-size:12px;color:#62594f}.seats li.off{opacity:.55}
.lobby .primary{width:100%;min-height:48px;font-size:17px;font-weight:900}
/* Màn chơi */
.game-view{margin:0 auto;width:100%;max-width:520px}
.hud{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 4px;min-height:34px;font-size:14px}
.hud .timer{font-family:'Dela Gothic One','M PLUS Rounded 1c',sans-serif;font-size:22px;min-width:64px;text-align:center}.hud .timer.low{color:#b3261e}
.hud .score b{font-size:18px}
.players{display:flex;gap:6px;overflow-x:auto;padding:4px 2px;scrollbar-width:none}.players::-webkit-scrollbar{display:none}
.player{flex:0 0 auto;display:flex;align-items:center;gap:6px;border:2px solid #b9afa1;border-radius:999px;padding:2px 10px;background:#fffdf7;font-size:13px;line-height:22px;white-space:nowrap}.player.me{border-color:#7045a6;background:#eee2fa}.player.off{opacity:.55}.player b{font-size:14px}.player.flash{animation:pop .5s ease-out}
.word-line{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;margin:2px 0 6px;text-align:center}
.current{font-size:20px;font-weight:900;min-height:28px;line-height:28px}.current.empty{font-size:14px;font-weight:400;color:#62594f}
.current.ok{color:#24643a}.current.no{color:#97340e}
.word-line .secondary{min-height:40px;padding:4px 12px}
.board-wrap{position:relative;width:100%;margin:0 auto}
.board{display:grid;gap:6px;width:100%;touch-action:none;user-select:none;-webkit-user-select:none;position:relative;z-index:1}
.tile{position:relative;aspect-ratio:1;min-width:0;padding:0 2px;border:2px solid #302d28;border-radius:16px;background:#fffdf7;box-shadow:0 3px #302d28;font-weight:900;font-size:17px;line-height:1.1;overflow:hidden;touch-action:none}
.board.c5 .tile{font-size:15px;border-radius:13px}
.tile.x2{background:#fff4c6}.tile.x3{background:#ffe0b9}
.tile .bonus{position:absolute;top:2px;right:5px;font-size:11px;font-weight:700;color:#7a4a00;pointer-events:none}
.tile.sel{background:#8253bd;color:#fff;border-color:#54317f;box-shadow:0 1px #54317f;transform:translateY(2px)}.tile.sel .bonus{color:#fff2b7}
.tile.last{outline:3px solid #ffdf45;outline-offset:-5px}
.tile.show{background:#83c59a;border-color:#24643a;box-shadow:0 3px #24643a}
.tile:disabled{color:inherit;opacity:1}
.board.review .tile{box-shadow:none;border-color:#b9afa1;background:#fffdf7;color:#62594f}.board.review .tile.show{background:#83c59a;border-color:#24643a;color:#12351f}
.trail{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:2}.trail polyline{fill:none;stroke:#ffdf45;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:.9}
.board.review~.trail polyline{stroke:#54317f;stroke-opacity:.6}
.notice{font-size:14px;line-height:20px;min-height:40px;text-align:center;margin:8px 4px 4px}.notice.good{color:#24643a;font-weight:700}.notice.warn{color:#97340e}
.found{display:flex;gap:6px;overflow-x:auto;padding:2px 2px 6px;scrollbar-width:thin;min-height:38px;align-items:center}
.found.wrap{flex-wrap:wrap;overflow:visible;justify-content:center}
.chip{flex:0 0 auto;border:2px solid #b9afa1;border-radius:999px;padding:2px 10px;font-size:13px;line-height:22px;background:#fff;white-space:nowrap}.chip.mine{border-color:#24643a;background:#dff0e3}.chip.theirs{color:#62594f;background:#f1ece2}
button.chip{min-height:32px}button.chip[aria-pressed=true]{background:#83c59a;border-color:#24643a}button.chip.missed{border-style:dashed}
.found-label{flex:0 0 auto;font-size:13px;color:#62594f}
.actions{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:4px;min-height:44px}.actions .small{font-size:13px;color:#62594f}
/* Kết quả */
.result{text-align:center;padding:16px 12px;margin:8px 0 12px;background:#fff4c6;border:2px solid #302d28;border-radius:22px;box-shadow:0 5px #302d28}.result h1{font-size:24px;margin:0 0 6px}.result p{margin:4px 0;font-size:15px}.result .primary{width:100%;max-width:320px;margin-top:10px}
.ranking{list-style:none;padding:0;margin:10px auto;max-width:340px;display:grid;gap:5px;text-align:left}.ranking li{display:flex;gap:8px;align-items:center;background:#fff;border:2px solid #302d28;border-radius:12px;padding:6px 12px;font-size:15px}.ranking li.me{background:#eee2fa}.ranking .pts{margin-left:auto;font-weight:900}
.section-title{font-size:14px;color:#62594f;text-align:center;margin:10px 0 4px}
dialog{width:min(92vw,490px);max-height:85svh;overflow:auto;background:#fffdf7;border:2px solid #302d28;border-radius:22px;padding:24px;color:inherit}dialog::backdrop{background:#302d2866}dialog h2{font-size:22px;margin:0 0 10px}dialog li,dialog p{font-size:16px;line-height:1.7}dialog ol{padding-left:22px}dialog form button{width:100%}.dialog-actions{display:flex;gap:10px;margin:20px 0}.dialog-actions button{flex:1}
.loading{text-align:center;padding:60px 0;font-size:16px}
body:not([data-screen=home]) footer{display:none}
body:not([data-screen=home]) main{width:min(100% - 28px,520px);margin:12px auto 16px}
body[data-screen=play] main{width:min(100% - 28px,clamp(300px,calc(100svh - 340px),520px))}
body[data-screen=play]{overscroll-behavior:none}
@keyframes pop{from{transform:scale(1.25)}to{transform:scale(1)}}
@media(max-width:520px){.home span{display:none}.home{font-size:22px;line-height:1;padding:0;width:40px;justify-content:center}.game-bar{gap:6px}.hero-art{width:290px}main{margin-top:20px}.title-view .tagline{font-size:16px}.board{gap:5px}.tile{font-size:16px}.board.c5 .tile{font-size:13.5px;border-radius:12px}html{scrollbar-width:none}html::-webkit-scrollbar{display:none}}
@media(max-height:680px){body[data-screen=play] main{margin-top:8px}.word-line{min-height:38px;margin:0 0 4px}.notice{min-height:36px;margin:4px 4px 2px;font-size:13px;line-height:18px}.hud{min-height:30px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
/* Lời mời ủng hộ ở màn kết quả (dùng chung cho các game AntGo Games). */
.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}
