:root { --gold: #c9a65a; --gold2: #e8cf8f; --ink: #060507; --panel: rgba(10, 9, 12, .72); --line: rgba(201, 166, 90, .35); --text: #ece2cd; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); overflow: hidden; color: var(--text); font-family: Georgia, 'Times New Roman', serif; -webkit-tap-highlight-color: transparent; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#top { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 16px; right: 16px; pointer-events: none; text-shadow: 0 1px 6px #000; }
#top .brand { font-size: 11px; letter-spacing: .32em; color: var(--gold); }
#top h1 { margin: 2px 0 0; font-weight: normal; font-size: 22px; letter-spacing: .06em; color: var(--gold2); }
#top .sub { font-size: 12px; letter-spacing: .08em; opacity: .85; margin-top: 2px; }
#top .tag { display: inline-block; border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-left: 4px; }
#status { position: fixed; left: 0; right: 0; top: 46%; text-align: center; font-size: 14px; letter-spacing: .25em; color: var(--gold); pointer-events: none; }
#status.err { letter-spacing: 0; color: #f0a090; padding: 0 24px; }
#status:empty { display: none; }
#ui { position: fixed; left: 0; right: 0; bottom: 0; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(6,5,7,.92), rgba(6,5,7,.55) 70%, transparent); opacity: 0; transition: opacity .6s; }
body.ready #ui { opacity: 1; }
.row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 3px 0; }
.row::-webkit-scrollbar { display: none; }
button { flex: 0 0 auto; min-height: 44px; min-width: 44px; padding: 0 13px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 14px Georgia, serif; letter-spacing: .03em; cursor: pointer; }
button[aria-pressed="true"] { background: linear-gradient(#3a2d12, #241b0a); border-color: var(--gold); color: var(--gold2); }
button:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }
.tools button { font-size: 13px; padding: 0 11px; background: rgba(10, 9, 12, .55); }
#stats { position: fixed; top: calc(84px + env(safe-area-inset-top)); left: 12px; right: 12px; margin: 0; padding: 8px 10px; background: rgba(0,0,0,.6); border: 1px solid var(--line); border-radius: 8px; font: 11px/1.5 ui-monospace, Menlo, monospace; color: #d9cfb6; white-space: pre-wrap; pointer-events: none; }
#bench { position: fixed; inset: 12% 12px auto 12px; background: #0d0b0f; border: 1px solid var(--gold); border-radius: 10px; padding: 12px; max-height: 70%; overflow: auto; }
#bench h2 { margin: 0 0 8px; font-weight: normal; font-size: 16px; color: var(--gold2); }
#bench pre { font: 11px/1.4 ui-monospace, Menlo, monospace; white-space: pre-wrap; margin: 0 0 8px; }
@media (min-width: 900px) { #ui { left: 50%; right: auto; transform: translateX(-50%); width: 760px; border-radius: 14px 14px 0 0; } .row { flex-wrap: wrap; justify-content: center; } }
@media (prefers-reduced-motion: reduce) { #ui { transition: none; } }

/* P3 body controls */
.sel { flex: 0 0 auto; position: relative; display: inline-flex; align-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); padding: 0 6px 0 12px; }
.sel span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-right: 4px; }
.sel select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; color: var(--text); font: 14px Georgia, serif; min-height: 42px; padding: 0 18px 0 2px; max-width: 46vw; }
.sel::after { content: '▾'; position: absolute; right: 9px; color: var(--gold); pointer-events: none; font-size: 12px; }
.sel select option, .sel select optgroup { background: #0d0b0f; color: var(--text); }
.sel:focus-within { outline: 2px solid var(--gold2); outline-offset: 2px; }
#now { position: fixed; left: 16px; right: 16px; top: calc(78px + env(safe-area-inset-top)); font-size: 13px; letter-spacing: .06em; color: var(--gold2); text-shadow: 0 1px 6px #000; pointer-events: none; min-height: 1em; }
