/* Tokens taken from the "Xmas Treff Demo" design canvas. */
:root {
  --navy: #003647;
  --teal: #03758D;
  --teal-dark: #025A6C;
  --mint: #55C8BE;
  --mint-light: #E6F6F4;
  --coral: #FF9271;
  --coral-light: #FFE9E3;
  --lilac: #8A89F0;
  --sky: #8EC3F4;
  --ground: #F4FBFA;
  --surface: #FFFFFF;
  --text: #000000;
  --muted: #3D5C66;
  --line: #E3ECEE;
  --grip: #C9D6DA;
  --error: #B3261E;
  --shadow: 0 6px 24px rgba(0, 54, 71, 0.10);
  --display: Poppins, Verdana, sans-serif;
  --body: Verdana, Geneva, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--navy); }
body {
  margin: 0;
  font: 14px/1.5 var(--body);
  color: var(--text);
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
}
/* Phone-first. Touch screens use their full width, whatever it is (Android phones are often
   wider than 430px). Only on desktop, with a mouse, does the app sit in a phone-sized column. */
:root { --column: none; }
@media (hover: hover) and (pointer: fine) {
  :root { --column: 430px; }
}
.app {
  position: relative;
  max-width: var(--column);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--ground);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
@media (min-width: 480px) and (hover: hover) and (pointer: fine) {
  body:not(.wide) { background: var(--navy); }
  body:not(.wide) .app { box-shadow: 0 0 60px rgba(0, 0, 0, 0.25); }
}
body.wide .app { max-width: 1100px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; }
p { margin: 0; }
a { color: var(--teal); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.pad { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.pad-x { padding: 20px 20px 0; }
.bottom { margin-top: auto; }
.stack-gap { gap: 16px; }
.lead { font-size: 15px; }

.eyebrow { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal); }
.eyebrow.light { color: var(--mint); letter-spacing: 0.12em; position: relative; }
.section-title { font-size: 20px; color: var(--navy); }
.section-title.lg { font-size: 22px; }
.pad-x .section-title { font-size: 22px; margin-top: 4px; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: #fff;
  padding: 28px 24px 36px;
  flex-shrink: 0;
}
.hero > * { position: relative; }
.hero-art { position: absolute; top: 0; left: 0; }
.logo { display: block; }
.hero .eyebrow { margin-top: 72px; }
.hero-title { margin-top: 6px; font-size: 40px; line-height: 1.1; }
.hero-title.md { font-size: 30px; line-height: 1.15; }
.hero-lead { margin-top: 12px; font-size: 15px; max-width: 280px; }
.hero.match { padding: 24px 24px 32px; }
.hero.match .party { display: block; margin-top: 60px; }
.hero.match .hero-title { margin-top: 16px; font-size: 32px; }
.hero.match .hero-lead { max-width: none; margin-top: 10px; }
.hero.nomatch .eyebrow { margin-top: 110px; }

/* Steps */
.steps { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 600;
}

/* Forms & buttons */
.login { padding-top: 4px; }
label { font-weight: bold; color: var(--navy); font-size: 13px; }
input[type=email] {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  font: 16px var(--body);
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 26px;
}
input[type=email]:focus { outline: none; border-color: var(--teal); }
input[aria-invalid=true] { border-color: var(--error); }
.error { color: var(--error); font-size: 13px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 26px;
  font: 600 15px var(--display);
  text-decoration: none;
  cursor: pointer;
  border: none;
}
.btn.primary { background: var(--navy); color: #fff; font-size: 16px; }
.btn.primary:hover { background: #00495f; }
.btn.outline { background: var(--surface); color: var(--navy); border: 2px solid var(--navy); font: 14px var(--body); min-height: 48px; }
.btn.light { background: #fff; color: var(--navy); margin-top: 10px; }
.btn.auto { width: auto; padding: 0 24px; }
.btn.sm { min-height: 34px; font-size: 13px; padding: 0 14px; width: auto; }
.btn.danger { background: var(--error); color: #fff; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }

/* Full-screen states */
.fullscreen {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 32px; text-align: center;
}
.fullscreen.navy { background: var(--navy); color: #fff; gap: 20px; }
.fs-title { font-size: 20px; }
.fs-sub { font-size: 13px; color: var(--mint); max-width: 280px; }
.fs-link { color: #fff; font-size: 13px; }
.dots { display: flex; gap: 8px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.dots span:nth-child(2) { background: var(--coral); }
.dots span:nth-child(3) { background: var(--lilac); }
.mock {
  width: 100%;
  padding: 16px;
  border: 1px dashed var(--mint);
  border-radius: 16px;
  font-size: 13px;
  text-align: left;
}

/* App bar + menu */
.appbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--navy); color: #fff;
  padding: 7px 15px 7px 20px;
  display: flex; align-items: center; gap: 12px;
}
.appbar-title { font: 600 16px var(--display); flex-grow: 1; }
.appbar-hello { font-size: 13px; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: -3px; top: 50px;
  width: 240px;
  background: var(--surface); color: var(--text);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 54, 71, 0.22);
  overflow: hidden;
}
.menu-who { padding: 14px 16px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.menu-name { font-weight: bold; color: var(--navy); }
.menu-item { min-height: 48px; padding: 0 16px; display: flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; }
.menu-item:hover { background: var(--ground); }

/* Avatars */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  color: var(--navy);
  font-family: var(--display); font-weight: 600;
  object-fit: cover;
}
.avatar.sm { width: 34px; height: 34px; font: bold 12px var(--body); }
.avatar.md { width: 52px; height: 52px; }
.menu-who .avatar.md { width: 40px; height: 40px; font: bold 13px var(--body); }
.avatar.lg { position: absolute; left: 24px; bottom: -40px; width: 84px; height: 84px; border: 4px solid #fff; font-size: 28px; }
.avatar.ring { border: 3px solid #fff; }

/* Personal page */
.home { padding-bottom: 32px; }
.home.has-actions { padding-bottom: 150px; }
/* Swipe screen: fit the viewport exactly; the card takes the leftover height
   and scrolls its own text if a profile is long, so the page never scrolls. */
.app:has(> .home.has-actions) { height: 100dvh; }
/* A sloppy swipe on the card must not trigger the browser's pull-to-refresh. */
html:has(.home.has-actions),
html:has(.home.has-actions) body { overscroll-behavior-y: none; }
.home.has-actions { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.home.has-actions .stack { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.home.has-actions .card { flex: 1; min-height: 0; }
.banner {
  margin: 16px 20px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--coral-light);
  display: flex; gap: 12px; align-items: center;
  font-size: 13px;
}
.teaser {
  margin: 16px 20px 0;
  padding: 14px;
  border-radius: 16px;
  background: var(--mint-light);
  border: 2px solid var(--teal);
  display: flex; gap: 12px; align-items: center;
  color: var(--navy); text-decoration: none;
}
.teaser div { flex-grow: 1; display: flex; flex-direction: column; font-size: 13px; }
.teaser strong { font-size: 15px; font-family: var(--display); }
.teaser.muted-teaser { background: var(--surface); border-color: var(--line); }

.stack { position: relative; margin: 14px 20px 0; }
.stack-behind {
  position: absolute; top: 12px; left: 14px; right: 14px; bottom: -12px;
  background: var(--surface); border-radius: 22px;
  box-shadow: 0 4px 16px rgba(0, 54, 71, 0.08); opacity: 0.7;
}
.card {
  position: relative;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  transition: transform 0.25s ease;
  display: flex; flex-direction: column;
}
.card.dragging { transition: none; cursor: grabbing; }
.card-head { position: relative; height: 92px; flex-shrink: 0; }
.card-head .avatar.lg { z-index: 1; }
.card-body { flex-grow: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 48px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.card-name { font-size: 22px; color: var(--navy); }
.bio { line-height: 1.6; }
.chip-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal); font-weight: bold; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 16px; color: var(--navy); font-size: 13px; }
.stamp {
  position: absolute; top: 18px; z-index: 2;
  padding: 4px 14px;
  border: 3px solid; border-radius: 10px;
  background: #fff;
  font: 600 22px var(--display);
  opacity: 0; pointer-events: none;
}
.stamp.yes { left: 18px; color: var(--teal); transform: rotate(-12deg); }
.stamp.no { right: 18px; color: var(--navy); transform: rotate(12deg); }

.actions {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--column); z-index: 5;
  padding: 40px 0 calc(28px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(244, 251, 250, 0), var(--ground) 45%);
  display: flex; justify-content: center; gap: 72px; align-items: flex-start;
}
.round-btn {
  border: none; background: none; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--navy); font: 12px var(--body);
}
.round-btn.yes-label { color: var(--teal); font-weight: bold; }
.circle { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; }
.circle.no { border: 2px solid var(--navy); background: #fff; box-shadow: 0 6px 18px rgba(0, 54, 71, 0.18); }
.circle.yes { background: var(--teal); box-shadow: 0 6px 18px rgba(3, 117, 141, 0.40); }

.panel {
  margin: 16px 20px 0;
  background: var(--surface);
  border-radius: 22px;
  padding: 28px 22px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  font-size: 13px;
}
.panel-title { font: 600 18px var(--display); color: var(--navy); }
.panel .btn { width: auto; padding: 0 18px; }

/* Leave sheet */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(0, 54, 71, 0.55);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
}
.sheet {
  width: 100%; max-width: var(--column);
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 12px 24px calc(32px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
.sheet-grip { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--grip); }
.sheet .section-title { margin-top: 8px; }
.sheet form { display: contents; }

/* Match / no match */
.match-card {
  position: relative;
  margin: -16px 20px 0;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: 0 6px 24px rgba(0, 54, 71, 0.12);
  padding: 20px;
  display: flex; flex-direction: column; gap: 18px;
}
.match-card hr { border: 0; height: 1px; background: var(--line); margin: 0; width: 100%; }
.match-who { display: flex; align-items: center; gap: 14px; }
.avatar-pair { display: flex; }
.avatar-pair .avatar + .avatar { margin-left: -14px; }
.match-name { font: 600 17px var(--display); color: var(--navy); }
.fact { display: flex; gap: 14px; align-items: center; }
.fact.topic { align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--mint-light); }
.topic-label { color: var(--teal-dark); }
.tip {
  display: flex; gap: 14px; align-items: center;
  padding: 14px; border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(0, 54, 71, 0.08);
  font-size: 13px;
}

/* Admin */
.admin { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.reset { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border: 2px solid var(--error); border-radius: 14px; }
.reset label { display: flex; gap: 8px; align-items: center; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: normal; }
.mail { background: var(--surface); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.mail summary { cursor: pointer; }
.mail pre { white-space: pre-wrap; font: 13px/1.5 var(--body); margin: 10px 0 0; }

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}
