body { display: flex; flex-direction: column; overflow: hidden; }
.small { font-size: .85rem; }
#splash { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; place-content: center; text-align: center; gap: 20px; }
#splash h1 { font-size: 5rem; margin: 0; }
#splash button { font-size: 1.6rem; padding: .7em 1.6em; }

#bar { display: flex; align-items: center; gap: 24px; padding: 12px 20px; background: var(--panel); flex-wrap: wrap; }
#bar .logo { font-size: 1.6rem; }
.join { display: flex; align-items: center; gap: 12px; }
#qr { width: 84px; height: 84px; background: #fff; border-radius: 8px; padding: 4px; }
#code { font-size: 2.6rem; font-weight: 900; letter-spacing: .25em; color: var(--accent-2); line-height: 1; }
#players { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; }
.chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--panel-2); border: 2px solid var(--pc, #444); min-width: 150px; }
.chip .num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: var(--pc, #444); color: #000; }
.chip.empty { opacity: .35; border-style: dashed; }
.chip.away { opacity: .6; }
.chip .port { margin-left: auto; font-size: .8rem; background: #0004; padding: 2px 8px; border-radius: 999px; }
.chip button { padding: 2px 8px; background: transparent; }
.bar-actions { display: flex; gap: 8px; }

#library { flex: 1; overflow: auto; padding: 20px; }
#console-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
#console-tabs button.active { background: var(--accent); color: #fff; }
#console-tabs button .count { opacity: .7; font-size: .8em; margin-left: 4px; }
#games { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.game { text-align: left; background: var(--panel); padding: 18px; border-radius: var(--radius); min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; border: 2px solid transparent; }
.game:focus-visible, .game:hover { border-color: var(--accent-2); outline: none; }
.game .title { font-weight: 700; font-size: 1.1rem; }
.game .meta { font-size: .8rem; color: var(--muted); }

#stage { flex: 1; position: relative; background: #000; }
#frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
body.playing #bar { position: fixed; top: 0; left: 0; right: 0; z-index: 10; transform: translateY(-100%); transition: transform .25s; }
body.playing.show-bar #bar { transform: none; }
body.playing #library { display: none; }
