[hidden]{display:none!important}
.web-app{color:#203d33}
.web-app:not([data-stage=playing]) .game-shell{max-width:650px;margin:auto;height:auto;min-height:calc(100dvh - 32px);display:flex;align-items:center;justify-content:center}
.web-app:not([data-stage=playing]) .game-panel{width:100%;max-width:600px;padding:34px;border-radius:22px;box-shadow:0 16px 52px #203d3310;overflow:visible;gap:15px}
.web-app:not([data-stage=playing]) .board-area{display:none}
.lobby-intro{text-align:center}.lobby-intro h1{font-size:clamp(29px,4vw,40px);letter-spacing:-.5px!important;line-height:1.25;font-weight:750;margin:8px 0}
.lobby-eyebrow{font-size:12px;font-weight:600;color:#658371;margin:16px 0 4px}
.lobby-lead{font-size:14px;color:#607067;line-height:1.7;margin:0 auto;max-width:360px}
.lobby-mark{display:flex;align-items:center;justify-content:center;gap:0;height:70px}
.lobby-mark i{width:65px;height:65px;border-radius:50%;border:5px double #b8ad84;background:#f2e9d1;box-shadow:0 6px 0 #ab9c71,0 11px 18px #203d3318;transform:rotate(-12deg)}
.lobby-mark i+i{background:#b94851;border-color:#d37379;box-shadow:0 6px 0 #87343e,0 11px 18px #203d3322;margin-inline-start:-13px;transform:rotate(12deg) translateY(5px)}
.lobby-steps{padding:0;margin:22px 0 12px;display:flex;gap:12px;justify-content:center;list-style:none;counter-reset:steps;color:#68776b;font-size:11px}
.lobby-steps li{display:flex;gap:6px;align-items:center}.lobby-steps li:before{counter-increment:steps;content:counter(steps);background:#edf2e9;color:#42654d;border-radius:50%;width:22px;height:22px;display:grid;place-items:center;font-weight:700;flex-shrink:0}
.game-panel input#nameInput{height:49px;border-radius:9px;font-size:16px;background:#fafcf8;padding:0 14px}.game-panel input:focus-visible{outline:3px solid #74ad893f;border-color:#327451}
.game-panel input:disabled{background:#f0f3ed;color:#526458}
.game-panel .mode-row{display:flex;gap:10px;flex-wrap:wrap}.game-panel .mode-row .button{flex:1;min-height:46px;min-width:110px;border-radius:9px;font-size:14px}
.game-panel .button.primary{background:#245e44;border-color:#245e44;box-shadow:0 3px 8px #245e4414}
.button:focus-visible{outline:3px solid #57a17b;outline-offset:3px}.button:disabled{opacity:.7;cursor:default}
.status-box{min-height:48px;display:flex;align-items:center;justify-content:center;text-align:center;line-height:1.65;border-radius:9px;font-size:13px}
[data-stage=connecting] .status-box:before,[data-stage=searching] .status-box:before{content:"";display:block;width:14px;height:14px;flex-shrink:0;border:2px solid #b6d1bd;border-top-color:#285e41;border-radius:50%;margin-inline-end:10px;animation:searchspin 1s linear infinite}
@keyframes searchspin{to{transform:rotate(360deg)}}
[data-stage=error] .status-box{color:#893c40;background:#fbf1f0;border-color:#e9c3c2}
.players-card{display:grid;grid-template-columns:minmax(0,1fr) 30px minmax(0,1fr);gap:10px;align-items:center;margin:2px 0}
.player-card{min-width:0;background:#f4f7f0;border:1px solid #dfe7d7;border-radius:13px;padding:17px 8px;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center}
.player-card strong{max-width:100%;overflow-wrap:anywhere;font-size:16px}.player-card small{font-size:11px;color:#4d604a}.player-avatar{display:block;width:30px;height:30px;border-radius:50%;border:3px double transparent;box-shadow:inset 0 -3px 4px #0002,0 2px 3px #0001;flex-shrink:0}.player-avatar[data-side=light]{background:#f4ecda;border-color:#b7a87e}.player-avatar[data-side=dark]{background:#b73d4b;border-color:#8c2737}
.versus{font-size:10px;font-weight:700;letter-spacing:1px!important;text-align:center;color:#99a38d}
.ready-chip{font-size:11px;color:#777d68;background:#e9ecdf;padding:3px 9px;border-radius:20px}.ready-chip[data-ready=true]{color:#25653d;background:#d8eddb}
.ready-button{min-height:52px;border-radius:10px;font-size:16px;font-weight:750}.ready-note{font-size:11px;text-align:center;color:#76816e;margin:0}
[data-stage=playing] .lobby-intro{display:none}[data-stage=playing] .player-card{padding:10px 4px}[data-stage=playing] .player-card strong{font-size:12px}[data-stage=playing] .player-card small{font-size:10px}[data-stage=playing] .player-avatar{font-size:23px}[data-stage=playing] .ready-chip{font-size:10px}
[data-stage=playing] .game-panel{gap:10px}[data-stage=playing] .game-panel>label,[data-stage=playing] #nameInput,[data-stage=playing] #computerBtn{display:none}
[data-stage=playing] .chat-input input{font-size:14px}[data-stage=playing] .mode-row .button{font-size:11px}
@media(max-width:640px){.web-app:not([data-stage=playing]) .game-shell{min-height:calc(100dvh - 20px);align-items:flex-start;padding-top:8px}.web-app:not([data-stage=playing]) .game-panel{padding:25px 20px;gap:14px;border-radius:18px}.lobby-steps{gap:9px;font-size:10px}.lobby-intro h1{font-size:30px}.lobby-lead{font-size:13px}.players-card{gap:5px}.player-card{padding:14px 6px}.game-panel label{margin-bottom:0}.game-panel .mode-row .button{font-size:13px}.web-app[data-stage=playing] .score-grid{display:grid}.web-app[data-stage=playing] .game-panel{padding:16px}.game-panel input#nameInput{font-size:16px}}
@media(prefers-reduced-motion:reduce){[data-stage=connecting] .status-box:before,[data-stage=searching] .status-box:before{animation:none}}

/* One viewport for play; secondary tasks live in accessible native dialogs. */
.browser-board{position:relative;isolation:isolate}
.browser-board[data-animating=true] button{cursor:wait}
.browser-board button.last-from{box-shadow:inset 0 0 0 3px #e6d18c}
.browser-board button.last-from:before{content:'';position:absolute;inset:14%;border:2px dashed #fff4c7;border-radius:50%;z-index:2;pointer-events:none}
.browser-board button.last-to{box-shadow:inset 0 0 0 4px #f4d67e}
.browser-board .motion-source>.browser-piece{visibility:hidden}
.move-ghost{position:absolute;left:0;top:0;width:12.5%;height:12.5%;z-index:5;pointer-events:none;will-change:transform}
.move-square-label{position:absolute;bottom:1px;left:3px;font:700 clamp(9px,2vw,12px) Arial,sans-serif;direction:ltr;background:#243b31;color:#fff6d9;padding:0 3px;border-radius:3px;z-index:3;pointer-events:none}
.browser-piece.king:after{display:none}
.king-crown{position:absolute;inset:17%;width:66%;height:66%;fill:#f8cf66;stroke:#674318;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 1px 1px #0005)}
.dark-piece .king-crown{stroke:#fff0b3;fill:#d99728;stroke-width:2}
.browser-board .just-crowned>.browser-piece{box-shadow:inset 0 0 0 2px #ffe59d,0 0 0 3px #e3b558,0 5px 10px #0004;animation:crown-pop .5s ease-out}
@keyframes crown-pop{50%{transform:scale(1.14)}}
.move-summary{flex-shrink:0;width:100%;text-align:center;min-height:26px;border-radius:8px;padding:5px 9px;background:#f4ead8;color:#294033;font:600 13px/1.5 Heebo,Arial,sans-serif;unicode-bidi:plaintext;overflow-wrap:anywhere}
@media(prefers-reduced-motion:reduce){.browser-board .just-crowned>.browser-piece{animation:none}}
.board-viewport{flex:1;min-height:0;width:100%;display:grid;place-items:center;container-type:size}
.board-viewport .browser-board{width:min(100%,calc(100dvh - 160px));max-height:100%;touch-action:manipulation}
@supports(width:1cqh){.board-viewport .browser-board{width:min(100cqw,100cqh)}}
.game-toolbar{display:flex;gap:10px;justify-content:center;width:100%;flex-shrink:0}
.game-toolbar .button{min-height:44px;min-width:110px;background:#fffdf7;border-radius:10px;font-size:14px;color:#254532;gap:7px}
.chat-badge{background:#b73d4b;color:white;border-radius:15px;min-width:21px;padding:1px 5px;font-size:11px}
.game-dialog{width:min(440px,calc(100% - 24px));max-height:calc(100dvh - 32px);padding:22px;border:1px solid #d5dfcf;border-radius:20px;background:#fffdf8;color:#203d33;box-shadow:0 24px 80px #132c354d;font-family:Heebo,Arial,sans-serif;overscroll-behavior:contain}
.game-dialog::backdrop{background:#132a2466;backdrop-filter:blur(3px)}
.game-dialog[open]{display:flex;flex-direction:column;gap:16px}
.dialog-header{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-shrink:0}
.dialog-header h2{font-size:21px;margin:0;line-height:1.4}
.dialog-close{display:grid;place-items:center;width:44px;height:44px;flex-shrink:0;border:1px solid #dde5d9;border-radius:50%;background:#f2f6ee;color:#355a43;font-size:27px;cursor:pointer}
.game-dialog p{margin:0;font-size:15px;line-height:1.8;overflow-wrap:anywhere}
.game-dialog .button{min-height:46px;font-size:15px;border-radius:10px;flex-shrink:0}
.game-dialog .chat-box{min-height:0;margin:0;gap:12px}
.game-dialog .chat-log{height:min(310px,45dvh);min-height:50px;border-radius:10px;font-size:15px;line-height:1.6;overscroll-behavior:contain}
.game-dialog .chat-log:empty:before{content:'כאן מופיעות ההודעות ביניכם';color:#74816c;text-align:center;margin:auto}
.game-dialog .chat-log div{overflow-wrap:anywhere}
.game-dialog .chat-input{flex-shrink:0;grid-template-columns:minmax(0,1fr) 60px}
.game-dialog .chat-input input{min-width:0;height:46px;border:1px solid #d4dfcc;border-radius:9px;padding:0 12px;font:16px Heebo,Arial,sans-serif}
.game-dialog .chat-input button{font:600 14px Heebo,Arial,sans-serif;border-radius:9px}
.game-notification{position:fixed;z-index:20;top:max(12px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:min(440px,calc(100% - 24px));display:flex;align-items:center;gap:8px;padding:10px 14px;border:1px solid #99bba2;border-radius:14px;background:#193d30;color:#fff;box-shadow:0 8px 32px #14271a33;font-size:14px;line-height:1.6}
.game-notification>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:anywhere}
.game-notification button{min-height:44px;min-width:44px;background:#ffffff18;border:0;border-radius:9px;color:white;font:inherit;cursor:pointer;flex-shrink:0}
.game-notification #noticeCloseBtn{font-size:23px}
[data-stage=playing] .game-panel>.mode-row,[data-stage=playing] .game-panel>.back-link{display:none}
[data-stage=playing] .player-card{gap:5px}
[data-stage=playing] .player-card small{font-size:12px;font-weight:600}
[data-stage=playing] .player-card strong{font-size:14px}
.web-app:is([data-stage=matched],[data-stage=ready]) .lobby-mark,.web-app:is([data-stage=matched],[data-stage=ready]) .lobby-steps,.web-app:is([data-stage=matched],[data-stage=ready]) .lobby-lead,.web-app:is([data-stage=matched],[data-stage=ready]) .lobby-eyebrow{display:none}
.web-app:is([data-stage=matched],[data-stage=ready]) .lobby-intro h1{font-size:25px;margin:0}
.web-app:is([data-stage=matched],[data-stage=ready]) .game-panel>label,.web-app:is([data-stage=matched],[data-stage=ready]) #nameInput,.web-app:is([data-stage=matched],[data-stage=ready]) #computerBtn{display:none}
@media(max-width:640px){
  .web-app[data-stage=playing]{height:100dvh;min-height:0;overflow:hidden;padding:8px;padding-top:max(8px,env(safe-area-inset-top));padding-bottom:max(8px,env(safe-area-inset-bottom))}
  .web-app[data-stage=playing] .game-shell{height:100%;min-height:0;display:flex;flex-direction:column;gap:8px}
  .web-app[data-stage=playing] .game-panel{order:0;overflow:visible;flex-shrink:0;padding:10px 12px;gap:7px;border-radius:14px}
  .web-app[data-stage=playing] .players-card{order:0;margin:0;gap:6px}
  .web-app[data-stage=playing] .player-card{display:grid;grid-template-columns:26px minmax(0,1fr);text-align:start;column-gap:7px;row-gap:0;padding:5px 7px;border-radius:9px}
  .web-app[data-stage=playing] .player-avatar{grid-row:span 2;width:25px;height:25px}
  .web-app[data-stage=playing] .player-card strong{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
  .web-app[data-stage=playing] .player-card small{font-size:12px}
  .web-app[data-stage=playing] .status-box{order:2;min-height:36px;padding:5px 8px;font-size:13px;line-height:1.4}
  .web-app[data-stage=playing] .score-grid{order:1;gap:5px}
  .web-app[data-stage=playing] .score-grid span{padding:2px;font-size:12px;border:0;background:transparent}
  .web-app[data-stage=playing] .score-grid b{display:inline;font-size:14px;margin-inline-end:3px}
  .web-app[data-stage=playing] .board-area{order:1;flex:1;min-height:0;padding:9px;border-radius:14px;gap:8px}
  .web-app[data-stage=playing] .browser-board{border-width:5px}
  .game-toolbar .button{flex:1;min-width:0;font-size:15px}
  .game-dialog{padding:18px;border-radius:18px}
}
@media(min-width:641px) and (max-height:520px){
  .web-app[data-stage=playing]{height:100dvh;min-height:0;padding:8px;overflow:hidden}
  .web-app[data-stage=playing] .game-shell{height:100%;min-height:0;grid-template-columns:220px minmax(0,1fr);gap:8px}
  .web-app[data-stage=playing] .game-panel{order:0;padding:12px;gap:8px;overflow:auto}
  .web-app[data-stage=playing] .board-area{order:1;padding:8px;gap:6px}
  .web-app[data-stage=playing] .player-card{padding:7px 4px}
  .web-app[data-stage=playing] .status-box{padding:8px;font-size:13px}
}
