:root{font-family:Tahoma,Arial,sans-serif;color:#133956;color-scheme:light;background:#e5f8ff}*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 8% 18%,#fff6c8,transparent 30%),linear-gradient(145deg,#effcff,#d3f4ff 60%,#e4eaff);min-height:100dvh}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:0;font-weight:bold}button:disabled{cursor:default;opacity:.55}[hidden]{display:none!important}.app{max-width:580px;margin:auto;padding:16px 18px max(18px,env(safe-area-inset-bottom))}header{display:flex;align-items:center;justify-content:space-between;direction:ltr}.brand{font-size:36px;font-weight:1000;letter-spacing:-3px;color:#082a72;text-align:center}.brand small{display:block;letter-spacing:2px;font-size:9px}.icon{width:42px;height:42px;display:grid;place-items:center;border-radius:50%;background:#ffffffb8;box-shadow:0 4px 0 #b6e5f1;color:#123e75;text-decoration:none;font-size:24px}h1{font-size:clamp(42px,10vw,66px);text-align:center;margin:12px 0 2px;font-weight:1000;line-height:1.2;text-shadow:0 3px 0 #a2510a,0 5px 0 #103c81,0 8px 8px #10486c30}h1 span{color:#ffb52b}h1 em{font-style:normal;color:#29baf5;text-shadow:0 3px 0 #1668b2,0 5px 0 #123c81,0 8px 8px #10486c30}.intro{text-align:center;color:#4a7188;margin:12px 0 20px;font-size:13px}.panel{border:2px solid white;background:#ffffffd9;border-radius:26px;padding:20px;box-shadow:0 13px 32px #428da220}.panel h2{margin-top:0}input,select{width:100%;border:1px solid #b7dce9;padding:12px;border-radius:13px;background:white;color:#173c5b;margin-top:6px}input:focus,select:focus{outline:3px solid #71d8ff}label{font-size:13px;font-weight:bold}.modes{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0}.modes button{padding:18px 8px;border-radius:17px;background:linear-gradient(135deg,#7ad7ff,#69a3ff);color:#123b65;box-shadow:0 4px 0 #3288d1;min-height:80px;font-size:17px}.modes button:nth-child(2){background:linear-gradient(135deg,#ffe77d,#ffb64c);box-shadow:0 4px 0 #e99828}.modes button:nth-child(3){background:linear-gradient(135deg,#b0f58a,#62dbac);box-shadow:0 4px 0 #28aa79}.modes button:nth-child(4){background:linear-gradient(135deg,#ddd1ff,#b0b9ff);box-shadow:0 4px 0 #8b87dd}.modes small{display:block;font-size:11px;margin-top:7px;font-weight:normal}.options{display:grid;grid-template-columns:1.3fr 1fr;gap:10px}.hint{font-size:12px;text-align:center;line-height:1.8;color:#466f85}.primary,.secondary{border-radius:17px;padding:14px 18px;font-weight:800}.primary{background:linear-gradient(#ffc336,#ff8827);color:#563000;box-shadow:0 5px 0 #d7611c}.secondary{background:linear-gradient(#fff,#e4f8ff);color:#123e73;border:1px solid #9bddf2;box-shadow:0 4px 0 #a9dfee}.wide{width:100%}.join{display:flex;gap:8px;margin:18px 0}.join input{margin:0;min-width:0}.text{background:transparent;color:#19527b;padding:10px}.scores{display:grid;grid-template-columns:1fr 62px 1fr;gap:9px;align-items:center;direction:ltr}.score{display:flex;align-items:center;justify-content:space-around;padding:10px 8px;border:2px solid #ffab28;border-radius:20px;background:#fffaec;box-shadow:0 5px 0 #eebd7d30;min-width:0}.score.blue{background:#f2fbff;border-color:#38b8fa}.score b{font-size:13px;display:block;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.score span{display:block;text-align:center;font-size:23px;margin-top:4px;background:#ffe7b2;border-radius:10px}.blue span{background:#ceefff}.mark{font-family:Arial,sans-serif;font-weight:1000}.x{color:#ff991c;text-shadow:0 2px 0 #a94c09,0 4px 5px #94470f30}.o{color:#13a5f9;text-shadow:0 2px 0 #1653ae,0 4px 5px #10559b40}.score .mark{font-size:42px}.round{text-align:center;background:#c8f0ff;padding:10px 2px;border-radius:15px}.round small{font-size:11px}.round b{display:block;font-size:25px}.status{width:max-content;max-width:100%;margin:20px auto 8px;background:linear-gradient(#ffbc32,#ff8f23);padding:10px 22px;border:2px solid #ffe2ad;border-radius:30px;color:#613100;font-size:18px;font-weight:800;text-align:center}.board{direction:ltr;display:grid;gap:8px;padding:12px;border:2px solid #9be8ff;border-radius:25px;background:linear-gradient(135deg,#91e9fc,#4bbbdc);box-shadow:inset 0 3px 6px #ffffffd0,0 7px 0 #4db1cc,0 15px 26px #2a97b72b;aspect-ratio:1;margin:10px 0 20px}.cell{display:grid;place-items:center;padding:0;min-width:0;min-height:0;border:2px solid #e3f9ff;border-radius:20%;background:linear-gradient(140deg,#fff,#e9f7ff);box-shadow:0 4px 0 #75b2c3;font-size:clamp(28px,15vw,80px);line-height:1;font-family:Arial,sans-serif}.cell:disabled{opacity:1}.cell:not(:disabled):hover{background:#fffbd9;transform:translateY(-2px)}.cell.win{background:#fff2a3;outline:3px solid #ffbf2e}.board[data-n="5"] .cell{font-size:clamp(25px,9vw,48px)}.board[data-n="4"] .cell{font-size:clamp(28px,11vw,58px)}.actions{display:grid;grid-template-columns:2fr 1fr;gap:12px}.roomInfo{display:flex;align-items:center;justify-content:center;background:#ffffffc0;border-radius:14px;margin-top:12px}.roomInfo span{font-weight:bold;letter-spacing:2px}footer{display:flex;justify-content:space-evenly;margin-top:20px}.notice{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);max-width:90%;width:max-content;padding:14px 20px;border-radius:16px;background:#153b59;color:white;z-index:20;font-size:13px;box-shadow:0 6px 30px #1235}dialog{border:1px solid #c0e8f5;border-radius:23px;padding:24px;color:#173f5b;width:min(92vw,460px);max-height:85dvh}dialog::backdrop{background:#11344e85;backdrop-filter:blur(4px)}.close{float:left;border-radius:50%;width:30px;height:30px;font-size:24px;color:#164867;background:#eaf6ff}.leader{display:flex;align-items:center;gap:12px;border-bottom:1px solid #deedf3;padding:12px 0}.leader span{flex:1;overflow-wrap:anywhere}.levelgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.levelgrid button{background:#dcf5ff;padding:15px;border-radius:12px;color:#165181}button:focus-visible,a:focus-visible{outline:3px solid #2649cc;outline-offset:3px}@media(prefers-reduced-motion:no-preference){.cell .mark{animation:pop .15s ease-out}@keyframes pop{from{transform:scale(.7)}to{transform:scale(1)}}}@media(max-width:350px){.app{padding:12px}.panel{padding:14px}.options{grid-template-columns:1fr}.score .mark{font-size:32px}.scores{grid-template-columns:1fr 50px 1fr}}

#hintReward{margin:0 0 18px}.cell.rewardedHint{outline:4px solid #00a86b;outline-offset:-5px;background:#d1ffe4}

/* Stable board dimensions regardless of marks, result text or hover. */
body{background-attachment:fixed}.board{grid-auto-rows:minmax(0,1fr);overflow-anchor:none;isolation:isolate}.cell{width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;touch-action:manipulation}.cell:not(:disabled):hover,.cell:active{transform:none}.cell .mark{animation:none;transform:none}.status{height:68px;min-height:68px;display:flex;align-items:center;justify-content:center;overflow:hidden;line-height:1.45;margin-top:20px;margin-bottom:8px}.score{min-height:80px}#ruleHint{height:24px;line-height:24px;margin:12px 0;overflow:hidden}#board{width:100%;aspect-ratio:1 / 1;grid-template-columns:repeat(3,minmax(0,1fr))}#board[data-n="3"]{grid-template-rows:repeat(3,minmax(0,1fr))}#board[data-n="4"]{grid-template-rows:repeat(4,minmax(0,1fr))}#board[data-n="5"]{grid-template-rows:repeat(5,minmax(0,1fr))}
