:root {
  --ink: #f4efe6;
  --muted: #c9bfae;
  --accent: #ffd23f;
  --known: #8fe3b0;
  --guessed: #ffc07a;
  --glass: rgba(18, 16, 13, 0.84);
  --line: rgba(255, 255, 255, 0.16);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; -webkit-user-select: none; user-select: none;   /* (a scrape mustn't select the card's words) */
  background: #c7d2d9; color: var(--ink); touch-action: none;
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
canvas { display: block; width: 100vw; height: 100vh; }
.title { position: fixed; left: 24px; top: 16px; pointer-events: none; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.title h1 { margin: 0; font: 600 34px/1.1 Georgia, "Times New Roman", serif; }
.title h1 span { color: var(--accent); }
.title p { margin: 4px 0 0; color: #eee8dc; }
.card { position: fixed; right: 16px; top: 16px; width: min(400px, calc(100vw - 32px)); max-height: calc(100vh - 120px);
  overflow: auto; padding: 18px 20px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); }
.card h2 { margin: 0 0 8px; font: 600 22px/1.25 Georgia, serif; }
.card .kicker { margin: 0 0 4px; padding-right: 40px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.card blockquote { margin: 10px 0; padding-left: 12px; border-left: 3px solid var(--accent); color: #f1e6c8; font-style: italic; }
.card blockquote cite { display: block; margin-top: 4px; font-style: normal; font-size: 13px; color: var(--muted); }
.card .fig { margin: 12px 0; }
.card .fig .pic { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; }
.card .fig img { display: block; max-width: 100%; max-height: 240px; border-radius: 6px; }
/* the report's photographs, blurred until we're allowed to show them (tools/blur-figs.mjs, dig.json figsWithheld) */
.card .fig .withheld { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 6px 14px;
  border-radius: 999px; background: rgba(18, 16, 13, 0.82); color: #f1e6c8; font-size: 14px; white-space: nowrap; pointer-events: none; }
/* a find's model, turning, where its photograph would be (dig.js showFig, finds.js turntable) */
.card .fig .pic.with-model { width: 100%; height: 220px; }
.card .fig img[hidden] { display: none; }
.card .fig .pic.with-model canvas { display: block; width: 100%; height: 100%; border-radius: 10px; touch-action: none;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.25)); }
.card .fig figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); }
.card .label { margin: 8px 0 0; font-size: 14px; color: var(--known); }
.card .close { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, 0.1); color: var(--ink); font-size: 22px; cursor: pointer; }
.hint { position: fixed; left: 24px; bottom: 76px; margin: 0; max-width: 560px; font-size: 14px; color: #eee8dc;
  text-shadow: 0 1px 4px #000; pointer-events: none; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.bar button { border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 999px; padding: 10px 18px; background: var(--glass);
  color: var(--ink); font: 600 16px system-ui, sans-serif; cursor: pointer; }
.bar button:disabled { opacity: 0.4; cursor: default; }
.bar #btn-vr { background: var(--accent); color: #1b1600; border-color: var(--accent); }
.bar button[aria-pressed="true"] { background: var(--accent); color: #1b1600; border-color: var(--accent); }
.loading { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; padding: 12px 22px;
  border-radius: 999px; background: var(--glass); }
@media (max-width: 640px) {
  .title h1 { font-size: 26px; }
  .card { top: auto; bottom: 120px; max-height: 40vh; }
  .card .fig img { max-height: 150px; }
  .card .fig .pic.with-model { height: 170px; }
  .card.layer { max-height: 30vh; }               /* a layer's card leaves the trench in view; it scrolls */
  body:has(.card:not([hidden])) .title p { display: none; }   /* room for the find, held up between the title and the card */
  .hint { bottom: 120px; }
  .card:not([hidden]) ~ .hint { display: none; }
  .bar button:disabled { display: none; }   /* a phone has room for two rows: what can't be tapped goes, so the bar stays under the card */
}
/* a marker over each flag on screen: the 3D flags are a few pixels across from where you look (Ben, 1 Nov: "how do i
   find anything on the dig?"); orange until looked at, then pale; a gentle pulse while not yet looked at */
.flags { position: fixed; inset: 0; pointer-events: none; }
.flags button { position: absolute; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; padding: 0; border-radius: 50%;
  border: 2px solid #fff; background: #ff6a1a; color: #fff; font-size: 17px; line-height: 1; pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); animation: flagpulse 1.6s ease-in-out infinite; }
.flags button.seen { background: #f4b48c; animation: none; }
.flags button.new:not(.seen) { animation: flagpop 0.5s cubic-bezier(.3, 1.8, .5, 1), flagpulse 1.6s ease-in-out 0.5s infinite; }
@keyframes flagpop { from { transform: scale(0); } to { transform: scale(1); } }
.flags button[hidden] { display: none; }
@keyframes flagpulse { 50% { transform: scale(1.18); } }
@media (pointer: coarse) { .flags button { width: 40px; height: 40px; margin: -20px 0 0 -20px; } }
.card:not([hidden]) ~ .flags { display: none; }
/* the hint's offer when you're stuck, and the glint it puts on the soil over something hidden */
.hint-me { margin-left: 6px; padding: 4px 12px; border: 1px solid #ffb27a; border-radius: 999px; background: rgba(255, 106, 26, 0.22);
  color: #fff; font: 600 14px system-ui, sans-serif; pointer-events: auto; cursor: pointer; }
.glint { position: absolute; left: 0; top: 0; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%; pointer-events: none;
  border: 3px solid rgba(255, 236, 190, 0.95); box-shadow: 0 0 18px 4px rgba(255, 214, 140, 0.8), inset 0 0 18px 4px rgba(255, 214, 140, 0.6);
  background: radial-gradient(circle, rgba(255, 246, 215, 0.9) 0, rgba(255, 214, 140, 0.45) 35%, rgba(255, 200, 120, 0) 70%);
  animation: glint 1.1s ease-in-out infinite; }
.glint::after { content: "\2726"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 34px;
  text-shadow: 0 0 10px #ffd58a; }
.glint[hidden] { display: none; }
@keyframes glint { 0%, 100% { transform: scale(0.6); opacity: 0.4; } 50% { transform: scale(1.1); opacity: 1; } }
/* the finds tray: under the title (a phone: top right), a count; open, a shelf of what's been found (each a picture taken as it came clean) and an
   empty slot for each still in the ground */
.tray { position: fixed; left: 24px; top: 96px; z-index: 5; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }   /* (under the title: the card is top right) */
.tray-btn { border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; background: var(--glass); color: var(--ink);
  font: 600 15px/1.2 system-ui, sans-serif; cursor: pointer; }
.tray-btn.bump { animation: traybump 0.6s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes traybump { 40% { transform: scale(1.25); background: var(--accent); color: #1b1600; } }
.tray-shelf { display: grid; grid-template-columns: repeat(4, 56px); gap: 6px; padding: 10px; border-radius: 14px; background: var(--glass);
  border: 1px solid var(--line); }
.tray-shelf[hidden] { display: none; }
.tray-shelf button { width: 56px; height: 56px; padding: 0; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, #4a4237, #1d1a16); }
.tray-shelf button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tray-shelf .empty { cursor: default; background: rgba(255, 255, 255, 0.04); border-style: dashed; color: var(--muted); font-size: 18px; }
.card:not([hidden]) ~ .tray .tray-shelf { display: none; }
@media (max-width: 640px) {
  .tray { top: auto; left: auto; right: 12px; top: 12px; align-items: flex-end; }
  .tray-btn { font-size: 14px; padding: 7px 12px; }
  .tray-shelf { grid-template-columns: repeat(4, 50px); }
  .tray-shelf button { width: 50px; height: 50px; }
  body:has(.card:not([hidden])) .tray { display: none; }    /* the card has the screen; the find is held up in the middle */
}
.card-go { margin: 12px 0 0; }
.card .action { border: 0; border-radius: 999px; padding: 12px 20px; background: var(--accent); color: #1b1600; font: 700 17px/1.2 system-ui, sans-serif; cursor: pointer; }
.card .action[hidden] { display: none; }
.card.reward { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255, 210, 63, 0.35), 0 10px 40px rgba(0, 0, 0, 0.5); }
/* ?kiosk: for a screen left running in the museum. While nobody's there, the view turns slowly and this asks to be touched */
.attract { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; text-align: center;
  padding: 22px 30px; border-radius: 22px; background: var(--glass); border: 1px solid var(--line); animation: attractpulse 2.4s ease-in-out infinite; }
.attract[hidden] { display: none; }
.attract p { margin: 0 0 6px; font: 600 30px/1.2 Georgia, serif; color: var(--accent); }
.attract span { color: var(--ink); font-size: 18px; }
@keyframes attractpulse { 50% { transform: translate(-50%, -50%) scale(1.04); } }
html.kiosk, html.kiosk * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.kiosk body.idle-now { cursor: none; }
