/* Layout: one full-window 3D scene, with a glass panel floating over it. */
@font-face { font-family: Jost; font-weight: 200; font-display: swap; src: url(/fonts/jost-latin-200-normal.woff2) format("woff2"); }
@font-face { font-family: Jost; font-weight: 300; font-display: swap; src: url(/fonts/jost-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: Jost; font-weight: 400; font-display: swap; src: url(/fonts/jost-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Jost; font-weight: 500; font-display: swap; src: url(/fonts/jost-latin-500-normal.woff2) format("woff2"); }

:root {
  --ground: #000000;
  --ink: #EDEAE3;
  --ink-2: #BDB9B0;
  --glass: rgba(16, 16, 18, 0.72);
  --edge: rgba(237, 234, 227, 0.16);
  --rule: rgba(237, 234, 227, 0.12);
  color-scheme: dark;
}

html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--ground); color: var(--ink); font-family: Jost, Futura, "Century Gothic", sans-serif; font-weight: 300; }

#scene { position: fixed; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#scene.dragging { cursor: grabbing; }
#scene.over { cursor: pointer; }
#scene[hidden] { display: none; }

.ui { position: fixed; inset: 0; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between;
  padding-block: 22px 18px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.ui button, .panel { pointer-events: auto; }

/* Pale pieces drift behind the words at the window's edges, so those edges are dimmed. */
.ui::before, .ui::after { content: ""; position: fixed; left: 0; right: 0; height: 110px; z-index: -1; pointer-events: none; }
.ui::before { top: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.6) 55%, transparent); }
.ui::after { bottom: 0; height: 80px; background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent); }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 32px; padding-inline: 16px; }
.mark { font-size: 15px; font-weight: 400; letter-spacing: 0.62em; text-transform: uppercase; text-shadow: 0 0 12px #000; }
.worlds { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.worlds button { min-height: 44px; padding: 0 14px; background: none; border: 0; color: var(--ink-2); font: inherit; font-size: 15px; letter-spacing: 0.08em; cursor: pointer; text-shadow: 0 0 10px #000; }
.worlds button:hover { color: #fff; }
.worlds button[aria-pressed="true"] { color: #fff; box-shadow: inset 0 -1px 0 var(--ink); }

.bottom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; padding-inline: 16px; }
.status { min-width: 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); text-shadow: 0 0 10px #000; }

.panel { position: fixed; top: 84px; right: max(32px, env(safe-area-inset-right, 0px)); bottom: 32px; width: 340px; box-sizing: border-box; padding: 26px 26px 22px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--edge) transparent; background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border: 1px solid var(--edge); }
.panel:empty { display: none; }
.eyebrow { font-size: 13px; letter-spacing: 0.22em; color: var(--ink-2); }
.panel h2 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 300; text-wrap: balance; }
.panel h2:focus { outline: none; }
.panel p { margin: 0; font-size: 17px; line-height: 1.45; color: #D8D4CB; }
.panel .small { font-size: 14px; color: var(--ink-2); }
.panel .count { font-size: 17px; color: var(--ink); }

.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 15px; line-height: 1.4; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.jobs { display: flex; flex-direction: column; gap: 10px; }
.job { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; border-left: 1px solid var(--edge); }
.job p { font-size: 15px; }
.job .small { font-size: 14px; }
.job button { align-self: flex-start; margin-top: 6px; }
.job.failed { border-left-color: var(--ink); }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { border-top: 1px solid var(--rule); }
.list button { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0; background: none; border: 0; color: var(--ink); font: inherit; font-size: 17px; text-align: left; cursor: pointer; }
.list button:hover { color: #fff; }
.list button span { font-size: 13px; color: var(--ink-2); text-align: right; }
.list .reason { padding-bottom: 10px; font-size: 14px; color: var(--ink-2); }

.btn { min-height: 44px; padding: 0 22px; background: transparent; color: var(--ink); border: 1px solid rgba(237, 234, 227, 0.42); font: inherit; font-size: 15px; font-weight: 400; letter-spacing: 0.06em; cursor: pointer; }
.btn:hover { border-color: #fff; color: #fff; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* Adding and correcting */
.add-piece { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--rule); }
.add-piece label, .fieldrow label { font-size: 13px; letter-spacing: 0.16em; color: var(--ink-2); }
.fieldrow { display: flex; flex-direction: column; gap: 4px; }
.field { box-sizing: border-box; width: 100%; min-height: 44px; padding: 8px 12px; background: rgba(0, 0, 0, 0.45); color: var(--ink); border: 1px solid var(--edge); border-radius: 0; font: inherit; font-size: 16px; }
textarea.field { resize: vertical; line-height: 1.4; }
.field::placeholder { color: var(--ink-2); }
.field:focus { outline: none; border-color: #fff; }
.panel .name { color: var(--ink); }
.offer:empty { display: none; }
.offer { display: flex; flex-direction: column; gap: 10px; }
.thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.thumb { display: flex; flex-direction: column; gap: 4px; padding: 6px; min-height: 44px; background: rgba(0, 0, 0, 0.45); color: var(--ink-2); border: 1px solid var(--edge); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.thumb img { width: 100%; height: 110px; object-fit: contain; background: #111; }
.thumb[aria-pressed="true"] { border-color: #fff; color: #fff; box-shadow: inset 0 0 0 1px #fff; }
.choice { display: flex; flex-direction: column; gap: 6px; }
.choice .row { margin-top: 0; gap: 6px; }
.pick { padding: 0 12px; font-size: 14px; letter-spacing: 0.02em; }
.pick[aria-pressed="true"] { border-color: #fff; color: #fff; background: rgba(237, 234, 227, 0.16); }
.more summary { min-height: 44px; display: flex; align-items: center; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.more[open] { display: flex; flex-direction: column; gap: 10px; }
.linkbtn { min-height: 44px; padding: 0; background: none; border: 0; color: var(--ink-2); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; text-align: left; }
.linkbtn:hover { color: #fff; }
.apartline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.photo { align-self: flex-start; max-width: 100%; max-height: 150px; object-fit: contain; background: #111; border: 1px solid var(--rule); }
.confirm { display: flex; flex-direction: column; gap: 10px; padding-left: 12px; border-left: 1px solid #fff; }
.drop { position: fixed; inset: 12px; z-index: 10; display: flex; align-items: center; justify-content: center; border: 2px dashed #fff; background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 24px; pointer-events: none; }
.drop[hidden] { display: none; }

.tip { position: fixed; left: 0; top: 0; padding: 6px 10px; font-size: 14px; background: rgba(0, 0, 0, 0.72); pointer-events: none; white-space: nowrap; }
.tip[hidden] { display: none; }

button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 900px) {
  .panel { top: auto; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: 16px; width: auto; max-height: 46%; padding: 18px; }
  .bottom { display: none; }
}
