/* Pluspunkt — strawberry-milk candy look.
   Display: Baloo 2 (chubby, warm). Text: Be Vietnam Pro (made for Vietnamese). */

:root {
  --bg: #FFF3F5;
  --bg2: #FFE7EC;
  --card: #FFFFFF;
  --ink: #4A1B33;
  --muted: #A8718A;
  --line: #F6D9E2;
  --hong: #E0507A;
  --hong-soft: #FBDCE6;
  --patrick: #5B67C7;
  --patrick-soft: #E0E4FA;
  --green: #2E9E6B;
  --green-soft: #D9F2E5;
  --red: #C93A50;
  --red-soft: #F9DBDF;
  --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);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #241021;
    --bg2: #2E1429;
    --card: #38182F;
    --ink: #FFE9F1;
    --muted: #C68FA8;
    --line: #4E2340;
    --hong: #F26D93;
    --hong-soft: #4E2038;
    --patrick: #8A96EE;
    --patrick-soft: #2A2A4E;
    --green: #4CC08D;
    --green-soft: #1B3A2D;
    --red: #EF6A7E;
    --red-soft: #4A1F28;
    --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;
}
.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: 16px 16px calc(96px + env(safe-area-inset-bottom));
}

h1, h2, h3, .display { font-family: 'Baloo 2', 'Be Vietnam Pro', sans-serif; line-height: 1.15; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--hong); outline-offset: 2px; border-radius: 8px;
}
input, textarea {
  font: inherit; color: var(--ink); width: 100%;
  background: var(--bg2); border: 2px solid transparent; border-radius: 14px;
  padding: 12px 14px;
}
input:focus, textarea:focus { border-color: var(--hong); outline: none; background: var(--card); }
textarea { resize: vertical; min-height: 72px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 14px; }
.brand { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 20px; color: var(--hong); }
.whoami { font-size: 12px; font-weight: 600; color: var(--muted); font-family: 'Be Vietnam Pro', sans-serif; }
.privhint { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.langs { display: 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(--hong); color: #fff; }
.iconbtn { font-size: 17px; padding: 7px 10px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow-soft); }

/* ---------- scoreboard (signature) ---------- */
.scoreboard {
  position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: var(--card); border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow); padding: 22px 10px 16px; margin-bottom: 24px; text-align: center;
}
.score-side .name { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 18px; }
.score-side.hong .name { color: var(--hong); }
.score-side.patrick .name { color: var(--patrick); }
.score-side .big {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 58px; line-height: 1;
  margin: 2px 0 8px; font-variant-numeric: tabular-nums;
  transition: transform 0.15s ease;
}
.score-side .big.pop { transform: scale(1.18); }
.flagchips { display: flex; gap: 6px; justify-content: center; font-size: 12px; font-weight: 600; }
.flagchips span { background: var(--bg2); border-radius: 999px; padding: 2px 9px; }
.heart {
  font-size: 40px; line-height: 1; color: var(--hong); user-select: none;
  animation: beat 1.6s ease-in-out infinite;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}
.heart.lean-hong { rotate: -14deg; }
.heart.lean-patrick { rotate: 14deg; }
@keyframes beat {
  0%, 100% { scale: 1; }
  12% { scale: 1.14; }
  24% { scale: 1; }
  36% { scale: 1.1; }
  48% { scale: 1; }
}

/* ---------- sections & date cards ---------- */
.section-title {
  font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 16px; color: var(--muted);
  margin: 22px 4px 10px; display: flex; align-items: center; gap: 8px;
}
.datecard {
  display: flex; gap: 14px; align-items: center; width: 100%; text-align: left;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-soft);
  padding: 14px; margin-bottom: 12px;
  transition: transform 0.12s ease;
}
.datecard:active { transform: scale(0.98); }
.datecard .thumb {
  width: 64px; height: 64px; flex: none; border-radius: 16px; object-fit: cover; background: var(--bg2);
  display: grid; place-items: center; font-size: 26px;
}
.datecard .info { flex: 1; min-width: 0; }
.datecard .title { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 17px; }
.datecard .when { font-size: 13px; color: var(--muted); font-weight: 500; }
.datecard .planline { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.datecard .chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; font-size: 12px; font-weight: 600; }
.datecard .chips span { background: var(--bg2); border-radius: 999px; padding: 1px 8px; }

.empty { text-align: center; color: var(--muted); padding: 28px 16px; font-size: 15px; }
.empty .biggie { font-size: 42px; display: block; margin-bottom: 8px; }

/* ---------- FAB ---------- */
.fab {
  position: fixed; right: max(18px, calc(50vw - 262px)); bottom: calc(20px + env(safe-area-inset-bottom));
  width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(135deg, var(--hong), #F27E9E);
  color: #fff; font-size: 30px; font-weight: 700; line-height: 1;
  box-shadow: 0 10px 24px rgba(224, 80, 122, 0.45);
  display: grid; place-items: center; z-index: 5;
  transition: transform 0.12s ease;
}
.fab:active { transform: scale(0.92); }

/* ---------- date detail ---------- */
.backbtn { font-weight: 700; color: var(--hong); font-size: 15px; padding: 6px 2px; display: inline-flex; gap: 6px; align-items: center; }
.detail-head { margin: 6px 2px 16px; }
.detail-head h1 { font-size: 30px; }
.detail-head .when { color: var(--muted); font-weight: 500; margin-top: 2px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-soft);
  padding: 16px; margin-bottom: 14px;
}
.card .cardlabel {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.card .bodytext { white-space: pre-wrap; }
.editlink { color: var(--hong); font-weight: 700; font-size: 13px; margin-left: auto; }

/* photos */
.photostrip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.photostrip::-webkit-scrollbar { display: none; }
.photostrip img, .phototile {
  width: 92px; height: 92px; flex: none; border-radius: 16px; object-fit: cover;
}
.phototile {
  display: grid; place-items: center; background: var(--bg2); color: var(--muted);
  font-size: 26px; border: 2px dashed var(--line);
}

/* quick add */
.quickadd { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qa-col { border-radius: 18px; padding: 12px; }
.qa-col.hong { background: var(--hong-soft); }
.qa-col.patrick { background: var(--patrick-soft); }
.qa-col .qa-name { font-family: 'Baloo 2', sans-serif; font-weight: 700; text-align: center; margin-bottom: 8px; }
.qa-col.hong .qa-name { color: var(--hong); }
.qa-col.patrick .qa-name { color: var(--patrick); }
.qa-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa-btns button {
  background: var(--card); border-radius: 14px; font-size: 22px; padding: 10px 0;
  box-shadow: var(--shadow-soft); transition: transform 0.1s ease;
}
.qa-btns button:active { transform: scale(0.9); }

/* entries feed */
.entry { display: flex; gap: 10px; align-items: flex-start; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry .eicon {
  width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 18px;
}
.eicon.plus { background: var(--green-soft); }
.eicon.minus { background: var(--red-soft); }
.eicon.green { background: var(--green-soft); }
.eicon.red { background: var(--red-soft); }
.entry .ebody { flex: 1; min-width: 0; }
.entry .eline { font-size: 14px; font-weight: 600; }
.entry .eline .p-hong { color: var(--hong); }
.entry .eline .p-patrick { color: var(--patrick); }
.entry .enote { font-size: 14px; color: var(--muted); white-space: pre-wrap; }
.entry .etime { font-size: 11px; color: var(--muted); margin-top: 2px; }
.entry .del { color: var(--muted); font-size: 15px; padding: 6px 8px; border-radius: 10px; }
.entry .del.armed, .del.armed { background: var(--red); color: #fff; font-weight: 700; font-size: 12px; }

/* ---------- sheet / modal ---------- */
.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; 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);
  max-height: 88dvh; overflow-y: auto;
}
@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; }
.btn {
  flex: 1; text-align: center; font-weight: 700; padding: 13px; border-radius: 16px; font-size: 15px;
  transition: transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--hong), #F27E9E); color: #fff; box-shadow: 0 6px 16px rgba(224, 80, 122, 0.35); }
.btn-ghost { background: var(--bg2); color: var(--muted); }
.btn-danger-line { color: var(--red); font-weight: 700; width: 100%; padding: 12px; margin-top: 8px; border-radius: 16px; }
.btn-danger-line.armed { background: var(--red); color: #fff; }
.kindpick { display: flex; gap: 8px; margin-top: 8px; }
.kindpick button {
  flex: 1; background: var(--bg2); border-radius: 14px; padding: 10px 4px; font-size: 21px;
  border: 2px solid transparent;
}
.kindpick button.on { border-color: var(--hong); background: var(--card); }
.kindpick .klabel { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.personpick { display: flex; gap: 8px; }
.personpick button {
  flex: 1; border-radius: 14px; padding: 11px; font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 16px;
  background: var(--bg2); color: var(--muted); border: 2px solid transparent;
}
.personpick button.on.hong { background: var(--hong-soft); color: var(--hong); border-color: var(--hong); }
.personpick button.on.patrick { background: var(--patrick-soft); color: var(--patrick); border-color: var(--patrick); }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(20, 4, 14, 0.92); z-index: 20; display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 80dvh; border-radius: 14px; }
.lightbox .lb-actions { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; justify-content: center; gap: 14px; }
.lightbox .lb-actions button { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 700; padding: 10px 20px; border-radius: 999px; }

/* ---------- login ---------- */
.login { min-height: 82dvh; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.login .hearts { font-size: 54px; animation: beat 1.6s ease-in-out infinite; }
.login h1 { font-size: 40px; margin: 10px 0 2px; }
.login h1 .amp { color: var(--hong); }
.login .tagline { color: var(--muted); margin-bottom: 30px; }
.login form { max-width: 320px; margin: 0 auto; width: 100%; }
.login input { text-align: center; font-size: 17px; }
.login .btn { width: 100%; margin-top: 12px; }
.login .err { color: var(--red); font-weight: 600; font-size: 14px; margin-top: 12px; min-height: 20px; }
.login .langs { margin: 26px auto 0; width: fit-content; }

/* location + maps */
.locrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.locname { font-size: 14px; font-weight: 600; }
.locbtn {
  background: var(--bg2); color: var(--hong); font-weight: 700; font-size: 13.5px;
  padding: 9px 14px; border-radius: 12px; margin-top: 2px;
}
.locbtn-x { color: var(--red); padding: 9px 11px; }
.mapbox {
  height: 46dvh; min-height: 220px; border-radius: 16px; overflow: hidden;
  position: relative; z-index: 0; margin-top: 8px; background: var(--bg2);
}
.mapbox-mini { height: 200px; min-height: 200px; margin-top: 4px; }
.leaflet-container { font-family: 'Be Vietnam Pro', system-ui, sans-serif; }

/* install banner */
.installcard {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-soft);
  padding: 14px; margin: 18px 0;
}
.install-icon { width: 52px; height: 52px; border-radius: 14px; }
.install-info { flex: 1; min-width: 150px; }
.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-btn { flex: none; padding: 10px 18px; font-size: 14px; }
.install-later { color: var(--muted); font-size: 13px; font-weight: 600; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: 999px; z-index: 30; box-shadow: var(--shadow);
  animation: fadein 0.2s ease;
}

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