:root {
  --bg: #0f1115;
  --surface: #1a1d24;
  --surface-2: #232732;
  --text: #f3f4f6;
  --muted: #9aa0ab;
  --accent: #ff5a5f;
  --like: #2ecc71;
  --nope: #ff5a5f;
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.screen {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
}

/* ---- Brand / start + join ---- */
.brand { text-align: center; margin: 24px 0 28px; }
.brand h1 { font-size: 2.6rem; margin: 0; letter-spacing: -1px; }
.brand h1::before { content: "🍴 "; }
.tagline { color: var(--muted); margin: 6px 0 0; }

.card-form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span, legend { font-weight: 600; font-size: 0.95rem; }
.field small { color: var(--muted); font-weight: 400; }
fieldset.field { border: 0; padding: 0; margin: 0; }

input[type="text"] {
  background: var(--surface-2);
  border: 1px solid #2c303b;
  color: var(--text);
  border-radius: 12px;
  padding: 14px;
  font-size: 1rem;
}

.segmented, .checks { display: flex; gap: 10px; flex-wrap: wrap; }
.segmented label, .checks label {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid #2c303b;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}
.segmented input, .checks input { accent-color: var(--accent); }

.btn {
  display: inline-block;
  text-align: center;
  border: 0;
  border-radius: 12px;
  padding: 15px 18px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn.primary { background: var(--accent); color: white; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid #2c303b; }

/* ---- Deck screen ---- */
.deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.deck-header .who { color: var(--muted); font-size: 0.9rem; }
.deck-header .share { display: flex; align-items: center; gap: 8px; }
.deck-header code { background: var(--surface-2); padding: 4px 8px; border-radius: 8px; }
.deck-header .btn.ghost { padding: 8px 12px; font-size: 0.85rem; }

.deck { position: relative; flex: 1; }

.done-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}
.done-state p { margin: 6px 0; }

/* Card stack sits above the done-state; when empty, done-state shows through. */
.card-stack { position: relative; height: 70vh; }

.card {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
  transition: transform 0.25s ease;
  will-change: transform;
}

.card-photo {
  position: relative;
  height: 62%;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
}

.card-stamp {
  position: absolute;
  top: 18px;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 3px solid;
  opacity: 0;
  transition: opacity 0.1s;
}
.card-stamp.like { left: 18px; color: var(--like); border-color: var(--like); transform: rotate(-12deg); }
.card-stamp.nope { right: 18px; color: var(--nope); border-color: var(--nope); transform: rotate(12deg); }
.card[data-lean="like"] .card-stamp.like { opacity: 1; }
.card[data-lean="nope"] .card-stamp.nope { opacity: 1; }

.card-body { padding: 16px 18px 8px; flex: 1; }
.card-body h2 { margin: 0 0 6px; font-size: 1.4rem; }
.meta { margin: 4px 0; font-size: 0.95rem; }
.muted { color: var(--muted); }

.card-actions { display: flex; gap: 14px; padding: 12px 18px 18px; }
.card-actions form { flex: 1; margin: 0; }
.swipe-btn {
  width: 100%;
  font-size: 1.6rem;
  padding: 14px 0;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  background: var(--surface-2);
}
.swipe-btn.like { box-shadow: inset 0 0 0 2px var(--like); }
.swipe-btn.nope { box-shadow: inset 0 0 0 2px var(--nope); }

/* ---- Match reveal ---- */
.match-reveal { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 12px; }
.match-title { font-size: 2rem; margin: 8px 0; text-align: center; }
.match-card {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.match-card .card-photo { height: 220px; }
.match-card .btn.primary { display: block; margin: 12px 16px 18px; }
