/* ── Auth / Magic ─────────────────────────────────────────────────────────── */
.auth-hero { display: flex; flex-direction: column; align-items: center; margin-top: 12px; }
.auth-logo { width: 160px; }
.view-auth .auth-logo { width: 200px; }
.terms-label { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; font-size: .88rem; cursor: pointer; }
.terms-label input { margin-top: 3px; flex: none; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 14px; color: #8a897a; font-weight: 700; font-size: .85rem;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 2px; background: rgba(26,26,26,.15); }

/* ── Onboarding ───────────────────────────────────────────────────────────── */
.progress-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.progress-dots .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: var(--vanilla); }
.progress-dots .dot--on { background: var(--pink-hot); }
.onb-hero { width: 150px; margin: 0 auto 8px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rules { display: flex; flex-direction: column; gap: 10px; }
.rules p { background: #fffef4; border: var(--border-w) solid var(--ink); border-radius: var(--radius-tile); padding: .7em 1em; box-shadow: var(--shadow-hard-sm); }

.view-loading { display: grid; place-items: center; min-height: 60vh; }
.spinner { width: 44px; height: 44px; border: 4px solid var(--pink-soft); border-top-color: var(--pink-hot); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 40px 16px; }
.empty-state img { width: 160px; margin: 0 auto 16px; }

/* ═══ Deck ═══ */
.deck-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.deck-logo { width: 40px; height: 40px; }
.slots-pill { font-family: var(--font-display); font-weight: 800; font-size: .9rem; background: var(--pink-soft); border: var(--border-w) solid var(--ink); border-radius: var(--radius-pill); padding: .4em 1em; box-shadow: var(--shadow-hard-sm); cursor: pointer; }
.stack-wrap { position: relative; height: min(64vh, 520px); margin-bottom: 12px; }
.card-stack { position: relative; width: 100%; height: 100%; }
.habit-card { position: absolute; inset: 0; perspective: 1200px; transition: transform .4s var(--ease-spring); cursor: grab; }
.card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s var(--ease-spring); }
.habit-card.flipped .card-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; background: var(--vanilla); border: var(--border-w) solid var(--ink); border-radius: var(--radius-card); box-shadow: var(--shadow-hard); overflow: hidden; display: flex; flex-direction: column; }
.face--back { transform: rotateY(180deg); }
.card-illo { flex: 1; background-size: cover; background-position: center; background-color: var(--pink-soft); }
.card-illo--emoji { display: flex; align-items: center; justify-content: center; font-size: 6rem; }
.card-body { padding: 16px 18px 20px; background: var(--vanilla); border-top: var(--border-w) solid var(--ink); }
.card-title { font-family: var(--font-display); font-size: 1.5rem; margin: 8px 0 4px; }
.card-desc { color: #4a4a3f; font-size: .95rem; }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: .82rem; }
.card-meta .diff { font-weight: 700; }
.flip-hint { color: #9a9a8a; }
.back-scroll { padding: 20px; overflow-y: auto; height: 100%; -webkit-overflow-scrolling: touch; }
.back-h { font-family: var(--font-display); margin: 14px 0 6px; font-size: 1.05rem; }
.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.benefits { color: #4a4a3f; font-size: .92rem; }
.stat-line { background: var(--pink-soft); border-radius: 12px; padding: 8px 12px; margin-top: 8px; font-weight: 700; }
.card-overlays { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.card-glow { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; background: var(--grad-flame); }
.stamp { position: absolute; top: 28px; font-family: var(--font-logo); font-size: 1.8rem; border: 4px solid currentColor; border-radius: 12px; padding: .05em .4em; opacity: 0; transition: opacity .1s; }
.stamp--like { right: 20px; color: var(--red); transform: rotate(-12deg); }
.stamp--nope { left: 20px; color: var(--ink); transform: rotate(12deg); }
.stamp--super { left: 50%; bottom: 40px; top: auto; transform: translateX(-50%); color: var(--pink-hot); }
.card-overlays[data-dir="like"] .stamp--like { opacity: var(--r, 1); }
.card-overlays[data-dir="nope"] .stamp--nope { opacity: var(--r, 1); }
.card-overlays[data-dir="super"] .stamp--super { opacity: var(--r, 1); }
.action-bar { display: flex; justify-content: center; gap: 20px; }
.act-nope { background: var(--vanilla); color: var(--ink); }
.act-super { background: var(--pink-soft); color: var(--maroon); width: 54px; height: 54px; font-size: 1.3rem; }
.act-like { background: var(--grad-flame); }
.aria-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ═══ Matches ═══ */
.tiles { display: flex; flex-direction: column; gap: 12px; }
.checkin-tile { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--vanilla); border: var(--border-w) solid var(--ink); border-radius: var(--radius-tile); box-shadow: var(--shadow-hard-sm); cursor: pointer; position: relative; }
.checkin-tile.is-ghosting { border-color: var(--red); animation: ghost-pulse 1.6s infinite; }
@keyframes ghost-pulse { 50% { box-shadow: 3px 3px 0 var(--red); } }
.tile-illo { width: 60px; height: 60px; border-radius: 14px; border: 2px solid var(--ink); background-size: cover; background-position: center; background-color: var(--pink-soft); flex: none; }
.tile-illo--emoji { display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.tile-main { flex: 1; min-width: 0; }
.tile-super { position: absolute; top: 8px; right: 68px; }
.tile-name { font-family: var(--font-display); font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.tile-streak { font-weight: 700; font-size: .85rem; }
.ghost-bubble { font-size: .8rem; color: var(--red); font-weight: 700; margin-top: 4px; }
.checkin-btn { width: 52px; height: 52px; border-radius: 50%; border: var(--border-w) solid var(--ink); background: var(--vanilla); color: var(--pink-hot); font-size: 1.5rem; font-weight: 800; cursor: pointer; flex: none; box-shadow: var(--shadow-hard-sm); transition: transform .1s; }
.checkin-btn.done { background: var(--grad-flame); color: var(--vanilla); }
.slot-empty { width: 100%; padding: 20px; border: var(--border-w) dashed var(--ink); border-radius: var(--radius-tile); background: transparent; font-family: var(--font-display); font-weight: 700; color: #8a897a; cursor: pointer; }
.section { margin-top: 20px; }
.section summary { font-family: var(--font-display); font-weight: 800; cursor: pointer; padding: 8px 0; }
.wait-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 2px solid rgba(0,0,0,.08); }
.wait-name { flex: 1; font-weight: 700; }
.wait-name--link { background: none; border: none; text-align: left; cursor: pointer; color: var(--ink); font-family: var(--font-body); font-size: 1rem; text-decoration: underline; text-decoration-color: var(--pink-hot); text-underline-offset: 3px; }

/* ═══ Stats ═══ */
.heart-hero { display: flex; justify-content: center; }
.streak-heart { position: relative; display: inline-block; }
.streak-heart .heart { fill: #d7d5c0; transition: fill .4s; }
.streak-heart .flame { fill: var(--red); opacity: 0; transform-origin: 50% 100%; }
.streak-heart .flame-group { opacity: 0; }
.streak-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--vanilla); -webkit-text-stroke: 1px var(--ink); padding-top: 12%; }
.streak-heart.flame-0 .heart { fill: var(--pink-soft); }
.streak-heart.flame-1 .heart, .streak-heart.flame-2 .heart { fill: var(--pink-hot); }
.streak-heart.flame-1 .flame-group, .streak-heart.flame-2 .flame-group { opacity: 1; }
.streak-heart.flame-1 .flame-a, .streak-heart.flame-2 .flame-a { opacity: .9; }
.streak-heart.flame-2 .flame-b, .streak-heart.flame-2 .flame-c { opacity: .7; }
.streak-heart.flame-3 .heart, .streak-heart.flame-4 .heart { fill: var(--red); }
.streak-heart.flame-3 .flame, .streak-heart.flame-4 .flame { opacity: 1; }
.streak-heart.flame-3 .flame-group, .streak-heart.flame-4 .flame-group { opacity: 1; animation: heartbeat 1s infinite; }
.streak-heart.flame-4 { filter: drop-shadow(0 0 14px var(--red)); }
.streak-heart.flame-5 .heart { fill: #F5B301; }
.streak-heart.flame-5 .flame { fill: #E20019; opacity: 1; }
.streak-heart.flame-5 .flame-group { opacity: 1; animation: heartbeat .8s infinite; }
@keyframes heartbeat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(.97); } }
.stat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-tile { padding: 16px; text-align: center; }
.stat-val { display: block; font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--pink-hot); }
.stat-label { font-size: .82rem; color: #6b6a5c; }
.week-chart { display: flex; gap: 8px; align-items: flex-end; height: 140px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; background: var(--grad-flame); border: 2px solid var(--ink); border-radius: 8px 8px 0 0; min-height: 4px; display: flex; align-items: flex-start; justify-content: center; }
.bar-fill.bar-empty { background: #e5e3ce; }
.bar-val { color: var(--vanilla); font-weight: 800; font-size: .75rem; padding-top: 2px; }
.bar-label { font-size: .72rem; font-weight: 700; color: #6b6a5c; }

/* ═══ Match detail ═══ */
.back-link { background: none; border: none; font-weight: 800; color: var(--maroon); cursor: pointer; padding: 4px 0; margin-bottom: 8px; }
.md-hero { display: flex; gap: 14px; align-items: center; padding: 14px; }
.md-illo { width: 72px; height: 72px; border-radius: 16px; border: 2px solid var(--ink); background-size: cover; background-position: center; background-color: var(--pink-soft); flex: none; }
.md-illo--emoji { display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.md-title { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 6px; }
.level-progress .lp-bar { height: 14px; background: #e5e3ce; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.lp-fill { height: 100%; background: var(--grad-flame); }
.md-stats { display: flex; justify-content: space-around; text-align: center; }
.md-stats b { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--pink-hot); }
.heatmap { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; }
.hm-cell { aspect-ratio: 1; border-radius: 4px; background: #e5e3ce; border: 1px solid rgba(0,0,0,.1); }
.hm-cell.hm-on { background: var(--grad-flame); }
.dd-teaser { padding: 16px; }
.md-profile { padding: 16px 18px; }
.md-profile h3 { font-family: var(--font-display); }
.md-profile h4.back-h { margin: 14px 0 6px; }
.md-meta { font-size: .85rem; }

/* ═══ Date (randka) ═══ */
.view-date { display: flex; flex-direction: column; align-items: center; min-height: 80vh; position: relative; }
.date-close { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: var(--vanilla); font-size: 1.2rem; cursor: pointer; }
.date-habit { font-family: var(--font-display); text-align: center; margin: 20px 0; }
.timer-wrap { position: relative; width: 300px; max-width: 80vw; }
.timer-ring { width: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: #e5e3ce; stroke-width: 16; }
.ring-fill { fill: none; stroke: var(--pink-hot); stroke-width: 16; stroke-linecap: round; transition: stroke-dashoffset .3s linear; }
.clock-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: 3rem; }
.date-steps { margin: 20px 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; max-width: 400px; }
.date-controls { display: flex; gap: 12px; margin-top: auto; padding-top: 20px; }
.date-finish { padding-top: 15vh; }
.finish-emoji { font-size: 4rem; }

/* confetti */
.match-backdrop { overflow: hidden; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; animation: fall 2.2s linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .8; } }
.match-modal { background: var(--vanilla); }
.match-hearts { font-size: 3rem; }

/* ═══ Double Date / czat ═══ */
.dd-done { color: var(--red); font-weight: 700; }
.invite-habit { padding: 16px; font-family: var(--font-display); font-size: 1.2rem; }

#app-outlet.outlet-chat { padding-bottom: var(--safe-b); padding-top: calc(var(--safe-t) + 12px); }
.view-chat { display: flex; flex-direction: column; height: calc(100dvh - var(--safe-t) - var(--safe-b) - 24px); }
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: var(--border-w) solid var(--ink); }
.chat-head .back-link { font-size: 1.4rem; margin: 0; }
.chat-partner-status { display: block; font-size: .78rem; color: #6b6a5c; font-weight: 600; }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 2px; -webkit-overflow-scrolling: touch; }
.chat-system { align-self: center; background: var(--pink-soft); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; font-size: .78rem; font-weight: 700; }
.chat-bubble { max-width: 78%; padding: .6em .9em; border: 2px solid var(--ink); border-radius: 16px; font-size: .95rem; word-break: break-word; }
.chat-bubble.mine { align-self: flex-end; background: var(--pink-soft); border-bottom-right-radius: 4px; }
.chat-bubble.theirs { align-self: flex-start; background: var(--vanilla); border-bottom-left-radius: 4px; }
.chat-bubble.pending { opacity: .6; }
.chat-bubble.failed { border-color: var(--red); }
.chat-bubble.failed::after { content: " ⚠"; color: var(--red); }
.chat-photo { border-radius: 10px; margin-bottom: 4px; max-height: 260px; }
.chat-composer-wrap { padding: 10px 0 calc(var(--safe-b) + 10px); border-top: var(--border-w) solid var(--ink); }
.chat-composer { display: flex; gap: 8px; align-items: center; }
.chat-input { flex: 1; padding: .7em 1em; border: var(--border-w) solid var(--ink); border-radius: var(--radius-pill); background: #fffef4; }
.chat-photo-btn { width: 44px; height: 44px; flex: none; border: var(--border-w) solid var(--ink); border-radius: 50%; background: var(--vanilla); font-size: 1.2rem; cursor: pointer; }

/* ═══ Profil / ustawienia ═══ */
.set-card { padding: 16px 18px; }
.set-card h3 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 2px solid rgba(0,0,0,.06); }
.set-row:last-child { border-bottom: none; }
.switch-row { cursor: pointer; }
.switch-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--pink-hot); }
.hour-select { border: 2px solid var(--ink); border-radius: 10px; padding: 4px 8px; font-weight: 700; background: #fffef4; }
.budget-row { display: flex; gap: 8px; flex-wrap: wrap; }
.restore-msg { min-height: 1.4em; }

/* ═══ Instalacja apki ═══ */
.install-link { display: inline-block; margin-top: 4px; font-weight: 700; color: var(--maroon); text-decoration: none; background: none; border: none; cursor: pointer; font-size: .95rem; font-family: var(--font-body); }
.auth-install { text-align: center; }
.install-card { padding: 16px; }
.install-card h3 { font-family: var(--font-display); }
.ios-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
