/* ═══════════════════════════════════════════
   COGWERK — dark industrial premium
   ═══════════════════════════════════════════ */

:root {
  --bg: #0c0e13;
  --bg-2: #12151c;
  --panel: #161a24;
  --panel-2: #1e2432;
  --line: #2a3142;
  --line-soft: rgba(255, 255, 255, .06);
  --text: #eef0f6;
  --muted: #9aa3b5;
  --accent: #ffb020;
  --accent-2: #35d0ba;
  --accent-glow: rgba(255, 176, 32, .35);
  --radius: 16px;
  --radius-sm: 11px;
  --mono: Consolas, "Cascadia Mono", "Courier New", monospace;
  --shadow-card: 0 18px 40px rgba(0, 0, 0, .45);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* subtle industrial grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

::selection { background: rgba(255, 176, 32, .32); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Header ─────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(12, 14, 19, .78);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  transition: opacity .2s var(--ease);
}

.brand:hover { opacity: .92; }

.brand-logo {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .16em;
}

.accent { color: var(--accent); }

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 24px;
  font-size: 14.5px;
  font-weight: 600;
  transition: color .18s ease;
  position: relative;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .2s var(--ease);
  transform-origin: left;
}

.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after { transform: scaleX(1); }

/* ── Hero ───────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  padding: 120px 28px 100px;
  border-bottom: 1px solid var(--line-soft);
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    url("../assets/hero.jpg") center 40% / cover no-repeat;
  transform: scale(1.04);
  filter: saturate(1.05) contrast(1.05);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(12, 14, 19, .94) 0%, rgba(12, 14, 19, .78) 42%, rgba(12, 14, 19, .45) 68%, rgba(12, 14, 19, .72) 100%),
    linear-gradient(to top, var(--bg) 0%, transparent 38%),
    radial-gradient(600px 280px at 70% 30%, rgba(255, 176, 32, .14), transparent 70%),
    radial-gradient(500px 260px at 20% 80%, rgba(53, 208, 186, .1), transparent 65%);
}

.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .22em;
  color: var(--accent);
  border: 1px solid rgba(255, 176, 32, .45);
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 24px;
  background: rgba(255, 176, 32, .08);
  box-shadow: 0 0 24px rgba(255, 176, 32, .12);
  backdrop-filter: blur(8px);
}

.hero-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse-dot 2.2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.85); }
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.5rem, 5.6vw, 4rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.02em;
  text-shadow: 0 4px 40px rgba(0, 0, 0, .55);
  max-width: 14ch;
}

.hero-sub {
  max-width: 540px;
  color: #c4cad8;
  font-size: 17px;
  line-height: 1.7;
  margin: 0 0 34px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .5);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #ffc14a 0%, var(--accent) 100%);
  color: #181103;
  font-weight: 800;
  font-size: 15px;
  padding: 13px 26px;
  border-radius: 12px;
  text-decoration: none;
  letter-spacing: .02em;
  box-shadow: 0 6px 24px rgba(255, 176, 32, .28);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(255, 176, 32, .4);
}

.hero-stats {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  background: rgba(12, 14, 19, .45);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 8px 14px;
  backdrop-filter: blur(8px);
}

/* ── Sekcja gier ────────────────────────── */

.games-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 68px 28px 32px;
  scroll-margin-top: 70px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.section-head h2,
.about h2 {
  font-size: 28px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -.01em;
}

.count-badge {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--accent);
  border: 1px solid rgba(255, 176, 32, .35);
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 176, 32, .06);
}

#search {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  width: min(300px, 100%);
  transition: border-color .15s ease, box-shadow .15s ease;
}

#search::placeholder { color: #6b7385; }

#search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 176, 32, .12);
}

/* ── Filtry ─────────────────────────────── */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 28px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease, transform .15s ease;
}

.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chip-color, var(--accent));
  flex-shrink: 0;
  box-shadow: 0 0 8px color-mix(in srgb, var(--chip-color, var(--accent)) 50%, transparent);
}

.chip:hover {
  border-color: var(--chip-color, var(--accent));
  color: var(--text);
  transform: translateY(-1px);
}

.chip[aria-pressed="true"] {
  border-color: var(--chip-color, var(--accent));
  color: var(--text);
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 14%, var(--panel));
  box-shadow: 0 0 20px color-mix(in srgb, var(--chip-color, var(--accent)) 18%, transparent);
}

.chip-count {
  font-family: var(--mono);
  font-size: 11px;
  opacity: .75;
}

/* ── Karty gier ─────────────────────────── */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .28s var(--ease), border-color .22s ease, box-shadow .28s var(--ease);
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--cat) 55%, transparent), transparent 45%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .28s ease;
  pointer-events: none;
  z-index: 2;
}

.card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--cat) 55%, var(--line));
  box-shadow: var(--shadow-card), 0 0 0 1px color-mix(in srgb, var(--cat) 20%, transparent);
}

.card:hover::before { opacity: 1; }

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #10141c;
  background: linear-gradient(160deg, color-mix(in srgb, var(--cat) 28%, #151a21), #0c0f14 75%);
}

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 14, 19, .55) 0%, transparent 45%);
  pointer-events: none;
  z-index: 1;
}

.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease), filter .35s ease;
  filter: saturate(1.05);
}

.card:hover .thumb img {
  transform: scale(1.07);
  filter: saturate(1.12) brightness(1.05);
}

.thumb-letter {
  position: absolute;
  left: 18px;
  bottom: 6px;
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  color: color-mix(in srgb, var(--cat) 75%, #fff);
  opacity: .85;
  text-shadow: 0 4px 18px rgba(0, 0, 0, .35);
}

.thumb-icon {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 104px;
  height: 104px;
  transform: translateY(-50%) rotate(-10deg);
  color: var(--cat);
  opacity: .2;
}

.thumb-icon svg { width: 100%; height: 100%; }

.status {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-weight: 600;
}

.status-live {
  color: #9df0bb;
  background: rgba(20, 80, 50, .55);
  border: 1px solid rgba(46, 196, 122, .5);
  box-shadow: 0 0 12px rgba(46, 196, 122, .2);
}

.status-soon {
  color: #c5cbd8;
  background: rgba(12, 14, 19, .62);
  border: 1px dashed rgba(120, 130, 150, .55);
}

.card-body {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h3 {
  margin: 0 0 8px;
  font-size: 17.5px;
  letter-spacing: -.01em;
}

.card-body p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  flex: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tags span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .07);
  padding: 4px 9px;
  border-radius: 7px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  padding-top: 13px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.cat-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cat);
  box-shadow: 0 0 8px var(--cat);
}

.btn-play {
  background: linear-gradient(180deg, #ffc14a 0%, var(--accent) 100%);
  color: #181103;
  font-weight: 800;
  font-size: 13px;
  padding: 9px 17px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(255, 176, 32, .22);
  transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}

.btn-play:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 176, 32, .32);
}

.btn-disabled {
  background: var(--panel-2);
  color: #6b7385;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 17px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  cursor: not-allowed;
  user-select: none;
}

.empty-state {
  text-align: center;
  padding: 56px 0;
  color: var(--muted);
  font-size: 15px;
}

/* ── O stronie ──────────────────────────── */

.about {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 28px 80px;
  scroll-margin-top: 70px;
}

.about h2 { margin-bottom: 20px; }

.about-card {
  background:
    linear-gradient(135deg, rgba(255, 176, 32, .06), transparent 40%),
    var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 26px 30px;
  max-width: 780px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .25);
}

.about-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.75;
  font-size: 15px;
}

.about-card p:last-child { margin-bottom: 0; }
.about-card strong { color: var(--text); }

.status-inline {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  border: 1px dashed #3d4557;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* ── Stopka ─────────────────────────────── */

.site-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 28px 16px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: linear-gradient(to top, rgba(255, 176, 32, .03), transparent);
}

.site-footer .sep { opacity: .4; }

/* ── Reduced motion ─────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-badge::before { animation: none; }
  .card,
  .thumb img,
  .btn-primary,
  .btn-play,
  .chip { transition: none; }
  .card:hover { transform: none; }
  .card:hover .thumb img { transform: none; }
}

/* ── Mobile ─────────────────────────────── */

@media (max-width: 640px) {
  .site-header { padding: 12px 16px; }
  .brand-name { font-size: 17px; }
  .site-nav a { margin-left: 14px; font-size: 13.5px; }
  .site-nav a::after { display: none; }
  .hero { padding: 80px 16px 64px; }
  .hero-bg { background-position: 70% center; }
  .games-section { padding: 48px 16px 22px; }
  .about { padding: 28px 16px 56px; }
  .section-head { flex-direction: column; align-items: stretch; }
  #search { width: 100%; }
  .games-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ── Przełącznik języków ────────────────── */

#lang-switch {
  margin-left: 24px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
  font: 600 13px "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  transition: border-color .15s ease;
}

#lang-switch:hover { border-color: var(--accent); }
#lang-switch:focus { outline: none; border-color: var(--accent); }

#lang-switch option {
  background: var(--panel);
  color: var(--text);
}

@media (max-width: 640px) {
  #lang-switch { margin-left: 12px; padding: 6px 8px; font-size: 12px; }
}

/* ── Logowanie / konto ──────────────────── */

.nav-auth { display: inline-block; margin-left: 14px; }

.btn-auth {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 9px;
  padding: 7px 14px;
  font: 600 13px "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  transition: border-color .15s ease;
}

.btn-auth:hover { border-color: var(--accent); }
.user-chip { color: var(--accent); }

.user-menu { position: relative; display: inline-block; }

.user-drop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  min-width: 190px;
  padding: 6px;
  z-index: 60;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

.drop-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
  font: 600 13px "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  text-decoration: none;
}

.drop-item:hover { background: var(--panel-2); }

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, .72);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-box {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  width: min(380px, 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

.auth-box h3 { margin: 0 0 18px; font-size: 20px; }

.auth-box input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 11px;
}

.auth-box input:focus { outline: none; border-color: var(--accent); }

.auth-submit {
  width: 100%;
  background: var(--accent);
  color: #181103;
  font-weight: 800;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 14.5px;
  cursor: pointer;
  margin-top: 4px;
  font-family: inherit;
}

.auth-submit:hover { filter: brightness(1.08); }

.auth-err { color: #ff8080; font-size: 13px; margin: 2px 0 8px; min-height: 16px; }

.auth-switch { margin-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--accent); cursor: pointer; text-decoration: none; font-weight: 600; }

.auth-x {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
}

.auth-x:hover { color: var(--text); }

@media (max-width: 640px) {
  .nav-auth { margin-left: 10px; }
  .btn-auth { padding: 6px 10px; font-size: 12px; }
}

/* ── Przycisk „Postaw kawę" ─────────────── */

.btn-coffee {
  display: inline-block;
  margin-left: 20px;
  background: rgba(255, 176, 32, .1);
  border: 1px solid rgba(255, 176, 32, .45);
  color: var(--accent);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.btn-coffee:hover {
  background: var(--accent);
  color: #181103;
  transform: translateY(-1px);
}

.coffee-foot {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.coffee-foot:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .btn-coffee { margin-left: 10px; padding: 6px 10px; font-size: 12px; }
}

/* ── „Postaw kawę" w hero (obok plakietki) ── */

.btn-coffee-hero {
  margin-left: 12px;
  margin-bottom: 24px;
  vertical-align: top;
  background: linear-gradient(180deg, #ffc14a 0%, var(--accent) 100%);
  border-color: var(--accent);
  color: #181103;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  padding: 8px 16px;
  box-shadow: 0 0 24px rgba(255, 176, 32, .22);
}

.btn-coffee-hero:hover {
  filter: brightness(1.07);
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .btn-coffee-hero { margin-left: 0; display: inline-block; margin-top: -12px; }
}
