:root {
  --fg: #111;
  --bg: #fafafa;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
}

/* Picker screen */
#picker {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
#picker h1 {
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 600;
  margin: 0 0 6px;
  text-align: center;
}
#picker p.sub {
  font-size: 14px;
  color: #666;
  margin: 0 0 26px;
  text-align: center;
  max-width: 520px;
}
.pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 720px;
}
.pair-btn {
  position: relative;
  border: none;
  border-radius: 14px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  height: 84px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  color: #fff;
  font-family: inherit;
}
.pair-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(0,0,0,0.16); }
.pair-btn:active { transform: translateY(0); }
.pair-btn .label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
@media (max-width: 520px) {
  .pair-grid { grid-template-columns: 1fr; }
  .pair-btn { height: 70px; }
}

/* Test screen */
#app {
  display: none;
  height: 100vh;
  width: 100vw;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  transition: background-color 0.2s ease;
}
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}
.title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: rgba(0,0,0,0.55);
  pointer-events: auto;
}
.progress {
  font-size: 13px;
  color: rgba(0,0,0,0.55);
  font-variant-numeric: tabular-nums;
  pointer-events: auto;
}
.question {
  margin-top: auto;
  text-align: center;
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 500;
  color: rgba(0,0,0,0.7);
  padding: 24px 16px 8px;
  user-select: none;
}
.buttons {
  display: flex;
  gap: 16px;
  padding: 18px 18px 32px;
  justify-content: center;
  margin-bottom: auto;
}
button.choice {
  flex: 1;
  max-width: 280px;
  padding: 18px 24px;
  font-size: 20px;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  transition: transform 0.08s ease, box-shadow 0.2s ease;
  letter-spacing: 0.5px;
}
button.choice:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.18); }
button.choice:active { transform: translateY(1px); }

/* Results screen */
#results {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 20;
  overflow-y: auto;
  padding: 40px 20px 60px;
}
#results .inner {
  max-width: 720px;
  margin: 0 auto;
}
#results h1 {
  font-size: clamp(24px, 4vw, 36px);
  margin: 0 0 12px;
  font-weight: 600;
}
#results p {
  font-size: 16px;
  line-height: 1.55;
  color: #333;
  margin: 8px 0;
}
.boundary-display {
  margin: 28px 0 16px;
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 18px rgba(0,0,0,0.06);
}
.gradient-bar {
  position: relative;
  height: 60px;
  border-radius: 10px;
  margin: 14px 0 32px;
  overflow: visible;
}
.gradient-fill {
  position: absolute;
  inset: 0;
  border-radius: 10px;
}
.marker {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 4px;
  background: #111;
  border-radius: 2px;
  transform: translateX(-2px);
}
.marker::after {
  content: attr(data-label);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
}
.marker.you::after {
  top: auto;
  bottom: -22px;
}
.swatch-row {
  display: flex;
  gap: 12px;
  margin: 18px 0;
  align-items: center;
  flex-wrap: wrap;
}
.swatch {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.swatch-label {
  font-size: 13px;
  color: #555;
}
.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.actions button {
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
}
.actions button.primary {
  background: #111;
  color: #fff;
  border-color: #111;
}
.footer-note {
  text-align: center;
  font-size: 12px;
  color: rgba(0,0,0,0.4);
  padding: 8px 0 14px;
}
.keys {
  text-align: center;
  font-size: 12px;
  color: rgba(0,0,0,0.5);
  padding-bottom: 6px;
}
.exit-row {
  display: flex;
  justify-content: center;
  padding: 4px 0 10px;
}
button.exit-btn {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.15);
  color: rgba(0,0,0,0.7);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  backdrop-filter: blur(4px);
  transition: background 0.15s ease, transform 0.08s ease;
}
button.exit-btn:hover { background: rgba(255,255,255,0.85); }
button.exit-btn:active { transform: translateY(1px); }
@media (max-width: 480px) {
  button.choice { font-size: 17px; padding: 16px; }
  .question { font-size: 22px; }
}
