:root{color-scheme:light;--ink:#203830;--muted:#798077;--paper:#f5f3ed;--green:#274d3e;--line:#dfdfd5;--accent:#b8cb90;font-family:Arial,Helvetica,sans-serif;color:var(--ink);background:var(--paper)}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
/* In der installierten App das elastische Nachziehen am Seitenrand verhindern. */
@media(display-mode:standalone){html,body{overscroll-behavior-y:none}}
body{padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
button,a,input,select{touch-action:manipulation}
.board{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.board img{-webkit-user-drag:none}
.board .square.hint-square:before{content:'';position:absolute;inset:5px;border:3px dashed #203830;outline:2px solid #fff4ce;z-index:7;pointer-events:none}
.hint-result{padding:14px 16px;margin:16px 0 0;border-left:4px solid var(--green);border-radius:4px;background:#edf0e5;color:var(--ink);font-size:13px;line-height:1.7;overflow-wrap:anywhere}
#hint-button:disabled{cursor:default}
.language-picker{margin-left:auto;min-width:0}
.language-picker select{max-width:145px;min-height:36px;padding:6px;border:1px solid var(--line);border-radius:5px;background:var(--paper);color:var(--ink);font:12px Arial,sans-serif}
.language-picker select:focus-visible{outline:3px solid #c18b39;outline-offset:3px}
.app-shell .topbar .language-picker+.quiet-button{margin-left:0}
@media(max-width:420px){.app-shell header.topbar{height:auto;min-height:60px;flex-wrap:wrap;padding:10px 0;gap:8px}.language-picker select{max-width:125px}.app-shell .topbar .language-picker+.quiet-button{margin-left:auto}}
.captured-pieces{display:flex;align-items:center;flex-wrap:wrap;gap:2px;min-height:30px;padding:0 4px;margin:4px 0 10px}
#bottom-captured{margin:8px 0 0}
.captured-label{font-size:10px;color:#637269;margin-right:6px}
.captured-piece{display:grid;place-items:center;width:28px;height:30px;font-size:26px;line-height:1;color:var(--ink)}
.captured-piece img{width:100%;height:100%;object-fit:contain}
.app-shell .topbar{height:58px;gap:16px}
.topbar .brand{font-size:26px}.topbar .brand>span:first-child{font-size:32px;margin-right:8px}
.app-shell .topbar .quiet-button{margin-left:auto;white-space:nowrap;font-size:11px}
.app-shell main{padding-top:18px}
.app-shell .visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@media(max-width:680px){.app-shell .topbar{height:52px;gap:10px}.topbar .brand{font-size:23px}.topbar .brand>span:first-child{font-size:28px;margin-right:5px}.app-shell main{padding-top:12px}}
.sidebar .status-panel{margin-bottom:18px;border-left:4px solid #879a77;background:#edf0e5}
.status-panel .status-badge{display:inline-block;font-size:10px;font-weight:bold;letter-spacing:1px;padding:6px 9px;border-radius:4px;background:#dce3ce;margin-bottom:14px}
.status-panel h2{overflow-wrap:anywhere}
.status-panel #status-detail{font-size:12px;line-height:1.7;margin:0;color:#506348}
.sidebar .status-panel[data-state="your-turn"]{border-left-color:#376a47;background:#e5efdf}
.sidebar .status-panel[data-state="check"]{border-left-color:#a53627;background:#fff0e8;color:#872719}
.status-panel[data-state="check"] .status-badge{background:#a53627;color:#fff}
.status-panel[data-state="check"] #status-detail{color:#872719}
.sidebar .status-panel[data-state="ended"]{border-left-color:#b08737;background:#f5efdf}
.board-frame{position:relative}
.board-frame.is-thinking:before,.board-frame.is-thinking:after{content:'';position:absolute;pointer-events:none;z-index:6}
.board-frame.is-thinking:after{inset:2px;border:2px solid #e8c879;border-radius:5px;box-shadow:0 0 12px #e8c87955,inset 0 0 8px #e8c87933;animation:thinking-glow 2.4s ease-in-out infinite}
.board-frame.is-thinking:before{width:6px;height:6px;left:4px;top:4px;border-radius:50%;background:#fff4ce;box-shadow:0 0 7px 3px #e8c879aa,0 0 16px 5px #e8c87955;transform:translate(-50%,-50%);animation:thinking-orbit 4s linear infinite}
@keyframes thinking-glow{0%,100%{opacity:.45}50%{opacity:1}}
@keyframes thinking-orbit{0%,100%{left:4px;top:4px}25%{left:calc(100% - 4px);top:4px}50%{left:calc(100% - 4px);top:calc(100% - 4px)}75%{left:4px;top:calc(100% - 4px)}}
@media(prefers-reduced-motion:reduce){.board-frame.is-thinking:before{display:none}.board-frame.is-thinking:after{animation:none;opacity:.8}}
.player-name-field{margin:20px 0}
.difficulty-field{margin:20px 0 0}
.match-field{margin:0 0 18px;min-width:0}
.match-field select{max-width:100%}
.difficulty-field label{display:block;font-size:12px;font-weight:bold;margin-bottom:9px}
.difficulty-field select{width:100%;min-height:44px;padding:10px;border:1px solid #c8cfc0;border-radius:5px;background:#fff;color:var(--ink);font:inherit;font-size:12px}
.difficulty-field select:focus-visible{outline:3px solid #c18b39;outline-offset:3px}
.difficulty-field p{font-size:10px;line-height:1.5;color:var(--muted);margin:8px 0 0}
.player-name-field label{display:block;font-size:12px;font-weight:bold;margin-bottom:9px}
.player-name-field label span:last-child{font-size:10px;font-weight:normal;color:var(--muted)}
.player-name-field input{width:100%;min-width:0;padding:12px;border:1px solid #c8cfc0;border-radius:5px;background:#fff;color:var(--ink)}
.player-name-field p{font-size:10px;line-height:1.5;color:var(--muted);margin:8px 0 0}
.player-line>div:not(.avatar){min-width:0}.player-line strong{overflow-wrap:anywhere}
.player-presence{font-weight:normal;color:var(--muted)}
.player-presence[data-state="online"]{color:#426c3d}
@media(min-width:681px){.sidebar .status-panel{position:sticky;top:16px;z-index:15}}
/* Eine eigene Ebene hält Figuren während des Zugs über allen Feldern. */
.board{position:relative;isolation:isolate}
.motion-piece{position:absolute;width:12.5%;height:12.5%;display:grid;place-items:center;z-index:12;pointer-events:none;will-change:transform,opacity}
.motion-piece img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 8px 5px #19291c55)}
.motion-piece .piece-fallback{font-size:clamp(22px,4vw,57px);color:#1f302a;text-shadow:0 1px 1px #fff}
.board .square.selected img,.board .square.selected .piece-fallback{animation:piece-lift 220ms cubic-bezier(.2,.7,.3,1) both;z-index:5;filter:drop-shadow(0 8px 4px #19291c55)}
.board .square.target:after{animation:target-appear 180ms ease-out both}
.board[aria-busy="true"]{cursor:progress}
.board[aria-busy="true"] .square{cursor:progress}
@keyframes piece-lift{from{transform:translateY(0) scale(1)}to{transform:translateY(-8%) scale(1.08)}}
@keyframes target-appear{from{opacity:0;transform:scale(.65)}to{opacity:1;transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.board .square.selected img,.board .square.selected .piece-fallback,.board .square.target:after{animation:none}}
*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button,a,input{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:wait;opacity:.55}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #c18b39;outline-offset:3px}[hidden]{display:none!important}.app-shell{max-width:1260px;padding:0 52px;margin:auto}.topbar{height:110px;display:flex;align-items:center;gap:30px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;font-family:Georgia,serif;font-weight:bold;font-size:36px;letter-spacing:-1px;color:var(--ink);text-decoration:none}.brand>span:first-child{font-size:46px;margin-right:12px}.brand-dot{color:#91a471}.header-note{font-size:12px;color:var(--muted);flex:1}.quiet-button{border:0;background:transparent;color:var(--ink);font-size:12px;padding:10px 0}.topbar .quiet-button{margin-left:auto}.page-heading{display:flex;align-items:center;justify-content:space-between;margin:42px 0 32px;gap:20px}.eyebrow{font-size:10px;font-weight:bold;letter-spacing:2px;margin:0 0 14px;color:#65775d}h1{font:normal 44px/1.13 Georgia,serif;letter-spacing:-1.5px;margin:0 0 12px}.page-heading p:not(.eyebrow){color:var(--muted);font-size:13px;margin:0}.connection{font-size:11px;border:1px solid var(--line);border-radius:25px;padding:10px 14px;white-space:nowrap}.connection:before,.status-dot{content:'';display:inline-block;width:6px;height:6px;background:#73946c;border-radius:50%;margin-right:8px}.connection.offline:before{background:#bf783d}.game-layout{display:grid;grid-template-columns:minmax(0,660px) minmax(260px,330px);gap:44px;align-items:start;justify-content:space-between}.board-column{min-width:0}.player-line{display:flex;align-items:center;gap:12px;padding:0 4px 15px}.player-line:has(.light-avatar){padding:17px 4px 0}.avatar{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;font-size:27px}.dark-avatar{background:#273d35;color:#e9e6d8}.light-avatar{background:#e7e4d8;color:#384d42}.player-line strong{display:block;font-size:12px}.player-line div>span{display:block;font-size:10px;margin-top:5px;color:var(--muted)}.color-label{margin-left:auto;font-size:9px;letter-spacing:1.5px;color:var(--muted)}.board-frame{padding:13px;background:#293f34;border-radius:5px;box-shadow:0 16px 35px #23342918}.board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));aspect-ratio:1}.square{position:relative;display:grid;place-items:center;padding:0;border:0;border-radius:0;min-width:0;aspect-ratio:1;background:#e8e5d4;color:#75816a}.square.dark{background:#7c9678;color:#e7eadb}.square img{width:100%;height:100%;object-fit:contain;position:absolute;pointer-events:none;filter:drop-shadow(0 3px 2px #19291c40)}.square .piece-fallback{font-size:clamp(22px,4vw,57px);line-height:1;z-index:1;color:#1f302a;text-shadow:0 1px 1px #fff}.square.last{box-shadow:inset 0 0 0 100px #dacf4860}.square.selected{box-shadow:inset 0 0 0 4px #ecbe58;background:#b8bc7e}.square.target:after{content:'';width:23%;height:23%;border-radius:50%;background:#263e3860;position:absolute;z-index:2}.square.capture:after{width:87%;height:87%;background:none;border:5px solid #263e3860}.square.check{background:#ce9776}.square:focus-visible{outline-offset:-4px;z-index:3}.coordinate{position:absolute;font-size:9px;font-weight:bold;z-index:4;pointer-events:none}.coordinate.rank{top:5px;left:5px}.coordinate.file{bottom:4px;right:5px}.board-tools{display:flex;justify-content:space-between;align-items:center;font-size:10px;color:var(--muted);padding-top:20px;gap:12px}.board-tools .quiet-button{font-size:11px;white-space:nowrap}.sidebar{padding-top:1px}.panel{border:1px solid var(--line);border-radius:8px;background:#faf9f5;padding:25px}.panel h2{font:normal 26px/1.18 Georgia,serif;margin:0 0 12px;letter-spacing:-.4px}.play-panel>p:not(.eyebrow){font-size:12px;line-height:1.7;color:var(--muted);min-height:40px;margin-bottom:23px}.primary-button,.secondary-button{width:100%;border:1px solid var(--green);border-radius:5px;min-height:46px;padding:12px 16px;display:flex;align-items:center;justify-content:space-between;font-size:12px;font-weight:bold;gap:10px}.primary-button{background:var(--green);color:#fff}.primary-button:hover{background:#365e4b}.secondary-button{background:transparent;color:var(--ink);border-color:#d8dccf;margin-top:10px}.secondary-button:hover{background:#efefe6}.fine-print{font-size:10px;color:var(--muted);line-height:1.7;text-align:center;margin:16px 0 0}.history-panel{margin-top:18px;padding-bottom:14px;min-height:215px}.section-heading{display:flex;justify-content:space-between;align-items:center}.section-heading h2{font:600 12px Arial,sans-serif;margin:0}.section-heading>span{font-size:9px;color:var(--muted);letter-spacing:1px}.empty-history{text-align:center;padding:24px 0 0;color:#929c86}.empty-history>span{font-size:30px}.empty-history p{font:italic 14px/1.6 Georgia,serif;margin:8px 0 0}#move-list{max-height:210px;overflow:auto;margin:16px 0 0;padding:0;list-style:none;scrollbar-width:thin}#move-list li{display:grid;grid-template-columns:35px 1fr 1fr;font-size:12px;padding:9px 8px;border-radius:3px}#move-list li:nth-child(odd){background:#eeeee5}#move-list .move-number{color:var(--muted)}.board-note{display:flex;gap:14px;padding:20px 12px;color:#8a9380}.board-note>span{font-size:32px}.board-note p{font:italic 13px/1.6 Georgia,serif;margin:0}.board-note strong{font-weight:normal;color:#60715a}footer{margin-top:38px;padding:23px 0;display:flex;justify-content:space-between;border-top:1px solid var(--line);font-size:10px;color:var(--muted)}footer b{padding:0 10px;font-weight:normal}.invite-field{display:flex;margin-top:8px;gap:5px}.invite-field input{min-width:0;width:100%;padding:10px;border:1px solid var(--line);border-radius:4px;font-size:11px;background:#fff;color:var(--ink)}.invite-field button{background:var(--green);border:0;border-radius:4px;color:white;font-size:10px;padding:8px}#invite-panel label{font-size:11px}.game-actions{display:flex;justify-content:space-between;margin-top:15px}dialog{border:1px solid var(--line);border-radius:12px;padding:28px;max-width:490px;width:calc(100% - 32px);background:var(--paper);color:var(--ink);box-shadow:0 25px 90px #0003}dialog::backdrop{background:#10231ec0;backdrop-filter:blur(3px)}dialog h2{font:normal 28px Georgia,serif;margin:0}dialog p{font-size:13px;line-height:1.8;color:#637269}.dialog-heading{display:flex;justify-content:space-between;align-items:center}.dialog-heading button{border:0;background:none;font-size:27px;color:var(--ink)}.promotion-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}.promotion-options button{padding:18px;background:#e2e6d7;border:1px solid var(--line);border-radius:4px;color:var(--ink)}.confirm-actions{display:flex;gap:10px}.confirm-actions .secondary-button{margin:0}.notice{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);padding:15px 22px;background:var(--ink);color:#fff;font-size:12px;border-radius:7px;max-width:90vw;z-index:20;box-shadow:0 8px 30px #0002}
@media(min-width:1400px){.page-heading{margin-top:50px}.game-layout{gap:60px}}@media(max-width:900px){.app-shell{padding:0 25px}.game-layout{gap:24px;grid-template-columns:minmax(0,1fr) 270px}.panel{padding:20px}.header-note{display:none}h1{font-size:37px}.page-heading{margin:28px 0}.connection{font-size:10px}.square img{width:105%;height:105%}}@media(max-width:680px){.app-shell{padding:0 18px}.topbar{height:78px}.brand{font-size:30px}.brand>span:first-child{font-size:37px}.page-heading{display:block;margin:27px 0 22px}h1{font-size:35px}.page-heading p:not(.eyebrow){font-size:12px;line-height:1.6}.connection{display:inline-block;margin-top:17px;padding:7px 11px}.game-layout{grid-template-columns:1fr;gap:22px}.board-frame{padding:8px}.square .piece-fallback{font-size:35px}.sidebar{display:grid;grid-template-columns:1fr}.board-note{display:none}.board-tools{padding-top:11px;font-size:9px}.board-tools .quiet-button{font-size:10px}.panel{padding:23px}.panel h2{font-size:26px}.section-heading h2{font-size:12px}.play-panel>p:not(.eyebrow){min-height:0;margin-bottom:18px}.history-panel{min-height:150px}.empty-history{padding:13px 0}.empty-history>span{display:none}.empty-history p br{display:none}footer{margin-top:26px;gap:15px;line-height:1.6;font-size:9px}footer>span:last-child{text-align:right}.coordinate{font-size:8px}.square.capture:after{border-width:3px}}

/* Sichere Bildschirmr?nder und erreichbare Dialoge auch im Querformat. */
dialog{max-height:calc(100vh - 32px);max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 32px);overflow-y:auto;overscroll-behavior:contain}
dialog::backdrop{-webkit-backdrop-filter:blur(3px)}
.notice{bottom:calc(24px + env(safe-area-inset-bottom,0px));overflow-wrap:anywhere}
@media(any-pointer:coarse){
    .language-picker select,.difficulty-field select,.player-name-field input,.invite-field input{font-size:16px;min-height:44px}
    .quiet-button,.invite-field button,.dialog-heading button{min-height:44px;min-width:44px}
    .app-shell header.topbar{height:auto;min-height:60px;flex-wrap:wrap}
    .language-picker select{max-width:155px}
}
