/*
  Shared look for Pelipuisto games: the site's palette, a full-window stage, and the start / game over
  overlays and buttons. Games add their own styles after this.
*/
/* The site's fonts, Latin only, copied from @fontsource-variable so games need no build step */
@font-face {
  font-family: 'Pelipuisto Fredoka';
  src: url('fonts/fredoka-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: 'Pelipuisto Nunito';
  src: url('fonts/nunito-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --ink: #23264a;
  --paper: #fbf7ea;
  --grass: #3cc25a;
  --grass-deep: #1b7a44;
  --sky: #2aa7ee;
  --sun: #ffcc1f;
  --berry: #f2457f;
  --tangerine: #ff8a1e;
  --lilac: #9a6cf7;
  --font: 'Pelipuisto Nunito', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  --font-heading: 'Pelipuisto Fredoka', var(--font);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* The heads-up line above a game: score, best, lives and the like */
.pp-hud {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.5rem;
  font-weight: 800;
  font-size: clamp(0.85rem, 2.5vmin, 1.1rem);
}

.pp-hud > * {
  background: white;
  border: 1px solid rgb(35 38 74 / 0.12);
  border-radius: 999px;
  box-shadow: 0 2px 6px -2px rgb(35 38 74 / 0.2);
  padding: 0.2rem 0.8rem;
}

.pp-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgb(35 38 74 / 0.45);
  z-index: 10;
}

.pp-overlay[hidden] {
  display: none;
}

.pp-panel {
  max-width: 26rem;
  width: 100%;
  text-align: center;
  background: var(--paper);
  border: 1px solid rgb(35 38 74 / 0.1);
  border-radius: 1rem;
  box-shadow:
    0 2px 4px rgb(35 38 74 / 0.08),
    0 24px 48px -16px rgb(35 38 74 / 0.45);
  padding: clamp(1rem, 4vmin, 2rem);
}

.pp-panel h1,
.pp-panel h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 6vmin, 2.4rem);
  line-height: 1.1;
}

.pp-panel p {
  margin: 0 0 1rem;
  font-size: clamp(0.95rem, 3vmin, 1.1rem);
}

.pp-buttons {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

.pp-button {
  font: inherit;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1rem, 3.5vmin, 1.25rem);
  color: var(--ink);
  background: var(--grass);
  border: 1px solid rgb(35 38 74 / 0.15);
  border-radius: 0.8rem;
  box-shadow:
    0 1px 2px rgb(35 38 74 / 0.08),
    0 8px 20px -8px rgb(35 38 74 / 0.3);
  padding: 0.55rem 1.4rem;
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease;
}

.pp-button:hover,
.pp-button:focus-visible {
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgb(35 38 74 / 0.08),
    0 14px 28px -10px rgb(35 38 74 / 0.4);
  outline: none;
}

.pp-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgb(35 38 74 / 0.15);
}

.pp-button.secondary {
  background: white;
}

.pp-button[aria-pressed='true'] {
  background: var(--sun);
}

.pp-home-link {
  position: fixed;
  left: 0.5rem;
  bottom: 0.5rem;
  z-index: 20;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgb(35 38 74 / 0.15);
  box-shadow: 0 2px 6px -2px rgb(35 38 74 / 0.2);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  font-size: 0.85rem;
}
