:root {
  color-scheme: light;
  --bg: #f6f2eb;
  --ink: #151515;
  --muted: #6e675f;
  --line: #d8d0c6;
  --panel: #fffdf8;
  --accent: #0b6b53;
  --accent-ink: #ffffff;
  --focus: #c84830;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #050505;
}

.topbar {
  position: fixed;
  z-index: 10;
  top: 10px;
  left: 10px;
  display: grid;
  grid-template-columns: auto auto;
  gap: 12px;
  align-items: center;
  min-height: 0;
  width: max-content;
  max-width: calc(100vw - 20px);
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(5, 5, 5, 0.42);
  color: white;
  backdrop-filter: blur(10px);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: 0;
}

#progress {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.setToggle {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 6px;
}

.setToggle button {
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 6px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  font-size: 12px;
}

.setToggle button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.meter {
  position: fixed;
  z-index: 12;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 160ms ease;
}

.introCard {
  position: fixed;
  z-index: 20;
  top: 78px;
  left: 10px;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 20px));
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(5, 5, 5, 0.62);
  color: white;
  backdrop-filter: blur(12px);
}

.introCard[hidden] {
  display: none;
}

.introCard h2 {
  font-size: 18px;
  line-height: 1.1;
}

.introCard p {
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  line-height: 1.35;
}

.introCard button {
  justify-self: start;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  cursor: pointer;
}

.stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  width: 100vw;
  height: 100vh;
  margin: 0;
  min-height: 0;
  background: #050505;
}

.choice {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #050505;
  overflow: hidden;
  cursor: pointer;
}

.choice:hover {
  box-shadow: inset 0 0 0 3px var(--accent);
}

.choice:focus-visible {
  outline: 4px solid color-mix(in srgb, var(--focus) 45%, transparent);
  outline-offset: 2px;
}

.choice img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.choiceLabel {
  position: absolute;
  top: 12px;
  left: 12px;
  min-width: 48px;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(21, 21, 21, 0.78);
  color: white;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.done {
  margin: 72px auto 0;
  max-width: 520px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
}

.done h2 {
  font-size: 32px;
  line-height: 1.1;
}

.done p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 18px;
}

.secondary {
  margin-top: 24px;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.review {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.reviewItem {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.reviewItem img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.reviewItem p {
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px) {
  .app {
    width: 100vw;
    padding-top: 0;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
    width: calc(100vw - 20px);
  }

  .setToggle {
    grid-template-columns: repeat(3, 1fr);
  }

  .stage {
    grid-template-columns: 1fr;
  }

  .choice {
    min-height: 0;
  }

  .choice img {
    max-height: none;
  }
}
