/* =========================================================================
   Volley Ballers — Volleyball Performance App
   Design system v2: premium athletic SaaS — aurora bg, glass, glow, motion.
   Edytuj zmienne w :root, żeby zmienić kolory / odstępy / typografię.
   ========================================================================= */

:root {
  /* --- Kolory tła --- */
  --bg:            #07080A;   /* główne tło (graphite/black) */
  --bg-2:          #0C0E12;   /* tło sekcji / wnętrza pierścieni */
  --bg-3:          #101218;
  --surface:       rgba(255,255,255,0.045);  /* karty */
  --surface-2:     rgba(255,255,255,0.075);  /* karty hover / aktywne */
  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);

  /* --- Typografia --- */
  --text:    #F5F7FA;          /* mocna biała */
  --text-2:  rgba(244,246,248,0.60);
  --text-3:  rgba(244,246,248,0.36);

  /* --- Akcent (gradient: blue → cyan, z fioletem w tle) --- */
  --accent:        #4EA8FF;
  --accent-2:      #76E4FF;
  --accent-3:      #9D7BFF;   /* tylko ambient/akcenty głębi */
  --accent-grad:   linear-gradient(135deg, #4EA8FF 0%, #76E4FF 100%);
  --accent-grad-3: linear-gradient(135deg, #4EA8FF 0%, #76E4FF 55%, #9D7BFF 120%);
  --accent-glow:   rgba(78,168,255,0.45);
  --accent-soft:   rgba(78,168,255,0.12);
  --on-accent:     #03101D;   /* tekst na akcencie */

  /* --- Semantyczne (tylko readiness/statusy) --- */
  --good:   #34E2A0;
  --mid:    #FFCB57;
  --bad:    #FF6B6B;

  /* --- Promienie --- */
  --r-sm: 12px;
  --r:    18px;
  --r-lg: 26px;
  --r-xl: 34px;

  /* --- Cienie (warstwowe, głębokie) --- */
  --shadow:      0 12px 40px rgba(0,0,0,0.55);
  --shadow-lg:   0 24px 70px -20px rgba(0,0,0,0.75);
  --hairline:    inset 0 1px 0 rgba(255,255,255,0.07);
  --shadow-glow: 0 0 0 1px var(--border), 0 18px 50px rgba(0,0,0,0.55);

  /* --- Easing --- */
  --ease:        cubic-bezier(.22,.7,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);

  --pad: 20px;
  --maxw: 480px; /* mobile-first kontener */

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  line-height: 1.5;
  letter-spacing: -0.011em;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: rgba(118,228,255,0.22); }

/* Ukryj scrollbary (czysty, appowy wygląd) */
.scroll, .chat-body, .day-tabs { scrollbar-width: none; }
.scroll::-webkit-scrollbar, .chat-body::-webkit-scrollbar, .day-tabs::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* Aurora tła — wolno dryfujące pola światła */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% -10%;
  background:
    radial-gradient(42% 38% at 50% -8%, rgba(78,168,255,0.22), transparent 70%),
    radial-gradient(38% 34% at 100% 8%, rgba(157,123,255,0.14), transparent 72%),
    radial-gradient(46% 42% at 0% 100%, rgba(52,226,160,0.08), transparent 70%),
    radial-gradient(40% 40% at 90% 100%, rgba(118,228,255,0.08), transparent 72%);
  pointer-events: none;
  z-index: 0;
  filter: saturate(120%);
  animation: aurora 26s var(--ease) infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(0,-2.5%,0) scale(1.08); }
}
/* Delikatne ziarno — premium "film grain" */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------- Aplikacja shell */
#app {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen { display: none; flex: 1; flex-direction: column; }
.screen.active { display: flex; }

/* --- ANIMACJE WEJŚCIA (staggerowane) --- */
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.screen.active > .top { animation: dropIn .5s var(--ease) backwards; }
.screen.active > .progress-track { animation: fadeIn .5s var(--ease) backwards; }

.screen.active .scroll > *,
.screen.active .hero > *:not(.hero-glow),
.screen.active .ready-wrap > *,
.screen.active .ob-step > * {
  animation: riseIn .55s var(--ease) backwards;
}
/* Stagger — kolejne elementy wchodzą z opóźnieniem */
.screen.active .scroll > *:nth-child(1),  .screen.active .hero > *:nth-child(2),  .screen.active .ready-wrap > *:nth-child(1),  .screen.active .ob-step > *:nth-child(1) { animation-delay: .04s; }
.screen.active .scroll > *:nth-child(2),  .screen.active .hero > *:nth-child(3),  .screen.active .ready-wrap > *:nth-child(2),  .screen.active .ob-step > *:nth-child(2) { animation-delay: .09s; }
.screen.active .scroll > *:nth-child(3),  .screen.active .hero > *:nth-child(4),  .screen.active .ready-wrap > *:nth-child(3),  .screen.active .ob-step > *:nth-child(3) { animation-delay: .14s; }
.screen.active .scroll > *:nth-child(4),  .screen.active .hero > *:nth-child(5),  .screen.active .ready-wrap > *:nth-child(4),  .screen.active .ob-step > *:nth-child(4) { animation-delay: .19s; }
.screen.active .scroll > *:nth-child(5),  .screen.active .hero > *:nth-child(6),  .screen.active .ready-wrap > *:nth-child(5),  .screen.active .ob-step > *:nth-child(5) { animation-delay: .24s; }
.screen.active .scroll > *:nth-child(6),  .screen.active .ready-wrap > *:nth-child(6),  .screen.active .ob-step > *:nth-child(6) { animation-delay: .29s; }
.screen.active .scroll > *:nth-child(7)  { animation-delay: .34s; }
.screen.active .scroll > *:nth-child(8)  { animation-delay: .39s; }
.screen.active .scroll > *:nth-child(9)  { animation-delay: .44s; }
.screen.active .scroll > *:nth-child(n+10) { animation-delay: .48s; }

.scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--pad) 124px;
  -webkit-overflow-scrolling: touch;
}

/* --------------------------------------------------------------- Typografia */
.eyebrow {
  font-size: 11.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.08; }
h2 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--text-2); }
.dim   { color: var(--text-3); }
.big-num {
  font-size: 54px; font-weight: 800; letter-spacing: -.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------- Karty */
.card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  box-shadow: var(--hairline), 0 10px 34px -16px rgba(0,0,0,0.7);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
/* Górny rozświetlony hairline (gradientowa ramka) */
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0) 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.card + .card { margin-top: 14px; }
.card.glow {
  border-color: var(--border-strong);
  box-shadow: var(--hairline), 0 0 50px -18px var(--accent-glow), 0 20px 50px -22px rgba(0,0,0,0.8);
}
@media (hover: hover) {
  .card:hover { transform: translateY(-3px); box-shadow: var(--hairline), 0 22px 50px -24px rgba(0,0,0,0.85); }
  .card.glow:hover { box-shadow: var(--hairline), 0 0 64px -16px var(--accent-glow), 0 24px 56px -22px rgba(0,0,0,0.85); }
}

/* ------------------------------------------------------------------ Buttony */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 17px 22px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  overflow: hidden;
  transition: transform .14s var(--ease), box-shadow .3s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent-grad);
  color: var(--on-accent);
  box-shadow: 0 10px 30px -8px var(--accent-glow), var(--hairline);
}
.btn-primary:hover { box-shadow: 0 16px 44px -8px var(--accent-glow), var(--hairline); }
/* Shine — przesuwający się błysk (hover + okresowo, by przyciągał wzrok na mobile) */
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -75%; width: 55%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg);
  animation: shine 5.5s var(--ease) infinite;
}
.btn-primary:hover::after { animation: shine .9s var(--ease); }
@keyframes shine { 0% { left: -75%; } 18%, 100% { left: 135%; } }
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  backdrop-filter: blur(12px);
}
.btn-ghost:hover { background: var(--surface-2); border-color: rgba(255,255,255,0.24); }
.btn-sm { padding: 12px 18px; font-size: 14px; width: auto; }

/* --------------------------------------------------------- Header ekranu */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--pad) 18px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--accent-grad);
  display: grid; place-items: center; color: var(--on-accent); font-weight: 900; font-size: 17px;
  box-shadow: 0 0 24px -4px var(--accent-glow), var(--hairline);
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  box-shadow: var(--hairline);
  transition: transform .2s var(--ease);
}
.avatar:active { transform: scale(.92); }

/* ===================================================================== */
/*  LANDING / SPLASH                                                     */
/* ===================================================================== */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px var(--pad) 44px;
  position: relative;
  overflow: hidden;
}
.hero-glow {
  position: absolute; top: -8%; left: 50%; transform: translateX(-50%);
  width: 140%; height: 62%;
  background:
    radial-gradient(circle, var(--accent-glow), transparent 62%),
    radial-gradient(circle at 70% 40%, rgba(157,123,255,0.3), transparent 60%);
  filter: blur(46px); opacity: .55; pointer-events: none;
  animation: heroPulse 7s ease-in-out infinite alternate;
}
@keyframes heroPulse { from { opacity: .42; transform: translateX(-50%) scale(1); } to { opacity: .62; transform: translateX(-50%) scale(1.08); } }
.hero h1 { font-size: 46px; margin: 16px 0 14px; letter-spacing: -.035em; }
.hero h1 span {
  background: var(--accent-grad-3);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero .sub { font-size: 17px; color: var(--text-2); max-width: 92%; margin-bottom: 30px; line-height: 1.55; }
.hero .badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.pill {
  font-size: 12px; font-weight: 600; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  backdrop-filter: blur(12px); box-shadow: var(--hairline);
}

/* ===================================================================== */
/*  ONBOARDING                                                           */
/* ===================================================================== */
.progress-track { height: 5px; background: rgba(255,255,255,0.06); border-radius: 999px; margin: 0 var(--pad); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0; background: var(--accent-grad); border-radius: 999px;
  transition: width .5s var(--ease); box-shadow: 0 0 14px var(--accent-glow);
  position: relative; overflow: hidden;
}
.progress-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  animation: shine 2.2s var(--ease) infinite;
}

.ob-step { padding: 24px var(--pad) 0; }
.ob-step h2 { margin-bottom: 6px; }
.ob-step .q-sub { color: var(--text-2); margin-bottom: 26px; }

/* Opcje wyboru */
.options { display: grid; gap: 10px; }
.options.grid-2 { grid-template-columns: 1fr 1fr; }
.opt {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 18px; border-radius: var(--r);
  background: var(--surface); border: 1.5px solid var(--border);
  transition: transform .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease), box-shadow .25s var(--ease);
  text-align: left; width: 100%;
  box-shadow: var(--hairline);
}
.opt:active { transform: scale(.98); }
@media (hover: hover) { .opt:hover { border-color: var(--border-strong); background: var(--surface-2); } }
.opt.sel {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 34px -12px var(--accent-glow), var(--hairline);
  animation: pop .34s var(--ease-spring);
}
@keyframes pop { 0% { transform: scale(.96); } 55% { transform: scale(1.03); } 100% { transform: scale(1); } }
.opt .opt-ico { font-size: 22px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.opt .opt-t { font-weight: 700; font-size: 15px; }
.opt .opt-d { font-size: 12.5px; color: var(--text-2); }
.opt .check { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; flex-shrink: 0; transition: all .2s var(--ease-spring); }
.opt.sel .check { background: var(--accent-grad); border-color: transparent; color: var(--on-accent); box-shadow: 0 0 14px var(--accent-glow); }
.opt.sel .check::after { content: "✓"; font-size: 13px; font-weight: 900; }
.opt.compact { flex-direction: column; align-items: flex-start; gap: 6px; }
.opt.compact .check { position: absolute; }

/* Slidery / inputy liczbowe */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 8px; font-weight: 600; }
.range-val { font-size: 36px; font-weight: 800; letter-spacing: -.03em; }
.range-val small { font-size: 16px; color: var(--text-2); font-weight: 600; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 7px; border-radius: 999px;
  background: rgba(255,255,255,0.08); margin-top: 14px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-grad); cursor: pointer; box-shadow: 0 0 0 5px rgba(78,168,255,0.16), 0 4px 14px var(--accent-glow);
  border: 3px solid var(--bg);
  transition: transform .12s var(--ease);
}
input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.18); }
input[type="range"]::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%; background: #4EA8FF;
  cursor: pointer; border: 3px solid var(--bg); box-shadow: 0 0 0 5px rgba(78,168,255,0.16);
}

.text-input {
  width: 100%; padding: 16px; border-radius: 14px;
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: 16px; color: var(--text); transition: border .2s var(--ease), box-shadow .2s var(--ease);
  box-shadow: var(--hairline);
}
.text-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.text-input::placeholder { color: var(--text-3); }

/* Stała stopka onboardingu */
.ob-footer {
  padding: 14px var(--pad) calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--bg) 32%);
  position: sticky; bottom: 0;
}

/* ===================================================================== */
/*  PLAN READY                                                           */
/* ===================================================================== */
.ready-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px var(--pad); }
.ready-ring {
  width: 134px; height: 134px; border-radius: 50%; margin-bottom: 28px; position: relative;
  background: conic-gradient(from -90deg, var(--accent), var(--accent-2) var(--p,0%), rgba(255,255,255,0.06) 0);
  display: grid; place-items: center;
  box-shadow: 0 0 70px -10px var(--accent-glow);
}
.ready-ring::before {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  background: conic-gradient(from -90deg, var(--accent-glow), transparent 70%);
  filter: blur(14px); opacity: .6; animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ready-ring::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--bg-2); box-shadow: var(--hairline); }
.ready-ring .pct { position: relative; z-index: 1; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.plan-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; width: 100%; margin: 26px 0; transition: opacity .6s var(--ease); }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 10px; box-shadow: var(--hairline); }
.stat-box .v { font-size: 24px; font-weight: 800; }
.stat-box .l { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }

/* ===================================================================== */
/*  PAYWALL                                                              */
/* ===================================================================== */
.price-tag { display: flex; align-items: baseline; gap: 6px; justify-content: center; margin: 6px 0 4px; }
.price-tag .amount { font-size: 50px; font-weight: 800; letter-spacing: -.04em; }
.price-tag .per { color: var(--text-2); font-size: 15px; }
.feature-list { display: grid; gap: 14px; margin: 24px 0; }
.feature-list li { list-style: none; display: flex; gap: 12px; align-items: flex-start; }
.feature-list .fi { width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; flex-shrink: 0; font-size: 13px; font-weight: 900; box-shadow: inset 0 0 0 1px rgba(118,228,255,0.25); }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--text-3); font-size: 12.5px; margin-top: 14px; }

/* Popup płatności (modal) */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(4,5,7,0.7);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.modal-overlay.show { display: flex; animation: fadeIn .28s var(--ease); }
.modal-card {
  width: 100%; max-width: var(--maxw);
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -30px 80px rgba(0,0,0,0.7), var(--hairline);
  max-height: 92dvh; overflow-y: auto;
  animation: sheetUp .42s var(--ease-spring);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text); font-size: 15px; display: grid; place-items: center;
  transition: background .2s var(--ease), transform .15s var(--ease);
}
.modal-close:hover { background: var(--surface-2); }
.modal-close:active { transform: scale(.9); }
#checkoutMount { min-height: 200px; }

@media (min-width: 481px) {
  .modal-overlay { align-items: center; }
  .modal-card { border-radius: var(--r-xl); margin: 0 16px; }
}

/* ===================================================================== */
/*  DASHBOARD                                                            */
/* ===================================================================== */
.hello { padding: 4px var(--pad) 20px; }
.hello .eyebrow { margin-bottom: 4px; }

/* Streak hero */
.streak-card { display: flex; align-items: center; gap: 18px; overflow: hidden; }
.streak-flame { font-size: 42px; filter: drop-shadow(0 0 16px rgba(255,150,60,.7)); animation: flameFlicker 2.4s ease-in-out infinite; }
@keyframes flameFlicker { 0%,100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08) rotate(2deg); } }
.streak-card .big-num {
  line-height: .9;
  background: linear-gradient(135deg, #FFB347, #FF7847);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* Pierścienie postępu (wspólne) */
.week-ring-wrap { display: flex; align-items: center; gap: 20px; }
.ring {
  --p: 0%;
  width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0; position: relative;
  background: conic-gradient(from -90deg, var(--accent), var(--accent-2) calc(var(--p)*1%), rgba(255,255,255,0.06) 0);
  display: grid; place-items: center;
  filter: drop-shadow(0 0 16px rgba(78,168,255,0.25));
}
.ring::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--bg-2); box-shadow: var(--hairline); }
.ring .ring-txt { position: relative; z-index: 1; font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }

/* Mini statystyki rzędem */
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-stat .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mini-stat .l { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Wykres progresu (słupki) */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 124px; margin-top: 16px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent) 60%, rgba(78,168,255,.2));
  min-height: 6px; transition: height .7s var(--ease);
  box-shadow: 0 0 18px -4px var(--accent-glow);
}
.bar.empty { background: rgba(255,255,255,0.06); box-shadow: none; }
.bar-col .lbl { font-size: 11px; color: var(--text-3); font-weight: 600; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; }
.section-title a { font-size: 13px; color: var(--accent-2); font-weight: 600; }

/* Karta dzisiejszego treningu (CTA) */
.today-cta { position: relative; overflow: hidden; }
.today-cta::before {
  content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%); filter: blur(12px);
  animation: heroPulse 5s ease-in-out infinite alternate;
}
.today-cta > * { position: relative; }
.today-cta .meta { display: flex; gap: 16px; color: var(--text-2); font-size: 13px; margin: 10px 0 18px; }
.today-cta .meta span { display: flex; align-items: center; gap: 5px; }

/* ===================================================================== */
/*  READINESS CHECK-IN                                                   */
/* ===================================================================== */
.checkin-q { margin-bottom: 24px; }
.checkin-q .q-label { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 14px; }
.checkin-q .q-label .ico { font-size: 20px; }
.scale { display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; }
.scale button {
  aspect-ratio: 1; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--border);
  font-size: 18px; font-weight: 700; transition: transform .14s var(--ease-spring), background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); color: var(--text-2);
  box-shadow: var(--hairline);
}
.scale button:active { transform: scale(.9); }
.scale button.sel { background: var(--accent-soft); border-color: var(--accent); color: var(--text); box-shadow: 0 0 24px -8px var(--accent-glow); transform: translateY(-2px); }

.readiness-result { text-align: center; }
.readiness-ring {
  --p: 0; width: 180px; height: 180px; margin: 12px auto 24px; border-radius: 50%; position: relative;
  background: conic-gradient(from -90deg, var(--rc, var(--accent)) calc(var(--p)*1%), rgba(255,255,255,0.06) 0);
  display: grid; place-items: center; transition: background .9s var(--ease);
  filter: drop-shadow(0 0 26px rgba(78,168,255,0.3));
}
.readiness-ring::after { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: var(--bg-2); box-shadow: var(--hairline); }
.readiness-ring .inner { position: relative; z-index: 1; }
.readiness-ring .inner .n { font-size: 50px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.readiness-ring .inner .u { font-size: 14px; color: var(--text-2); }
.reco { padding: 18px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); text-align: left; display: flex; gap: 14px; box-shadow: var(--hairline); }
.reco .reco-ico { font-size: 28px; }
.reco .reco-t { font-weight: 700; margin-bottom: 3px; }
.reco .reco-d { font-size: 13.5px; color: var(--text-2); }

/* ===================================================================== */
/*  DAILY VIEW (trening)                                                 */
/* ===================================================================== */
.train-head { padding: 24px var(--pad) 8px; }
.train-head .session-type {
  font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
/* Wybór dnia planu — poziomy scroll */
.day-tabs { display: flex; gap: 8px; padding: 10px var(--pad) 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.day-tab { flex-shrink: 0; padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; transition: all .2s var(--ease); box-shadow: var(--hairline); }
.day-tab:active { transform: scale(.95); }
.day-tab.active { background: var(--accent-grad); border-color: transparent; color: var(--on-accent); box-shadow: 0 6px 20px -8px var(--accent-glow); }
.day-tab .opt-dot { font-size: 10px; opacity: .7; font-weight: 600; }

.ex-note { font-size: 13px; color: var(--text-2); margin: 10px 0 0; line-height: 1.5; }

.block-tabs { display: flex; gap: 8px; padding: 14px var(--pad); position: sticky; top: 0; background: linear-gradient(180deg, var(--bg) 72%, transparent); z-index: 5; }
.block-tab { flex: 1; padding: 12px; border-radius: 13px; font-size: 13px; font-weight: 700; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); transition: all .2s var(--ease); box-shadow: var(--hairline); }
.block-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--text); box-shadow: 0 0 22px -10px var(--accent-glow); }

.exercise {
  position: relative;
  border: 1px solid var(--border); border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018));
  padding: 18px; margin-bottom: 12px;
  box-shadow: var(--hairline);
  transition: opacity .3s var(--ease), border-color .25s var(--ease), transform .15s var(--ease), box-shadow .25s var(--ease);
}
@media (hover: hover) { .exercise:hover { border-color: var(--border-strong); } }
.exercise.done { opacity: .5; }
.ex-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ex-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.ex-tag { font-size: 11px; color: var(--accent-2); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.ex-stats { display: flex; gap: 18px; margin: 12px 0; }
.ex-stats .es { font-size: 13px; color: var(--text-2); }
.ex-stats .es b { display: block; color: var(--text); font-size: 18px; font-weight: 800; margin-top: 2px; }
.ex-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.yt-link { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text); padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); transition: background .2s var(--ease), transform .14s var(--ease); }
.yt-link:active { transform: scale(.95); }
.yt-link:hover { background: rgba(255,255,255,0.1); }
.yt-link .yt-ico { color: #ff4d4d; font-size: 16px; }
.ex-check { margin-left: auto; width: 32px; height: 32px; border-radius: 10px; border: 2px solid var(--border-strong); display: grid; place-items: center; flex-shrink: 0; transition: all .2s var(--ease-spring); }
.ex-check:active { transform: scale(.85); }
.exercise.done .ex-check { background: var(--good); border-color: var(--good); color: var(--on-accent); box-shadow: 0 0 18px -4px rgba(52,226,160,.6); }
.exercise.done .ex-check::after { content: "✓"; font-weight: 900; }

/* Timer przerw — floating */
.rest-timer {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(20px);
  width: calc(var(--maxw) - 40px); max-width: calc(100% - 32px);
  background: rgba(12,14,18,.82); backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--border-strong); border-radius: var(--r);
  padding: 16px 18px; display: none; align-items: center; gap: 16px; z-index: 30;
  box-shadow: var(--shadow-lg), var(--hairline);
  opacity: 0; transition: opacity .3s var(--ease), transform .35s var(--ease-spring);
}
.rest-timer.show { display: flex; opacity: 1; transform: translateX(-50%) translateY(0); }
.rest-timer .rt-num { font-size: 36px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 84px; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.rest-timer .rt-label { font-size: 12px; color: var(--text-2); }
.rest-timer .rt-actions { margin-left: auto; display: flex; gap: 8px; }
.rt-btn { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 700; font-size: 13px; transition: transform .14s var(--ease), background .2s var(--ease); }
.rt-btn:active { transform: scale(.92); }

/* ===================================================================== */
/*  CHAT                                                                 */
/* ===================================================================== */
.chat-screen { display: flex; flex-direction: column; height: calc(100dvh - 71px); }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 18px var(--pad); border-bottom: 1px solid var(--border); background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent); }
.chat-header .coach-av { width: 46px; height: 46px; border-radius: 50%; background: var(--accent-grad); display: grid; place-items: center; font-weight: 800; color: var(--on-accent); box-shadow: 0 0 22px -6px var(--accent-glow), var(--hairline); }
.chat-header .status { font-size: 12px; color: var(--good); display: flex; align-items: center; gap: 5px; }
.chat-header .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); animation: livePulse 2s ease-in-out infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.8); } }
.chat-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px var(--pad); display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 80%; padding: 13px 16px; border-radius: 18px; font-size: 14.5px; line-height: 1.45; animation: msgIn .35s var(--ease-spring) backwards; box-shadow: 0 4px 16px -8px rgba(0,0,0,.6); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.msg.in  { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 6px; backdrop-filter: blur(10px); }
.msg.out { align-self: flex-end; background: var(--accent-grad); color: var(--on-accent); border-bottom-right-radius: 6px; font-weight: 500; }
.msg .t { font-size: 10px; opacity: .6; margin-top: 4px; display: block; }
.chat-input { display: flex; gap: 10px; padding: 14px var(--pad) calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: rgba(7,8,10,.85); backdrop-filter: blur(20px); }
.chat-input input { flex: 1; padding: 14px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 15px; transition: border .2s var(--ease), box-shadow .2s var(--ease); }
.chat-input input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.chat-input .send { width: 50px; height: 50px; border-radius: 50%; background: var(--accent-grad); color: var(--on-accent); display: grid; place-items: center; font-size: 19px; flex-shrink: 0; box-shadow: 0 6px 20px -6px var(--accent-glow); transition: transform .14s var(--ease-spring); }
.chat-input .send:active { transform: scale(.88); }

/* ===================================================================== */
/*  PROFILE                                                              */
/* ===================================================================== */
.profile-hero { text-align: center; padding: 20px 0 10px; }
.profile-hero .big-av { width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 14px; background: var(--accent-grad); display: grid; place-items: center; font-size: 34px; font-weight: 800; color: var(--on-accent); box-shadow: 0 0 44px -8px var(--accent-glow), var(--hairline); }
.info-list { display: grid; gap: 1px; background: var(--border); border-radius: var(--r); overflow: hidden; box-shadow: var(--hairline); }
.info-row { display: flex; justify-content: space-between; padding: 16px 18px; background: var(--bg-2); font-size: 14.5px; transition: background .2s var(--ease); }
.info-row:hover { background: var(--bg-3); }
.info-row .k { color: var(--text-2); }
.info-row .v { font-weight: 600; }
.goal-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.goal-chip { font-size: 12.5px; font-weight: 600; padding: 8px 14px; border-radius: 999px; background: var(--accent-soft); border: 1px solid rgba(78,168,255,0.4); color: var(--accent-2); }
.sub-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 999px; background: var(--accent-grad); color: var(--on-accent); font-weight: 700; font-size: 13px; box-shadow: 0 6px 20px -8px var(--accent-glow), var(--hairline); }

/* ===================================================================== */
/*  PANEL TRENERA — lista rozmów                                         */
/* ===================================================================== */
.convo {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px; border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018));
  border: 1px solid var(--border); margin-bottom: 10px;
  transition: transform .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
  box-shadow: var(--hairline);
}
.convo:active { transform: scale(.985); }
@media (hover: hover) { .convo:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-2px); } }
.convo-av {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-grad); color: var(--on-accent);
  display: grid; place-items: center; font-weight: 800; font-size: 18px;
  box-shadow: 0 0 20px -8px var(--accent-glow), var(--hairline);
}
.convo-main { flex: 1; min-width: 0; }
.convo-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.convo-name { font-weight: 700; font-size: 15px; }
.convo-time { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.convo-last { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* ===================================================================== */
/*  BOTTOM NAV                                                           */
/* ===================================================================== */
.tabbar {
  position: sticky; bottom: 0; left: 0; right: 0;
  display: none; align-items: center; justify-content: space-around;
  padding: 12px 8px calc(12px + env(safe-area-inset-bottom));
  background: rgba(7,8,10,.72); backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%);
  border-top: 1px solid var(--border); z-index: 20;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.4);
}
.tabbar.show { display: flex; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-3); font-size: 10.5px; font-weight: 600; padding: 4px 12px; transition: color .2s var(--ease); position: relative; }
.tab .tab-ico { font-size: 21px; line-height: 1; transition: transform .25s var(--ease-spring); }
.tab:active .tab-ico { transform: scale(.85); }
.tab.active { color: var(--text); }
.tab.active .tab-ico { filter: drop-shadow(0 0 10px var(--accent-glow)); transform: translateY(-1px); }
/* Świecąca kropka aktywnej zakładki */
.tab.active:not(.fab)::after {
  content: ""; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent); animation: pop .3s var(--ease-spring);
}
.tab.fab .tab-ico {
  width: 54px; height: 54px; border-radius: 50%; margin-top: -24px;
  background: var(--accent-grad); color: var(--on-accent);
  display: grid; place-items: center; font-size: 25px;
  box-shadow: 0 10px 28px -6px var(--accent-glow), var(--hairline);
  position: relative;
}
/* Pulsujący pierścień wokół FAB */
.tab.fab .tab-ico::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: fabPulse 2.6s var(--ease) infinite;
}
@keyframes fabPulse { 0% { box-shadow: 0 0 0 0 rgba(78,168,255,0.5); } 70%,100% { box-shadow: 0 0 0 16px rgba(78,168,255,0); } }
.tab.fab:active .tab-ico { transform: scale(.92); }

/* ===================================================================== */
/*  Helpers / Toast                                                      */
/* ===================================================================== */
.spacer-8  { height: 8px; }
.spacer-16 { height: 16px; }
.spacer-24 { height: 24px; }
.center { text-align: center; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.toast {
  position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(16,18,24,.92); border: 1px solid var(--border-strong); backdrop-filter: blur(24px);
  color: var(--text); padding: 14px 22px; border-radius: 14px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .35s var(--ease-spring); z-index: 100; box-shadow: var(--shadow-lg), var(--hairline);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.back-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; font-size: 18px; transition: background .2s var(--ease), transform .14s var(--ease); box-shadow: var(--hairline); }
.back-btn:hover { background: var(--surface-2); }
.back-btn:active { transform: scale(.9); }

/* Loader (kropki) */
.loading-dots { display: inline-flex; gap: 6px; }
.loading-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite ease-in-out; box-shadow: 0 0 10px var(--accent-glow); }
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%,100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

/* Dostępność — szanuj wyłączone animacje */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Ramka desktopowa (podgląd na szerokim ekranie) */
@media (min-width: 481px) {
  body { padding: 0; }
  #app {
    box-shadow: 0 40px 120px rgba(0,0,0,.7);
    border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  }
}
