/* Sudoku board and game-specific tools. Platform UI is shared with Block Puzzle. */
*{box-sizing:border-box}
body{margin:0;background:#fafbfa;color:#263d4b;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;font-size:14px;line-height:1.5}
button,input,select{font:inherit}
button,a,input,select{-webkit-tap-highlight-color:transparent}
button{cursor:pointer;border:1px solid #dce5e6;background:white;color:inherit}
button:disabled{cursor:default;opacity:.4}
a{color:inherit;text-decoration:none}
svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
button svg,a svg{vertical-align:middle}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #008e9e80;outline-offset:3px}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.skip-link{position:fixed;top:-60px;left:20px;z-index:999;background:#fff;padding:12px;border:2px solid #008e9e}
.skip-link:focus{top:10px}
.loading{padding:100px;text-align:center}
.difficulty-bar{display:flex;gap:19px;align-items:center;margin-bottom:19px;min-height:30px;font-size:13px}
.difficulty-bar>span:first-child{color:#8c9ba5}
.difficulty-bar button{padding:3px 0;border:0;background:none!important;border-radius:0!important;font-size:13px;white-space:nowrap;font-weight:600;color:#7d8b94!important}
.difficulty-bar button.active{color:#008e9e!important}
.play-layout{display:grid;grid-template-columns:minmax(0,510px) minmax(235px,310px);gap:27px;max-width:848px}
.board-panel{min-width:0}
.board-meta{display:flex;align-items:center;justify-content:space-between;height:34px;margin-bottom:9px;font-size:12px;line-height:1.3;color:#94a1a8}
.board-meta>div{display:flex;align-items:center;gap:9px}
.board-meta strong{color:#526a79;font-size:15px;font-variant-numeric:tabular-nums;font-weight:500}
.board-wrap{position:relative;width:100%;aspect-ratio:1}
.sudoku-board{display:flex;flex-direction:column;width:100%;height:100%;border:2px solid #3c5266;background:white;user-select:none;touch-action:manipulation}
.sudoku-row{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));flex:1;min-height:0}
.sudoku-row:not(:last-child){border-bottom:1px solid #c7d2db}
.sudoku-row:nth-child(3n):not(:last-child){border-bottom:2px solid #3c5266}
#portal button.sudoku-cell{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-width:0;min-height:0;border:0;border-radius:0!important;padding:0;box-shadow:none;background:#fff;color:#008e9e;font-size:clamp(22px,3.4vw,38px);font-weight:400;line-height:1;transition:background-color .08s}
.sudoku-cell:not(:last-child){border-right:1px solid #c7d2db!important}
.sudoku-cell:nth-child(3n):not(:last-child){border-right:2px solid #3c5266!important}
#portal button.sudoku-cell.given{color:#344b61}
#portal button.sudoku-cell.related{background:#eff4f6}
#portal button.sudoku-cell.same-number{background:#d7e9eb}
#portal button.sudoku-cell.selected{background:#bce2e5}
#portal button.sudoku-cell.error{color:#de5664;background:#fff0f1}
#portal button.sudoku-cell.selected.error{background:#ffdfe3}
#portal button.sudoku-cell:hover{background:#d8eff0}
#portal button.sudoku-cell:focus-visible{outline:2px solid #008e9e;outline-offset:-3px;z-index:1}
#portal button.sudoku-cell.flash-error{background:#ffd8de;color:#ce3d51}
.cell-notes{position:absolute;inset:4px;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);color:#6c8492;font-size:clamp(8px,1.1vw,12px);line-height:1}
.cell-notes>span{display:flex;justify-content:center;align-items:center}
.game-controls{padding-top:43px}
.control-tools{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:19px}
.tool{border:0!important;background:none!important;display:flex;align-items:center;flex-direction:column;gap:8px;padding:0;color:#70828f!important;font-size:11px!important;white-space:nowrap}
.tool-icon{position:relative;width:53px;height:53px;border-radius:50%;background:#edf3f4;display:grid;place-items:center;color:#008e9e}
.tool-icon svg{width:26px;height:26px;stroke-width:1.5}
.tool-icon small{position:absolute;top:-3px;right:-6px;background:#8a9ca6;border:2px solid #fafbfa;border-radius:12px;color:white;padding:2px 4px;min-width:23px;font-size:8px;line-height:1.2}
.tool.on .tool-icon{background:#cde8e9}
.tool.on small{background:#008e9e}
.number-pad{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
#portal .number-pad button{height:95px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;border:0!important;background:#edf2f5;color:#008e9e;border-radius:5px;font-size:39px;line-height:1.05;font-weight:400;padding:10px}
#portal .number-pad button:hover{background:#dcecee}
#portal .number-pad button:disabled{opacity:.25}
.number-pad small{font-size:9px;color:#81949e;min-height:10px}
.new-game{width:100%;margin-top:9px;min-height:55px!important}
.play-tip{display:flex;align-items:flex-start;gap:12px;margin-top:27px;padding-top:18px;border-top:1px solid #e1e9e9}
.tip-icon{color:#6f9699;padding-top:1px}
.tip-icon svg{width:19px;height:19px}
.play-tip h3{font-size:12px!important;margin:0 0 6px;font-weight:600;color:#49666f!important}
.play-tip p{font-size:11px;line-height:1.9;margin:0;color:#8b989e!important}
.save-note{display:flex;align-items:center;justify-content:center;gap:6px;font-size:10px;color:#91a29e!important;margin:12px 0 0}
.save-note svg{width:12px;height:12px;color:#71a396}
.personal-stats{display:flex;align-items:center;gap:12px;margin-top:24px;padding:17px 20px;border:1px solid #e5ebea;border-radius:9px;background:#fff;font-size:11px}
.stats-icon{display:grid;place-items:center;color:#caa35a;background:#fcf7e9;border-radius:50%;width:35px;height:35px}
.stats-icon svg{width:19px}
.personal-stats strong{font-size:11px;font-weight:600;color:#6b8189}
.personal-stats p{font-size:12px;margin:3px 0 0;color:#94a1a7!important}
.personal-stats>span:last-child{margin-left:auto;color:#879b9d;font-size:10px}
.keyboard-note{font-size:10px;color:#9aa7ab!important;margin:24px 0 0;max-width:820px;line-height:1.8}
.board-cover{position:absolute;inset:2px;z-index:3;display:grid;place-items:center;background:#f3f8f8;text-align:center;padding:15px}
.board-cover>div>svg{width:36px;height:36px;color:#008e9e}
.board-cover h2{font-size:24px;letter-spacing:-.5px;margin:18px 0 7px}
.board-cover p{font-size:12px;margin-bottom:23px}
.countdown{position:absolute;inset:2px;display:grid;place-items:center;z-index:4;background:#f0f7f8ed;color:#008e9e;font-size:25px;font-weight:600}
.match-note{font-size:12px;color:#008e9e!important;margin:12px 0}
.multiplayer-layout{grid-template-columns:minmax(0,470px) minmax(200px,265px) minmax(220px,1fr);gap:20px;max-width:none}
.multiplayer-layout .number-pad button{height:86px}
.multiplayer-layout .tool-icon{width:45px;height:45px}
.multiplayer-layout .tool{font-size:10px!important}
.multiplayer-layout .control-tools{gap:4px}
.multiplayer-layout .play-tip{font-size:10px}
.multiplayer-layout .chat-messages{height:170px}
.rules-article{max-width:760px;margin:15px 0 40px}
.rules-article h1{font-size:34px;letter-spacing:-.8px}
.rules-article h2{font-size:20px;margin-top:32px}
.rules-article p{font-size:14px;line-height:1.9;color:#748891}
.rules-article .lead{font-size:18px}
.rules-article .primary{margin-top:20px}
#game-dialog{border:1px solid #dce7e7;border-radius:17px;width:min(440px,calc(100% - 30px));padding:32px;background:#fff;color:#334f5b;box-shadow:0 20px 90px #1c4e4825}
#game-dialog::backdrop{background:#172f3c80;backdrop-filter:blur(3px)}
#game-dialog h2{font-size:24px;letter-spacing:-.6px;line-height:1.3;margin:10px 0 15px}
#game-dialog p{font-size:13px;line-height:1.8;color:#889aa1}
#game-dialog label{display:block;font-size:12px;font-weight:600;color:#718991;margin:18px 0}
#game-dialog select,#game-dialog input{display:block;width:100%;border:1px solid #dae5e6;border-radius:7px;padding:10px;margin-top:7px;background:white;color:#526f7a;min-width:0;font-size:14px}
.form-row{display:flex;gap:15px}
.form-row>label{flex:1;min-width:0}
.dialog-close{position:absolute;right:15px;top:10px;background:none;border:0;color:#8ca0a6;font-size:25px;padding:2px 8px}
.dialog-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:25px}
.form-error{color:#be6470!important}
.result-modal{text-align:center}
.result-symbol{display:grid;place-items:center;background:#f3f8ed;color:#b5a563;width:72px;height:72px;border-radius:50%;margin:0 auto 20px}
.result-symbol svg{width:36px;height:36px}
.result-metrics{display:flex;gap:10px;justify-content:space-between;margin:25px 0;font-size:10px;color:#849b9e}
.result-metrics strong{display:block;margin-top:7px;color:#3e6470;font-size:23px;font-weight:500;font-variant-numeric:tabular-nums}
.result-modal>.primary,.result-modal>.secondary{display:flex;width:100%;margin:10px 0}
#toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);z-index:200;background:#264d55;color:#fff;padding:13px 20px;border-radius:10px;max-width:min(450px,calc(100% - 30px));width:max-content;box-shadow:0 4px 20px #203c4420;font-size:12px}
@media(min-width:1600px){.play-layout:not(.multiplayer-layout){max-width:900px;grid-template-columns:540px 330px;gap:30px}
.number-pad button{height:104px!important}}
@media(max-width:1250px){.multiplayer-layout{grid-template-columns:minmax(0,1fr) 250px;max-width:850px}
.multiplayer-layout #match-side{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:20px}
.multiplayer-layout .standings-panel{margin:0}
.multiplayer-layout .chat-messages{height:180px}}
@media(max-width:950px){.play-layout{gap:20px;grid-template-columns:minmax(0,1fr) 245px}
.difficulty-bar{gap:15px;font-size:12px}
.difficulty-bar button{font-size:12px}
.number-pad button{height:80px!important;font-size:33px!important}
.tool-icon{width:45px;height:45px}
.tool{font-size:10px!important}}
@media(max-width:760px){.difficulty-bar{gap:13px;margin-bottom:11px;font-size:11px;overflow:auto;padding-bottom:5px;scrollbar-width:none}
.difficulty-bar button{font-size:11px}
.play-layout,.multiplayer-layout{grid-template-columns:minmax(0,1fr) 235px;gap:18px}
.board-meta{font-size:10px;margin-bottom:7px;height:28px}
.board-meta strong{font-size:13px}
.game-controls{padding-top:35px}
.tool-icon{width:43px;height:43px}
.tool-icon svg{width:22px;height:22px}
.control-tools{gap:4px;margin-bottom:15px}
.number-pad{gap:6px}
.number-pad button{height:77px!important}
.new-game{min-height:46px!important}
.play-tip{margin-top:18px;padding-top:15px;gap:8px}
.play-tip h3{font-size:11px!important}
.play-tip p{font-size:10px}
.cell-notes{font-size:10px;inset:3px}
.personal-stats{padding:12px;margin-top:19px;gap:9px}
.personal-stats>span:last-child{max-width:100px;text-align:right;font-size:9px}
.save-note{font-size:9px}
.keyboard-note{font-size:9px}
#toast{bottom:20px}}
@media(max-width:600px){.difficulty-bar{gap:17px;white-space:nowrap}
.difficulty-bar>span:first-child{display:none}
.play-layout,.multiplayer-layout{display:flex;flex-direction:column;gap:0;max-width:440px;margin:auto}
.sudoku-board{border-width:2px}
#portal button.sudoku-cell{font-size:clamp(23px,7.8vw,34px)}
.cell-notes{font-size:clamp(8px,2.4vw,11px);inset:3px}
.board-meta{margin-bottom:8px;height:27px;font-size:11px}
.board-meta strong{font-size:13px}
.board-panel{width:100%}
.game-controls{padding-top:17px;display:flex;flex-direction:column}
.control-tools{order:1;margin-bottom:18px;gap:15px}
.tool{font-size:10px!important;gap:6px}
.tool-icon{width:48px;height:48px}
.tool-icon svg{width:24px;height:24px}
.number-pad{order:2;grid-template-columns:repeat(9,minmax(0,1fr));gap:5px}
#portal .number-pad button{height:58px!important;gap:3px;border-radius:5px;font-size:28px!important;padding:7px 0}
.number-pad small{font-size:8px}
.new-game{order:3;margin-top:16px;height:47px}
.play-tip{order:4;margin-top:20px;gap:10px;padding:16px 0 0}
.play-tip h3{font-size:12px!important}
.play-tip p{font-size:11px;line-height:1.8}
.save-note{margin-top:10px;font-size:9px}
.personal-stats{display:none}
.keyboard-note{display:none}
.difficulty-bar .room-indicator{display:none}
.board-meta .time-group{gap:6px!important}
.multiplayer-layout #match-side{display:flex;flex-direction:column;gap:0;margin-top:20px}
.multiplayer-layout .standings-panel{margin:0 0 15px}
.multiplayer-layout .tool-icon{width:48px;height:48px}
.multiplayer-layout .chat-messages{height:230px}
.rules-article h1{font-size:28px}
.rules-article .lead{font-size:16px}
.rules-article h2{font-size:18px}
.rules-article p{font-size:13px}
#game-dialog{padding:28px 23px}
.dialog-actions .primary,.dialog-actions .secondary{font-size:12px;padding:11px 14px}
.board-cover h2{font-size:22px}
.board-cover p{font-size:11px}}
@media(max-width:360px){.difficulty-bar{gap:14px}
.difficulty-bar button{font-size:10px}
.number-pad{gap:3px}
#portal .number-pad button{height:51px!important;font-size:25px!important}
.control-tools{gap:8px}
.tool-icon{width:44px;height:44px}
.cell-notes{inset:2px}
.save-note{font-size:8px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
#portal .sudoku-board button.sudoku-cell{color:#008e9e}
#portal .sudoku-board button.sudoku-cell.given{color:#344b61}
#portal .sudoku-board button.sudoku-cell.error{color:#de5664}
#portal .number-pad button{color:#008e9e!important}
.final-board-details summary{font-size:12px;cursor:pointer;padding:14px 0;color:#638b8f}
.final-board{display:grid;grid-template-columns:repeat(9,1fr);width:min(100%,380px);aspect-ratio:1;border:2px solid #526a79;margin:15px auto;background:#fff}
.final-board>span{display:grid;place-items:center;border-right:1px solid #d3dee0;border-bottom:1px solid #d3dee0;font-size:21px;color:#008e9e}
.final-board>span.given{color:#405969;background:#f4f7f7}
.final-board>span:nth-child(3n){border-right:2px solid #526a79}
.final-board>span:nth-child(n+19):nth-child(-n+27),.final-board>span:nth-child(n+46):nth-child(-n+54){border-bottom:2px solid #526a79}
.history-result{border-bottom:1px solid #e5edeb;padding:12px 0}
.history-result summary{cursor:pointer;font-size:12px}
.history-result summary span{display:block;color:#8aa1a3;font-size:10px;margin-top:5px}
.surrender-button{order:5;width:100%;margin:18px 0 0}
@media(max-width:600px){.final-board>span{font-size:20px}
#game-dialog:has(.history-result){padding:24px 16px}
.surrender-button{font-size:11px;margin-top:10px}}
#portal .game-controls .tool{padding:0}
#portal .game-controls .pause-button{padding:3px}
