:root {
  --bg: #f3efe7;
  --ink: #1d1a16;
  --muted: #7a7266;
  --line: #ddd5c7;
  --panel: #fbf8f2;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(60% 60% at 50% 55%, #fffaf0, var(--bg));
  color: var(--ink);
  font: 400 14px/1.45 Inter, system-ui, sans-serif;
}

button,
input {
  font: inherit;
  color: inherit;
}

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 22px 28px 0;
  pointer-events: none;
}

.top > * {
  pointer-events: auto;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 14px;
  font: 600 clamp(26px, 3.6vw, 44px) / 1 Fraunces, Georgia, serif;
}

.search {
  display: flex;
  gap: 8px;
  max-width: 520px;
}

.search input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.search button,
.ideas button {
  padding: 8px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--panel);
  cursor: pointer;
}

.ideas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.ideas button {
  padding: 4px 11px;
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.status {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.stage {
  position: fixed;
  inset: 0;
  cursor: grab;
  touch-action: none;
}

.stage.dragging {
  cursor: grabbing;
}

/* Tiles are positioned in 2D from the sphere maths in app.js. */
.tile {
  position: absolute;
  top: 0;
  left: 0;
  width: 74px;
  height: 74px;
  margin: -37px 0 0 -37px;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--c);
  border-radius: 50%;
  background: var(--c) center / cover no-repeat;
  box-shadow: 0 6px 18px rgb(40 30 20 / 0.25);
  cursor: pointer;
  transition: opacity 0.4s, filter 0.4s;
  will-change: transform;
}

.tile.dim {
  opacity: 0.08 !important;
  filter: grayscale(1);
}

.tile.hit {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--ink), 0 10px 30px rgb(40 30 20 / 0.35);
}

.detail {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 6;
  width: min(380px, calc(100vw - 32px));
  padding: 18px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 20px 60px rgb(40 30 20 / 0.2);
}

.detail img {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: var(--line);
}

.detail h2 {
  margin: 14px 0 4px;
  font: 600 20px/1.2 Fraunces, Georgia, serif;
}

.detail p {
  margin: 0 0 12px;
  color: var(--muted);
}

.chips {
  display: flex;
  height: 26px;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 6px;
}

.chips span {
  flex: 1;
}

.detail a {
  color: var(--ink);
}

.close {
  position: absolute;
  top: 6px;
  right: 10px;
  z-index: 1;
  border: 0;
  background: none;
  color: var(--panel);
  font-size: 30px;
  text-shadow: 0 1px 4px rgb(0 0 0 / 0.6);
  cursor: pointer;
}

.legend {
  position: fixed;
  left: 28px;
  bottom: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notice {
  position: fixed;
  inset: auto 16px 20px;
  margin: 0;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
}

@media (max-width: 700px) {
  .tile {
    width: 52px;
    height: 52px;
    margin: -26px 0 0 -26px;
  }

  .ideas {
    display: none;
  }
}
