:root { --gold: #E2B95C; --gold2: #f5dc9a; --ink: #f3efe6; --mute: rgba(243,239,230,.62); --panel: rgba(12,13,15,.55); --line: rgba(226,185,92,.35); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #15171a; color: var(--ink);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body.theme-light { background: #d8d9db; --ink: #17181a; --mute: rgba(23,24,26,.62); --panel: rgba(255,255,255,.62); --line: rgba(150,115,40,.45); }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

.title { position: fixed; top: max(18px, env(safe-area-inset-top)); left: 22px; pointer-events: none; }
.title h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: .01em; color: var(--gold); }
.title h1 span { color: var(--ink); font-weight: 500; }
.title p { margin: 4px 0 0; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }

.spec { position: fixed; top: 92px; left: 22px; width: 250px; padding: 12px 14px; border-left: 2px solid var(--gold);
  background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 0 8px 8px 0; font-size: 12.5px; }
.spec dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; }
.spec dt { color: var(--gold); font-weight: 600; text-transform: uppercase; font-size: 10.5px; letter-spacing: .08em; padding-top: 2px; }
.spec dd { margin: 0; color: var(--ink); }

.caption { position: fixed; right: 22px; top: max(20px, env(safe-area-inset-top)); max-width: 300px; text-align: right; font-size: 14px; line-height: 1.4;
  color: var(--ink); text-shadow: 0 1px 3px rgba(0,0,0,.45); transition: opacity .35s; }
.caption b { display: block; color: var(--gold); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 3px; }
body.theme-light .caption { text-shadow: none; }

.views { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(52px + env(safe-area-inset-bottom)); display: flex; gap: 6px;
  padding: 6px; background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 12px; max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; }
.views::-webkit-scrollbar { display: none; }
button { font: inherit; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.views button { padding: 8px 12px; font-size: 13.5px; }
.views button b { display: inline-block; margin-right: 6px; font-size: 11px; color: var(--gold); opacity: .8; }
.views button:hover { border-color: var(--line); }
.views button.on { background: var(--gold); color: #17140c; }
.views button.on b { color: #17140c; }

.toggles { position: fixed; right: 22px; bottom: calc(110px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; }
.toggles button { padding: 8px 12px; font-size: 13px; background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-color: var(--line); text-align: left; min-width: 132px; }
.toggles button i { font-style: normal; color: var(--gold); float: right; margin-left: 12px; }

.hint { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 22px calc(10px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; gap: 16px;
  font-size: 12px; color: var(--mute); pointer-events: none; }
.hint .disc { font-style: italic; }

#loader { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: #15171a; transition: opacity .6s; z-index: 5; }
#loader p { margin: 0; color: var(--mute); font-size: 14px; letter-spacing: .08em; }
#loader .ring { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(226,185,92,.2); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body.capture .hint, body.capture .toggles { display: none; }

@media (max-width: 760px) {
  .title { left: 14px; top: max(12px, env(safe-area-inset-top)); }
  .title h1 { font-size: 17px; } .title h1 span { display: block; font-size: 14px; }
  .title p { font-size: 11px; }
  .spec { display: none; }
  .caption { left: 14px; right: 14px; top: auto; bottom: calc(150px + env(safe-area-inset-bottom)); max-width: none; text-align: left; font-size: 13px; }
  .toggles { right: auto; left: 8px; right: 8px; bottom: calc(100px + env(safe-area-inset-bottom)); flex-direction: row; justify-content: center; }
  .toggles button { min-width: 0; font-size: 12px; padding: 7px 9px; }
  .views { bottom: calc(44px + env(safe-area-inset-bottom)); }
  .views button { font-size: 12.5px; padding: 8px 10px; }
  .hint { flex-direction: column; gap: 2px; padding: 6px 14px calc(6px + env(safe-area-inset-bottom)); font-size: 11px; text-align: center; }
}
#loader.done { opacity: 0; pointer-events: none; }

.closeview .spec { opacity: 0; pointer-events: none; }
.spec { transition: opacity .3s; }
