:root {
  --ink: #000000;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.55);
  --line: rgba(255, 255, 255, 0.5);
  --accent: #d97a5a;
  font-family: "PP Neue Montreal", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  padding: 1.5rem;
}

.frame {
  max-width: 1100px;
  margin: 0 auto;
  min-height: calc(100vh - 3rem);
  border: 1px solid var(--line);
  padding: 1.75rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2rem;
}

.header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  margin-bottom: 2.5rem;
}

.title {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  text-align: left;
  text-transform: uppercase;
}

.about-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
}

.about-btn:hover { opacity: 0.7; }

.layout {
  display: flex;
  gap: 3rem;
  flex: 1;
  margin-bottom: 2.5rem;
}

.sidebar {
  width: 170px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nav-action {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.nav-action:hover:not(:disabled) { text-decoration: underline; }

.nav-action:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.nav-action[hidden] { display: none; }

.nav-action-primary {
  color: var(--accent);
  font-weight: 600;
}

.nav-action-primary:disabled { color: rgba(217, 122, 90, 0.4); }

.camera-status {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: var(--accent);
}

.stage {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  flex: 1;
}

.tile {
  flex: 1;
  min-width: 240px;
}

.tile-frame {
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
}

.tile-frame video,
.tile-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

/* The matched artwork shows at its own natural aspect ratio, uncropped —
   not forced into the fixed 4:5 box the camera tile uses. */
.tile-frame.result {
  aspect-ratio: auto;
  height: auto;
  min-height: 120px;
}

.tile-frame.result img {
  position: static;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

.tile-label {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.countdown-overlay[hidden] { display: none; }

.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 2;
}

.countdown-overlay span {
  font-size: 4.5rem;
  font-weight: 500;
  color: #fff;
}

.caption { margin-top: 0.9rem; text-align: center; }

.obj-title {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.obj-meta {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.chain-btn {
  display: block;
  margin: 0.9rem auto 0;
  padding: 0.55rem 1.1rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.chain-btn:hover { background: rgba(255, 255, 255, 0.12); }

.bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.status {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.disclaimer {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: right;
}

.about-overlay[hidden] { display: none; }

.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  padding: 1.5rem;
}

.about-panel {
  position: relative;
  max-width: 560px;
  width: 100%;
  background: #000;
  border: 1px solid var(--line);
  padding: 2.2rem;
}

.about-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
}

.about-panel p {
  margin: 0;
  line-height: 1.65;
  color: var(--text);
  font-size: 0.95rem;
}

.about-close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

.about-close:hover { color: var(--text); }

@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; column-gap: 1.5rem; }
  .bottom { flex-direction: column; align-items: flex-start; }
  .disclaimer { text-align: left; }
}
