:root {
  --pink: #fd267a;
  --orange: #ff6036;
  --grad: linear-gradient(45deg, var(--pink), var(--orange));
  --bg: #f5f6f8;
  --card: #fff;
  --text: #21262e;
  --muted: #656e7b;
  --green: #1be4a1;
  --red: #ff4458;
  --blue: #3ca4ff;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111418; --card: #1c2027; --text: #e9ebee; --muted: #9aa3ad; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }

header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px; background: var(--card); box-shadow: 0 1px 0 rgba(0,0,0,.08); position: sticky; top: 0; z-index: 10; }
.logo { text-decoration: none; font-weight: 800; font-size: 26px; letter-spacing: -1px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo small { font-size: 14px; letter-spacing: 0; font-weight: 600; }
.flame { -webkit-text-fill-color: initial; }
nav { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 600; font-size: 14px; }
nav a { text-decoration: none; color: var(--muted); }
nav a.active { color: var(--pink); }

main { max-width: 960px; margin: 0 auto; padding: 16px; }

/* login */
.login { max-width: 360px; margin: 10vh auto; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.big-flame { font-size: 72px; }
.login h1 { margin: 0; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login p { color: var(--muted); margin: 0; }
.login input { padding: 14px; border-radius: 30px; border: 1px solid #ccd; font-size: 16px; text-align: center; background: var(--card); color: var(--text); }
button.primary, .login button { padding: 14px; border: 0; border-radius: 30px; background: var(--grad); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; }
.login .bad { color: var(--red); }

/* deck */
.deck-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.deck { position: relative; width: min(400px, 100%); aspect-ratio: 4 / 5.6; }
.card { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; background: #222;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); touch-action: none; user-select: none; cursor: grab; will-change: transform; }
.card.dragging { cursor: grabbing; }
.card .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #ddd; pointer-events: none; }
.card .bars { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 4px; z-index: 2; }
.card .bars span { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.4); }
.card .bars span.on { background: #fff; }
.card .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 16px 16px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.85)); z-index: 2; }
.card .info h2 { margin: 0; font-size: 28px; }
.card .info h2 small { font-weight: 400; font-size: 18px; margin-left: 6px; }
.card .info .tagline { margin: 4px 0 8px; font-size: 15px; opacity: .95; }
.card .info .work { font-size: 13px; opacity: .85; }
.card .info .more { position: absolute; right: 14px; bottom: 16px; width: 32px; height: 32px; border-radius: 50%;
  background: #fff; color: #222; border: 0; font-weight: 800; cursor: pointer; }
.stamp { position: absolute; top: 40px; z-index: 3; font-size: 40px; font-weight: 900; padding: 4px 12px;
  border: 5px solid; border-radius: 8px; opacity: 0; letter-spacing: 2px; }
.stamp.like { left: 24px; color: var(--green); border-color: var(--green); transform: rotate(-20deg); }
.stamp.nope { right: 24px; color: var(--red); border-color: var(--red); transform: rotate(20deg); }
.stamp.super { left: 50%; top: auto; bottom: 160px; transform: translateX(-50%) rotate(-10deg); color: var(--blue); border-color: var(--blue); }

.buttons { display: flex; gap: 22px; align-items: center; }
.buttons button { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--card); font-size: 28px;
  box-shadow: 0 4px 14px rgba(0,0,0,.15); cursor: pointer; transition: transform .1s; }
.buttons button:active { transform: scale(.9); }
.buttons .nope { color: var(--red); }
.buttons .like { color: var(--green); }
.buttons .super { color: var(--blue); width: 52px; height: 52px; font-size: 22px; }
.buttons .rewind { color: #f5b748; width: 44px; height: 44px; font-size: 18px; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty .big { font-size: 64px; }

/* match overlay */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.85); color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 16px; animation: fade .2s; }
.overlay h1 { font-size: 52px; margin: 0; font-style: italic; background: linear-gradient(45deg, #fff, var(--green));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.overlay img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; background: #ddd; }
@keyframes fade { from { opacity: 0; } }

/* detail sheet */
.sheet { max-width: 520px; margin: 0 auto; background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.sheet .photos { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
.sheet .photos img { flex: 0 0 100%; width: 100%; aspect-ratio: 4/5; object-fit: cover; scroll-snap-align: start; background: #ddd; }
.sheet .body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.sheet h2 { margin: 0; }
.sheet h2 small { color: var(--muted); font-weight: 400; }
.sheet .handle { color: var(--muted); font-size: 13px; }
.sheet h3 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.sheet p { margin: 0; line-height: 1.45; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 12px; border-radius: 20px; border: 1px solid var(--muted); font-size: 13px; }
.chip.green { border-color: var(--green); }
.chip.red { border-color: var(--red); }
.prompt { border-radius: 12px; padding: 12px; background: var(--bg); }
.prompt .q { font-size: 13px; color: var(--muted); }
.prompt .a { font-size: 18px; font-weight: 600; margin-top: 4px; }
.lines li { margin-bottom: 6px; }

/* grids */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tile { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/5; background: #ccc; text-decoration: none; color: #fff; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .label { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.8)); font-weight: 700; }
.tile .label small { display: block; font-weight: 400; opacity: .85; font-size: 12px; }
.tile .badge { position: absolute; top: 8px; right: 8px; font-size: 20px; }
h2.section { margin: 24px 0 12px; }
.pair { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.pair img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #ddd; }
.pair .heart { font-size: 24px; }
.pair .lines { font-size: 14px; color: var(--muted); flex: 1; }
.pair .lines b { color: var(--text); }

pre.code { background: #111; color: #e6e6e6; padding: 14px; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.skill { max-width: 720px; margin: 0 auto; line-height: 1.5; }
.history { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.history img { width: 80px; height: 100px; object-fit: cover; border-radius: 8px; background: #ddd; }

.card .info .persona { font-size: 13px; font-style: italic; opacity: .9; margin-bottom: 6px; }
a.pair.convo { text-decoration: none; color: inherit; }
.thread { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.thread-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: center;
  background: var(--card); border-radius: 12px; padding: 12px; }
.thread-head img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #ddd; }
.thread-head small { color: var(--muted); }
.bubble { max-width: 80%; padding: 10px 14px; border-radius: 18px; line-height: 1.4; }
.bubble .who { font-size: 11px; opacity: .75; margin-bottom: 3px; }
.bubble.left { align-self: flex-start; background: var(--card); border-bottom-left-radius: 4px; }
.bubble.right { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
nav[hidden] { display: none; }
