/* transl8 — Pluspunkt's strawberry-milk look: pink and berry ink, chubby Baloo 2 headings, Be Vietnam Pro for
   text (drawn for Vietnamese), white cards with pink-tinted shadows, stadium buttons, bottom sheets. */
@font-face { font-family: 'Baloo 2'; src: url('fonts/baloo2.woff2?v=e2e4e8affb') format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('fonts/be-vietnam-pro-400.woff2?v=e2e4e8affb') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('fonts/be-vietnam-pro-500.woff2?v=e2e4e8affb') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('fonts/be-vietnam-pro-600.woff2?v=e2e4e8affb') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('fonts/be-vietnam-pro-700.woff2?v=e2e4e8affb') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #FFF3F5;
  --bg2: #FFE7EC;
  --card: #FFFFFF;
  --ink: #4A1B33;
  --muted: #A8718A;
  --line: #F6D9E2;
  --slot1: #E0507A;
  --slot1-soft: #FBDCE6;
  --slot2: #5B67C7;
  --slot2-soft: #E0E4FA;
  --green: #2E9E6B;
  --green-soft: #D9F2E5;
  --red: #C93A50;
  --red-soft: #F9DBDF;
  --amber: #9A6200;
  --amber-soft: #FFF0D6;
  --shadow: 0 10px 30px rgba(224, 80, 122, 0.16);
  --shadow-soft: 0 4px 14px rgba(224, 80, 122, 0.10);
  --radius: 22px;
  --blob-a: rgba(224, 80, 122, 0.16);
  --blob-b: rgba(91, 103, 199, 0.13);
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #241021;
    --bg2: #2E1429;
    --card: #38182F;
    --ink: #FFE9F1;
    --muted: #C68FA8;
    --line: #4E2340;
    --slot1: #F26D93;
    --slot1-soft: #4E2038;
    --slot2: #8A96EE;
    --slot2-soft: #2A2A4E;
    --green: #4CC08D;
    --green-soft: #1B3A2D;
    --red: #EF6A7E;
    --red-soft: #4A1F28;
    --amber: #F0B656;
    --amber-soft: #43311A;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.25);
    --blob-a: rgba(242, 109, 147, 0.10);
    --blob-b: rgba(138, 150, 238, 0.09);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif; background: var(--bg); color: var(--ink);
  min-height: 100dvh; line-height: 1.5; -webkit-tap-highlight-color: transparent;
}
.bg-blob { position: fixed; border-radius: 50%; filter: blur(70px); z-index: 0; pointer-events: none; }
.bg-blob-a { width: 46vmax; height: 46vmax; top: -14vmax; right: -12vmax; background: var(--blob-a); }
.bg-blob-b { width: 40vmax; height: 40vmax; bottom: -16vmax; left: -12vmax; background: var(--blob-b); }
#app {
  position: relative; z-index: 1; max-width: 560px; margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
h1, h2, h3, .display { font-family: 'Baloo 2', 'Be Vietnam Pro', sans-serif; line-height: 1.15; }
h1 { font-size: 28px; margin-bottom: 6px; }
a { color: var(--slot1); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.55; }
:focus-visible { outline: 3px solid var(--slot1); outline-offset: 2px; border-radius: 8px; }
input, textarea, select {
  font: inherit; color: var(--ink); width: 100%; background-color: var(--bg2);
  border: 2px solid transparent; border-radius: 14px; padding: 12px 14px;
}
select {
  appearance: none; padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat;
}
input:focus, textarea:focus, select:focus { border-color: var(--slot1); outline: none; background-color: var(--card); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.lead { color: var(--muted); margin: 4px 0 18px; }
.biggie { font-size: 46px; line-height: 1; margin-bottom: 8px; }
.link { display: inline-block; color: var(--slot1); font-weight: 700; font-size: 14.5px; padding: 10px 4px; text-decoration: none; }
.err { color: var(--red); font-weight: 600; font-size: 14px; margin-top: 10px; }
.err:empty { display: none; }
.notice { background: var(--amber-soft); color: var(--amber); border-radius: 14px; padding: 10px 12px; font-weight: 600; font-size: 14px; margin-top: 12px; }
.wide { width: 100%; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 2px 14px; }
.brand { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 23px; color: var(--slot1); text-decoration: none; }
.eight { color: var(--slot2); }
.topbar-title { font-size: 20px; flex: 1; text-align: center; margin: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.langs { display: inline-flex; background: var(--card); border-radius: 999px; padding: 3px; box-shadow: var(--shadow-soft); }
.langs button { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--muted); }
.langs button.on { background: var(--slot1); color: #fff; }
.iconbtn { font-size: 17px; line-height: 1.2; padding: 7px 10px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow-soft); text-decoration: none; }
.backbtn { font-weight: 700; color: var(--slot1); font-size: 15px; padding: 6px 2px; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }

/* welcome */
.hero { min-height: 86dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 6px; }
.hero-icon { width: 96px; height: 96px; border-radius: 26px; box-shadow: var(--shadow); animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
.hero-title { font-size: 46px; font-weight: 800; color: var(--slot1); margin: 10px 0 0; }
.tagline { color: var(--muted); font-weight: 500; margin-bottom: 14px; }
.hero .card { width: 100%; max-width: 360px; margin-top: 18px; text-align: left; }
.hero .fine { max-width: 340px; }
.legal { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.legal a { color: var(--muted); }

/* pages and cards */
.page { padding-top: 8px; }
.narrow { max-width: 420px; margin: 0 auto; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 16px; margin-bottom: 14px; }
.card > label:first-child { margin-top: 0; }
.cardlabel { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.form .btn, .invitecard .btn, .page > .btn { width: 100%; margin-top: 14px; }
.section-title { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 16px; color: var(--muted); margin: 22px 4px 10px; }
.banner { background: var(--card); border-left: 5px solid var(--slot2); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; box-shadow: var(--shadow-soft); font-size: 14px; }
.banner.warn { border-left-color: var(--red); background: var(--red-soft); }
.banner a { font-weight: 700; margin-left: 4px; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* buttons */
.btn { display: inline-block; text-align: center; font-weight: 700; padding: 13px 18px; border-radius: 999px; font-size: 15px; text-decoration: none; transition: transform 0.1s ease; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--slot1), #F27E9E); color: #fff; box-shadow: 0 6px 16px rgba(224, 80, 122, 0.35); }
.btn-ghost { background: var(--bg2); color: var(--ink); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-line { color: var(--red); font-weight: 700; width: 100%; padding: 12px; margin-top: 10px; border-radius: 16px; }
.btn.busy { position: relative; color: transparent; }
.btn.busy::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.7); border-top-color: transparent; animation: spin 0.8s linear infinite;
}
.btn-ghost.busy::after { border-color: var(--muted); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.armed { background: var(--red) !important; color: #fff !important; border-radius: 12px; }

/* checkboxes */
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; font-weight: 500; color: var(--ink); margin: 14px 0 0; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--slot1); margin-top: 1px; padding: 0; }

/* recovery and invite codes */
.codebox {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 10px; margin: 8px 0 12px; font-family: var(--mono); font-weight: 700;
  font-size: clamp(14px, 4.3vw, 20px); letter-spacing: 0.05em; text-align: center; user-select: all;
}
.codebox span { background: var(--bg2); border-radius: 10px; padding: 8px 0; }
.codeinput { font-family: var(--mono); font-size: 16px; letter-spacing: 0.04em; text-transform: uppercase; text-align: center; }
.invitecode { font-family: var(--mono); font-weight: 800; font-size: 32px; letter-spacing: 0.08em; color: var(--slot1); margin: 4px 0 12px; user-select: all; text-align: center; }
.invitebox { text-align: center; }
.qr { display: block; width: min(220px, 70vw); height: auto; margin: 10px auto; border-radius: 16px; box-shadow: var(--shadow-soft); }
.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-weight: 600; margin: 8px 0; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--slot1); animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; background: var(--slot2); }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-6px); opacity: 1; } }
.disclose summary { cursor: pointer; font-weight: 700; color: var(--slot1); list-style: none; }
.disclose summary::-webkit-details-marker { display: none; }
.disclose[open] summary { margin-bottom: 10px; }
.invitecard { text-align: center; }
.invitecard label { text-align: left; }

/* the two of you */
.couplecard {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; background: var(--card);
  border-radius: calc(var(--radius) + 6px); box-shadow: var(--shadow); padding: 22px 10px 18px; margin-bottom: 18px; text-align: center;
}
.member .avatar { width: 64px; height: 64px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; }
.member.s1 .avatar { background: var(--slot1-soft); }
.member.s2 .avatar { background: var(--slot2-soft); }
.member .name { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.member.s1 .name, .pair .s1 { color: var(--slot1); }
.member.s2 .name, .pair .s2 { color: var(--slot2); }
.member .sub { font-size: 12px; color: var(--muted); font-weight: 600; }
.heart { font-size: 34px; display: inline-block; animation: beat 1.6s ease-in-out infinite; }
.couplecard .heart { align-self: center; } /* members align at the top, the heart sits between the avatars */
@keyframes beat { 0%, 100% { scale: 1; } 12% { scale: 1.14; } 24% { scale: 1; } 36% { scale: 1.1; } 48% { scale: 1; } }
.soon { text-align: center; color: var(--muted); font-weight: 500; }

/* iPhone: Safari and the Home Screen app do not share storage */
.ioshint { border-left: 5px solid var(--slot2); text-align: left; width: 100%; max-width: 360px; }
.ioshint p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.ioshint .invitecode { font-size: 24px; margin: 8px 0 4px; }
.ioshint .btn { margin-top: 8px; }
.invitecard + .ioshint { max-width: none; }

/* install hint */
.installcard { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.install-icon { width: 48px; height: 48px; border-radius: 13px; }
.install-info { flex: 1; min-width: 160px; }
.install-title { font-family: 'Baloo 2', sans-serif; font-weight: 700; }
.install-text { font-size: 13px; color: var(--muted); }
.install-actions { display: flex; align-items: center; gap: 10px; }
.install-actions .btn { padding: 9px 16px; font-size: 14px; }
.install-later { color: var(--muted); font-size: 13px; font-weight: 600; }

/* settings */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  flex: 1 1 0; min-width: 90px; background: var(--bg2); border-radius: 14px; padding: 9px 6px; font-weight: 600; font-size: 14px;
  border: 2px solid transparent; display: flex; flex-direction: column; align-items: center;
}
.seg button small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.seg button.on { border-color: var(--slot1); background: var(--card); color: var(--slot1); }
.rowbtn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px 4px; font-weight: 600; border-bottom: 1px solid var(--line); }
.rowbtn:last-child { border-bottom: 0; }
.rowbtn.danger { color: var(--red); }
.pair { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 17px; padding: 2px 0 8px; }
.devices { padding: 10px 0; border-bottom: 1px solid var(--line); }
.device { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; font-size: 14px; }
.device .fine { margin-top: 0; }
.chip { display: inline-block; background: var(--slot2-soft); color: var(--slot2); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; }
.del { color: var(--muted); font-size: 14px; padding: 6px 10px; border-radius: 10px; background: var(--bg2); }
.settings-foot { text-align: center; margin: 22px 0 10px; }

/* bottom sheet */
.overlay { position: fixed; inset: 0; background: rgba(40, 8, 28, 0.45); z-index: 10; display: flex; align-items: flex-end; justify-content: center; animation: fadein 0.18s ease; }
@keyframes fadein { from { opacity: 0; } }
.sheet {
  background: var(--card); width: 100%; max-width: 560px; border-radius: 26px 26px 0 0; max-height: 88dvh; overflow-y: auto;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  animation: slideup 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0.6; } }
.sheet h2 { font-size: 22px; margin-bottom: 4px; }
.sheet .subtitle { color: var(--muted); font-size: 14px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; }
.sheet-actions .btn { flex: 1; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; padding: 10px 18px; border-radius: 999px;
  box-shadow: var(--shadow); animation: fadein 0.2s ease; max-width: calc(100vw - 32px); text-align: center;
}
.errorcard { text-align: center; }
.errorcard .btn { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
