/* ======================================================================
   Mój Dziennik - style. Najpierw czytelny dziennik, gra tylko w "Skinach".
   ====================================================================== */
:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --card-2: #f0f2f7;
  --text: #141824;
  --muted: #687087;
  --line: #e4e7ef;
  --accent: #3b5bfd;
  --accent-2: #7c5cff;
  --accent-soft: #e9edff;
  --accent-text: #2b45d6;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --warn: #d48806;
  --warn-soft: #fff4d9;
  --ok: #18a058;
  --ok-soft: #e3f7ec;
  --gold: #e0a800;
  --g1: #e5484d; --g2: #f0802a; --g3: #d9a400; --g4: #4fae2e; --g5: #18a058; --g6: #0e9384; --gx: #8b90a0;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .04), 0 6px 20px rgba(20, 24, 40, .05);
  --tabbar-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117; --card: #181b24; --card-2: #222634; --text: #eceef4; --muted: #969db1; --line: #2a2f3d;
    --accent: #7086ff; --accent-2: #a28bff; --accent-soft: #232a4d; --accent-text: #a9b6ff;
    --danger-soft: #3a1d20; --warn: #e8a92a; --warn-soft: #3a2f12; --ok-soft: #133024; --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1117; --card: #181b24; --card-2: #222634; --text: #eceef4; --muted: #969db1; --line: #2a2f3d;
  --accent: #7086ff; --accent-2: #a28bff; --accent-soft: #232a4d; --accent-text: #a9b6ff;
  --danger-soft: #3a1d20; --warn: #e8a92a; --warn-soft: #3a2f12; --ok-soft: #133024; --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
a { color: var(--accent-text); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.error { color: var(--danger); margin: 0; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row.center { justify-content: center; }
.spread { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
svg.i { width: 22px; height: 22px; flex: none; }
svg.i.xs { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- Formularze i przyciski ---------- */
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .input {
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; outline: none; width: 100%;
}
.sim .input, .range-form .input, .room-chat .input { width: auto; }
textarea.input { resize: vertical; font: inherit; font-size: 16px; }
.field input:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 16px;
  font-weight: 650; cursor: pointer; text-decoration: none; text-align: center;
  background: var(--card-2); color: var(--text); transition: transform .1s, filter .15s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--accent-text); }
.btn.danger-text { color: var(--danger); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn.icon-text svg { width: 19px; height: 19px; }
.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 12px; background: transparent;
  cursor: pointer; color: var(--text); text-decoration: none;
}
.icon-btn:hover { background: var(--card-2); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* przełącznik (checkbox jako suwak) */
input.toggle {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0;
  width: 46px; height: 28px; border-radius: 14px; background: var(--line); position: relative; cursor: pointer; transition: background .2s;
}
input.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
input.toggle:checked { background: var(--ok); }
input.toggle:checked::after { transform: translateX(18px); }

/* ---------- Logowanie ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.login-logo { margin: 0 auto 4px; border-radius: 18px; box-shadow: 0 10px 30px rgba(59, 91, 253, .25); }
.login-card h1 { font-size: 28px; letter-spacing: -.01em; }
.login-card p { margin: 0; }

/* ---------- Szkielet aplikacji ---------- */
.app { min-height: 100dvh; }
.main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 4px;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px 16px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.topbar h1 { font-size: 24px; letter-spacing: -.015em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#back-btn { margin-left: -8px; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 3px 8px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); }
.bell-btn { position: relative; }
.bell-count { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; line-height: 17px; text-align: center; }
.bell-count:empty { display: none; }
.bell-btn.has svg { animation: bell-ring 1.2s ease-in-out 2; transform-origin: 50% 0; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }
.me-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; text-decoration: none; margin-left: 2px; }
.me-ini { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

.view { padding: 4px 16px 16px; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20; display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 650;
}
.tabbar a svg { width: 24px; height: 24px; transition: transform .15s; }
.tabbar a.active { color: var(--accent); }
.tabbar a.active svg { transform: translateY(-1px); }
.dot-count {
  position: absolute; top: 6px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.sidebar { display: none; }

@media (max-width: 699px) {
  #refresh-btn, #demo-badge { display: none !important; }
}
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 250px 1fr; }
  .tabbar { display: none; }
  .main { padding-bottom: 32px; }
  .sidebar {
    display: flex; flex-direction: column; gap: 14px;
    position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: 20px 14px; border-right: 1px solid var(--line); background: var(--card);
  }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 17px; padding: 0 8px; }
  .brand img { border-radius: 9px; }
  #side-nav { display: flex; flex-direction: column; gap: 2px; }
  #side-nav .nav-group { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 12px 12px 4px; }
  #side-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 550; }
  #side-nav a:hover { background: var(--card-2); }
  #side-nav a.active { background: var(--accent-soft); color: var(--accent-text); }
  #side-nav a .dot-count { position: static; margin-left: auto; }
  #side-nav .sep { height: 1px; background: var(--line); margin: 8px 4px; }
  #side-nav a.nav-game svg { color: var(--accent-2); }
  .topbar { padding-top: 18px; max-width: 792px; margin: 0 auto; }
}

/* ---------- Karty i listy ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.bordered { box-shadow: none; border: 1px solid var(--line); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-head.pad { padding: 16px 16px 4px; margin: 0; }
.card-head h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.card-head a { color: var(--accent-text); font-size: 13px; font-weight: 650; text-decoration: none; flex: none; }
.section-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 6px 4px -4px; display: flex; align-items: center; gap: 6px; }
.note { padding: 12px 14px; border-radius: 14px; background: var(--card-2); font-size: 14px; line-height: 1.45; }
.note.warn { background: var(--warn-soft); }
.note.ok { background: var(--ok-soft); color: var(--ok); font-weight: 600; }

.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-top: 1px solid var(--line);
  text-decoration: none; color: inherit; background: none;
  border-left: 0; border-right: 0; border-bottom: 0;
  width: 100%; text-align: left; cursor: pointer;
}
.row:first-child { border-top: 0; }
@media (hover: hover) { .row:hover { background: var(--card-2); } }
.row.static { cursor: default; }
.row.static:hover, .row.lesson:hover { background: none; }
.row.block { display: block; }
.row .title { font-weight: 650; }
.row .sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.row .sub.wrap { white-space: normal; }
.row .end { text-align: right; flex: none; font-size: 13px; color: var(--muted); }
.row > svg.i { color: var(--muted); }
.row.unread .title { font-weight: 800; }
.row.unread::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-left: -6px; }
.row.is-new { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.row > .grade:first-child { min-width: 40px; }
.row-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.row-link > span:first-child { font-size: 24px; }
.chev { font-size: 22px; color: var(--muted); }
.kind-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; flex: none; }
.kind-dot.test { background: var(--danger); }
.kind-dot.hw { background: var(--warn); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.grade {
  position: relative; min-width: 34px; height: 34px; padding: 0 8px;
  display: inline-grid; place-items: center; border-radius: 10px;
  font-weight: 750; font-size: 15px; color: #fff; background: var(--gx);
  border: 0; cursor: pointer; font-variant-numeric: tabular-nums; transition: transform .1s;
}
.grade:active:not(.pop) { transform: scale(.92); }
.grade.lg { min-width: 56px; height: 56px; font-size: 24px; border-radius: 16px; }
.grade.sm { min-width: 28px; height: 28px; font-size: 13px; border-radius: 8px; padding: 0 5px; cursor: default; }
.grade.g1 { background: var(--g1); } .grade.g2 { background: var(--g2); } .grade.g3 { background: var(--g3); }
.grade.g4 { background: var(--g4); } .grade.g5 { background: var(--g5); } .grade.g6 { background: var(--g6); }
.grade.nc { opacity: .5; }
.grade.new { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
.grade.new::after { content: ""; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--card); }
.avg-txt { font-weight: 800; font-variant-numeric: tabular-nums; }
.avg-txt.g1 { color: var(--g1); } .avg-txt.g2 { color: var(--g2); } .avg-txt.g3 { color: var(--g3); }
.avg-txt.g4 { color: var(--g4); } .avg-txt.g5 { color: var(--g5); } .avg-txt.g6 { color: var(--g6); }

.pill {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 650;
  background: var(--card-2); color: var(--muted); white-space: nowrap;
}
.pill.accent { background: var(--accent-soft); color: var(--accent-text); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.sym { min-width: 36px; justify-content: center; }
.quiz-pill { background: linear-gradient(90deg, #8b5cf6, #ec4899) !important; color: #fff !important; }

.segmented { display: flex; padding: 3px; gap: 3px; background: var(--card-2); border-radius: 12px; }
.segmented button, .segmented a {
  flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px;
  font-weight: 650; font-size: 14px; color: var(--muted); cursor: pointer; text-decoration: none; text-align: center;
}
.segmented button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(20, 24, 40, .1); }
.segmented button:disabled { opacity: .35; cursor: not-allowed; }
@media (max-width: 400px) { .segmented button, .segmented a { font-size: 13px; padding: 8px 4px; } }
.navline { display: flex; align-items: center; gap: 8px; }
.navline .label { flex: 1; text-align: center; font-weight: 750; }

.bar { height: 6px; border-radius: 3px; background: var(--card-2); overflow: hidden; margin-top: 6px; }
.bar > div { height: 100%; border-radius: 3px; background: var(--ok); transition: width .6s cubic-bezier(.2, .9, .2, 1); }
.bar.warn > div { background: var(--warn); }
.bar.danger > div { background: var(--danger); }
.bar.now > div { background: var(--accent); }
.bar.xp > div { background: linear-gradient(90deg, #8b5cf6, #ec4899); }

/* ---------- Start ---------- */
.hello {
  display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 30%, transparent);
}
.hello h2 { font-size: 24px; letter-spacing: -.01em; margin: 2px 0; }
.hello-date { font-size: 13px; font-weight: 650; opacity: .85; }
.hello-sub { font-size: 14px; opacity: .9; }
.lucky { flex: none; width: 84px; padding: 10px 4px; text-align: center; border-radius: 16px; background: rgba(255, 255, 255, .18); }
.lucky b { display: block; font-size: 30px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.lucky span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; opacity: .9; line-height: 1.2; margin-top: 2px; }
.lucky.me { background: #fff; color: var(--accent-text); }

.now-card { margin: 8px 12px 6px; padding: 14px; border-radius: 14px; background: var(--accent-soft); }
.now-card.next { background: var(--card-2); }
.now-kicker { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-text); }
.now-card.next .now-kicker { color: var(--muted); }
.now-title { font-size: 20px; font-weight: 800; margin-top: 2px; }
.now-sub { font-size: 13px; color: var(--muted); }
.now-next { font-size: 13px; margin-top: 8px; color: var(--muted); }
.now-next b { color: var(--text); }
.now-card .bar { background: color-mix(in srgb, var(--accent) 18%, transparent); height: 7px; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick.two { grid-template-columns: 1fr 1fr; }
.quick > div > .card { height: 100%; }
.stat { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; min-width: 0; }
.stat b { font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat span { color: var(--muted); font-size: 12.5px; line-height: 1.25; }
.stat.hot b { color: var(--accent); }
.stat.soft { background: var(--card-2); border-radius: 14px; padding: 12px; }
.quick .card.stat { padding: 14px 12px; transition: transform .12s; }
.quick .card.stat:active { transform: scale(.97); }
.quick .skeleton { min-height: 52px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.datebox { width: 46px; flex: none; text-align: center; border-radius: 12px; background: var(--card-2); padding: 6px 0; }
.datebox.today { background: var(--accent); color: #fff; }
.datebox.today small { color: rgba(255, 255, 255, .85); }
.datebox b { display: block; font-size: 18px; line-height: 1.1; }
.datebox small { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 700; }

/* ---------- Oceny ---------- */
.grade-summary { display: flex; align-items: center; gap: 16px; }
.gs-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.gs-main b { font-size: 40px; line-height: 1; letter-spacing: -.02em; }
.gs-main span { font-size: 13px; color: var(--muted); margin-top: 4px; }
.gs-side { display: flex; gap: 16px; }
.gs-side div { display: flex; flex-direction: column; align-items: center; }
.gs-side b { font-size: 20px; font-variant-numeric: tabular-nums; }
.gs-side span { font-size: 12px; color: var(--muted); }
.gs-new b { color: var(--accent); }
.row.subject { align-items: flex-start; }
.subject-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.avg-badge { flex: none; font-size: 13px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: var(--card-2); font-variant-numeric: tabular-nums; }
.avg-badge.g1 { color: var(--g1); background: color-mix(in srgb, var(--g1) 14%, transparent); }
.avg-badge.g2 { color: var(--g2); background: color-mix(in srgb, var(--g2) 14%, transparent); }
.avg-badge.g3 { color: var(--g3); background: color-mix(in srgb, var(--g3) 16%, transparent); }
.avg-badge.g4 { color: var(--g4); background: color-mix(in srgb, var(--g4) 14%, transparent); }
.avg-badge.g5 { color: var(--g5); background: color-mix(in srgb, var(--g5) 14%, transparent); }
.avg-badge.g6 { color: var(--g6); background: color-mix(in srgb, var(--g6) 14%, transparent); }
.sheet-grade { display: flex; gap: 14px; align-items: center; }
.sim { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sim select, .sim input { padding: 8px 10px; font-size: 15px; }

/* ---------- Plan lekcji ---------- */
.days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.days button {
  border: 0; border-radius: 14px; padding: 8px 0 6px; cursor: pointer;
  background: var(--card); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 0;
}
.days button small { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.days button b { font-size: 18px; line-height: 1.2; }
.days button i { font-style: normal; font-size: 10px; color: var(--muted); min-height: 13px; }
.days button.on { background: var(--accent); color: #fff; }
.days button.on small, .days button.on i { color: rgba(255, 255, 255, .85); }
.days button.today:not(.on) b { color: var(--accent); }

.lesson { align-items: flex-start; cursor: default; }
.lesson .num { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--card-2); font-weight: 750; font-size: 13px; }
.lesson .badges { margin-top: 5px; display: flex; gap: 4px; flex-wrap: wrap; }
.lesson .badges .pill { white-space: normal; }
.lesson.now { background: var(--accent-soft); }
.lesson.now .num { background: var(--accent); color: #fff; }
.lesson.canceled .title { text-decoration: line-through; color: var(--muted); }

/* ---------- Terminarz ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .wd { font-size: 11px; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.cal button { aspect-ratio: 1; border: 0; border-radius: 10px; background: transparent; cursor: pointer; position: relative; font-weight: 650; font-variant-numeric: tabular-nums; }
.cal button:hover { background: var(--card-2); }
.cal button.out { visibility: hidden; }
.cal button.weekend, .cal button.past { color: var(--muted); }
.cal button.today { color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.cal button.on { background: var(--accent); color: #fff; }
.cal button i { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cal button i.test { background: var(--danger); }
.cal button.on i { background: #fff; }
.cal-legend { display: flex; gap: 14px; justify-content: center; margin-top: 10px; font-size: 12px; color: var(--muted); }
.cal-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 3px; }
.cal-legend i.test { background: var(--danger); }

/* ---------- Frekwencja ---------- */
.ring-wrap { display: flex; align-items: center; gap: 16px; }
.ring { width: 88px; height: 88px; flex: none; position: relative; }
@media (min-width: 420px) { .ring { width: 120px; height: 120px; } }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 800; }
@media (min-width: 420px) { .ring .val { font-size: 26px; } }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 8px; flex: 1; min-width: 0; }
.legend div b { display: block; font-size: 20px; }
.legend div span { display: block; font-size: 11px; line-height: 1.25; color: var(--muted); }

/* ---------- Wiadomości, ogłoszenia ---------- */
.msg-top { display: flex; gap: 8px; align-items: center; }
.msg-top .btn { flex: none; padding: 10px 14px; }
.row.msg { align-items: flex-start; }
.row.msg .avatar-sm { margin-top: 2px; }
.msg-title { font-size: 19px; margin-bottom: 12px; }
.message-body { white-space: pre-wrap; word-wrap: break-word; line-height: 1.6; }
.message-body.clamp { max-height: 9.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.people { max-height: 260px; overflow: auto; }
.announcement { display: flex; flex-direction: column; gap: 10px; }
.ann-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ann-head h2 { font-size: 17px; }
.announcement .btn.ghost { align-self: flex-start; padding: 0; }

/* ---------- Co nowego ---------- */
.upd-kicker { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-text); }
.update { display: flex; flex-direction: column; gap: 8px; }
.update h2 { font-size: 19px; }
.update.latest { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.upd-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.upd-list li { position: relative; padding-left: 22px; line-height: 1.45; }
.upd-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--ok); font-weight: 900; }
#sheet-body .btn.ghost { align-self: center; }

/* ---------- Zadania, tematy ---------- */
.hw-check {
  width: 30px; height: 30px; flex: none; border-radius: 9px; border: 2px solid var(--line); background: var(--card);
  display: grid; place-items: center; color: transparent; font-weight: 900; cursor: pointer; padding: 0;
}
.hw-check.on { background: var(--ok); border-color: var(--ok); color: #fff; animation: pop .35s cubic-bezier(.2, 2, .4, 1); }
@keyframes pop { from { transform: scale(.8); } }
.row.hw-done .title { text-decoration: line-through; color: var(--muted); }
.range-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Profil, menu, znajomi ---------- */
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.profile-head h2 { font-size: 19px; }
.avatar-sm { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; background: var(--accent-soft); color: var(--accent-text); text-transform: uppercase; }
.avatar-xs { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--accent-soft); color: var(--accent-text); }
.avatar-lg { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); text-transform: uppercase; }

.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.menu-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px;
  background: var(--card-2); color: var(--text); text-decoration: none; font-size: 12.5px; font-weight: 650; text-align: center; line-height: 1.2;
}
.menu-item .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.menu-item:active { transform: scale(.96); }
.menu-game {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; text-decoration: none; color: #fff;
  background: linear-gradient(120deg, #2b2350, #4a2a6b 55%, #6b2a5e);
}
.menu-game b { display: block; }
.menu-game small { font-size: 12px; opacity: .8; }
.mg-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .14); flex: none; }
.mg-coins { font-weight: 800; color: #ffd23f; font-size: 13px; }

.friend-code { text-align: center; display: grid; gap: 8px; justify-items: center; }
.code-big { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 34px; font-weight: 800; letter-spacing: 6px; }
.add-friend { display: grid; gap: 10px; }
.add-friend h2 { font-size: 17px; }
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; min-width: 0; font: inherit; font-size: 18px; letter-spacing: 4px; text-transform: uppercase; text-align: center;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: inherit; }
.friend-row { align-items: flex-start; }
.friend-grades { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.friend-link { color: inherit; text-decoration: none; }
.friend-actions { display: flex; gap: 2px; align-items: center; flex: none; }
.friend-head { display: flex; align-items: center; gap: 14px; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 13px; font-weight: 650; text-decoration: none; cursor: pointer; }
.chip.on { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.rank-n { width: 28px; text-align: center; font-weight: 800; }
.me-row { background: var(--accent-soft); }
.row.switch { cursor: pointer; }
.row.switch .sub { white-space: normal; }

/* ---------- Arkusz (szczegóły) ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 10, 18, .45); animation: fade .2s; }
.sheet-panel {
  position: relative; width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto;
  background: var(--card); border-radius: 24px 24px 0 0;
  padding: 10px 18px calc(24px + env(safe-area-inset-bottom));
  animation: up .25s cubic-bezier(.2, .8, .2, 1);
}
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet-close { position: absolute; top: 8px; right: 8px; }
#sheet-body { display: flex; flex-direction: column; gap: 14px; }
#sheet-body h2 { font-size: 20px; padding-right: 36px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 700px) {
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 24px; }
  .sheet-handle { display: none; }
}

/* ---------- Stany ---------- */
.skeleton { border-radius: 10px; min-height: 18px; background: linear-gradient(90deg, var(--card-2) 25%, var(--line) 50%, var(--card-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; color: var(--muted); padding: 22px 10px; }
.err-box { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; color: var(--danger); }
.demo-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between;
  max-width: 760px; margin: 0 auto 10px; padding: 10px 14px; border-radius: 14px; width: calc(100% - 32px);
  background: var(--warn-soft); color: var(--text); font-size: 13px; line-height: 1.3;
}
.demo-bar button { border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 800; background: var(--warn); color: #1a1200; cursor: pointer; }
.ptr { position: fixed; z-index: 30; left: 50%; top: calc(env(safe-area-inset-top) + 60px); width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, -50px); pointer-events: none; }
.ptr.spin svg { animation: spin .8s linear infinite; }

/* ---------- Efekty i powiadomienia ---------- */
.fx-layer { position: fixed; inset: 0; z-index: 200; pointer-events: none; overflow: hidden; }
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-float { position: absolute; transform: translate(-50%, 0); font-weight: 800; font-size: 18px; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); animation: fx-float 1.3s ease-out forwards; }
@keyframes fx-float { to { transform: translate(-50%, -60px); opacity: 0; } }
.coin-ic, .fx-coin { width: 16px; height: 16px; border-radius: 50%; flex: none; display: inline-block;
  background: radial-gradient(circle at 35% 30%, #fff6c8, #ffd700 40%, #c79100); box-shadow: inset 0 0 0 2px #e0a800; }
.fx-coin { position: absolute; left: 0; top: 0; width: 22px; height: 22px; }
.fx-count { position: absolute; inset: 0; display: grid; place-items: center; }
.fx-count b { font-size: 120px; font-weight: 900; color: #fff; text-shadow: 0 6px 30px rgba(0, 0, 0, .5); animation: count-pop .9s ease-out forwards; }
@keyframes count-pop { from { transform: scale(1.6); opacity: 0; } 30% { transform: scale(1); opacity: 1; } to { opacity: 0; } }
.fx-notes { position: fixed; z-index: 260; left: 50%; top: calc(env(safe-area-inset-top) + 66px); transform: translateX(-50%); width: min(430px, calc(100vw - 20px)); pointer-events: none; }
.fx-note {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 10px 11px 14px; border-radius: 16px; cursor: pointer;
  background: color-mix(in srgb, #15131f 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  animation: note-in .32s cubic-bezier(.2, 1.3, .4, 1);
}
.fx-note.out { animation: note-out .26s ease-in forwards; }
@keyframes note-in { from { transform: translateY(-24px) scale(.96); opacity: 0; } }
@keyframes note-out { to { transform: translateY(-24px); opacity: 0; } }
.fx-note-body { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.fx-note button { flex: none; border: 0; border-radius: 12px; padding: 8px 14px; font-weight: 800; background: var(--accent); color: #fff; cursor: pointer; }
.fx-ach-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #107c10; }
.fx-ach-text { display: flex; flex-direction: column; line-height: 1.25; }
.fx-ach-text small { font-size: 12px; opacity: .8; }

/* ---------- Smaczki (oba tryby) ---------- */
.view.enter > * { animation: rise .38s cubic-bezier(.2, .8, .2, 1) both; }
.view.enter > *:nth-child(2) { animation-delay: .04s; } .view.enter > *:nth-child(3) { animation-delay: .08s; }
.view.enter > *:nth-child(4) { animation-delay: .12s; } .view.enter > *:nth-child(5) { animation-delay: .16s; }
.view.enter > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.grade.pop { animation: grade-pop .38s cubic-bezier(.2, 2, .4, 1); }
@keyframes grade-pop { 40% { transform: scale(1.25) rotate(-6deg); } }
.grade.new { animation: new-glow 1.6s ease-in-out 3; }
@keyframes new-glow { 50% { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent), 0 0 16px var(--accent); } }
.tabbar a.active svg { animation: tab-hop .35s cubic-bezier(.2, 2, .4, 1); }
@keyframes tab-hop { 40% { transform: translateY(-4px) scale(1.12); } }
.ring-fill { transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }
.pill[data-fx] { cursor: pointer; }
.stripe { color: var(--danger); font-weight: 800; }
.lucky.me { animation: lucky-glow 1.2s ease-in-out 3; }
@keyframes lucky-glow { 50% { box-shadow: 0 0 0 4px rgba(255, 255, 255, .5), 0 0 24px rgba(255, 255, 255, .7); } }

.subj-ic { margin-right: 6px; font-size: .95em; }
.pill.ev { text-decoration: none; white-space: normal; }
.days button { position: relative; }
.ev-dot { position: absolute; top: 6px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.ev-dot.test { background: var(--danger); }
.days button.on .ev-dot { background: #fff; }
.day-events { display: flex; flex-direction: column; gap: 6px; padding: 4px 12px 8px; }
.day-ev { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: inherit; background: var(--accent-soft); }
.day-ev.test { background: var(--danger-soft); }
.day-ev b { display: block; font-size: 14px; }
.day-ev small { display: block; font-size: 12px; color: var(--muted); }
.hello-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hello-chips span { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .18); }
.week-strip { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; padding: 12px 14px; }
.week-strip b { display: block; }
.week-strip small { display: block; color: var(--muted); font-size: 13px; }
.week-ic { font-size: 24px; }
.streak-note { padding: 11px 14px; border-radius: 14px; font-size: 14px; background: linear-gradient(90deg, color-mix(in srgb, #ff9f1a 18%, var(--card)), var(--card)); box-shadow: var(--shadow); }
.need { padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.need.ok { background: var(--ok-soft); }

/* ---------- Efekty trybu Turbo ---------- */
.fx-caption {
  position: absolute; left: 50%; transform: translate(-50%, -50%); width: 92vw; text-align: center; line-height: 1.05;
  font-weight: 900; letter-spacing: .01em; text-transform: uppercase; color: #fff;
  -webkit-text-stroke: .08em #000; paint-order: stroke fill; text-shadow: 0 6px 20px rgba(0, 0, 0, .4);
  animation: cap-out 1.4s ease forwards; animation-delay: .9s;
}
.fx-caption span { display: inline-block; animation: cap-word .35s cubic-bezier(.2, 1.8, .4, 1) both; }
@keyframes cap-word { from { opacity: 0; transform: scale(1.8) rotate(-4deg); } }
@keyframes cap-out { to { opacity: 0; transform: translate(-50%, -60%); } }
body.fx-shake #view { animation: shake .45s cubic-bezier(.36, .07, .19, .97); } /* nie .app - pasek na dole by skakał */
@keyframes shake {
  10%, 90% { transform: translate(calc(var(--shake) * -.3), 0); }
  20%, 80% { transform: translate(calc(var(--shake) * .5), calc(var(--shake) * .2)); }
  30%, 50%, 70% { transform: translate(calc(var(--shake) * -1), calc(var(--shake) * -.2)); }
  40%, 60% { transform: translate(var(--shake), 0); }
}
.fx-sixseven { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6vw; animation: fade-in-out 2.3s ease both; }
.fx-sixseven span {
  font-size: min(42vw, 260px); font-weight: 900; line-height: 1; color: #ffd23f;
  -webkit-text-stroke: .04em #000; paint-order: stroke fill; text-shadow: 0 10px 40px rgba(0, 0, 0, .45);
  animation: weigh .32s ease-in-out infinite alternate;
}
.fx-sixseven .seven { color: #ff7ad9; animation-delay: .16s; }
@keyframes weigh { from { transform: translateY(-.12em) rotate(-6deg); } to { transform: translateY(.12em) rotate(6deg); } }
@keyframes fade-in-out { 0% { opacity: 0; } 10%, 82% { opacity: 1; } 100% { opacity: 0; } }
.main, .tabbar, .sidebar { transition: filter .35s; }
.app.fx-gray .main, .app.fx-gray .tabbar, .app.fx-gray .sidebar { filter: grayscale(1) contrast(1.05) brightness(.9); }
.fx-wasted { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, .55)); animation: fade-in-out 1.9s ease both; }
.fx-wasted span {
  font: 900 italic min(16vw, 120px)/1 Georgia, "Times New Roman", serif; letter-spacing: .02em; text-transform: uppercase;
  color: #c8102e; -webkit-text-stroke: .025em #000; paint-order: stroke fill; text-shadow: 0 4px 0 #000;
  animation: wasted-in .5s cubic-bezier(.2, 1.4, .4, 1) .25s both;
}
@keyframes wasted-in { from { transform: scale(1.6); opacity: 0; } }
.fx-combo {
  position: absolute; right: 14px; top: calc(env(safe-area-inset-top) + 76px); text-align: right; line-height: 1;
  color: hsl(calc(50 - var(--heat, 0) * 50) 100% 58%); -webkit-text-stroke: .06em #000; paint-order: stroke fill; font-weight: 900;
}
.fx-combo b { display: block; font-size: calc(34px + var(--heat, 0) * 26px); }
.fx-combo span { font-size: 13px; color: #fff; letter-spacing: .04em; }

/* ---------- Tryb Turbo na Starcie ---------- */
.game-strip { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #2b2350, #4a2a6b 55%, #7a2a62); box-shadow: 0 8px 24px rgba(74, 42, 107, .35); }
.game-strip b { display: block; }
.game-strip small { display: block; font-size: 12px; opacity: .8; margin-top: 4px; }
.game-strip .bar { background: rgba(255, 255, 255, .15); height: 7px; display: block; }
.game-strip .bar > span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #8b5cf6, #ec4899); }
.gs-lvl { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; font-weight: 900; background: rgba(255, 255, 255, .14); flex: none; }
.gs-btn { flex: none; font-size: 13px; font-weight: 800; padding: 9px 12px; border-radius: 12px; background: linear-gradient(180deg, #ffd23f, #e0a800); color: #2a1a00; animation: pulse 1.6s ease-in-out infinite; }
.hub-claims .quests { margin-top: 0; }
.feed.solo { position: static; padding-top: 4px; background: none; }

/* ---------- Wybór trybu (po pierwszym logowaniu) ---------- */
.mode-pick {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  animation: fade .25s;
}
.mode-pick.out { animation: fade-out .25s forwards; }
@keyframes fade-out { to { opacity: 0; } }
.mode-box { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.mode-box h2 { font-size: 24px; letter-spacing: -.01em; }
.mode-box p { margin: 0 0 6px; }
.mode-card {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px; border: 2px solid var(--line); border-radius: 20px;
  background: var(--card); box-shadow: var(--shadow); text-align: left; cursor: pointer; transition: transform .12s, border-color .15s;
}
.mode-card:hover { border-color: var(--accent); }
.mode-card:active { transform: scale(.98); }
.mode-card b { display: block; font-size: 18px; margin-bottom: 2px; }
.mode-card small { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; }
.mode-ic { font-size: 34px; flex: none; }
.mode-card.crazy { border-color: transparent; color: #fff; background: linear-gradient(135deg, #6d4bff, #c13dd6 60%, #ff7a59); box-shadow: 0 12px 30px rgba(193, 61, 214, .35); }
.mode-card.crazy small { color: rgba(255, 255, 255, .85); }

/* ---------- Tryb Turbo: monety na górze, złota szóstka, karta nowej oceny ---------- */
.coin-box.top { margin-right: 2px; }
@media (max-width: 380px) { .coin-box.top .free { display: none; } }
.golden-six {
  position: absolute; left: 0; top: 0; width: 64px; height: 64px; display: grid; place-items: center; pointer-events: auto; cursor: pointer;
  border-radius: 18px; font-size: 40px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 #9a6a00, 0 0 10px rgba(122, 82, 0, .6);
  background: radial-gradient(circle at 30% 25%, #fff6c8, #ffd700 35%, #c79100); box-shadow: 0 0 24px #ffd700, 0 0 60px #ffae00aa;
  animation: golden-glow .5s ease-in-out infinite alternate; touch-action: manipulation;
}
@keyframes golden-glow { to { box-shadow: 0 0 34px #fff1a0, 0 0 90px #ffd700; } }
.reveal { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: auto; background: rgba(5, 6, 14, .5); animation: reveal-bg 3.6s ease both; }
@keyframes reveal-bg { 0% { opacity: 0; } 8%, 88% { opacity: 1; } 100% { opacity: 0; } }
.reveal-card {
  width: min(320px, 86vw); padding: 24px 22px 22px; border-radius: 26px; text-align: center; color: #fff;
  background: linear-gradient(160deg, #22213a, #15141f); box-shadow: 0 24px 70px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
  animation: reveal-in .55s cubic-bezier(.2, 1.5, .4, 1);
}
.reveal-card.l6 { background: linear-gradient(160deg, #0e4a43, #0b2b28); }
.reveal-card.l5 { background: linear-gradient(160deg, #0f4229, #0a2a1b); }
.reveal-card.l1 { background: linear-gradient(160deg, #4a0d15, #26070b); }
@keyframes reveal-in { from { transform: scale(.6) rotate(-6deg); opacity: 0; } }
.reveal-kicker { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .75; margin-bottom: 12px; }
.reveal-grade { min-width: 96px; height: 96px; font-size: 52px; font-weight: 900; border-radius: 24px; cursor: default; animation: reveal-flip .7s cubic-bezier(.2, 1.4, .4, 1) .1s both; }
@keyframes reveal-flip { from { transform: rotateY(180deg) scale(.5); } }
.reveal-subject { margin-top: 14px; font-size: 22px; font-weight: 900; }
.reveal-cat { font-size: 13px; opacity: .65; margin-top: 2px; }
.reveal-line { margin-top: 12px; font-size: 16px; font-weight: 600; line-height: 1.35; opacity: .95; }
.reveal-more { margin-top: 10px; font-size: 13px; opacity: .7; }

/* ======================================================================
   SKINY - wszystko poniżej dotyczy tylko zakładki z grą
   ====================================================================== */
.hub-bar {
  position: sticky; top: calc(env(safe-area-inset-top) + 60px); z-index: 9;
  display: flex; align-items: center; gap: 8px; max-width: 792px; margin: 0 auto; padding: 0 12px 8px 16px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
@media (min-width: 900px) { .hub-bar { top: 68px; } }
.hub-tabs { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.hub-tabs::-webkit-scrollbar { display: none; }
.hub-tabs a { flex: none; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; background: var(--card); box-shadow: var(--shadow); }
.hub-tabs a.on { background: linear-gradient(120deg, #6d4bff, #c13dd6); color: #fff; }
.coin-box {
  flex: none; display: flex; align-items: center; gap: 5px; text-decoration: none; color: var(--text);
  background: var(--card); box-shadow: var(--shadow); padding: 6px 10px; border-radius: 99px; font-size: 13px; white-space: nowrap;
}
.coin-box b { font-variant-numeric: tabular-nums; }
.coin-box .free { font-size: 12px; font-weight: 800; }
.coin-box .free:empty { display: none; }
.coin-box.pulse { animation: pulse .45s ease; }
@keyframes pulse { 40% { transform: scale(1.1); } }

.hub-hero { display: flex; flex-direction: column; gap: 14px; color: #fff; background: linear-gradient(135deg, #2b2350, #4a2a6b 55%, #7a2a62); }
.hub-level { display: flex; gap: 12px; align-items: center; }
.hub-lvl { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; font-weight: 900; background: rgba(255, 255, 255, .14); flex: none; }
.hub-hero .muted { color: rgba(255, 255, 255, .7); }
.hub-hero .bar { background: rgba(255, 255, 255, .15); height: 8px; }
.hub-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hub-stats div { background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 10px; }
.hub-stats b { display: block; font-size: 16px; color: #ffd23f; white-space: nowrap; }
.hub-stats span { font-size: 12px; opacity: .75; }
.hub-claims { display: flex; flex-direction: column; gap: 10px; }
.hub-claims:empty { display: none; }
.claim-card {
  display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 16px; padding: 14px; cursor: pointer; text-align: left;
  color: #2a1a00; background: linear-gradient(135deg, #ffe17a, #ffc400 60%, #f0a800); box-shadow: 0 6px 18px rgba(240, 168, 0, .3);
}
.claim-card.grades { background: linear-gradient(135deg, #b8f5d0, #3ddc84); color: #06301a; box-shadow: 0 6px 18px rgba(61, 220, 132, .3); }
.claim-card small { display: block; font-size: 12px; opacity: .8; }
.claim-ic { font-size: 26px; }
.claim-amt { font-size: 15px; white-space: nowrap; }
.hub-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .hub-tiles { grid-template-columns: repeat(3, 1fr); } }
.hub-tile {
  display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; text-decoration: none; color: var(--text);
  background: var(--card); box-shadow: var(--shadow); border-left: 4px solid var(--tc, var(--accent)); transition: transform .12s;
}
.hub-tile:active { transform: scale(.97); }
.hub-tile span { font-size: 24px; }
.hub-tile small { color: var(--muted); font-size: 12px; }
.t-cases { --tc: #f0a800; } .t-inv { --tc: #3d8bff; } .t-upg { --tc: #3ddc84; } .t-battle { --tc: #ff5c7a; } .t-market { --tc: #8b5cf6; } .t-earn { --tc: #14b8a6; }
.ach-badge { width: 34px; text-align: center; font-size: 20px; }
.row.locked { opacity: .5; }

.quests .quest-check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 900; font-size: 13px; }
.quest.done .quest-check { background: #3ddc84; border-color: #3ddc84; color: #08311b; }
.quest.done .title { text-decoration: line-through; color: var(--muted); }
.quest .end b { color: var(--gold); font-size: 13px; }
.quest.done .end b { opacity: .5; }

/* Live dropy */
.feed {
  position: sticky; top: calc(env(safe-area-inset-top) + 101px); z-index: 8; display: flex; align-items: center; gap: 8px;
  max-width: 792px; margin: 0 auto; padding: 0 16px 8px; overflow: hidden; background: linear-gradient(var(--bg) 70%, transparent);
}
@media (min-width: 900px) { .feed { top: 109px; } }
.feed-live { flex: none; font-size: 10px; font-weight: 900; letter-spacing: .06em; color: #fff; background: #fe2c55; padding: 3px 6px; border-radius: 4px; writing-mode: vertical-rl; transform: rotate(180deg); }
.feed-track { display: flex; gap: 6px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.feed-track:empty::after { content: 'Tu pojawią się dropy wszystkich graczy'; font-size: 12px; color: var(--muted); padding: 12px 0; white-space: nowrap; }
.feed-item {
  flex: none; width: 112px; height: 48px; display: flex; align-items: center; gap: 4px; padding: 2px 6px 2px 2px; border-radius: 8px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 28%, var(--card)), var(--card)); border-bottom: 2px solid var(--rc);
  font-size: 10px; line-height: 1.15; overflow: hidden;
}
.feed-item .gun { width: 46px; height: 36px; flex: none; }
.feed-item b, .feed-item span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 58px; }
.feed-item span { color: var(--muted); }
.feed-item.new { animation: feed-in .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes feed-in { from { transform: translateX(-60px) scale(.6); opacity: 0; } }

/* Eventy */
.event-bar { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto 8px; width: calc(100% - 32px); padding: 10px 12px; border-radius: 14px; text-decoration: none; color: #fff;
  background: linear-gradient(120deg, #7c3aed, #db2777); box-shadow: 0 6px 20px rgba(219, 39, 119, .3); }
.event-bar small { opacity: .9; }
.ev-ic { font-size: 24px; }
.ev-btn { flex: none; background: #fff; color: #7c3aed; font-weight: 800; border-radius: 999px; padding: 7px 14px; font-size: 13px; }
.event-head { text-align: center; display: grid; gap: 6px; background: linear-gradient(160deg, color-mix(in srgb, #7c3aed 25%, var(--card)), var(--card)); }
.event-kicker { font-size: 12px; font-weight: 900; letter-spacing: .14em; color: #db2777; }
.event-timer { font-size: 44px; font-weight: 900; line-height: 1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.admin-form { display: grid; gap: 10px; }
.admin-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.admin-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.admin-form label.switch { display: flex; color: var(--text); font-size: 14px; }
.admin-form textarea { font-weight: 400; font-size: 15px; line-height: 1.45; }
.admin-row label { min-width: 0; }

/* Skiny i skrzynki */
.gun { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45)); }
.shop-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.shop-balance { font-size: 30px; font-weight: 900; color: var(--gold); line-height: 1.1; font-variant-numeric: tabular-nums; }
.shop-links { display: flex; gap: 6px; flex-wrap: wrap; }
.key-note { background: color-mix(in srgb, #3ddc84 14%, var(--card)); font-size: 14px; }
.case-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .case-grid { grid-template-columns: repeat(4, 1fr); } }
.case-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px 12px; border-radius: 16px;
  text-decoration: none; color: var(--text); background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--cc) 30%, var(--card)), var(--card) 70%);
  box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--cc) 40%, transparent); transition: transform .15s;
}
.case-tile:hover { transform: translateY(-3px); }
.case-tile-name { font-weight: 800; text-align: center; font-size: 14px; }
.case-tile-price { font-size: 16px; font-weight: 900; color: var(--gold); }
.case-free { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 800; background: #3ddc84; color: #04220f; padding: 2px 7px; border-radius: 99px; }
.case-stars { font-size: 11px; font-weight: 800; color: #9a6a00; background: #fff1bf; padding: 2px 8px; border-radius: 99px; }
.case-tag { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 900; letter-spacing: .08em; padding: 2px 7px; border-radius: 6px; background: var(--cc); color: #111; }
.case-art { position: relative; width: 100%; max-width: 180px; aspect-ratio: 1.33; display: grid; place-items: center; background: radial-gradient(circle, color-mix(in srgb, var(--cc) 55%, transparent), transparent 70%); }
.case-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5)); }
.case-tile:hover .case-art img { animation: float 1.6s ease-in-out infinite alternate; }
@keyframes float { to { transform: translateY(-5px) rotate(-2deg) scale(1.04); } }
.case-art.skin-art { background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--cc) 45%, transparent), transparent 70%); border-radius: 14px; }
.case-art.skin-art img { transform: rotate(-12deg) scale(1.05); }
.case-hero { display: flex; gap: 14px; align-items: center; }
.case-hero .case-art { width: 130px; flex: none; }
.case-hero h2 { font-size: 21px; }
.case-hero-price { font-size: 20px; font-weight: 900; color: var(--gold); }

.star-card { background: linear-gradient(135deg, color-mix(in srgb, #ffd23f 18%, var(--card)), var(--card)); }
.star-head { display: flex; gap: 12px; align-items: center; }
.star-big { font-size: 30px; flex: none; filter: drop-shadow(0 2px 8px rgba(255, 190, 40, .5)); }
.star-info { display: flex; flex-direction: column; gap: 4px; background: linear-gradient(135deg, color-mix(in srgb, #ffd23f 14%, var(--card)), var(--card)); }
.skin-meta span.up { color: #d48806; }
.cougar-switch button[data-cg="1"].on { background: linear-gradient(135deg, #2ee6d6, #3d8bff); color: #fff; }
.open-btn.cougar { background: linear-gradient(180deg, #2ee6d6, #1f9fb8); box-shadow: 0 4px 0 #156f80; }
.open-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.open-btn {
  border: 0; border-radius: 14px; padding: 13px 10px; cursor: pointer; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 17px; font-weight: 900; letter-spacing: .01em; background: linear-gradient(180deg, #4fd86f, #23a344); box-shadow: 0 4px 0 #1a7a33;
}
.open-btn small { font-size: 12px; font-weight: 700; opacity: .9; }
.open-btn.free { background: linear-gradient(180deg, #ffd23f, #e0a800); box-shadow: 0 4px 0 #8a6500; color: #2a1a00; grid-column: 1 / -1; }
.open-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #1a7a33; }
.open-btn:disabled { opacity: .4; cursor: default; }
.upg .open-btn, .view > .open-btn { width: 100%; }

#reels { display: flex; flex-direction: column; gap: 8px; }
#reels:empty { display: none; }
.case-window { position: relative; width: 100%; height: 150px; overflow: hidden; border-radius: 14px; background: #1b1b24; box-shadow: inset 0 0 40px #000; }
.case-window.bonus { box-shadow: inset 0 0 40px #000, 0 0 0 2px #ffd23f, 0 0 24px rgba(255, 210, 63, .45); }
.case-strip { display: flex; gap: 8px; padding: 10px 0; will-change: transform; }
.case-item {
  position: relative; flex: none; width: 128px; height: 130px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--rc) 35%, #2a2a36), #1f1f2a 70%); border-bottom: 5px solid var(--rc); text-align: center; padding: 6px; color: #fff;
}
.case-item .gun { width: 104px; height: 78px; }
.case-name { font-size: 10px; line-height: 1.2; color: #c9c9d6; }
.case-name b { color: #fff; font-size: 11px; }
.case-item.win { box-shadow: 0 0 0 3px var(--rc), 0 0 40px var(--rc); transform: scale(1.05); transition: .3s; z-index: 1; }
.case-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; transform: translateX(-50%); background: #ffd23f; box-shadow: 0 0 12px #ffd23f; z-index: 2; }
.case-window.vertical { height: 300px; }
.case-window.vertical .case-strip { flex-direction: column; align-items: center; padding: 0 6px; }
.case-window.vertical .case-item { width: 100%; height: 120px; }
.case-window.vertical .case-marker { left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 3px; transform: translateY(-50%); }
.star-tag { position: absolute; top: 4px; right: 4px; font-size: 22px; line-height: 1; filter: drop-shadow(0 0 8px #ffd23f); animation: star-in .6s cubic-bezier(.2, 2, .4, 1); }
@keyframes star-in { from { transform: scale(0) rotate(-30deg); } }
.bonus-banner { text-align: center; font-weight: 900; font-size: 17px; padding: 12px; border-radius: 14px; color: #2a1a00; background: linear-gradient(90deg, #ffe17a, #ffc400, #ffe17a); animation: star-in .5s cubic-bezier(.2, 2, .4, 1); }
.drop-banner { text-align: center; font-weight: 900; font-size: 20px; padding: 10px; border-radius: 14px; margin-bottom: 10px; color: #fff;
  background: linear-gradient(120deg, color-mix(in srgb, var(--rc) 85%, #000), var(--rc)); box-shadow: 0 0 30px color-mix(in srgb, var(--rc) 50%, transparent); }

.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.skin-card {
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 10px 8px; border-radius: 12px; cursor: default;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rc) 25%, var(--card)), var(--card) 75%);
  border-bottom: 4px solid var(--rc); box-shadow: var(--shadow); transition: transform .15s;
}
.skin-card[role="button"] { cursor: pointer; }
.skin-card[role="button"]:hover { transform: translateY(-3px); }
.skin-card[data-sel] { outline: 3px solid #3ddc84; }
.skin-card[data-stars]::before { content: attr(data-stars); position: absolute; top: 6px; left: 6px; z-index: 1; font-size: 11px; font-weight: 900; color: #2a1a00; background: #ffd23f; padding: 1px 6px; border-radius: 99px; }
.skin-card .gun { margin: 4px 0 6px; }
.skin-card.r-gold, .skin-card.r-red { box-shadow: 0 0 16px color-mix(in srgb, var(--rc) 45%, transparent); }
.skin-card.r-gold::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .35) 45%, transparent 60%); background-size: 250% 100%; animation: shine 2.4s linear infinite; }
@keyframes shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.skin-weapon { font-size: 11px; color: var(--muted); }
.skin-name { font-weight: 800; font-size: 13px; line-height: 1.2; }
.skin-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-top: 4px; }
.skin-meta span { color: var(--muted); font-weight: 700; }
.skin-meta b { color: var(--gold); }
.drops-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.drops-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.drops-actions .btn { flex: 1; }
#drops:empty { display: none; }
.skin-big { padding: 20px; border-radius: 16px; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 35%, var(--card-2)), var(--card-2) 70%); border-bottom: 5px solid var(--rc); }
.float-bar { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #3ddc84 0 7%, #8bd34a 7% 15%, #ffd23f 15% 38%, #f0802a 38% 45%, #e5484d 45%); margin: 6px 0 4px; }
.float-bar span { position: absolute; top: -4px; width: 3px; height: 16px; background: var(--text); transform: translateX(-50%); }
.sell-row { display: grid; gap: 8px; }
.sell-all { border: 1px solid var(--gold); color: var(--gold); font-weight: 800; }

/* Upgrader */
.upg { display: grid; grid-template-columns: 1fr 160px 1fr; gap: 10px; align-items: center; }
@media (max-width: 520px) { .upg { grid-template-columns: 1fr 112px 1fr; } }
.upg-wheel { position: relative; aspect-ratio: 1; }
.upg-wheel svg { width: 100%; height: 100%; }
.upg-needle { position: absolute; left: 50%; top: 4%; bottom: 50%; width: 4px; margin-left: -2px; background: var(--text); border-radius: 2px; transform-origin: 50% 100%; }
.upg-needle::before { content: ""; position: absolute; top: -6px; left: -6px; border: 8px solid transparent; border-bottom-color: var(--text); }
.upg-pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 900; color: #23a344; pointer-events: none; }
.upg-result { text-align: center; font-weight: 750; padding: 10px; border-radius: 12px; }
.upg-result.win { background: var(--ok-soft); color: var(--ok); }
.upg-result.lose { background: var(--danger-soft); color: var(--danger); }
.result-title { font-size: clamp(30px, 9vw, 44px); font-weight: 900; line-height: 1.1; letter-spacing: -.01em; }
.result-title.win { color: var(--gold); }
.result-title.lose { color: var(--danger); }

/* Bitwy */
.join-form { display: flex; gap: 8px; }
.code-input { flex: 1; text-transform: uppercase; letter-spacing: .3em; font-size: 22px !important; font-weight: 900; text-align: center; }
.room-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.room-code { font-size: 46px; font-weight: 900; letter-spacing: .25em; color: #8b5cf6; line-height: 1; padding-left: .25em; font-variant-numeric: tabular-nums; }
.room-config { display: flex; gap: 8px; flex-wrap: wrap; }
.room-config select { flex: 1; min-width: 140px; width: auto; }
.room-players { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.room-player { display: flex; align-items: center; gap: 10px; border-left: 5px solid var(--pc); }
.room-player.ready { box-shadow: 0 0 0 2px #3ddc84, var(--shadow); }
.room-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--pc, #888); color: #fff; font-weight: 900; text-transform: uppercase; }
.room-chat { display: flex; flex-direction: column; gap: 8px; }
.room-chat-log { max-height: 180px; overflow: auto; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.room-chat form { display: flex; gap: 6px; }
.room-chat input { flex: 1; padding: 8px 12px; }
.battle-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; }
.battle { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 8px; }
.battle-col { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 14px; background: var(--card); border-top: 4px solid var(--pc); transition: box-shadow .3s; min-width: 0; }
.battle-col.lead { box-shadow: 0 0 0 2px #3ddc84; }
.battle-col.winner { box-shadow: 0 0 0 3px #ffd700, 0 0 40px #ffd70088; }
.battle-player { display: flex; align-items: center; gap: 6px; min-width: 0; }
.battle-player b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.battle-total { font-size: 18px; font-weight: 900; color: var(--gold); }
.battle-won { display: flex; flex-direction: column; gap: 6px; }
.battle-won .skin-card { padding: 6px; }
.battle-won .skin-name { font-size: 11px; }
.battle-result { text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.battle-result.won { box-shadow: 0 0 0 3px #ffd700, 0 0 40px #ffd70066; }
.battle.many { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.battle.many .case-window.vertical { height: 190px; }
.battle.many .case-window.vertical .case-item { height: 86px; }
.battle.many .case-window.vertical .case-item .gun { width: 72px; height: 54px; }
.battle.many .battle-won .skin-card:nth-child(n+3) { display: none; }
@media (max-width: 520px) {
  .battle.many { grid-template-columns: 1fr 1fr; }
  .case-window.vertical { height: 240px; }
  .case-window.vertical .case-item { height: 100px; }
  .case-window.vertical .case-item .gun { width: 80px; }
}
.invite-list { display: grid; gap: 8px; margin-top: 12px; text-align: left; width: 100%; }
.invite-row { display: flex; align-items: center; gap: 10px; }
/* Bitwy: tryby i wybór skrzynek */
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mode-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--card); font-size: 12px; font-weight: 700; cursor: pointer; text-align: center; line-height: 1.15; }
.mode-chip span { font-size: 18px; }
.mode-chip.on { border-color: transparent; color: #fff; background: linear-gradient(135deg, #6d4bff, #c13dd6); }
.mode-desc { margin-top: 10px; font-size: 13px; color: var(--muted); }
.mode-desc b { color: var(--text); }
.bc-cost { color: var(--gold); }
.bc-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.bc-item, .bc-add { position: relative; flex: none; width: 84px; height: 96px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.bc-item { background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--cc) 35%, var(--card-2)), var(--card-2) 75%); border-bottom: 3px solid var(--cc); }
.bc-item img { width: 64px; height: 48px; object-fit: contain; }
.bc-item small { font-size: 10px; font-weight: 700; text-align: center; line-height: 1.1; padding: 0 4px; max-height: 22px; overflow: hidden; }
.bc-item .bc-n { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; font-size: 11px; }
.bc-x { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; font-size: 11px; cursor: pointer; }
.bc-add { border: 2px dashed var(--line); background: none; color: var(--accent-text); font-weight: 800; cursor: pointer; }
.bc-picker { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.bc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto; }
.bc-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 1px solid color-mix(in srgb, var(--cc) 40%, transparent); border-radius: 12px; cursor: pointer;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--cc) 25%, var(--card)), var(--card) 75%); }
.bc-tile:active { transform: scale(.95); }
.bc-tile img { width: 70px; height: 52px; object-fit: contain; }
.bc-tile b { font-size: 11px; text-align: center; line-height: 1.15; }
.bc-tile small { font-size: 11px; font-weight: 800; color: var(--gold); }
.battle-mode { padding: 9px 12px; border-radius: 12px; font-size: 13px; background: linear-gradient(90deg, color-mix(in srgb, #6d4bff 20%, var(--card)), var(--card)); }
.jackpot { display: flex; flex-direction: column; gap: 10px; }
.jp-bar { position: relative; display: flex; height: 26px; border-radius: 13px; overflow: hidden; }
.jp-bar span { height: 100%; }
.jp-needle { position: absolute; top: -4px; bottom: -4px; left: 0; width: 4px; margin-left: -2px; background: #fff; border-radius: 2px; box-shadow: 0 0 8px #000; }
.jp-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; }
.jp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.bc-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--card-2); }

/* Rynek */
.mk { font-size: 11px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.mk.up { color: #2fbf71; }
.mk.down { color: #ff5a5f; }
.mk.big { font-size: 14px; vertical-align: middle; }
.skin-card > .mk { position: absolute; top: 6px; right: 8px; background: color-mix(in srgb, var(--card) 85%, transparent); border-radius: 6px; padding: 1px 4px; }
.mk-head { display: flex; justify-content: space-between; align-items: center; }
.mk-row { width: 100%; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.mk-row .grow .title { display: block; }
.mk-thumb { flex: none; width: 56px; height: 42px; display: grid; place-items: center; border-radius: 8px; border-bottom: 3px solid var(--rc); background: color-mix(in srgb, var(--rc) 18%, var(--card)); }
.mk-thumb img { max-width: 100%; max-height: 100%; }
.mk-chart svg { width: 100%; height: 90px; display: block; }
.mk-chart .line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.mk-chart .up .line { stroke: #2fbf71; } .mk-chart .up .area { fill: rgba(47, 191, 113, .15); }
.mk-chart .down .line { stroke: #ff5a5f; } .mk-chart .down .area { fill: rgba(255, 90, 95, .15); }
.mk-range { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; }

/* Zarabiaj */
.earn-head { text-align: center; }
.earn-card { display: flex; align-items: center; gap: 12px; }
.earn-card.ready { border: 1px solid #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, .15); }
.earn-card .btn { flex: none; min-width: 92px; }
.earn-ic { font-size: 28px; flex: none; width: 40px; text-align: center; }
.math-game { display: grid; gap: 12px; }
.math-top { display: flex; justify-content: space-between; font-weight: 700; }
.math-time { font-size: 26px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.math-q { font-size: clamp(40px, 13vw, 60px); font-weight: 900; text-align: center; transition: color .2s; font-variant-numeric: tabular-nums; }
.math-q.ok { color: #23a344; } .math-q.bad { color: #ff5a5f; }
.math-in { font-size: 24px; text-align: center; }
.math-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.math-pad .btn { font-size: 20px; padding: 14px 0; }

/* ======================================================================
   Quizy (nauka - poza grą)
   ====================================================================== */
.quiz-intro { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 28px 18px; }
.quiz-intro h2 { font-size: 24px; }
.quiz-intro p { margin: 0; }
.quiz-kind { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: #8b5cf6; text-transform: uppercase; }
.quiz-loading { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-weight: 600; }
.quiz-spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--card-2); border-top-color: #8b5cf6; animation: spin .8s linear infinite; }
.quiz-start { font-size: 18px; font-weight: 800; padding: 14px 48px; margin-top: 8px; }
.quiz-top { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.quiz-count { padding: 4px 10px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow); }
.quiz-streak { flex: 1; text-align: center; color: #ff9f1a; font-size: 18px; }
.quiz-score { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.quiz-timer { height: 10px; border-radius: 5px; background: var(--card-2); overflow: hidden; }
.quiz-timer > div { height: 100%; width: 100%; background: linear-gradient(90deg, #ff4d4f, #ffd23f 40%, #3ddc84); }
.quiz-q { font-size: 20px; font-weight: 700; text-align: center; padding: 26px 18px; }
.quiz-answers { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .quiz-answers { grid-template-columns: 1fr 1fr; } }
.quiz-a {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; border: 0; border-radius: 14px; cursor: pointer;
  color: #fff; font-size: 16px; font-weight: 700; text-align: left; box-shadow: 0 5px 0 rgba(0, 0, 0, .25); transition: transform .1s, opacity .2s;
}
.quiz-a:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.quiz-a .shape { font-size: 22px; opacity: .9; }
.quiz-a.a0 { background: #e21b3c; } .quiz-a.a1 { background: #1368ce; } .quiz-a.a2 { background: #d89e00; } .quiz-a.a3 { background: #26890c; }
.quiz-a:disabled { opacity: .35; cursor: default; }
.quiz-a.right { opacity: 1; outline: 4px solid #3ddc84; animation: pop .4s cubic-bezier(.2, 2, .4, 1); }
.quiz-a.wrong { opacity: 1; outline: 4px solid #ff4d4f; animation: shake-x .4s; }
@keyframes shake-x { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.quiz-after { display: flex; flex-direction: column; gap: 10px; }
.quiz-after:empty { display: none; }
.quiz-expl.ok { border-left: 5px solid #3ddc84; }
.quiz-expl.bad { border-left: 5px solid #ff4d4f; }
.quiz-next { font-size: 17px; font-weight: 800; padding: 14px; }
.view.quiz-fire .quiz-timer { box-shadow: 0 0 0 2px #ff9f1a; }
.quiz-end { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 30px 18px; }
.quiz-final { font-size: 40px; font-weight: 900; color: #8b5cf6; font-variant-numeric: tabular-nums; }
.quiz-end-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

/* ---------- Taśma bez obrazków + gwiazdka jako wynik ---------- */
.case-item .gun-ph { width: 96px; height: 60px; border-radius: 30px 8px 8px 30px; flex: none;
  background: linear-gradient(100deg, transparent 8%, color-mix(in srgb, var(--rc) 55%, #fff 0%) 8% 72%, transparent 72%),
              linear-gradient(0deg, transparent 40%, color-mix(in srgb, var(--rc) 35%, transparent) 40% 60%, transparent 60%);
  opacity: .55; }
.battle.many .case-window.vertical .case-item .gun-ph { width: 64px; height: 40px; }
.case-item.star-tile { background: radial-gradient(circle at 50% 40%, #fff3b0, #ffb800 45%, #7a4d00 100%); border-bottom-color: #ffd23f; }
.star-glyph { font-size: 48px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .4)); }
.star-glyph.big { font-size: 56px; display: block; text-align: center; margin: 10px 0; }
.star-pool { display: grid; gap: 6px; margin-top: 10px; }
.star-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; font-size: 13px;
  background: color-mix(in srgb, var(--rc) 12%, var(--card)); border-left: 4px solid var(--rc); }
.star-row .muted { white-space: nowrap; }
.skin-card.star-odds { --rc: #ffd23f; background: radial-gradient(circle at 50% 30%, rgba(255, 210, 63, .25), var(--card) 75%); }
@media (max-width: 420px) { .star-row { flex-wrap: wrap; } .star-row .muted { order: 3; width: 100%; } }

/* ---------- e-Usprawiedliwienia ---------- */
.justify-form { display: grid; gap: 10px; }
.justify-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.justify-form .input { width: 100%; box-sizing: border-box; min-width: 0; }
.jf-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.justify-row { display: grid; gap: 4px; margin-bottom: 8px; }
.diag pre { white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto; }

/* ---------- Relacje: podsumowanie tygodnia ---------- */
.stories::-webkit-scrollbar { display: none; }
.story { display: flex; flex-direction: column; align-items: center; gap: 5px; border: 0; background: none; cursor: pointer; color: var(--text); flex: none; width: 74px; padding: 0; }
.story-ring { width: 66px; height: 66px; border-radius: 50%; padding: 3px; background: conic-gradient(#f59e0b, #ef4444, #ec4899, #8b5cf6, #f59e0b); display: grid; place-items: center; }
.story.seen .story-ring { background: var(--line); }
.story-ic { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: var(--card); border: 3px solid var(--bg); }
.story-label { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; color: var(--muted); }
.story-view {
  position: fixed; inset: 0; z-index: 280; color: #fff; display: flex; flex-direction: column; touch-action: none; user-select: none;
  transition: background .4s; animation: fade .2s;
}
.st-bars { display: flex; gap: 4px; padding: calc(env(safe-area-inset-top) + 10px) 10px 0; }
.st-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.st-bars i { display: block; height: 100%; width: 0; background: #fff; }
.st-close { position: absolute; right: 8px; top: calc(env(safe-area-inset-top) + 20px); border: 0; background: none; color: #fff; font-size: 22px; width: 44px; height: 44px; cursor: pointer; z-index: 2; }
.st-slide { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 26px 60px; gap: 10px; }
.st-slide.in > * { animation: st-in .5s cubic-bezier(.2, 1.3, .4, 1) both; }
.st-slide.in > *:nth-child(2) { animation-delay: .08s; } .st-slide.in > *:nth-child(3) { animation-delay: .16s; } .st-slide.in > *:nth-child(4) { animation-delay: .24s; }
@keyframes st-in { from { transform: translateY(24px); opacity: 0; } }
.st-kicker { font-size: 13px; font-weight: 900; letter-spacing: .14em; opacity: .8; }
.st-big { font: 400 clamp(40px, 12vw, 64px) Anton, Impact, sans-serif; line-height: 1.05; letter-spacing: .01em; }
.st-huge { font: 400 clamp(90px, 32vw, 150px) Anton, Impact, sans-serif; line-height: 1; }
.st-sub { font-size: 17px; font-weight: 600; opacity: .92; max-width: 340px; line-height: 1.35; }
.st-count { font: 400 44px Anton, Impact, sans-serif; margin-top: 6px; }
.st-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 320px; }
.st-chip { min-width: 44px; height: 44px; font-size: 20px; cursor: default; }
.st-best { min-width: 120px; height: 120px; font: 400 72px Anton, Impact, sans-serif; border-radius: 28px; cursor: default; }
.st-btn { margin-top: 14px; border: 0; border-radius: 14px; padding: 13px 22px; background: #fff; color: #111; font-weight: 800; font-size: 15px; text-decoration: none; cursor: pointer; }
.demo-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between;
  max-width: 760px; margin: 0 auto 10px; padding: 10px 14px; border-radius: 14px; width: calc(100% - 32px);
  background: var(--warn-soft); color: var(--text); font-size: 13px; line-height: 1.3;
}
.demo-bar button { border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 800; background: var(--warn); color: #1a1200; cursor: pointer; }
.st-chip, .st-best { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 6px 16px rgba(0, 0, 0, .25); }
.stories { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.story-view { background: #111; }
.st-lines { display: grid; gap: 6px; font-size: 17px; font-weight: 700; max-width: 340px; }
.st-lines div::first-letter { text-transform: uppercase; }
.st-share { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 22px); transform: translateX(-50%); border: 0; border-radius: 999px;
  padding: 12px 20px; background: rgba(255, 255, 255, .95); color: #111; font-weight: 800; font-size: 15px; cursor: pointer; white-space: nowrap;
  animation: none !important; }

/* ---------- Konta ---------- */
.login-pane { display: grid; gap: 12px; }
.login-pane[hidden] { display: none; }
.login-card .check, .acct-prompt .check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); text-align: left; }
.login-sep { font-size: 12px; font-weight: 700; color: var(--muted); text-align: left; padding-top: 6px; border-top: 1px solid var(--line); }
.how-acct { text-align: left; font-size: 13px; background: var(--card-2, rgba(127,127,127,.08)); border-radius: 12px; padding: 10px 12px; }
.how-acct summary { cursor: pointer; font-weight: 700; }
.how-body ul { padding-left: 18px; margin: 8px 0; display: grid; gap: 6px; }
.how-body p { margin: 8px 0; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 4px; }
.acct-prompt { display: grid; gap: 10px; }
.acct-prompt .field { display: grid; gap: 4px; font-size: 13px; }
.acct-prompt .input { width: 100%; box-sizing: border-box; }
.acct-card { display: grid; gap: 8px; }
.justify-form label.jf-check { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
/* przycisk "Dodaj" nie wystaje poza kartę na wąskich telefonach */
.add-friend { grid-template-columns: minmax(0, 1fr); }
.add-row { min-width: 0; }
.add-row input { width: 0; }
.add-row .btn { flex: none; }

/* ---------- Zwiastun "Co potrafi aplikacja" ---------- */
.st-ic { font-size: 84px; line-height: 1; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .3)); }
.st-lines.ticks { text-align: left; }
.st-lines.ticks div::before { content: "✓ "; font-weight: 900; }
.st-cta { display: grid; gap: 10px; width: min(320px, 100%); margin-top: 14px; }
.st-cta .st-btn { margin: 0; width: 100%; }
.st-btn.ghost { background: rgba(255, 255, 255, .18); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6); }
.trailer-btn { display: grid; gap: 2px; text-align: left; width: 100%; border: 0; cursor: pointer; padding: 14px 16px; border-radius: 16px; color: #fff;
  background: linear-gradient(120deg, #4f46e5, #c026d3 60%, #ec4899); box-shadow: 0 10px 30px rgba(192, 38, 211, .35); font: inherit; }
.trailer-btn b { font-size: 16px; }
.trailer-btn small { opacity: .9; font-size: 12px; }
.trailer-btn .tb-row { display: flex; align-items: center; gap: 12px; }
.trailer-btn .tb-ic { font-size: 28px; }
.trailer-btn .tb-go { margin-left: auto; font-size: 20px; font-weight: 900; }
.invite-hint { display: grid; gap: 8px; text-align: left; border: 1px solid #7c83ff; }
.ih-head { display: flex; gap: 10px; align-items: center; }
.ih-ic { font-size: 28px; }
.ih-code { letter-spacing: 3px; font-size: 16px; }
