/* ==========================================================================
   LOBBY — hero, siatka gier, sekcje. Wyłącznie struktura; kolory ze skórki.
   ========================================================================== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  padding: clamp(24px, 5vw, 56px) 0 clamp(28px, 5vw, 60px);
}

/* Logo na stronie głównej — główny punkt zaczepienia wzroku. */
.hero__logo {
  width: min(480px, 86%);
  height: auto;
  display: block;
  margin: 0 0 20px;
  filter: var(--logo-shadow);
}

@media (max-width: 820px) {
  .hero__logo { margin-left: auto; margin-right: auto; }
}

.hero__title {
  font-size: clamp(23px, 3.6vw, 36px);
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-bottom: 14px;
}
.hero__title em {
  font-style: normal;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lead {
  color: var(--tx-2);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
  max-width: 46ch;
  margin-bottom: 24px;
}
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Poglądowy stolik w hero — czysty CSS, bez obrazków */
.hero__table {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  background: var(--felt-bg);
  border: var(--felt-frame-width) solid transparent;
  border-image: var(--felt-frame) 1;
  box-shadow: var(--sh-3), var(--felt-inset);
  overflow: hidden;
}
.hero__pieces {
  position: absolute;
  inset: 12%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;
}
.hero__piece {
  width: min(60px, 70%);
  aspect-ratio: 1;
  border-radius: 50%;
  animation: float 5s ease-in-out infinite;
}
.hero__piece--l { background: var(--piece-light); box-shadow: var(--piece-ring-light), var(--piece-shadow); }
.hero__piece--d { background: var(--piece-dark); box-shadow: var(--piece-ring-dark), var(--piece-shadow); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.hero__piece:nth-child(2n) { animation-delay: -1.4s; }
.hero__piece:nth-child(3n) { animation-delay: -2.7s; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero__table { max-width: 420px; margin: 0 auto; }
}

/* --------------------------------------------------------------- sekcje */
.section__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 34px 0 16px;
  flex-wrap: wrap;
}
.section__head h2 { font-size: clamp(19px, 2.4vw, 24px); }
.section__head p { margin: 0; color: var(--tx-3); font-size: 14px; }

/* --------------------------------------------------------------- filtry */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filters button {
  padding: 6px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--tx-2);
  font-size: 13px;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.filters button:hover { background: var(--bg-3); }
.filters button[aria-pressed="true"] {
  background: var(--accent-grad);
  color: var(--on-accent);
  border-color: transparent;
  font-weight: 650;
}

/* --------------------------------------------------------------- siatka gier */
.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: clamp(12px, 1.8vw, 20px);
}

/* Kafelek gry: duży przycisk „graj" plus stopka z odnośnikiem do zasad.
   Przycisk w przycisku byłby niepoprawnym HTML-em, więc kafelek jest divem. */
.gcard {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel-bg);
  box-shadow: var(--sh-2);
  overflow: hidden;
  color: var(--tx-1);
  transition: transform .16s cubic-bezier(.2,.7,.3,1), box-shadow .2s ease, border-color .2s ease;
}
.gcard:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: var(--bg-3); }
.gcard:focus-within { border-color: var(--accent); }
.gcard[data-state="soon"] { opacity: .62; }
.gcard[data-state="soon"]:hover { transform: none; box-shadow: var(--sh-2); }

.gcard__play {
  display: flex;
  flex-direction: column;
  flex: 1;
  border: 0;
  padding: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.gcard__play[disabled] { cursor: default; }
.gcard__play:focus-visible { outline: none; box-shadow: var(--glow); }

.gcard__foot {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 14px 13px;
}
.gcard__rules {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--tx-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.gcard__rules:hover { background: var(--bg-3); color: var(--tx-1); border-color: var(--accent); }

.gcard__art {
  aspect-ratio: 16 / 10;
  position: relative;
  display: grid;
  place-items: center;
  background: var(--gcard-art-bg);
  border-bottom: 1px solid rgba(0,0,0,.4);
  overflow: hidden;
}
.gcard__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.07), transparent 45%, rgba(0,0,0,.28));
}
.gcard__art svg { width: 66%; height: 66%; filter: drop-shadow(0 6px 12px rgba(0,0,0,.5)); }

.gcard__body { padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.gcard__title { font-family: var(--font-display); font-size: 16px; display: flex; align-items: center; gap: 8px; }
.gcard__desc { color: var(--tx-3); font-size: 12.5px; line-height: 1.45; flex: 1; }
.gcard__meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }

/* Miejsce na reklamę. Nie rezerwuje wysokości, dopóki nic w nim nie ma —
   pusta ramka na stronie wygląda gorzej niż brak reklamy. */
.adslot {
  margin: 26px 0 0;
  min-height: 0;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.adslot:empty { display: none; }

/* --------------------------------------------------------------- pasek informacji */
.notice {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 18px 0 0;
  padding: 13px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel-bg);
  font-size: 14px;
  line-height: 1.5;
  color: var(--tx-2);
}
.notice b { color: var(--tx-1); }
.notice .btn { margin-left: auto; }
.notice--ok { border-color: var(--ok); background: var(--ok-soft); color: var(--tx-1); }
.notice--warn { border-color: var(--warn); background: var(--warn-soft); color: var(--tx-1); }

/* --------------------------------------------------------------- stoły online */
.tables__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tables__status { font-size: 13px; color: var(--tx-3); }
.tables__status[data-state="gotowe"]::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--ok);
}
.tables__status[data-state="zerwane"] { color: var(--warn); }
.tables__head .btn { margin-left: auto; }

.tables { display: grid; gap: 8px; }

/* Nagłówek grupy stołów — „czekają na graczy" to co innego niż
   „partia trwa", i gracz musi to widzieć, zanim kliknie. */
.tables__label {
  margin: 14px 2px 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tx-3);
}
.tables__label:first-child { margin-top: 0; }

.trow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel-bg);
  color: var(--tx-1);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .12s ease;
}
.trow:hover { border-color: var(--accent); transform: translateY(-1px); }
.trow:focus-visible { outline: none; box-shadow: var(--glow); }
.trow__game { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.trow__name { font-family: var(--font-display); font-size: 15.5px; }
.trow__clock { font-size: 12.5px; color: var(--tx-3); }
.trow__who { font-size: 13px; color: var(--tx-2); overflow: hidden; text-overflow: ellipsis; }
.trow__empty { color: var(--tx-3); font-style: italic; }
.trow__state { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

/* Wołanie do działania po prawej: przy stole z wolnym miejscem „Usiądź",
   przy trwającej partii „Oglądaj". */
.trow__go {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--tx-3);
  white-space: nowrap;
  transition: color .16s ease, transform .16s ease;
}
.trow:hover .trow__go { color: var(--accent); transform: translateX(2px); }
.trow[data-open="true"] { border-left: 3px solid var(--ok); }
.trow[data-open="false"] { border-left: 3px solid var(--line); }
.chip--play { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

@media (max-width: 640px) {
  .trow { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .trow__state { justify-content: flex-start; }
}

/* Wybór gry w oknie zakładania stołu. */
.picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 6px;
  max-height: 232px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.picker__item {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 7px 4px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--tx-2);
  cursor: pointer;
  font-size: 11.5px;
  line-height: 1.25;
  text-align: center;
}
.picker__item:hover { background: var(--bg-3); }
.picker__item[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--tx-1);
  box-shadow: var(--glow);
}
.picker__art { display: block; width: 38px; height: 38px; }
.picker__art svg { width: 100%; height: 100%; border-radius: 5px; }

.empty {
  padding: 28px;
  text-align: center;
  color: var(--tx-3);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  font-size: 14px;
}

.footnote { margin-top: 44px; color: var(--tx-3); font-size: 12.5px; line-height: 1.6; }
