/* home.poparda.dev — a phone-first family page: content floats on a warm wallpaper (the glow of a hearth),
   frosted-glass surfaces, iOS-sized type and touch targets. Designed for iPhone 16 Pro Max (430 x 932 pt),
   fine on any width. Dark by default, a dawn variant for light mode. */
:root {
  --wall: #0e1514; --g1: #1f5a52; --g2: #4a2f63; --g3: #c2611f;
  --ink: #f6f2ec; --muted: rgba(246, 242, 236, .64); --faint: rgba(246, 242, 236, .38);
  --glass: rgba(255, 255, 255, .085); --glass-strong: rgba(28, 30, 30, .62); --hair: rgba(255, 255, 255, .14);
  --accent: #ffa95e; --accent-ink: #1d1006; --ok: #63d98a; --warn: #ffc35c; --danger: #ff8a7a;
  --field: rgba(0, 0, 0, .22); --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --r-lg: 24px; --r-md: 18px; --r-sm: 12px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --wall: #efe5d8; --g1: #9cc2a8; --g2: #cdb6e0; --g3: #f4a46d;
    --ink: #1d1a16; --muted: rgba(29, 26, 22, .62); --faint: rgba(29, 26, 22, .38);
    --glass: rgba(255, 255, 255, .52); --glass-strong: rgba(255, 252, 247, .78); --hair: rgba(255, 255, 255, .7);
    --accent: #c4581a; --accent-ink: #fff; --ok: #1f8a4c; --warn: #a86400; --danger: #b8402c;
    --field: rgba(255, 255, 255, .6); --shadow: 0 18px 50px rgba(80, 50, 20, .16);
    color-scheme: light;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--wall); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); background: transparent; /* the .wall shows through */
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- wallpaper ---- */
.wall { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--wall); }
.wall::after {
  content: ""; position: absolute; inset: 0; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* three soft lights sized to a tall phone screen: teal at the top, plum on the right, the hearth's ember below */
.glow { position: absolute; border-radius: 50%; filter: blur(40px); will-change: transform; }
.g1 { width: 130vw; height: 60vh; left: -45vw; top: -18vh; background: radial-gradient(closest-side, var(--g1), transparent); opacity: .95; animation: drift1 38s ease-in-out infinite alternate; }
.g2 { width: 100vw; height: 48vh; right: -45vw; top: 26vh; background: radial-gradient(closest-side, var(--g2), transparent); opacity: .8; animation: drift2 46s ease-in-out infinite alternate; }
.g3 { width: 160vw; height: 62vh; left: -30vw; bottom: -26vh; background: radial-gradient(closest-side, var(--g3), transparent); opacity: .85; animation: drift3 30s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(10vw, 4vh) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-12vw, 6vh) scale(.92); } }
@keyframes drift3 { to { transform: translate(8vw, -4vh) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .glow { animation: none; } }

.glass {
  background: var(--glass); border: .5px solid var(--hair); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
}

/* ---- top bar: invisible over the wallpaper, frosted once the page scrolls ---- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  transition: background .25s, border-color .25s; border-bottom: .5px solid transparent;
}
.top.scrolled { background: var(--glass-strong); border-bottom-color: var(--hair); -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%); }
.toptitle { font-weight: 600; font-size: 17px; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.top.scrolled .toptitle { opacity: 1; transform: none; }
.avatar {
  position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: 8px; width: 36px; height: 36px; border-radius: 50%;
  border: .5px solid var(--hair); background: var(--glass); color: var(--ink); font: 600 15px/1 inherit; cursor: pointer;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.menu { position: absolute; right: max(16px, env(safe-area-inset-right)); top: calc(env(safe-area-inset-top) + 52px); min-width: 220px; border-radius: var(--r-md); padding: 6px; display: grid; }
.who { padding: 10px 12px 8px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menuitem { text-align: left; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: none; color: var(--danger); font: inherit; cursor: pointer; }
.menuitem:hover { background: var(--glass); }

/* ---- page frame ---- */
.wrap {
  max-width: 560px; margin: 0 auto; display: grid; gap: 22px; align-content: start;
  padding: calc(env(safe-area-inset-top) + 62px) max(20px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 170px) max(20px, env(safe-area-inset-left));
  animation: rise .35s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.center { min-height: 100dvh; align-content: center; padding-bottom: calc(env(safe-area-inset-bottom) + 40px); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.large { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 18px; }
.eyebrow { margin: 0 0 -14px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lede { margin: -8px 0 0; color: var(--muted); font-size: 17px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.note { margin: -6px 0 0; font-size: 12px; color: var(--faint); text-align: center; }
.stack { display: grid; gap: 12px; }
.msg { font-size: 13px; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- sign-in ---- */
.logincard { border-radius: 28px; padding: 32px 24px 24px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.logincard p { margin: 0; }
.mark { width: 72px; height: 72px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(145deg, #ffb26b, #d2541a); box-shadow: 0 12px 30px rgba(210, 84, 26, .45); }
.mark svg { width: 40px; height: 40px; color: #fff; stroke-width: 2.4; }
.gbtn { min-height: 44px; }

/* ---- start: springboard ---- */
.springboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 10px; padding: 6px 0 0; }
.icon { position: relative; display: grid; justify-items: center; gap: 7px; text-decoration: none; }
.icon b { font-size: 12px; font-weight: 500; letter-spacing: -.005em; text-shadow: 0 1px 6px rgba(0, 0, 0, .35); white-space: nowrap; }
@media (prefers-color-scheme: light) { .icon b { text-shadow: 0 1px 6px rgba(255, 255, 255, .6); } }
.sq {
  width: 64px; height: 64px; border-radius: 15px; display: grid; place-items: center; color: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .28); transition: transform .15s;
}
.sq svg { width: 32px; height: 32px; stroke-width: 1.9; }
.icon:active .sq { transform: scale(.92); }
.i-money { background: linear-gradient(160deg, #4fdc7b, #1a9a52); }
.i-duties { background: linear-gradient(160deg, #5aa9ff, #4a4fe0); }
.i-wardrobe { background: linear-gradient(160deg, #e9c48f, #a8743c); }
.i-insta { background: linear-gradient(45deg, #f7a23a, #e3366f 55%, #8a3ab9); }
.i-tree { background: linear-gradient(160deg, #a7d36b, #3d8b4f); }
.i-poems { background: linear-gradient(160deg, #ffb26b, #d2541a); }
.i-topics { background: linear-gradient(160deg, #7fd6ff, #2a7de1); }
.i-reports { background: linear-gradient(160deg, #c9a2ff, #6a3fd0); }
.badge {
  position: absolute; top: -6px; right: calc(50% - 40px); min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: #ff3b30; color: #fff; font: 600 13px/22px inherit; text-align: center; font-style: normal; box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

/* ---- widgets ---- */
.widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.widgetlist { grid-column: span 2; display: grid; gap: 12px; }
.tcard { border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 4px; text-decoration: none; }
.tcard b { font-size: 17px; font-weight: 600; }
.tcard .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; background: var(--accent); color: var(--accent-ink); }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 600; background: var(--field); color: var(--muted); }
.chip.ok { color: var(--ok); } .chip.warn { color: var(--warn); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---- topic ---- */
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin: -8px 0 -14px -6px; color: var(--accent); text-decoration: none; font-size: 17px; }
.back svg { width: 26px; height: 26px; stroke-width: 2.2; }
.panel { border-radius: var(--r-lg); padding: 18px 16px; display: grid; gap: 10px; }
.panel > p { margin: 0; }
.q { padding: 12px 0; border-top: .5px solid var(--hair); display: grid; gap: 8px; }
.qt { margin: 0; font-weight: 600; }
.other { background: var(--field); border-radius: var(--r-sm); padding: 8px 12px; white-space: pre-wrap; font-size: 15px; }
.form { display: grid; gap: 6px; }
.card { border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 6px; background: var(--field); }
.meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.tag { background: var(--glass); border-radius: 6px; padding: 0 6px; font-weight: 600; }
.pre { white-space: pre-wrap; margin: 0; }
input, textarea {
  font: inherit; font-size: 17px; -webkit-appearance: none; appearance: none; color: var(--ink); width: 100%;
  background: var(--field); border: .5px solid var(--hair); border-radius: var(--r-sm); padding: 11px 13px;
}
textarea { resize: vertical; }
label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.btn {
  min-height: 46px; justify-self: start; display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 999px; padding: 0 22px; font: 600 16px inherit; text-decoration: none; cursor: pointer; box-shadow: 0 8px 20px rgba(255, 140, 50, .3);
}
.link { min-height: 44px; min-width: 44px; background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.danger { color: var(--danger); margin-left: auto; }

/* ---- wierszyki ---- */
.hero { display: grid; gap: 22px; }
.sechead { display: grid; gap: 4px; margin-top: 8px; }
.sechead p { margin: 0; color: var(--muted); font-size: 15px; }
.song { border-radius: var(--r-lg); padding: 14px 14px 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; transition: transform .15s; }
.song.playing { box-shadow: var(--shadow), 0 0 0 1.5px var(--accent) inset; }
.song .num { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.song .ttl { font-size: 19px; font-weight: 650; letter-spacing: -.012em; line-height: 1.2; }
.song .poem { font-size: 14px; color: var(--muted); }
.song .why { grid-column: 1 / -1; margin: 6px 0 0; font-size: 15px; color: var(--muted); }
.song .chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.song .info { display: grid; gap: 2px; min-width: 0; }
.play {
  grid-row: 1; grid-column: 2; width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px rgba(255, 140, 50, .35); transition: transform .12s;
}
.play:active { transform: scale(.92); }
.play svg, .mplay svg { fill: currentColor; stroke: none; width: 22px; height: 22px; }
.play .i-play { margin-left: 3px; }
.scrub { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.scrub input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; padding: 0; border: 0; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent)) 0/var(--p, 0%) 100% no-repeat, var(--field); }
.scrub input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.scrub input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }
.lyrics { grid-column: 1 / -1; margin: 12px 0 2px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--field); white-space: pre-line; font-size: 15px; line-height: 1.55; font-style: italic; }
.heard { grid-column: 1 / -1; margin: 8px 0 0; font-size: 12px; color: var(--faint); }

/* ---- mini player + tab bar ---- */
.tabs {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 10px);
  width: min(calc(100vw - 32px), 240px); height: 64px; border-radius: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px;
  background: var(--glass-strong);
}
.tabs a { display: grid; justify-items: center; align-content: center; gap: 2px; border-radius: 26px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; transition: color .2s, background .2s; }
.tabs a svg { width: 25px; height: 25px; }
.tabs a.on { color: var(--accent); background: var(--glass); }
.tabs a[data-tab=notes].on { color: var(--accent-ink); background: var(--accent); }

/* ---- notes ---- */
.composer { border-radius: var(--r-lg); padding: 14px; display: grid; gap: 10px; margin-bottom: 16px; }
.composer textarea, .ncard textarea { width: 100%; min-height: 84px; resize: none; border: 0; border-radius: var(--r-sm); padding: 12px 14px; background: var(--field); color: var(--ink); font: 17px/1.45 inherit; box-sizing: border-box; }
.composer textarea:focus, .ncard textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.crow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ncard { border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 8px; }
.ncard p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; line-height: 1.45; cursor: text; }
.nmeta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--faint); }
.nmeta button { min-height: 32px; padding: 0 10px; border: 0; border-radius: 16px; background: transparent; color: var(--muted); font: 600 13px/1 inherit; cursor: pointer; }
.nmeta button:hover { background: var(--glass); }
.nmeta .del { color: var(--danger); }
.nmeta .btn { min-height: 36px; padding: 0 16px; background: var(--accent); color: var(--accent-ink); }
.mini {
  position: fixed; z-index: 29; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 84px);
  width: min(calc(100vw - 32px), 420px); border-radius: 22px; padding: 8px 14px 10px 8px; display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: center;
  background: var(--glass-strong);
}
.mplay { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.mtext { display: grid; min-width: 0; }
.mtext b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtext span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbar { grid-column: 1 / -1; height: 3px; margin-top: 8px; border-radius: 2px; background: var(--field); overflow: hidden; }
.mbar i { display: block; height: 100%; width: 0; background: var(--accent); }

/* ---- welcome tour ---- */
.tour { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .45); display: grid; place-items: end center; padding: 16px max(12px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@media (min-width: 700px) { .tour { place-items: center; } }
.tourcard { width: min(480px, 100%); border-radius: 28px; padding: 22px; display: grid; gap: 10px; background: var(--glass-strong); }
.tourcard h2 { margin: 0; font-size: 24px; }
.tourcard p { margin: 0; }
.tourrow { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

@media (min-width: 900px) {
  .wrap { max-width: 640px; }
  .springboard { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
