:root {
  --orange: #ff8000;
  --ink: #14110e;
  --paper: #faf7f3;
  --muted: #9a9089;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

#stage.dragging {
  cursor: grabbing;
}

/*
 * Drop zone — also the empty state, so it covers the canvas until an image
 * loads. It never takes pointer events itself: showing it mid-drag would
 * otherwise change the element under the cursor and fire a stray
 * dragenter/dragleave pair at the counter in app.js.
 */
.drop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 2rem;
  text-align: center;
  background: radial-gradient(
    circle at 50% 40%,
    rgba(255, 128, 0, 0.16),
    transparent 55%
  );
  transition: background-color 0.15s ease;
}

.drop[hidden] {
  display: none;
}

.drop.over {
  background-color: rgba(255, 128, 0, 0.12);
  outline: 2px dashed var(--orange);
  outline-offset: -1.5rem;
}

.mark {
  width: 4rem;
  height: 4rem;
  margin-bottom: 0.5rem;
  color: var(--paper);
}

.drop h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.drop p {
  margin: 0;
  color: var(--muted);
}

.drop .fine {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

button {
  pointer-events: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--orange);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.hud {
  position: fixed;
  top: 1rem;
  left: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem 0.4rem 0.6rem;
  border-radius: 999px;
  background: rgba(20, 17, 14, 0.6);
  backdrop-filter: blur(6px);
  font-size: 0.85rem;
  font-weight: 500;
}

.hud-mark {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
}

.hud[hidden],
.hint[hidden],
.error[hidden],
.panel[hidden] {
  display: none;
}

/* Thumbnail rail, plus Clear all beneath it. */
.panel {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: calc(100vh - 2rem);
  padding: 0.5rem;
  border-radius: 0.75rem;
  background: rgba(20, 17, 14, 0.6);
  backdrop-filter: blur(6px);
}

/* Only the tiles scroll, so Clear all stays reachable however many are loaded. */
.rail {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#clear {
  flex: none;
  padding: 0.15rem 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
}

#clear:hover {
  color: var(--orange);
}

.shot {
  position: relative;
  flex: none;
}

.shot .pick {
  display: block;
  padding: 0;
  border-radius: 0.4rem;
  line-height: 0;
  text-decoration: none;
  outline-offset: 2px;
}

.shot img {
  display: block;
  width: 7rem;
  height: 3.5rem;
  border: 2px solid transparent;
  border-radius: 0.4rem;
  opacity: 0.65;
  transition:
    opacity 0.15s ease,
    border-color 0.15s ease;
}

.shot:hover img {
  opacity: 1;
}

.shot.active img {
  border-color: var(--orange);
  opacity: 1;
}

/*
 * Inside the thumbnail, not hanging off its corner: the rail scrolls, and
 * overflow-y also clips the x-axis, so anything outside the tile is cut off.
 */
.shot .remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: rgba(20, 17, 14, 0.75);
  color: var(--paper);
  font-size: 0.8rem;
  line-height: 1.25rem;
  text-align: center;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.shot:hover .remove,
.shot .remove:focus-visible {
  opacity: 1;
}

.shot .remove:hover {
  color: var(--orange);
}

.hint {
  position: fixed;
  bottom: 1.25rem;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.error {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  background: rgba(20, 17, 14, 0.8);
  font-size: 0.85rem;
  color: var(--orange);
}

@media (hover: none) {
  .shot .remove {
    opacity: 1;
  }
}
