/* TheCartonick — wygląd strony. Kolor akcentu ustawia panel treści (zmienna --accent). */
:root {
  --accent: #DA4141;
  --accent-rgb: 218, 65, 65;
  --live-rgb: 46, 189, 107;
  --bg: #1F2023;
  --surface: #27292D;
  --line: #36383D;
  --line-strong: #45474D;
  --text: #E2E3E4;
  --soft: #C9CBCF;
  --muted: #A9ABB0;
  --pad-x: clamp(20px, 3.2vw, 56px);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--text); }
a:hover { color: #fff; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, p { margin: 0; }

/* Układ: na telefonie zwykłe przewijanie, na komputerze całość w jednym ekranie (niżej) */
.pg {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 100vh;
  padding: 0 var(--pad-x);
}
/* Poświata w lewym górnym rogu: czerwona (kolor akcentu), a podczas streama zielona */
.glow { position: absolute; top: -320px; left: -320px; width: 960px; height: 960px; pointer-events: none; }
.glow::before, .glow::after { content: ''; position: absolute; inset: 0; border-radius: 50%; transition: opacity .8s ease; }
.glow::before { background: radial-gradient(circle, rgba(var(--accent-rgb), .22) 0%, rgba(var(--accent-rgb), .06) 42%, rgba(var(--accent-rgb), 0) 70%); }
.glow::after { background: radial-gradient(circle, rgba(var(--live-rgb), .26) 0%, rgba(var(--live-rgb), .07) 42%, rgba(var(--live-rgb), 0) 70%); opacity: 0; }
.is-live .glow::before { opacity: 0; }
.is-live .glow::after { opacity: 1; }
.top, .hero, .bottom, .foot { position: relative; }

/* Nagłówek */
.top {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid rgba(var(--accent-rgb), .4);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img, .brand .tc-logo { height: 44px; width: auto; display: block; }

/* Logo: kropka miga jak lampka nagrywania (podczas streama szybciej) */
.tc-logo { overflow: visible; }
.tc-logo-dot { transform-box: fill-box; transform-origin: 50% 50%; animation: tcRec 2.4s ease-in-out infinite; }
.is-live .tc-logo-dot { animation-duration: 1.2s; }
@keyframes tcRec { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.9); } }
.brand span { font-weight: 800; font-size: 16px; letter-spacing: .22em; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px; font-weight: 600; font-size: 15px; }
.nav a { text-decoration: none; padding: 10px 0; }

/* Sekcja główna */
.hero {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: clamp(24px, 3vw, 56px);
  padding: clamp(14px, 2.6vh, 32px) 0;
}
.hero-text { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: clamp(14px, 2.4vh, 24px); }
.kicker { font-weight: 700; font-size: 13px; letter-spacing: .24em; color: var(--muted); }
.headline { white-space: nowrap; font-weight: 800; font-size: clamp(32px, min(2.9vw, 5.4vh), 64px); line-height: 1; letter-spacing: -.03em; }
.headline span { color: var(--accent); }
.lead { max-width: 420px; font-size: clamp(16px, 2.1vh, 20px); color: var(--soft); }
.btn-primary {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 0 28px; border-radius: 12px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 19px; text-decoration: none;
  transition: transform .15s ease, filter .15s ease;
}
.btn-primary:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); }

/* Player Twitcha */
.player-wrap { position: relative; flex: none; width: 100%; max-width: 100%; }
.player {
  position: relative; width: 100%;
  aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden;
  border: 1px solid #3A3C41; box-shadow: 0 30px 70px rgba(0, 0, 0, .5); background: #26282C;
}
.offline, .offline img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.offline img { object-fit: cover; }
/* Player Twitcha jest schowany, dopóki kanał nie nadaje — wtedy widać grafikę offline */
.embed { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .4s ease; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.is-live .embed { opacity: 1; pointer-events: auto; }
.is-live .offline { visibility: hidden; }
.live-badge {
  position: absolute; top: 16px; left: 16px; z-index: 2; pointer-events: none;
  display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .04em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.live-badge[hidden] { display: none; }
.live-badge .dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
/* Dymek z aktualnym tytułem streama (tylko na żywo) */
.live-title {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: 100%; margin: 0 auto 14px; padding: 9px 16px;
  border-radius: 12px; background: #2A2C31; border: 1px solid rgba(var(--live-rgb), .55);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 0 0 4px rgba(var(--live-rgb), .08);
  font-size: 17px; font-weight: 700; line-height: 1.3; color: #fff; white-space: nowrap;
  animation: ltIn .35s cubic-bezier(.22, 1, .36, 1);
}
.live-title[hidden] { display: none; }
.live-title::after {
  content: ''; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; margin-left: -6px;
  background: #2A2C31; border-right: 1px solid rgba(var(--live-rgb), .55); border-bottom: 1px solid rgba(var(--live-rgb), .55);
  transform: rotate(45deg);
}
.lt-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.lt-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.live-title.lt-wrap { white-space: normal; text-align: center; width: 100%; }
.lt-wrap .lt-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@keyframes ltIn { from { opacity: 0; translate: 0 6px; } }
.noscript { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* Dół: harmonogram + o mnie */
.bottom { flex: none; display: flex; flex-wrap: wrap; align-items: stretch; gap: 20px; }
.schedule { flex: 1.8 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px;
  border-top: 1px solid rgba(var(--accent-rgb), .4); padding-top: 14px;
}
.section-head h2 { font-weight: 800; font-size: clamp(22px, 3vh, 30px); letter-spacing: -.02em; }
.section-head span { font-size: 14px; color: var(--muted); }
.cards { flex: 1 1 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.card {
  position: relative; overflow: hidden; min-width: 0; display: block; width: 100%; margin: 0;
  padding: 14px 16px 14px 32px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.card:hover { border-color: rgba(var(--accent-rgb), .6); background: #2B2D32; transform: translateY(-2px); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.card::before { content: ''; position: absolute; left: 16px; top: 18px; bottom: 18px; width: 3px; border-radius: 2px; background: var(--accent); }
.card-body { position: relative; display: flex; flex-direction: column; }
.card-body > span { display: block; }
.card-body > .card-desc { display: -webkit-box; }
.card-more { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.card:hover .card-more { text-decoration: underline; text-underline-offset: 3px; }
.card-day { font-size: 14px; line-height: 1.3; }
.card-day strong { font-weight: 700; }
.card-day > span { color: var(--muted); white-space: nowrap; }
.card-time { font-weight: 800; font-size: clamp(26px, 3.6vh, 40px); line-height: 1.1; letter-spacing: -.03em; }
.card-cat { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-desc { font-size: 13px; color: var(--soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cards-empty {
  position: relative; flex: 1 1 auto; min-height: 128px;
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px 20px 40px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  font-weight: 700; font-size: clamp(16px, 2.2vh, 20px); color: var(--text);
}
.cards-empty::before { content: ''; position: absolute; left: 16px; top: 18px; bottom: 18px; width: 3px; border-radius: 2px; background: var(--accent); }
.cards-empty svg { flex: none; color: var(--accent); }

.about {
  flex: 1 1 400px; min-width: 0; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  padding: 18px 20px; display: flex; align-items: center; gap: 20px;
}
.avatar { flex: none; width: 88px; height: 88px; border-radius: 50%; border: 3px solid var(--accent); object-fit: cover; background: var(--bg); }
.avatar.is-logo { object-fit: contain; padding: 14px; }
div.avatar.is-logo { display: flex; align-items: center; justify-content: center; padding: 0; }
div.avatar.is-logo .tc-logo { height: 54px; width: auto; }
.about-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.label { font-weight: 700; font-size: 12px; letter-spacing: .24em; color: var(--accent); }
.about h2 { font-weight: 800; font-size: 20px; line-height: 1.2; }
.about p { font-size: 14px; color: var(--soft); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pill {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-strong); font-weight: 700; font-size: 14px; text-decoration: none;
}
.pill-accent { border: 2px solid var(--accent); font-weight: 800; }
.pill:hover { background: rgba(255, 255, 255, .05); }

/* Stopka */
.foot {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
  padding: 14px 0 clamp(12px, 2vh, 20px); font-size: 13px; color: var(--muted);
}
.foot a { color: var(--soft); }
.foot-right { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.link-btn {
  appearance: none; background: none; border: 0; padding: 4px 0; margin: 0; cursor: pointer;
  font: inherit; color: var(--soft); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px;
  transition: color .15s ease, text-decoration-color .15s ease;
}
.link-btn:hover { color: #fff; text-decoration-color: var(--accent); }

/* Okienka: Regulamin / Sprzęt / Donate — kliknięcie poza tekstem zamyka */
dialog.info {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
  padding: clamp(24px, 6vh, 64px) var(--pad-x); border: 0; overflow-y: auto;
  background: rgba(23, 24, 27, .94); color: var(--text);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
dialog.info[open] { display: flex; animation: fade .2s ease; }
dialog.info::backdrop { background: transparent; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: relative; width: 100%; max-width: 560px; margin: auto; }
.sheet h2 { font-weight: 800; font-size: clamp(32px, 5vh, 48px); letter-spacing: -.02em; line-height: 1.05; }
.info-sub-top { margin: 0 0 10px !important; }
.info-sub { margin-top: 6px; font-size: 14px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.info-close {
  position: absolute; top: -4px; right: -8px; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: none; border: 1px solid var(--line-strong); color: var(--soft);
}
.info-close:hover { color: #fff; border-color: var(--soft); }
.rules { margin: 28px 0 0; padding: 0; list-style: none; counter-reset: r; display: flex; flex-direction: column; gap: 14px; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 28px 1fr; gap: 8px; font-size: 17px; color: var(--soft); }
.rules li::before { content: counter(r, decimal-leading-zero); font-weight: 800; font-size: 13px; color: var(--accent); padding-top: 4px; }
.rules li:first-child { color: var(--text); font-weight: 700; }
.specs { margin: 28px 0 0; display: flex; flex-direction: column; }
.specs div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.specs div:last-child { border-bottom: 0; }
.specs dt { color: var(--muted); font-size: 14px; padding-top: 2px; }
.specs dd { margin: 0; font-weight: 600; }
.info-text { margin: 24px 0 28px; font-size: 18px; color: var(--soft); }
.info-note { margin-top: 18px; font-size: 13px; color: var(--muted); }

/* Komputer: cała strona mieści się w jednym ekranie, wszystko skaluje się do wysokości okna */
@media (min-width: 1101px) and (min-height: 641px) {
  .pg { height: 100vh; height: 100dvh; }
  .hero { flex-wrap: nowrap; }
  .player-wrap {
    width: min(60vw, calc((100vh - 525px) * 1.7778));
    width: min(60vw, calc((100dvh - 525px) * 1.7778));
  }
  /* na komputerze dymek „wisi” nad playerem i nie przesuwa układu */
  .live-title { position: absolute; left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%); margin: 0; }
}

/* Tablet / telefon: zwykłe przewijanie */
@media (max-width: 1100px), (max-height: 640px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding-top: 28px; }
}
@media (max-width: 960px) {
  .headline { white-space: normal; font-size: clamp(34px, 9vw, 52px); }
  .hero-text { flex-basis: 100%; }
}
@media (max-width: 520px) {
  .nav { gap: 4px 20px; }
  .brand span { letter-spacing: .14em; font-size: 14px; }
  .cards { grid-template-columns: 1fr; }
  .about { flex-direction: column; align-items: flex-start; }
  .schedule { flex-basis: 100%; }
  .specs div { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .live-badge .dot, .tc-logo-dot, .lt-dot, .live-title { animation: none; }
  .card { transition: none; }
  .btn-primary, .embed, .link-btn, .glow::before, .glow::after { transition: none; }
  dialog.info[open] { animation: none; }
}
