/* Retro online-game window skin with our own palette: periwinkle frame, indigo outlines,
   tangerine and honey accents. Drawn with CSS plus our own mark.svg. No game images or fonts. */
@font-face { font-family: "Fredoka"; src: url("/fonts/fredoka-latin-wght-normal.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("/fonts/silkscreen-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --frame: #a9b5d4;
  --frame-dark: #7f8cb4;
  --frame-light: #d6dcee;
  --frame-pale: #eef1f9;
  --paper: #ffffff;
  --line: #2b2a58;
  --ink: #1d1b33;
  --muted: #565a7d;
  --coral: #d9622f;
  --coral-light: #f9a978;
  --coral-deep: #a8431a;
  --honey: #f2b93c;
  --teal: #5470bd;
  --teal-dark: #37509a;
  --focus: #3f8fd8;
  --radius: 9px;
  --stitch: 2px solid #cfd6ea;
  --bar: linear-gradient(#8ea6e0, #6681cb 52%, #5872bd);
  --gloss: inset 0 2px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(43, 42, 88, .16);
  --cool: linear-gradient(#e6ebf8, #bdc8e4);
  --warm: linear-gradient(#fcbf8c, #f08a55);
  --pixel: "Silkscreen", ui-monospace, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 450;
  color: var(--ink);
  background: linear-gradient(#aecbf3, #dfe3fa 55%, #fbe5d0);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- main window ---------- */
#app {
  max-width: 680px; height: 100dvh; margin: 0 auto;
  display: flex; flex-direction: column;
  background: var(--frame); overflow: hidden;
}
@media (min-width: 720px) and (min-height: 640px) {
  #app {
    height: min(calc(100dvh - 48px), 840px); margin-top: 24px;
    border: 3px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(43, 42, 88, .35);
  }
}
#view { flex: 1; min-height: 0; overflow: hidden auto; position: relative; scrollbar-width: thin; scrollbar-color: var(--teal) var(--frame-light); }

.win-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 auto;
  margin: 7px 7px 0; padding: 4px 5px 4px 14px; min-height: 40px;
  background: linear-gradient(#fff, #f0f3fb); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .5);
}
.win-name { font-weight: 600; font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 19px; }
/* our own mark: a heart with syrup dripping over it */
.mark { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; background: url("/mark.svg") center / contain no-repeat; transform-origin: 50% 80%; }
/* close button: a soft tangerine tile, its cross is two bars */
.win-x {
  position: relative; flex: 0 0 auto; width: 30px; height: 28px; padding: 0; cursor: pointer;
  border: 2px solid var(--line); border-radius: 8px; background: var(--warm); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: transform .12s ease, filter .2s ease;
}
.win-x::before, .win-x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 3px; border-radius: 2px; background: var(--line); }
.win-x::before { transform: translate(-50%, -50%) rotate(45deg); }
.win-x::after { transform: translate(-50%, -50%) rotate(-45deg); }

/* folder tabs standing on an indigo rule */
#tabbar { display: flex; gap: 4px; flex: 0 0 auto; margin-top: 8px; padding: 0 16px; border-bottom: 3px solid var(--line); }
#tabbar a {
  flex: 1; position: relative; text-align: center; text-decoration: none; padding: 6px 6px 5px;
  font-size: 19px; font-weight: 600; color: var(--line);
  background: linear-gradient(#cdd5ea, #a9b3d2 ); border: 2px solid var(--line); border-bottom: 0;
  border-radius: 12px 12px 0 0; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55);
  transition: filter .2s ease, color .2s ease, transform .2s cubic-bezier(.2, .8, .2, 1); transform-origin: 50% 100%;
}
#tabbar a.active { color: #fff; text-shadow: 0 1px 1px rgba(90, 30, 0, .55); background: linear-gradient(#e98350, var(--coral)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4); }
#tabbar .dot {
  position: absolute; top: -4px; right: 10px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--honey); border: 2px solid var(--line);
}

/* ---------- pieces ---------- */
.page { padding: 14px 16px 32px; }
h1 { font-size: 24px; font-weight: 600; margin: 0 0 2px; }
.sub { color: var(--muted); margin: 0 0 14px; }
.page > form > .sub { color: #2f2f55; }
.sub.hint { font-size: 14px; margin: 8px 0 10px; }
.panel { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.panel > h2 { margin: 0; padding: 4px 10px 5px; text-align: center; font-size: 18px; font-weight: 500; color: #4a4f75; background: linear-gradient(#e3e8f5, #cbd3e9); border-bottom: var(--stitch); }
.panel-body { padding: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label, .label { font-size: 14px; font-weight: 600; color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input, select, textarea { width: 100%; padding: 10px 12px; border-radius: 7px; border: 2px solid var(--frame-dark); background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: 2px solid rgba(63, 143, 216, .45); outline-offset: 0; }
input::placeholder, textarea::placeholder { color: #6c7092; }
textarea { resize: vertical; min-height: 80px; }
.counter { font-size: 13px; color: var(--muted); align-self: flex-end; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 10px 18px; cursor: pointer; text-decoration: none; font-weight: 600; font-size: 17px; color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--warm); box-shadow: var(--gloss);
}
.btn.secondary { background: var(--cool); }
.btn.honey { background: linear-gradient(#fbdc7c, #efac2c); }
.btn.danger { color: #fff; background: linear-gradient(#d95a6a, #ac2d42); }
.btn:disabled { opacity: .6; cursor: default; }
.link-btn { background: none; border: 0; color: inherit; cursor: pointer; padding: 6px; }
.error { color: #a8233c; font-weight: 500; font-size: 15px; min-height: 20px; margin: 4px 0 8px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 80px; padding: 9px 8px; cursor: pointer; font-weight: 500;
  border: 2px solid var(--line); border-radius: 8px; background: var(--cool);
}
.seg button.on { background: var(--warm); box-shadow: inset 0 2px 4px rgba(120, 50, 0, .25); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 56px 24px; }
.empty .big { font-size: 52px; }
.deck > .empty { background: #fff; border-radius: var(--radius); height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.deck > .empty p { margin: 2px 0; }

/* ---------- login ---------- */
.auth { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 460px; margin: 0 auto; }
.auth .hero { text-align: center; margin-bottom: 16px; }
.auth .hero .mark { width: 68px; height: 68px; }
.auth .hero h1 { font-size: 42px; color: #fff; text-shadow: 0 0 1px var(--line), 2px 0 0 var(--line), -2px 0 0 var(--line), 0 2px 0 var(--line), 0 -2px 0 var(--line), 0 5px 0 rgba(43, 42, 88, .35); }
.auth .hero .sub { color: var(--line); font-weight: 500; margin: 6px 0 0; }
.auth .switch { text-align: center; margin: 14px 0 0; color: var(--muted); }
.auth .switch button { background: none; border: 0; color: var(--coral-deep); font-weight: 600; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin: 4px 0 8px; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--coral); }
.check a { color: var(--teal-dark); }

/* ---------- swipe ---------- */
.discover { position: relative; height: 100%; min-height: 440px; display: flex; flex-direction: column; padding: 20px 16px 18px; }
.deck { position: relative; flex: 1; min-height: 0; }
.card {
  position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  background: var(--frame); border-radius: var(--radius); touch-action: none; user-select: none; -webkit-user-select: none; will-change: transform;
}
.card.behind { filter: brightness(.97); }
.photo-pane { box-shadow: inset 0 0 0 2px #fff; position: relative; min-width: 0; min-height: 0; overflow: hidden; container-type: size; background: var(--frame-dark); border: 2px solid var(--line); border-radius: var(--radius); }
.photo-pane .photo { position: absolute; inset: 0; }
.photo-pane .photo img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; display: block; }
.avatar { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 100px; font-weight: 600; color: rgba(255, 255, 255, .95); }
.bars { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 4px; z-index: 2; }
.bars i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .55); border: 1px solid rgba(43, 42, 88, .6); }
.bars i.on { background: var(--coral-light); border-color: var(--line); }
.photo-pane .expand {
  position: absolute; right: 8px; bottom: 8px; z-index: 3; width: 34px; height: 34px; padding: 0; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--line); background: var(--cool); border: 2px solid var(--line); border-radius: 8px;
}
.info { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.info-head { flex: 0 0 auto; padding: 4px; text-align: center; font-size: 20px; font-weight: 500; color: #4a4f75; background: linear-gradient(#e3e8f5, #cbd3e9); border-bottom: var(--stitch); }
.d-rows { flex: 1; min-height: 0; overflow: hidden; padding: 0 10px; }
.d-row { padding: clamp(8px, 1.9vh, 20px) 8px clamp(6px, 1.2vh, 12px); border-bottom: var(--stitch); }
.d-text { font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.d-text b, .d-text span { font-weight: 500; }
.d-bio .d-text, .d-looking .d-text { -webkit-line-clamp: 3; }
.d-bio .d-text { font-size: 17px; }
.info .more { flex: 0 0 auto; border: 0; cursor: pointer; padding: 7px; background: var(--frame-pale); color: var(--teal-dark); font-weight: 600; font-size: 14px; }
.stamp { position: absolute; top: 34px; z-index: 3; padding: 2px 12px; font-size: 32px; font-weight: 700; letter-spacing: 1px; background: rgba(255, 255, 255, .88); border: 4px solid; border-radius: 9px; opacity: 0; pointer-events: none; }
.stamp.like { left: 14px; color: var(--coral-deep); transform: rotate(-12deg); }
.stamp.nope { right: 14px; color: var(--teal-dark); transform: rotate(12deg); }
.actions { flex: 0 0 auto; display: grid; grid-template-columns: 38px 1fr 1fr 38px; column-gap: 8px; padding-top: 18px; }
.actions button {
  height: 50px; padding: 0; cursor: pointer; font-size: 24px; font-weight: 600; letter-spacing: .3px; color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--cool); box-shadow: var(--gloss);
}
.actions .nope { margin-left: clamp(0px, 6vw, 42px); }
.actions .like { margin-right: clamp(0px, 6vw, 42px); background: var(--warm); }
.actions .flip { position: relative; }
.actions .flip::before { content: ""; position: absolute; left: 50%; top: 50%; width: 0; height: 0; border: 9px solid transparent; }
.actions .flip.prev::before { border-right: 14px solid var(--line); border-left: 0; transform: translate(-60%, -50%); }
.actions .flip.next::before { border-left: 14px solid var(--line); border-right: 0; transform: translate(-40%, -50%); }
.actions .flip:disabled { cursor: default; opacity: .45; }

.prompt-slide {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; overflow: auto;
  padding: 26px 22px 46px; color: #fff; background: linear-gradient(165deg, #7591d8, var(--teal-dark));
}
.prompt-slide::before { content: "\201C"; font: 700 90px/.7 Georgia, serif; height: 46px; opacity: .4; }
.prompt-slide .q { font-size: 16px; font-weight: 500; color: #e2e8fa; }
.prompt-slide .a { font-size: clamp(19px, 9.5cqw, 30px); font-weight: 600; line-height: 1.2; margin-top: 8px; overflow-wrap: anywhere; }
.prompt-slide.long .a { font-size: clamp(16px, 6.4cqw, 21px); }

/* Phones: the same two panes, stacked, so photos stay big. */
@media (max-width: 559px) {
  .discover { padding: 12px 10px 12px; }
  .card { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; }
  .info-head { font-size: 17px; padding: 2px; }
  .d-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
  .d-row { padding: 6px 4px 4px; }
  .d-text, .d-bio .d-text { font-size: 16px; }
  .d-job, .d-looking, .d-bio { grid-column: 1 / -1; }
  .d-job { grid-column: auto; }
  .d-looking .d-text, .d-bio .d-text { -webkit-line-clamp: 2; }
  .actions { padding-top: 12px; }
  .actions button { font-size: 22px; }
  #tabbar { padding: 0 10px; }
  #tabbar a { font-size: 18px; }
}
@media (max-height: 640px) { .d-bio { display: none; } }

/* swipe keycap popup */
.swipe-key {
  position: absolute; top: 36%; z-index: 6; pointer-events: none; opacity: 0;
  padding: 10px 20px 11px; font: 600 40px/1 "Fredoka", system-ui, sans-serif; color: var(--line);
  background: rgba(238, 241, 250, .9); border: 3px solid rgba(43, 42, 88, .75); border-bottom-width: 8px; border-radius: 12px;
}
.swipe-key.right { right: 18%; background: rgba(253, 214, 199, .9); }
.swipe-key.left { left: 18%; }

/* ---------- match list ---------- */
.match-list { height: 100%; min-height: 360px; display: flex; flex-direction: column; background: var(--frame-pale); }
.ml-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 10px 0; padding: 8px 12px; color: #fff;
  background: var(--bar); border: 2px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35);
}
.ml-head h1 { margin: 0; font-size: 21px; text-shadow: 0 1px 1px rgba(20, 20, 70, .6); }
.ml-count { padding: 0 10px; font-weight: 600; color: var(--ink); border: 2px solid var(--line); border-radius: 7px; background: linear-gradient(#fbdc7c, #efac2c); }
.ml-status { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 500; text-shadow: 0 1px 1px rgba(20, 20, 70, .6); }
.ml-status::before { content: ""; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--line); background: #a4a8bd; }
.ml-status.on::before { background: #ffd866; }
.ml-cols, .convo { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 72px; }
.ml-cols { flex: 0 0 auto; margin: 0 10px; background: linear-gradient(#e3e8f5, #cbd3e9); border: solid var(--line); border-width: 0 2px; font: 700 14px/1 var(--pixel); color: #4a4f75; }
.ml-cols span { padding: 8px 12px; }
.ml-cols span + span { border-left: 2px solid #b7c1de; }
.ml-rows { flex: 1; min-height: 0; overflow-y: auto; margin: 0 10px 10px; background: var(--paper); border: 2px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); scrollbar-width: thin; scrollbar-color: var(--teal) var(--frame-light); }
.ml-cols + .ml-rows { border-top-color: #b7c1de; }
.ml-group {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 5px 10px 6px; cursor: pointer; text-align: left;
  font-size: 17px; font-weight: 500; color: var(--line); background: #b9c4e0; border: 0; border-bottom: 2px solid #fff;
}
.ml-chev { display: inline-block; width: 9px; height: 9px; margin: -4px 4px 0; border: solid currentColor; border-width: 0 3px 3px 0; transform: rotate(45deg); transition: transform .2s ease; }
.ml-group[aria-expanded="false"] .ml-chev { transform: rotate(-45deg); margin-top: 0; }
.convo { align-items: stretch; text-decoration: none; font-size: 17px; border-bottom: 2px solid var(--frame-pale); transition: background-color .15s ease; }
.convo > div { padding: 8px 12px; min-width: 0; display: flex; align-items: center; }
.convo > div + div { border-left: 2px solid var(--frame-pale); }
.c-name { gap: 10px; }
.c-job span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo .txt { min-width: 0; flex: 1; }
.convo .name { font-size: 18px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo .last { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo.unread { background: #fff1c9; }
.convo.unread .name, .convo.unread .last { font-weight: 600; color: var(--ink); }
.thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; flex: 0 0 auto; background: var(--frame-light); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .avatar { font-size: 26px; }
.convo .thumb { width: 44px; height: 44px; border: 2px solid var(--line); border-radius: 12px; }
.ml-foot { flex: 0 0 auto; display: flex; justify-content: center; padding: 12px 16px 14px; background: var(--frame); border-top: var(--stitch); }
.ml-foot .btn { width: auto; min-width: 190px; font: 700 15px/1.3 var(--pixel); }
@media (max-width: 559px) {
  .ml-cols, .convo { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 54px; }
  .ml-cols { font-size: 12px; }
  .ml-cols span, .convo > div { padding-left: 8px; padding-right: 6px; }
  .convo { font-size: 15px; }
}

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 320px; background: var(--frame-pale); }
.chat-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px; margin: 10px 10px 0; padding: 6px 8px; color: #fff;
  background: var(--bar); border: 2px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35);
}
.chat-head .thumb { width: 44px; height: 44px; border: 2px solid var(--line); border-radius: 12px; }
.chat-head .thumb .avatar { font-size: 20px; }
.chat-head .who { flex: 1; min-width: 0; cursor: pointer; }
.chat-head .who b { display: block; font-weight: 600; font-size: 18px; }
.chat-head .who small { color: #fff; font-size: 14px; }
.back { text-decoration: none; font-size: 28px; line-height: 1; padding: 2px 8px; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; margin: 0 10px; padding: 14px; display: flex; flex-direction: column; gap: 7px; background: var(--paper); border: solid var(--line); border-width: 0 2px 2px; border-radius: 0 0 var(--radius) var(--radius); scrollbar-width: thin; scrollbar-color: var(--teal) var(--frame-light); }
.msg { max-width: 78%; padding: 7px 12px; border-radius: 10px; line-height: 1.35; font-size: 16px; overflow-wrap: anywhere; white-space: pre-wrap; border: 2px solid; }
.msg.them { align-self: flex-start; background: var(--frame-pale); border-color: #bcc7e2; border-bottom-left-radius: 2px; }
.msg.me { align-self: flex-end; background: #ffe2cd; border-color: #eda77b; color: var(--ink); border-bottom-right-radius: 2px; }
.msg-time { align-self: center; font-size: 13px; color: var(--muted); margin: 6px 0 2px; }
.typing { flex: 0 0 auto; font-size: 14px; color: var(--muted); padding: 2px 16px; min-height: 22px; }
.composer { flex: 0 0 auto; display: flex; gap: 8px; padding: 10px; background: var(--frame); border-top: var(--stitch); }
.composer .btn { width: auto; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); }

/* ---------- profile editor ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-slot {
  aspect-ratio: 3 / 4; border-radius: 9px; overflow: hidden; position: relative; cursor: pointer;
  background: var(--frame-pale); border: 3px dashed var(--frame-dark); display: flex; align-items: center; justify-content: center; color: var(--teal-dark); font-size: 30px;
}
.photo-slot.filled { border: 3px solid var(--line); cursor: default; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.photo-slot .x, .photo-slot .star { position: absolute; width: 28px; height: 28px; padding: 0; cursor: pointer; font-size: 14px; line-height: 1; color: #fff; background: var(--teal); border: 2px solid var(--line); border-radius: 5px; }
.photo-slot .x { top: 5px; right: 5px; }
.photo-slot .star { bottom: 5px; right: 5px; }
.photo-slot .main-tag { position: absolute; left: 5px; bottom: 5px; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--coral-light); border: 2px solid var(--line); padding: 0 8px; border-radius: 5px; }
.photo-slot.busy::after { content: "…"; position: absolute; }
.prompt-block { background: var(--frame-pale); border: 2px solid var(--frame-light); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.prompt-block select { margin-bottom: 8px; }
.place-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.place-row select { width: auto; flex: 1; padding: 7px 10px; margin: 0; }
.order-wrap { margin: 6px 0 4px; }
.order-strip { display: flex; gap: 7px; overflow-x: auto; padding: 8px 4px 4px; }
.os-item { position: relative; flex: 0 0 auto; }
.os-photo, .os-prompt { width: 48px; height: 64px; border-radius: 6px; overflow: hidden; border: 2px solid var(--line); }
.os-photo img { width: 100%; height: 100%; object-fit: cover; }
.os-prompt { width: 88px; padding: 5px; font-size: 11px; font-weight: 600; line-height: 1.15; color: #fff; background: linear-gradient(165deg, #7591d8, var(--teal-dark)); display: flex; align-items: flex-end; }
.os-num { position: absolute; top: -7px; left: -4px; min-width: 19px; padding: 0 5px; border-radius: 5px; background: #fff; border: 2px solid var(--line); font-size: 11px; font-weight: 700; line-height: 15px; text-align: center; }
.danger-zone { margin-top: 22px; padding-top: 16px; border-top: 3px solid var(--frame-dark); }

/* ---------- popup windows ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(28, 27, 64, .66); display: flex; align-items: center; justify-content: center; padding: 20px; }
.sheet { position: relative; width: 100%; max-width: 430px; max-height: 88dvh; overflow-y: auto; background: var(--frame); border: 3px solid var(--line); border-radius: 12px; scrollbar-width: thin; scrollbar-color: var(--teal) var(--frame-light); }
.sheet > .win-bar { position: sticky; top: 8px; z-index: 5; }
.sheet > .win-bar::before { content: ""; position: absolute; z-index: -2; inset: -11px -11px 18px; background: var(--frame); }
.sheet > .win-bar::after { content: ""; position: absolute; z-index: -1; inset: -2px; background: linear-gradient(#fff, #f0f3fb); border: 2px solid var(--line); border-radius: var(--radius); }
.details { margin: 12px 10px 12px; padding: 12px 14px 14px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); }
.details h3 { font-size: 25px; font-weight: 600; margin: 0 0 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 14px; font-weight: 500; padding: 2px 9px; background: var(--frame-light); border-radius: 5px; }
.details p { line-height: 1.4; margin: 12px 0 0; overflow-wrap: anywhere; }
.gallery { display: grid; gap: 10px; margin-top: 14px; }
.gallery figure { margin: 0; position: relative; overflow: hidden; border-radius: 9px; border: 3px solid var(--line); }
.gallery img { width: 100%; display: block; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.gallery .report-photo { position: absolute; right: 8px; bottom: 8px; cursor: pointer; font-size: 13px; padding: 3px 10px; color: #fff; background: rgba(28, 27, 64, .82); border: 0; border-radius: 6px; }
.prompt-card { background: var(--frame-pale); border: var(--stitch); border-radius: 10px; padding: 11px 13px; }
.prompt-card .q { font-size: 14px; font-weight: 500; color: var(--muted); }
.prompt-card .a { font-size: 19px; font-weight: 500; margin-top: 2px; line-height: 1.3; overflow-wrap: anywhere; }
.sheet-actions { display: flex; gap: 10px; padding: 0 10px 12px; }
.sheet-actions .btn { font-size: 15px; padding: 8px 12px; }
.report-form .btn { font-size: 16px; padding: 9px 6px; white-space: nowrap; }
.report-form { padding: 0 14px 14px; }
.report-form > .win-bar { margin: 6px -8px 14px; }
.report-form .reason { display: flex; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer; background: var(--paper); border-bottom: var(--stitch); }
.report-form .reason input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--coral); }
.report-form textarea { margin-top: 12px; }
.report-form .note { font-size: 15px; color: #2a2a4c; margin: 0 0 10px; }
.report-form .note a { color: var(--line); }
.report-form .error { color: #7d1a30; }

.match-modal { text-align: center; color: #fff; max-width: 360px; width: 100%; }
.match-modal h2 { font-size: 42px; font-weight: 700; margin: 0 0 6px; color: #ffd0bd; text-shadow: 2px 0 0 var(--coral-deep), -2px 0 0 var(--coral-deep), 0 2px 0 var(--coral-deep), 0 -2px 0 var(--coral-deep), 0 5px 0 rgba(0, 0, 0, .3); }
.match-modal p { font-size: 18px; }
.match-modal .pair { position: relative; display: flex; justify-content: center; align-items: center; margin: 24px 0; }
.match-modal .pair .thumb { width: 116px; height: 132px; border: 4px solid #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.match-modal .pair .thumb + .match-heart + .thumb { margin-left: -14px; }
.match-modal .pair .avatar { font-size: 44px; }
.match-heart { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; font-size: 44px; filter: drop-shadow(0 4px 12px rgba(240, 110, 70, .6)); }
.match-modal .btn { margin-top: 10px; }

#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60; max-width: 90vw; padding: 9px 18px; font-weight: 500; color: var(--line); background: #fff; border: 3px solid var(--line); border-radius: 9px; box-shadow: 0 8px 22px rgba(43, 42, 88, .3); }

/* ---------- photo viewer ---------- */
.zoomable { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.lb-bg { position: absolute; inset: 0; background: rgba(18, 17, 42, .95); }
.lb-img { position: relative; max-width: 100vw; max-height: 100dvh; object-fit: contain; will-change: transform; transform-origin: center; -webkit-user-drag: none; }
.lb-close, .lb-nav { position: absolute; z-index: 2; cursor: pointer; padding: 0; color: #fff; background: var(--teal); border: 3px solid #fff; border-radius: 9px; transition: filter .2s ease, transform .12s ease; }
.lb-close { top: calc(14px + env(safe-area-inset-top)); right: 14px; width: 42px; height: 42px; font-size: 18px; }
.lb-nav { top: 50%; margin-top: -24px; width: 46px; height: 48px; font-size: 28px; line-height: 1; }
.lb-nav.prev { left: 12px; }
.lb-nav.next { right: 12px; }
.lb-count { position: absolute; z-index: 2; top: calc(22px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); color: #fff; font-size: 16px; font-variant-numeric: tabular-nums; }
@media (hover: none) { .lb-nav { display: none; } }

/* ---------- legal ---------- */
.legal-page { max-width: 720px; margin: 24px auto; padding: 20px 24px 48px; line-height: 1.6; background: #fff; border: 3px solid var(--line); border-radius: 12px; }
.legal-page h1 { font-size: 30px; }
.legal-page h2 { font-size: 20px; font-weight: 600; margin-top: 28px; }
.legal-page li { margin-bottom: 6px; }
.legal-page .updated { color: var(--muted); margin-top: 0; }
.legal-page nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; font-weight: 600; }
.legal-page nav a { color: var(--coral-deep); text-decoration: none; }
.draft-banner { background: #fff3cd; color: #5c4400; border: 2px solid #f0d488; border-radius: 8px; padding: 12px 14px; font-size: 15px; margin-bottom: 20px; }
.legal-page mark { background: #ffe58a; color: #3a2a00; padding: 0 3px; border-radius: 3px; }
.disclaimer { font-size: 13px; color: #2a2a4c; text-align: center; line-height: 1.5; margin: 18px 0 0; }
.support-row { text-align: center; margin: 18px 0 0; }
.support { display: inline-flex; align-items: center; gap: 7px; padding: 7px 16px; font-size: 14px; font-weight: 600; color: var(--line); text-decoration: none; background: linear-gradient(#fbdc7c, #efac2c); border: 2px solid var(--line); border-radius: 999px; box-shadow: var(--gloss); }
.support:hover { filter: brightness(1.05); }
.support:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.legal-links { display: flex; justify-content: center; gap: 14px; font-size: 14px; margin-top: 6px; }
.legal-links a { color: #2a2a4c; }

/* ---------- motion & flair ---------- */
.view-root { height: 100%; }
.view-root.leaving { position: absolute; left: 0; right: 0; height: 100%; pointer-events: none; z-index: 1; }
.btn, .seg button, .actions button, .expand, .back, .link-btn, .photo-slot, .thumb, .ml-group { transition: transform .14s cubic-bezier(.2, .8, .2, 1), filter .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease; }
.btn:active:not(:disabled), .actions button:active:not(:disabled), .seg button:active, .win-x:active, .expand:active, .lb-nav:active, .lb-close:active { transform: translateY(2px) scale(.97); }
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.fx-dot { position: absolute; border-radius: 50%; will-change: transform, opacity; }
.fx-emoji { position: absolute; line-height: 1; will-change: transform, opacity; }
.fx-ring { position: fixed; width: 120px; height: 120px; border-radius: 50%; pointer-events: none; z-index: 94; border: 3px solid rgba(255, 200, 170, .9); box-shadow: 0 0 40px rgba(249, 167, 140, .6), inset 0 0 30px rgba(240, 130, 95, .4); }
@keyframes sway { 0%, 100% { transform: rotate(0) } 30% { transform: rotate(-18deg) } 70% { transform: rotate(14deg) } }

@media (hover: hover) {
  .btn:hover:not(:disabled), .actions button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.06); box-shadow: var(--gloss), 0 4px 0 rgba(43, 42, 88, .25); }
  .seg button:hover:not(.on) { filter: brightness(1.05); transform: translateY(-1px); }
  #tabbar a:hover { filter: brightness(1.06); transform: scaleY(1.07); }
  .win-x:hover { filter: brightness(1.12); transform: scale(1.08); }
  .logo:hover .mark { animation: sway .8s ease; }
  .back:hover { transform: translateX(-3px); }
  .expand:hover { transform: scale(1.1); }
  .info:hover .info-head { background: #c4cde6; }
  .info:hover .more { background: #dfe5f4; }
  .ml-group:hover { background: #c8d1e8; }
  .convo:hover { background: #e6edfb; }
  .convo:hover .thumb { transform: scale(1.1) rotate(-3deg); }
  .photo-slot:not(.filled):hover { border-color: var(--coral); color: var(--coral-deep); transform: scale(1.03); }
  .photo-slot.filled:hover img { transform: scale(1.04); }
  .gallery figure:hover img { transform: scale(1.02); }
  .lb-close:hover, .lb-nav:hover { filter: brightness(1.15); }
  .report-form .reason:hover { background: #fff0e4; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
@media (max-width: 559px) and (max-height: 720px) {
  .info-head { display: none; }
  .d-looking .d-text { -webkit-line-clamp: 1; }
  .info .more { padding: 4px; }
  .actions button { height: 44px; }
}
