:root{color-scheme:dark}
#tabletPair{--edge:#ffffff25;--muted:#d4cbbd;font-family:system-ui,sans-serif;color:#f9f3e8}
#tabletPair{width:min(92vw,440px);max-height:92dvh;padding:24px;border:1px solid var(--edge);border-radius:18px;background:#1b201c;box-shadow:0 24px 80px #000a}
#tabletPair::backdrop{background:#111811cd}
#tabletPair h2,.controller h1{margin:0;font:400 clamp(30px,5vw,44px) Georgia,serif}
#tabletPair p{margin:12px 0;color:var(--muted)}
#tabletQr img{display:block;width:min(100%,290px);height:auto;aspect-ratio:1;margin:16px auto;border-radius:9px;image-rendering:pixelated;background:#fff}
.tablet-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
#tabletOpen,#tabletPair :is(button,a){border:1px solid var(--edge,#ffffff35);border-radius:9px;background:#2f352e;color:inherit;cursor:pointer;padding:9px 13px;font:inherit;text-decoration:none}
#tabletOpen{white-space:nowrap}
#tabletOpen:focus-visible,#tabletPair button:focus-visible{outline:2px solid #f0ce96;outline-offset:2px}
body[data-kiosk=true] :is(.stages,.direct,footer){display:none}
.controller{--ink:#172c25;--edge:#d8e1db;--muted:#52675d;--accent:#214b3e;--content-width:1080px;box-sizing:border-box;margin:0;background:#f5f7f5;min-height:100dvh;color-scheme:light;color:var(--ink);font:16px/1.35 system-ui,sans-serif}
.controller [hidden]{display:none!important}
.controller-head{position:sticky;top:0;z-index:1;background:#fffffff7;border-bottom:1px solid var(--edge);padding:16px max(22px,calc((100% - var(--content-width))/2));backdrop-filter:blur(10px)}
.controller-head>span{display:block;color:var(--accent);font-size:.85rem;font-weight:650;margin-bottom:4px}
.controller-head p{margin:7px 0 0;color:var(--muted);min-height:1.4em;font-size:.92rem}
.controller main{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;width:min(var(--content-width),calc(100% - 44px));margin:16px auto 28px}
.controller section{background:#fff;border:1px solid var(--edge);border-radius:16px;padding:clamp(17px,3vw,25px)}
.controller h2{font-size:1.24rem;font-weight:680;margin:0 0 14px}
.controller h3{font-size:.96rem;font-weight:620;color:var(--muted);margin:16px 0 9px}
.controller main>section:first-child,.outdoor-controls{grid-column:1/-1}
.key-grid.outdoor-layout{gap:22px}
.direction-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.direction-up{grid-column:2}
.direction-up+button{grid-column:1}
.key-grid,.floor-keys,.fabric-grid,.three-keys,#controller-menu{display:grid;gap:10px}
.key-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.floor-keys{grid-template-columns:repeat(6,minmax(0,1fr));margin:10px 0}
.fabric-grid,.three-keys,#controller-menu{grid-template-columns:repeat(3,minmax(0,1fr))}
#controller-menu{margin-top:13px}
.controller button{min-height:70px;background:#edf2ee;color:var(--ink);border:1px solid var(--edge);border-radius:11px;padding:9px 7px;font:650 clamp(16px,2.2vw,20px)/1.22 system-ui,sans-serif;cursor:pointer;touch-action:manipulation}
.controller button:focus-visible,.controller .sending{outline:2px solid var(--accent);outline-offset:2px}
#controller-menu button{min-height:54px;background:#fff}
#controller-menu button[aria-pressed=true],.controller .primary-key,.controller .selected{background:var(--accent);border-color:var(--accent);color:white}
.controller .wide-key{width:100%}
.fabric-grid span{display:block;height:32px;background:var(--fabric);border-radius:6px;margin:0 3px 7px}
@media(max-width:720px){.controller main{grid-template-columns:1fr;width:calc(100% - 32px)}.controller-head{padding:13px 16px}}
@media(max-width:560px){.key-grid.outdoor-layout{grid-template-columns:1fr;gap:9px}.controller button{min-height:64px}.floor-keys{gap:6px}}
