/* gierki.link — wspólna skóra podstron z grami */

:root {
  --bg: #0b0f1a;
  --bg-soft: #121828;
  --surface: rgba(255, 255, 255, .05);
  --surface-hi: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .12);
  --text: #e8ecf6;
  --muted: #98a2b8;
  --violet: #a78bfa;
  --pink: #f472b6;
  --sky: #38bdf8;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(167, 139, 250, .18), transparent 65%),
    radial-gradient(800px 500px at 90% 10%, rgba(56, 189, 248, .14), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 8px; }

kbd {
  font-family: ui-monospace, Consolas, monospace;
  font-size: .8em;
  background: var(--surface-hi);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
}

/* --- pasek górny --- */

.game-bar {
  width: min(760px, 100%);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color .15s, background .15s, transform .15s;
}

.back:hover { color: var(--text); background: var(--surface-hi); transform: translateX(-3px); }

.game-bar h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* --- scena --- */

.stage {
  width: min(760px, 100%);
  padding: 0 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.panel {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.stat {
  flex: 1 1 110px;
  min-width: 100px;
  text-align: center;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.stat__label {
  display: block;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.board-wrap {
  position: relative;
  width: 100%;
  display: grid;
  place-items: center;
}

canvas {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1;
  display: block;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
  background: rgba(11, 15, 26, .82);
  backdrop-filter: blur(6px);
  border-radius: 18px;
}

.overlay[hidden] { display: none; }

.overlay__title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.overlay__text { margin: 0; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: linear-gradient(100deg, var(--violet), var(--pink));
  color: #16081f;
  box-shadow: 0 12px 28px rgba(167, 139, 250, .3);
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.btn--ghost:hover { background: var(--surface-hi); }

.btn--ghost[aria-pressed="true"] {
  background: linear-gradient(100deg, var(--violet), var(--pink));
  border-color: transparent;
  color: #16081f;
}

.hint {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
