#game { scroll-margin-top: calc(56px + env(safe-area-inset-top)); }
.pl-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 8px; padding-top: env(safe-area-inset-top); background: #0b0e1a; border-bottom: 1px solid var(--line); flex: none; box-sizing: content-box; }
.pl-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, .06); border: 0; color: var(--ink); cursor: pointer; flex: none; }
.pl-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; white-space: nowrap; overflow: hidden; }
.pl-title b, .pl-title .pl-h1 { overflow: hidden; text-overflow: ellipsis; }
.pl-main { width: 100%; max-width: min(calc(759px * var(--ar, 1.3333) + 28px), calc((100vh - 68px) * var(--ar, 1.3333) + 20px)); max-width: min(calc(759px * var(--ar, 1.3333) + 28px), calc((100dvh - 68px) * var(--ar, 1.3333) + 20px)); margin: 0 auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; box-sizing: border-box; }
.pl-stagewrap { overflow-x: auto; overflow-y: hidden; display: flex; justify-content: center; }
.pl-stage { position: relative; border: 4px solid var(--line); border-radius: 16px; overflow: hidden; background: #000; box-shadow: var(--shadow); aspect-ratio: 4 / 3; width: 100%; flex: none; }
.pl-guest { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: linear-gradient(90deg, rgba(255,176,32,.14), rgba(124,140,255,.12)); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: .9rem; }
.pl-tut { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(0,0,0,.8); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); overflow: hidden; }
.pl-tut-box { display: flex; flex-direction: column; width: 80%; min-width: min(100%, 360px); max-height: 100%; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 16px; }
.pl-tut-body { flex: 1 1 auto; min-height: 0; overflow: auto; color: var(--ink); font-size: .9rem; line-height: 1.55; margin-bottom: 14px; padding-right: 6px; }
.pl-tut-box > .btn { flex: none; align-self: flex-start; }
.pl-tut-body table { width: 100%; border-collapse: collapse; }
.pl-tut-body th, .pl-tut-body td { text-align: left; vertical-align: top; padding: 4px 12px 4px 0; border-bottom: 1px solid var(--line); }
@media (max-height: 560px) {
  .pl-tut { padding: 8px; }
  .pl-tut-box { padding: 12px 14px 12px; }
  .pl-tut-body { margin-bottom: 10px; }
}
.pl-actions { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 4px 0 24px; }
.pl-zoom { display: flex; align-items: center; gap: 6px; }
#zoomReset { min-width: 60px; font-variant-numeric: tabular-nums; }
@media (orientation: portrait) and (max-width: 1100px) {
  .pl-main.pl-hoch { max-width: calc((100vh - 68px) * var(--arp, .625) + 20px); max-width: calc((100dvh - 68px) * var(--arp, .625) + 20px); }
  .pl-main.pl-hoch .pl-stage { aspect-ratio: var(--arp-v, 750 / 1200) !important; }
  .pl-main.pl-hoch .pl-rotate { display: none !important; }
}
@media (orientation: landscape) and (max-height: 620px) {
  .pl-stage { width: auto; height: calc(100dvh - 56px); max-width: 100%; }
}
.pl-compact-only, .pl-side-head, .pl-side-guest { display: none; }
@media (orientation: landscape) and (max-height: 620px) and (pointer: coarse), (orientation: landscape) and (max-height: 480px) {
  .pl-main { padding: 4px; gap: 0; max-width: none; }
  .pl-guest, .pl-rotate, .pl-actions, .pl-side { display: none; }
  .pl-stage { width: auto; height: calc(100dvh - 46px - env(safe-area-inset-top) - 8px); max-width: 100%; border-width: 2px; border-radius: 10px; }
  .pl-compact-only { display: grid; }
  body.pl-side-open .pl-side-head b { display: flex; align-items: center; gap: 8px; }
  body.pl-side-open .pl-scores { grid-template-columns: 1fr; }
  body.pl-side-open #plBoards { background: rgba(255, 176, 32, .25); color: var(--accent); }
}
.res-nextgame { margin: 6px 0 0; }
.pl-stage:fullscreen #game { position: absolute; inset: 0; }
.pl-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pl-score { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.hs-reload { margin-left: auto; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.pl-hs { list-style: none; margin: 0; padding: 4px 0; max-height: calc(5 * 34px); overflow-y: auto; scrollbar-width: thin; }
.pl-hs .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .pl-scores { grid-template-columns: 1fr; }
}
.result-score { font-size: 3rem; font-weight: 900; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.pl-restoast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 155; max-width: calc(100% - 32px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; box-shadow: var(--shadow); font-size: .95rem; transition: opacity .2s, transform .2s; }
.res-trn { display: flex; flex-direction: column; gap: 2px; margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 204, 51, .08); border: 1px solid rgba(255, 204, 51, .25); color: inherit; text-decoration: none; text-align: left; font-size: .92rem; }
.res-stats { display: flex; justify-content: center; gap: 12px; margin: 10px 0 14px; }
.res-next { margin: 8px auto 12px; max-width: 340px; padding: 9px 14px; border-radius: 12px; background: linear-gradient(90deg, rgba(255,193,7,.16), rgba(255,193,7,.06)); border: 1px solid rgba(255,193,7,.4); color: var(--fg); font-size: .95rem; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); margin: 10px auto; animation: spin 1s linear infinite; }
@media (pointer: coarse) {
  .pl-btn { width: 44px; height: 44px; }
  .hs-reload { width: 44px; height: 44px; }
  .pl-zoom { display: none; }
}
.pl-rotate { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pl-rotate-go { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 92px; padding: 14px 18px; border-radius: 16px; border: 2px solid var(--accent); background: linear-gradient(135deg, rgba(255, 176, 32, .24), rgba(255, 176, 32, .07)); color: var(--ink); font: inherit; text-align: left; cursor: pointer; animation: plQuer 2.4s ease-in-out 1s 2; }
.pl-rotate-go .sgzi { width: 46px; height: 46px; flex: none; color: var(--accent); transform: rotate(90deg); }
.pl-rotate-go b { display: block; font-size: 1.3rem; line-height: 1.2; }
.pl-rotate-go small { display: block; margin-top: 3px; font-size: .9rem; color: var(--muted); }
.pl-rotate-go:active { transform: translateY(1px); }
@keyframes plQuer { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 176, 32, 0); } 50% { box-shadow: 0 0 0 6px rgba(255, 176, 32, .22); } }
@media (prefers-reduced-motion: reduce) { .pl-rotate-go { animation: none; } }
.pl-rot-x { display: none; }
body.pl-rotated { overflow: hidden; }
@supports (padding: max(0px)) {
  .pl-bar { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .pl-main { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
}
.pl-notice { z-index: 70; }
.pl-notice h2 { margin: 6px 0 4px; }
.pl-notice .pl-notice-txt { margin: 0 0 6px; font-weight: 600; }
.tour { position: fixed; inset: 0; z-index: 80; }
.tour-kopf { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.tour-titel { font-size: 1.02rem; color: var(--accent); }
.tour-nr { margin-left: auto; font-size: .78rem; color: var(--muted); }
.tour-text { margin: 0 0 10px; font-size: .9rem; line-height: 1.5; color: var(--ink-soft); }
.tour-cta { margin: 0 0 10px; }
.tour-knoepfe { display: flex; align-items: center; gap: 8px; }
.tour-luecke { flex: 1; }
.pl-tut-actions { display: flex; flex-wrap: wrap; gap: 10px; flex: none; }
:where([data-theme="light"]) .pl-bar { background: var(--bar-bg2); border-bottom-color: var(--line); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
:where([data-theme="light"]) .pl-btn { background: var(--card2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
:where([data-theme="light"]) .pl-btn:hover { background: #e2e6ed; }
:where([data-theme="light"]) body.pl-side-open #plBoards { background: #fff1d6; color: var(--accent-text); }
:where([data-theme="light"]) .pl-tut { background: rgba(24, 28, 44, .6); }
:where([data-theme="light"]) .pl-rotate-go { background: linear-gradient(135deg, #fff1d6, #fbf3e4); }
:where([data-theme="light"]) .pl-rotate-go .sgzi { color: var(--accent-text); }
:where([data-theme="light"]) .pl-hs .me { background: rgba(244, 165, 28, .18); }
:where([data-theme="light"]) .tour-loch { box-shadow: 0 0 0 9999px rgba(24, 28, 44, .55); }
:where([data-theme="light"]) .tour-loch.wichtig { box-shadow: 0 0 0 9999px rgba(24, 28, 44, .55), 0 0 22px 4px rgba(22, 124, 78, .45); }
.pl-ton { position: absolute; right: 8px; top: calc(100% + 6px); z-index: 30; width: 270px; padding: 12px 14px; border-radius: 12px; background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 10px; }
.pl-ton[hidden] { display: none; }
.pl-ton-h { font-size: .95rem; }
.pl-ton-z { display: grid; gap: 4px; }
.pl-ton-an { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .9rem; }
.pl-ton-an input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.pl-ton-r { width: 100%; margin: 0; accent-color: var(--accent); }
.pl-ton-r:disabled { opacity: .4; }
.pl-ton-hinweis { margin: 0; font-size: .75rem; color: var(--muted); }
.pl-coach { position: absolute; left: 10px; top: 10px; z-index: 6; max-width: min(340px, calc(100% - 20px)); pointer-events: none; }
.pl-coach[hidden], .pl-coach-box[hidden], .pl-coach-pille[hidden] { display: none; }
.pl-coach-box, .pl-coach-pille { pointer-events: auto; }
.pl-coach-box { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--card) 94%, transparent); color: var(--ink); border: 1px solid var(--accent); box-shadow: var(--shadow); font-size: .86rem; line-height: 1.45; }
.pl-coach-k { display: flex; align-items: center; gap: 8px; }
.pl-coach-k b { flex: 1; color: var(--accent); }
.pl-coach-zu { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.pl-coach-zu:hover { background: var(--bg2); color: var(--ink); }
.pl-coach-zu svg { width: 16px; height: 16px; }
.pl-coach-box ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.pl-coach-f { display: flex; gap: 8px; justify-content: flex-end; }
.pl-coach-pille { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--accent); background: var(--card); color: var(--ink); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
.pl-coach-pille svg { width: 16px; height: 16px; color: var(--accent); }
.pl-einst { width: 300px; max-height: calc(100dvh - 80px); overflow: auto; }
.pl-einst-t { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pl-einst-t svg { width: 15px; height: 15px; }
.pl-einst-ans { display: flex; gap: 6px; }
.pl-einst-ans button { flex: 1; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--ink); font: inherit; font-size: .82rem; cursor: pointer; }
.pl-einst-ans button svg { width: 15px; height: 15px; }
.pl-einst-ans button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #1a1300; font-weight: 600; }
.pl-einst-tasten { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: .86rem; }
.pl-einst-tasten kbd { display: inline-block; min-width: 26px; padding: 1px 6px; margin-right: 6px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--bg2); font: 600 .78rem/1.5 inherit; text-align: center; }
.pl-einst-spiel { color: var(--muted); }
#plTon[aria-expanded="true"] { background: rgba(255, 255, 255, .16); }
.pl-vorl-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 220px; overflow: auto; }
.pl-vorl-liste li { display: flex; gap: 6px; }
.pl-vorl-liste li .btn:first-child { flex: 1; justify-content: flex-start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-vorl-leer { font-size: .85rem; color: var(--muted); }
.pl-vorl-neu { display: flex; gap: 6px; }
.pl-vorl-neu input { flex: 1; min-width: 0; }
.pl-vorl-meldung { margin: 0; font-size: .8rem; color: var(--bad-strong, #ff7a7a); }
.pl-vorl-meldung.gut { color: var(--ok); }
.pl-vorl { min-width: 260px; }
