:root {
  --brand: #C56519;
  --brand-dark: #9e4f10;
  --brand-soft: #fbeee2;
  --brand-softer: #fdf7f1;
  --text: #2b2420;
  --muted: #74675d;
  --line: #eaded3;
  --bg: #fffaf5;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 2px 4px rgba(90, 50, 15, .05), 0 8px 24px rgba(90, 50, 15, .07);
  --green: #2e7d4f;
  --red: #b3261e;
  --blue: #2a62a8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--brand-dark); }
img { max-width: 100%; display: block; }
svg { width: 1.1em; height: 1.1em; flex: none; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Przyciski */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  padding: .65em 1.15em; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(197, 101, 25, .4); outline-offset: 2px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--brand-dark); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); background: var(--brand-softer); }
.btn-light { background: rgba(255, 255, 255, .95); color: var(--brand-dark); }
.btn-light:hover { background: #fff; }
.btn-sm { padding: .4em .85em; font-size: .85rem; }
.btn[disabled] { opacity: .6; cursor: wait; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-dark); cursor: pointer; text-decoration: underline; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Nagłówek (kompaktowy – utwory widać od razu) */
.hero {
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, .16) 0 90px, transparent 91px),
    radial-gradient(circle at 96% 100%, rgba(255, 255, 255, .1) 0 110px, transparent 111px),
    linear-gradient(135deg, #d97a2b, var(--brand) 55%, #a9520f);
  color: #fff;
  padding: 18px 0;
}
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hero-brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; min-width: 0; }
.hero-title { display: block; font-size: clamp(1.1rem, 2.4vw, 1.45rem); font-weight: 800; line-height: 1.2; }
.hero .lead { display: block; font-size: .92rem; opacity: .92; margin-top: 2px; }
.hero-badge {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: rgba(255, 255, 255, .2); color: #fff;
}
.hero-badge svg { width: 24px; height: 24px; }
.login .hero-badge { width: 64px; height: 64px; margin: 0 auto; }
.login .hero-badge svg { width: 32px; height: 32px; }
.hero-badge.small { background: var(--brand-soft); color: var(--brand); }
.social { display: flex; gap: 8px; flex: none; }

main.wrap { margin-top: 28px; }

.about { padding: 24px 28px; margin-top: 40px; }
.about h2 { color: var(--brand-dark); }
.about p:last-child { margin-bottom: 0; }

/* Lista utworów */
.tracks-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.tracks-head h1, .tracks-head h2 { margin: 0; font-size: 1.5rem; }
.count { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); font-size: .85rem; padding: .1em .6em; border-radius: 999px; vertical-align: middle; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input, .filters select, .login input, dialog input {
  font: inherit; font-size: .95rem; padding: .5em .9em; border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--text);
}
.filters input[type=search] { min-width: 200px; }

.track-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.track {
  display: grid; grid-template-columns: 136px 1fr auto; gap: 18px; align-items: center;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px 12px 12px;
  transition: transform .15s, box-shadow .15s;
}
.track:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(90, 50, 15, .06), 0 14px 32px rgba(90, 50, 15, .1); }
.thumb {
  position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; background: var(--brand-soft);
  border: 0; padding: 0; cursor: pointer; width: 100%; display: block;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.thumb:hover img { transform: scale(1.05); }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(40, 20, 5, .15); transition: background .15s; }
.thumb .play svg {
  width: 44px; height: 44px; padding: 11px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--brand); box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
.thumb .play .i-play { padding-left: 13px; }
.thumb:hover .play { background: rgba(40, 20, 5, .3); }
.thumb:hover .play svg { transform: scale(1.1); }
.thumb .i-pause { display: none; }
.track.is-playing .thumb .i-play { display: none; }
.track.is-playing .thumb .i-pause { display: block; }
.track.is-playing .thumb .play svg { background: var(--brand); color: #fff; }
.track.is-loading .thumb .play svg { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.85); opacity: .7; } }
.track.is-active { box-shadow: 0 0 0 2px var(--brand), var(--shadow); }

.yt-link { display: inline-flex; align-items: center; gap: .3em; color: var(--muted); text-decoration: none; }
.yt-link:hover { color: #c4302b; }

.progress { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.progress[hidden] { display: none; }
.progress input { flex: 1; accent-color: var(--brand); min-width: 0; }
.progress .time { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.info h3 { font-size: 1.08rem; margin: 0 0 .25em; }
.info h3 a { color: inherit; text-decoration: none; }
.info h3 a:hover { color: var(--brand-dark); text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; color: var(--muted); font-size: .9rem; }
.meta span { display: inline-flex; align-items: center; gap: .3em; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.empty { padding: 32px; text-align: center; color: var(--muted); }

/* Strona utworu */
.crumbs { margin-bottom: 14px; font-weight: 700; }
.crumbs a { text-decoration: none; }
.track.song-card { display: grid; grid-template-columns: minmax(0, 400px) 1fr; gap: 28px; align-items: center; padding: 20px; }
.track.song-card:hover { transform: none; }
.song-thumb { border-radius: 14px; aspect-ratio: 16/9; }
.song-thumb .play svg { width: 72px; height: 72px; padding: 18px; }
.song-thumb .play .i-play { padding-left: 22px; }
.song-body h1 { font-size: clamp(1.4rem, 3vw, 2rem); color: var(--text); }
.song-body .meta { font-size: 1rem; margin-bottom: 8px; }
.song-body .progress { margin: 10px 0; }
.hint { font-size: .9rem; margin: 6px 0 18px; }
.song-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-lg { font-size: 1.1rem; padding: .8em 1.6em; }
.more { margin-top: 40px; }
.more h2 { font-size: 1.35rem; }
.center { text-align: center; margin-top: 20px; }
.notfound { display: grid; gap: 10px; justify-items: center; }
.notfound h1 { margin: 0; color: var(--text); }

/* Paginacja */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 28px 0 8px; }
.page {
  min-width: 42px; padding: .45em .8em; border-radius: 999px; text-align: center; text-decoration: none;
  background: #fff; border: 2px solid var(--line); color: var(--text); font-weight: 700;
}
a.page:hover { border-color: var(--brand); color: var(--brand-dark); }
.page.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.page.gap { border: 0; background: none; min-width: auto; }

/* Stopka */
.footer { margin-top: 56px; padding: 28px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer p { margin: 0; }
.social-small { display: flex; gap: 16px; }
.social-small a { display: inline-flex; align-items: center; gap: .35em; text-decoration: none; }

/* Powiadomienie */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--text); color: #fff; padding: .7em 1.2em; border-radius: 999px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }

/* Logowanie */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 380px; padding: 32px; text-align: center; display: grid; gap: 14px; }
.login h1 { font-size: 1.4rem; margin: 0; }
.login p { margin: 0; }
.login label { text-align: left; font-weight: 700; display: grid; gap: 6px; }
.login input { border-radius: 12px; width: 100%; }
.back { font-size: .9rem; }
.alert { background: #fdecea; color: var(--red); padding: .7em 1em; border-radius: 12px; margin: 0 0 16px; }

/* Panel */
.is-admin { font-size: 15px; }
.admin-bar { background: var(--brand); color: #fff; }
.admin-bar .wrap { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; padding-bottom: 12px; max-width: 1240px; }
.admin-bar .brand { color: #fff; font-weight: 800; text-decoration: none; display: inline-flex; gap: .4em; align-items: center; font-size: 1.1rem; }
.admin-bar nav { display: flex; gap: 18px; align-items: center; }
.admin-bar nav a, .admin-bar .linkish { color: #fff; }
.admin-bar form { margin: 0; }
main.admin { margin-top: 24px; max-width: 1240px; }
.admin-intro { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 24px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-intro h1 { font-size: 1.4rem; margin: 0 0 .2em; }
.admin-intro p { margin: 0; }
.admin-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { padding: .4em .9em; border-radius: 999px; text-decoration: none; color: var(--text); background: #fff; border: 2px solid var(--line); font-weight: 700; }
.tab span { color: var(--muted); font-weight: 600; }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tab.active span { color: rgba(255, 255, 255, .85); }

.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 12px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr.on { background: var(--brand-softer); }
.c-thumb { width: 96px; }
.c-thumb img { border-radius: 6px; width: 80px; height: 45px; max-width: none; object-fit: cover; }
.c-title { min-width: 240px; }
.c-title .t { font-weight: 700; }
.c-dur, .c-added { white-space: nowrap; color: var(--muted); }
.c-actions { white-space: nowrap; }
.c-actions .btn { margin: 2px 0; }
.sub { font-size: .8rem; color: var(--muted); }
.sub.err, .sub.warn { color: var(--red); max-width: 260px; }
.pill { display: inline-block; font-size: .8rem; font-weight: 700; padding: .15em .7em; border-radius: 999px; white-space: nowrap; }
.pill.gray { background: #eee; color: #555; }
.pill.blue { background: #e3edf9; color: var(--blue); }
.pill.green { background: #e2f3e8; color: var(--green); }
.pill.red { background: #fdecea; color: var(--red); }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #d9cfc6; border-radius: 999px; transition: background .2s; }
.switch span::after { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid rgba(197, 101, 25, .4); outline-offset: 2px; }

dialog { border: 0; padding: 24px; width: min(420px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(40, 25, 10, .45); }
dialog form { display: grid; gap: 14px; }
dialog label { display: grid; gap: 6px; font-weight: 700; }
dialog input { border-radius: 12px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Telefony */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero { padding: 14px 0; }
  .hero-inner { flex-wrap: wrap; gap: 10px; }
  .hero .lead { display: none; }
  .hero-badge { width: 40px; height: 40px; }
  .social { width: 100%; }
  .social .btn { flex: 1; }
  main.wrap { margin-top: 20px; }
  .about { padding: 22px 20px; }
  .track.song-card { grid-template-columns: 1fr; gap: 18px; padding: 14px; }
  .song-actions .btn { flex: 1 1 100%; }
  .track { grid-template-columns: 96px 1fr; gap: 12px; padding: 10px; }
  .actions { grid-column: 1 / -1; justify-content: stretch; }
  .actions .btn { flex: 1; }
  .filters { width: 100%; }
  .filters input[type=search] { flex: 1 1 100%; min-width: 0; }
  .filters select { flex: 1; }
  .footer .wrap { flex-direction: column; }
  .admin-bar nav { gap: 12px; font-size: .9rem; }
}
