:root{font-family:system-ui,-apple-system,'Segoe UI',Arial,sans-serif;color:#0a2350;background:#eaf2ff}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:linear-gradient(145deg,#eaf5ff,#fff 35%,#e5efff)}[hidden]{display:none!important}button{font:inherit;cursor:pointer}button:focus-visible,a:focus-visible{outline:3px solid #ffc441;outline-offset:3px}.topbar{height:72px;display:flex;align-items:center;justify-content:space-between;background:#fff;padding:0 max(24px,calc((100vw - 1120px)/2));box-shadow:0 3px 15px #0a35611a}.logo{font-weight:850;font-size:27px;text-decoration:none;color:#082253}.logo b{color:#f76d0a}.flame{font-size:29px}.back-link{text-decoration:none;color:#0b4f99;font-weight:700}main{max-width:1200px;margin:auto;padding:28px 20px 70px}.intro{text-align:center;padding:30px 10px 24px}.eyebrow{letter-spacing:.18em;color:#f47c16;font-size:.73rem;font-weight:850}.intro h1{font-weight:950;font-size:clamp(2.7rem,7vw,4.9rem);margin:8px 0;color:#062f74}.intro h1 span{color:#fa880a}.intro p{font-size:1.13rem;color:#496286;max-width:650px;margin:0 auto 23px;line-height:1.6}.features{display:flex;gap:15px;justify-content:center;flex-wrap:wrap}.features span{background:#fff;border:1px solid #d8e6f9;border-radius:30px;padding:8px 15px;font-size:.91rem;font-weight:650}.choice-wrap{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:27px;max-width:1000px;margin:18px auto 24px}.choice{background:white;border:1px solid #d4dfed;border-radius:22px;overflow:hidden;box-shadow:0 16px 35px #093c7a17;transition:transform .2s}.choice:hover{transform:translateY(-3px)}.choice>img{width:100%;height:280px;object-fit:contain;background:#11386a}.choice-body{padding:24px}.pill{display:inline-block;background:#e7f2ff;color:#05519b;padding:6px 12px;border-radius:30px;font-size:.73rem;font-weight:850;letter-spacing:.07em}.choice h2{font-size:1.6rem;margin:9px 0}.choice p{line-height:1.55;color:#4d5f79;min-height:50px}.orange-btn{border:0;background:linear-gradient(#ffad13,#ff6500);color:white;border-radius:13px;box-shadow:0 5px 0 #cf5300,0 9px 22px #f6872950;font-size:1.1rem;font-weight:850;padding:15px 24px;width:100%;text-shadow:0 1px 2px #a4470a}.orange-btn:active{transform:translateY(3px);box-shadow:0 2px 0 #cf5300}.simple-btn{border:none;background:transparent;color:#0b5397;font-weight:700;display:block;margin:20px auto;padding:12px}.game-head{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:0 auto 22px;max-width:1080px}.game-head h1{font-size:clamp(1.5rem,3.7vw,2.4rem);margin:5px 0}.game-head p{color:#64758d;margin:0}.head-buttons{display:flex;gap:10px}.outline-btn{border:1px solid #b7cce5;background:#fff;color:#0e4381;border-radius:10px;padding:11px 14px;font-weight:800}.play-layout{display:flex;gap:26px;align-items:flex-start;justify-content:center}.side-panel{order:2;width:290px;display:flex;flex-direction:column;gap:18px}.player-card{background:white;border:2px solid #d1dfee;box-shadow:0 10px 26px #0a326019;border-radius:18px;padding:15px;display:grid;grid-template-columns:44px 1fr;gap:8px;align-items:center;transition:all .2s}.player-card.active{border-color:#ffac1e;box-shadow:0 0 0 4px #ffdd7f7d,0 0 28px #ffd15e7a;animation:turnPulse 1.5s ease-in-out infinite alternate}@keyframes turnPulse{to{box-shadow:0 0 0 6px #ffc3409e,0 0 32px #ffaf28bb}}.player-card .avatar{font-size:33px}.player-card strong{display:block;font-size:1.12rem}.player-card small{color:#526985;font-size:.76rem}.reserve{grid-column:1/-1;display:flex;justify-content:center;align-items:center;gap:12px;background:#f0f5fc;border-radius:10px;padding:7px;font-size:1rem}.reserve img{width:38px;height:38px;object-fit:contain}.status-panel{background:#073a83;color:#fff;border-radius:20px;padding:25px;box-shadow:0 13px 27px #0c31672e}.status-panel span{color:#fbd28c;font-size:.78rem;letter-spacing:.08em;text-transform:uppercase}.status-panel h3{font-size:1.5rem;margin:8px 0}.status-panel p{color:#d5e5ff;line-height:1.5;margin:0}.board-frame{order:1;position:relative;width:min(70vw,680px);aspect-ratio:1;flex-shrink:0;box-shadow:0 15px 35px #2d1c174b;border-radius:20px;overflow:hidden;background:#ab5c15}.board-frame>img{width:100%;height:100%;display:block}.board-frame>svg{position:absolute;inset:0;width:100%;height:100%;touch-action:manipulation}.board-link{stroke:#261009;stroke-width:6;opacity:.38;pointer-events:none}.socket{fill:#ffba50;stroke:#3b200c;stroke-width:6;pointer-events:none}.point-ring{fill:none;stroke:#36f6bd;stroke-width:10;stroke-dasharray:12 7;animation:glow .8s infinite alternate;pointer-events:none}@keyframes glow{to{stroke:#fffa88;stroke-width:16}}.point.selected .point-ring{stroke:#fff}.cow{filter:drop-shadow(2px 5px 4px #1e120a9c);pointer-events:none}.point{cursor:pointer}.point:not(.selectable) .hit{cursor:default}.footnote{text-align:center;max-width:850px;margin:20px auto;line-height:1.5;color:#516c91}.result{position:fixed;inset:0;z-index:20;display:grid;place-items:center;background:#021538c9;overflow:hidden}.result-card{position:relative;background:linear-gradient(165deg,#fff,#e9f2ff);padding:40px 28px;max-width:430px;width:calc(100% - 30px);border:5px solid #efb94e;border-radius:30px;text-align:center;box-shadow:0 0 60px #ffc53b99}.result-card h2{font-size:2.5rem;margin:10px 0;color:#0a3b7e}.result-card p{color:#455a72}.result-card .outline-btn{margin-top:18px}.winner-emoji{font-size:80px;animation:float 1s ease-in-out infinite alternate}@keyframes float{to{transform:translateY(-15px) rotate(10deg)}}#confetti{position:absolute;inset:0;pointer-events:none}#confetti span{position:absolute;top:-30px;width:12px;height:23px;animation:fall 3s linear infinite}@keyframes fall{to{transform:translateY(110vh) rotate(720deg)}}dialog{border:0;border-radius:24px;max-width:600px;width:calc(100% - 30px);box-shadow:0 20px 70px #1119}dialog::backdrop{background:#031834aa}.dialog-content{padding:14px 20px;color:#1c3554;line-height:1.6}.close{float:right;border:0;background:#edf3fc;border-radius:10px;padding:8px}.dialog-content li{margin-bottom:8px}@media(max-width:850px){.play-layout{flex-direction:column;align-items:stretch}.board-frame{width:min(100%,680px);align-self:center}.side-panel{order:0;width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.status-panel{grid-column:1/-1;grid-row:1}.player-card{padding:10px}.choice>img{height:220px}}@media(max-width:610px){.choice-wrap{grid-template-columns:1fr}.choice>img{height:240px}.back-link{font-size:.82rem}.logo{font-size:22px}.game-head{align-items:flex-start}.head-buttons{flex-direction:column}.side-panel{gap:9px}.player-card small{font-size:.66rem}.status-panel{padding:17px}.status-panel h3{font-size:1.2rem}.topbar{height:64px;padding:0 15px}main{padding:16px 10px 40px}.choice-body{padding:19px}}

/* Private online room additions */
.online-choice{display:block;margin-top:10px;text-align:center;width:100%;box-sizing:border-box}
.online-lobby{max-width:850px;margin:32px auto;padding:12px}
.lobby-box{border-radius:28px;padding:clamp(22px,5vw,42px);background:linear-gradient(135deg,#083e8a,#091d49);color:#fff;box-shadow:0 20px 55px #0c275940;text-align:center}
.lobby-box h1{color:#fff;margin:12px 0}.lobby-box p{color:#dcecff}
.invite-wrap{display:flex;gap:9px;margin:22px 0 10px;align-items:center;flex-wrap:wrap}
.invite-wrap input{flex:1;min-width:180px;border:2px solid #b0c9ff;border-radius:14px;padding:14px;font:inherit;color:#061737;background:#fff}
.lobby-buttons{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;margin:18px 0}
.lobby-buttons .orange-btn{display:inline-block;text-decoration:none}
.lobby-note{font-weight:700;color:#ffe29a!important}
#onlineRoomBar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px;font-weight:800;color:#eab84d}
#onlineRoomBar[hidden]{display:none}
.tiny-btn{border:1px solid #eab84d;color:#eab84d;background:transparent;padding:6px 10px;border-radius:9px;cursor:pointer}
.player-card.active{box-shadow:0 0 0 3px #ffc845,0 0 28px #ffdd6066!important;animation:turnPulse 1.5s ease-in-out infinite alternate}
@keyframes turnPulse{to{box-shadow:0 0 0 5px #fff38a,0 0 38px #ffdd60bb}}
@media(max-width:480px){.invite-wrap{flex-direction:column}.invite-wrap input,.invite-wrap button{width:100%;box-sizing:border-box}}

/* Private online Morabaraba chat */
.m-chat{position:fixed;bottom:20px;right:20px;z-index:18;font-family:inherit}.m-chat-toggle{position:relative;width:62px;height:62px;border-radius:50%;border:3px solid #fff;background:linear-gradient(145deg,#ffbc3e,#ff6b00);box-shadow:0 7px 21px #14274966;color:#fff;font-size:29px;cursor:pointer}.m-chat-toggle:focus-visible{outline:3px solid #204fb7}.m-chat-badge{position:absolute;top:-8px;right:-8px;border:2px solid #fff;border-radius:18px;background:#ed3d50;color:white;min-width:25px;padding:3px 6px;font-size:12px;font-weight:800}.m-chat-panel{position:absolute;bottom:74px;right:0;width:min(360px,calc(100vw - 24px));height:min(480px,calc(100dvh - 122px));display:flex;flex-direction:column;background:#fff;box-shadow:0 20px 70px #001b4b77;border-radius:21px;overflow:hidden;border:2px solid #e9bb69}.m-chat-panel[hidden],.m-chat-badge[hidden]{display:none!important}.m-chat-header{display:flex;align-items:center;justify-content:space-between;background:linear-gradient(110deg,#0a408f,#102452);color:#fff;padding:14px 15px}.m-chat-header strong,.m-chat-header small{display:block}.m-chat-header small{color:#cdddff;font-size:11px;margin-top:4px}.m-chat-header button{background:#ffffff24;color:#fff;border:0;border-radius:9px;padding:8px 11px}.m-chat-messages{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:9px;padding:14px;background:#f2f6ff;overscroll-behavior:contain}.m-chat-empty{margin:auto;color:#63718d;text-align:center}.m-chat-message{max-width:88%;padding:9px 12px;border-radius:13px;background:#fff;box-shadow:0 2px 7px #17376717;word-break:break-word;font-size:14px}.m-chat-message.mine{align-self:flex-end;background:#dff0ff}.m-chat-message.theirs{align-self:flex-start}.m-chat-message strong{display:block;font-size:11px;margin-bottom:4px}.m-chat-message.mine strong{color:#1162b5}.m-chat-message.theirs strong{color:#77542c}.m-chat-message time{display:block;text-align:right;color:#697c91;font-size:10px;margin-top:5px}.m-chat-form{display:flex;gap:7px;padding:10px;background:#fff;border-top:1px solid #e4eafa}.m-chat-form input{min-width:0;flex:1;border:1px solid #c5d8f1;border-radius:11px;padding:10px;font:inherit}.m-chat-form button{border:0;border-radius:11px;background:#f58a10;color:white;font-size:22px;font-weight:bold;width:45px}.m-chat-form button:disabled{opacity:.5;cursor:default}.m-chat-error{font-size:11px;color:#b32629;background:#fff;padding:0 12px 6px;min-height:5px}.m-chat-error:empty{display:none}@media(max-width:500px){.m-chat{bottom:12px;right:12px}.m-chat-toggle{width:55px;height:55px}.m-chat-panel{bottom:66px}}

/* Desktop chat visibility patch, keeping mobile behaviour intact. */
.m-chat {position:fixed!important;z-index:100000!important;right:22px!important;bottom:22px!important;left:auto!important;top:auto!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;}
.m-chat[hidden] {display:none!important;}
.m-chat-toggle{display:grid!important;place-items:center!important;visibility:visible!important;opacity:1!important;min-width:60px;min-height:60px;}
.m-chat-panel {z-index:100001;}
@media(min-width:900px){.m-chat{right:32px!important;bottom:32px!important}.m-chat-toggle{width:66px;height:66px;box-shadow:0 8px 30px #09274b88,0 0 0 5px #fff9!important}}
@media(max-width:500px){.m-chat{right:12px!important;bottom:12px!important}}

/* Morabaraba Torch — Experience Update: current player and move history */
.mt-turn-banner{display:flex;gap:13px;align-items:center;border-radius:17px;padding:13px 15px;background:#102d61;color:#fff;box-shadow:0 8px 22px #0c285032;border:2px solid #235397;min-height:77px}
.mt-turn-banner strong{display:block;font-size:1.03rem;letter-spacing:.025em}
.mt-turn-banner small{display:block;margin-top:4px;color:#d9eaff;font-size:.82rem}
.mt-turn-symbol{display:grid;place-items:center;border-radius:50%;background:#ffc14c;width:34px;height:34px;flex-shrink:0;color:#15345a;box-shadow:0 0 0 4px #ffffff23;font-size:22px}
.mt-turn-banner.mt-you{background:linear-gradient(125deg,#0b588c,#0e367b);border-color:#f2bc3c}
.mt-turn-banner.mt-you .mt-turn-symbol{animation:mtSignal 1.15s ease-in-out infinite alternate}
.mt-turn-banner.mt-opponent .mt-turn-symbol{background:#d4e2f9}
.mt-turn-banner.mt-finished{background:#204268;border-color:#cbb884}
.player-card.mt-current{outline:3px solid #ffbc3d;outline-offset:1px;box-shadow:0 0 0 5px #ffc14c44,0 12px 28px #0a32602a;animation:mtFrame 1.4s ease-in-out infinite alternate}
@keyframes mtSignal{to{box-shadow:0 0 0 9px #ffdc6b48;transform:scale(1.08)}}
@keyframes mtFrame{to{box-shadow:0 0 0 8px #ffc14c63,0 12px 30px #0a32602a}}
.mt-history{border:1px solid #c7d8ec;background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 9px 20px #123c671a}
.mt-history summary{cursor:pointer;list-style-position:inside;padding:14px 15px;font-weight:800;color:#113b78}
.mt-history summary span{float:right;border-radius:100px;background:#e8f1fb;padding:2px 8px;font-size:.8rem}
.mt-history ol{max-height:180px;overflow-y:auto;margin:0;padding:5px 20px 5px 35px;font-size:.86rem;color:#344f73}
.mt-history li{padding:6px 0;border-bottom:1px solid #edf2f8}
.mt-history-help{font-size:.72rem;color:#60738a;padding:0 15px 12px;margin:4px 0 0;line-height:1.4}
@media(max-width:850px){.mt-turn-banner,.mt-history{grid-column:1/-1}.mt-turn-banner{grid-row:1}.status-panel{grid-row:auto}}
@media(prefers-reduced-motion:reduce){.mt-turn-banner .mt-turn-symbol,.player-card.mt-current{animation:none!important}}
