:root {
  --bg: #fff8ec;
  --bg2: #eafbe6;
  --card: #ffffff;
  --soft: #faf6ef;
  --hl: #fff3c8;
  --topbg: rgba(255, 248, 236, .85);
  --link: #2b8a37;
  --money: #1f6f2a;
  --b1: #ffe3b8;
  --b2: #d9f5d0;
  --b3: #f8d8ef;
  --particle: #ffffff;
  --ink: #2b2340;
  --ink2: #6d6585;
  --line: #efe6d8;
  --green: #3fa34d;
  --green-d: #2b8a37;
  --red: #e0453a;
  --gold: #ffb627;
  --sky: #2f9bd6;
  --pink: #e8559a;
  --purple: #a64fc9;
  --family: #ffb627;
  --dovolenka: #19b5a5;
  --tesime: #ff7a3d;
  --radius: 24px;
  --shadow: 0 6px 0 rgba(43, 35, 64, .06), 0 10px 30px rgba(43, 35, 64, .08);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: 'Baloo 2', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 10% 0%, var(--b1) 0, transparent 40%),
    radial-gradient(circle at 100% 30%, var(--b2) 0, transparent 45%),
    radial-gradient(circle at 0% 100%, var(--b3) 0, transparent 40%);
  transition: background-color .4s;
  background-attachment: fixed;
  min-height: 100vh;
  font-size: 17px;
  line-height: 1.35;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
h1, h2, h3 { margin: 0; line-height: 1.1; }

/* ---------- logo a názov ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 40px; height: 40px; animation: sway 6s ease-in-out infinite; }
.word { font-weight: 800; font-size: 26px; letter-spacing: .5px; }
.word b { font-weight: 800; }
.word .s { font-weight: 700; opacity: .85; }
@keyframes sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(8deg); } }

/* ---------- prihlásenie ---------- */
.login { max-width: 560px; margin: 0 auto; padding: 40px 16px 60px; text-align: center; }
.login .brand { flex-direction: column; gap: 6px; }
.login .brand img { width: 120px; height: 120px; }
.login .word { font-size: 46px; }
.login p.sub { color: var(--ink2); margin: 4px 0 28px; }
.profiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.profile {
  background: var(--card); border-radius: var(--radius); padding: 18px 10px 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 700; font-size: 20px;
  border: 3px solid transparent; transition: transform .15s;
}
.profile:active { transform: scale(.96); }
.profile:hover { border-color: var(--c); }

.avatar {
  --size: 64px;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: var(--c); display: grid; place-items: center; font-size: calc(var(--size) * .5);
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.15), 0 3px 0 rgba(0,0,0,.08);
  position: relative; flex: none; color: #fff;
}
.avatar svg { width: 62%; height: 62%; }
.avatar.sm { --size: 34px; }
.avatar.md { --size: 48px; }
.avatar.lg { --size: 88px; }
.avatar .badge {
  position: absolute; right: -6px; bottom: -6px; background: #fff; border-radius: 50%;
  width: calc(var(--size) * .5); height: calc(var(--size) * .5); display: grid; place-items: center;
  font-size: calc(var(--size) * .32); box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.pinbox { max-width: 340px; margin: 0 auto; }
.pindots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 22px; }
.pindots i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--c); }
.pindots i.on { background: var(--c); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pinpad button {
  background: var(--card); border-radius: 22px; height: 68px; font-size: 28px; font-weight: 700; box-shadow: var(--shadow);
}
.pinpad button:active { transform: scale(.94); background: #f4f0ff; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* ---------- rozloženie ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--topbg); backdrop-filter: blur(12px);
}
.top .word { font-size: 22px; }
.top .brand img { width: 34px; height: 34px; }
.top .acts { display: flex; gap: 8px; align-items: center; }
.round {
  width: 44px; height: 44px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center; font-size: 22px;
}
.round.sos { background: #ffe1dd; }
main { max-width: 760px; margin: 0 auto; padding: 6px 16px calc(110px + env(safe-area-inset-bottom)); }
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20;
  display: flex; gap: 4px; background: var(--card); padding: 6px; border-radius: 30px; box-shadow: 0 10px 40px rgba(43,35,64,.18);
  width: min(560px, calc(100% - 24px));
}
.nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 2px; border-radius: 24px;
  font-size: 13px; font-weight: 700; color: var(--ink2);
}
.nav button span { font-size: 24px; line-height: 1.1; }
.nav button.on { background: var(--navc, #eafbe6); color: #2b2340; }

/* ---------- karty ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h2 { font-size: 22px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.card h2 .t { display: flex; gap: 8px; align-items: center; }
.muted { color: var(--ink2); }
.small { font-size: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.empty { color: var(--ink2); text-align: center; padding: 10px 0 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 18px;
  background: var(--green); color: #fff; font-weight: 700; box-shadow: 0 4px 0 var(--green-d); transition: transform .1s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--green-d); }
.btn.sec { background: var(--soft); color: var(--ink); box-shadow: 0 4px 0 var(--line); }
.btn.red { background: var(--red); box-shadow: 0 4px 0 #b9322a; }
.btn.gold { background: var(--gold); color: #4a3300; box-shadow: 0 4px 0 #d79300; }
.btn.sm { padding: 6px 12px; font-size: 15px; border-radius: 14px; }
.btn.block { width: 100%; }
.link { color: var(--link); font-weight: 700; font-size: 15px; }

/* ---------- vianoce ---------- */
.xmasbox {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 22px 20px; margin-bottom: 16px; color: #fff;
  background: linear-gradient(135deg, #d93a3a, #b51f3a 55%, #1f7a3d);
  box-shadow: 0 8px 0 rgba(120, 20, 30, .25), 0 14px 30px rgba(120, 20, 30, .25);
}
.xmasbox .big { font-size: 64px; font-weight: 800; line-height: .9; }
.xmasbox .lbl { font-size: 20px; font-weight: 700; }
.xmasbox .tree { position: absolute; right: 8px; bottom: -6px; font-size: 96px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); }
.xmasbox .lights { position: absolute; left: 0; right: 0; top: 0; height: 14px; display: flex; justify-content: space-around; }
.xmasbox .lights i { width: 10px; height: 14px; border-radius: 0 0 50% 50%; animation: blink 1.6s infinite; }
.xmasbox .lights i:nth-child(4n+1) { background: #ffd84d; }
.xmasbox .lights i:nth-child(4n+2) { background: #7ee0ff; animation-delay: .4s; }
.xmasbox .lights i:nth-child(4n+3) { background: #9dff7a; animation-delay: .8s; }
.xmasbox .lights i:nth-child(4n) { background: #ff9de2; animation-delay: 1.2s; }
@keyframes blink { 50% { opacity: .25; } }
#snow { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
#snow i { position: absolute; top: -20px; color: var(--particle); font-style: normal; text-shadow: 0 0 4px rgba(120, 160, 200, .6); animation: fall linear infinite; }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); } }
#app { position: relative; z-index: 2; }

/* ---------- nálady ---------- */
.moods { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.mood {
  display: flex; flex-direction: column; align-items: center; padding: 8px 0 4px; border-radius: 18px; background: var(--soft);
  border: 3px solid transparent; transition: transform .15s;
}
.mood span { font-size: 36px; line-height: 1.1; }
.mood small { font-size: 12px; font-weight: 700; color: var(--ink2); }
.mood:active { transform: scale(.9); }
.mood.on { border-color: var(--green); background: var(--hl); transform: scale(1.06); }
.ask { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: var(--shadow); } 50% { box-shadow: 0 0 0 6px rgba(63,163,77,.18), var(--shadow); } }
.family { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; }
.family .who { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; }
.moodtable { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 22px; text-align: center; }
.moodtable th { font-size: 12px; color: var(--ink2); font-weight: 700; }
.moodtable td:first-child { text-align: left; }
.moodtable td.e { opacity: .25; font-size: 14px; }
.moodscroll { overflow-x: auto; }

/* ---------- odpočty ---------- */
.counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.count { border-radius: 20px; padding: 12px; color: #fff; background: var(--cc, var(--green)); position: relative; overflow: hidden; }
.count .n { font-size: 40px; font-weight: 800; line-height: 1; }
.count .u { font-size: 14px; font-weight: 700; opacity: .9; }
.count .l { font-weight: 700; margin-top: 4px; line-height: 1.15; }
.count .e { position: absolute; right: 8px; top: 4px; font-size: 30px; opacity: .9; }

/* ---------- zoznamy ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 18px; background: var(--soft); }
.item .ic { font-size: 26px; width: 34px; text-align: center; flex: none; }
.item .tt { font-weight: 700; }
.item.done .tt { text-decoration: line-through; opacity: .55; }
.check {
  width: 30px; height: 30px; border-radius: 10px; border: 3px solid var(--green); display: grid; place-items: center; flex: none;
  font-size: 18px; color: #fff;
}
.check.on { background: var(--green); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--soft); }
.pill.gold { background: #fff0c8; color: #8a5b00; }
.pill.green { background: #dcf5d8; color: #1f6f2a; }
.pill.red { background: #ffe1dd; color: #a2241b; }
.money { font-weight: 800; color: var(--money); white-space: nowrap; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.tabs button { padding: 8px 14px; border-radius: 99px; background: var(--card); font-weight: 700; white-space: nowrap; box-shadow: var(--shadow); }
.tabs button.on { background: var(--green); color: #fff; }

.piggy {
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px; color: #4a3300;
  background: linear-gradient(135deg, #ffe08a, #ffb627); box-shadow: 0 8px 0 rgba(215, 147, 0, .35);
  display: flex; align-items: center; gap: 14px;
}
.piggy .big { font-size: 44px; font-weight: 800; line-height: 1; }
.piggy .pig { font-size: 60px; }

.request { border-radius: 20px; padding: 14px; background: #ffe9e5; border: 3px dashed #f19b90; margin-bottom: 10px; }
.request.taken { background: #fff6d8; border-color: #f3cf62; }

/* ---------- kalendár ---------- */
.calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.calhead h2 { font-size: 26px; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dn { text-align: center; font-size: 13px; font-weight: 700; color: var(--ink2); }
.day {
  min-height: 64px; border-radius: 14px; background: var(--soft); padding: 4px; text-align: left; display: flex; flex-direction: column;
  gap: 2px; overflow: hidden; border: 2px solid transparent;
}
.day.out { opacity: .35; }
.day.today { border-color: var(--green); background: var(--hl); }
.day .d { font-weight: 800; font-size: 15px; }
.day .bar { height: 6px; border-radius: 3px; }
.day .emo { font-size: 13px; line-height: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--ink2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 4px; vertical-align: -1px; }

/* ---------- okno (sheet) ---------- */
.sheetbg { position: fixed; inset: 0; background: rgba(43,35,64,.35); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet {
  background: var(--bg); width: min(620px, 100%); max-height: 92vh; overflow: auto; border-radius: 28px 28px 0 0;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); animation: up .25s;
}
.sheet h2 { font-size: 24px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
label.f { display: block; font-weight: 700; margin: 12px 0 6px; font-size: 15px; }
.in {
  width: 100%; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); outline: none; font-size: 17px;
}
.in:focus { border-color: var(--green); }
textarea.in { min-height: 70px; resize: vertical; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { padding: 8px 14px; border-radius: 99px; background: var(--card); border: 2px solid var(--line); font-weight: 700; }
.choice.on { border-color: var(--green); background: var(--green); color: #fff; }
.pickers { display: flex; gap: 10px; flex-wrap: wrap; }
.picker { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; opacity: .4; transition: .15s; }
.picker.on { opacity: 1; transform: scale(1.06); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- srdiečka ---------- */
.heartfly { position: fixed; z-index: 60; pointer-events: none; font-size: 40px; animation: heart 2.6s ease-out forwards; }
@keyframes heart {
  0% { transform: translateY(0) scale(.4); opacity: 0; }
  15% { opacity: 1; transform: translateY(-20px) scale(1.2); }
  100% { transform: translateY(-70vh) scale(1) rotate(20deg); opacity: 0; }
}
.heartmsg {
  position: fixed; z-index: 61; left: 50%; top: 40%; transform: translate(-50%, -50%); background: var(--card); border-radius: 28px;
  padding: 22px 26px; text-align: center; box-shadow: 0 20px 60px rgba(232, 85, 154, .35); animation: pop .4s; max-width: 86vw;
}
.heartmsg .h { font-size: 70px; line-height: 1; animation: beat 1s infinite; }
@keyframes beat { 50% { transform: scale(1.15); } }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.6); opacity: 0; } }
.emojis { display: flex; gap: 8px; flex-wrap: wrap; }
.emojis button { font-size: 30px; width: 52px; height: 52px; border-radius: 16px; background: var(--card); border: 3px solid transparent; }
.emojis button.on { border-color: var(--pink); }
.emojis .choice { padding: 0; display: grid; place-items: center; font-size: 28px; border-radius: 16px; }
.emojis .choice.on { background: #ffe4f1; border-color: var(--pink); color: inherit; }

#toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: #2b2340; color: #fff; padding: 10px 18px; border-radius: 16px; font-weight: 700; opacity: 0; transition: .25s; z-index: 70;
  pointer-events: none; max-width: 90vw; text-align: center;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 420px) {
  .mood span { font-size: 30px; }
  .xmasbox .big { font-size: 54px; }
  .day { min-height: 54px; }
  .word { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.mood { position: relative; }
.mood .num { position: absolute; top: 2px; left: 7px; font-size: 12px; color: var(--ink2); }
.mood small { white-space: nowrap; font-size: 11px; }

/* ---------- stiahnutie appky ---------- */
.install {
  border-radius: var(--radius); padding: 16px; margin: 0 0 18px; color: #fff; text-align: left;
  background: linear-gradient(135deg, #3fa34d, #2f9bd6); box-shadow: 0 8px 0 rgba(31, 111, 42, .25), 0 14px 30px rgba(31, 111, 42, .2);
}
.install .tt { font-weight: 800; font-size: 19px; }
.install .appicon { width: 56px; height: 56px; border-radius: 14px; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.2); }
.install .steps { margin: 14px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.install .key { display: inline-block; background: rgba(255,255,255,.25); border-radius: 8px; padding: 0 6px; }

/* ---------- zvonček ---------- */
.round.bell { position: relative; background: var(--hl); }
.round.bell .count {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--red); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid #fff; animation: pop .3s;
}
.item.notif { width: 100%; }
.item.notif.new { background: var(--hl); }
.item.notif .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); flex: none; }
.top .acts { gap: 6px; }
@media (max-width: 420px) {
  .top .round { width: 40px; height: 40px; font-size: 19px; }
  .top .word { font-size: 19px; }
  .top .brand img { width: 28px; height: 28px; }
}

/* ---------- témy ---------- */
.request, .piggy { color: #2b2340; }
.request .muted { color: #6d6585; }
#snow i.rise { top: auto; bottom: -30px; animation-name: rise; }
@keyframes rise { to { transform: translateY(-115vh) rotate(-20deg); } }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theme {
  border-radius: 20px; padding: 0; overflow: hidden; text-align: left; border: 3px solid transparent;
  background: var(--card); box-shadow: var(--shadow); transition: transform .15s;
}
.theme:active { transform: scale(.96); }
.theme.on { border-color: var(--green); }
.theme .sw { height: 70px; display: grid; place-items: center; font-size: 34px; position: relative; }
.theme .sw i { position: absolute; bottom: 6px; left: 8px; right: 8px; height: 10px; border-radius: 5px; }
.theme .nm { padding: 8px 10px; font-weight: 700; font-size: 15px; line-height: 1.15; }
.theme .ds { font-size: 12px; color: var(--ink2); font-weight: 600; }
.grp { margin: 18px 0 8px; font-size: 16px; font-weight: 800; color: var(--ink2); }
.themecur { display: flex; align-items: center; gap: 12px; }
.themecur .sw { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; flex: none; }

.btn { white-space: nowrap; }
