/* Shared look of a Plbl game site (template from common_rules/website/template).
   Colours follow plbl.day: muted grey-green paper in light, deep green-black in dark.
   A game gives the site its own feel by changing --accent / --accent-2 in its page. */

:root {
  color-scheme: light;
  --bg: #e9ece8;
  --bg-soft: #f1f3f0;
  --bg-hover: #f6f8f5;
  --border: #d5dbd6;
  --text: #1f2a25;
  --text-soft: #59665f;
  --accent: #1c8f56;
  --accent-2: #15803d;
  --accent-soft: rgba(28, 143, 86, 0.16);
  --on-accent: #fff;
  --shadow: rgba(31, 42, 37, 0.08);
  --logo-shadow: rgba(31, 157, 95, 0.26);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141a17;
    --bg-soft: #1b231f;
    --bg-hover: #212b26;
    --border: #2b3631;
    --text: #e1e8e4;
    --text-soft: #94a39b;
    --accent: #3cc47f;
    --accent-soft: rgba(60, 196, 127, 0.2);
    --on-accent: #0d1a13;
    --shadow: rgba(0, 0, 0, 0.3);
    --logo-shadow: rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141a17;
  --bg-soft: #1b231f;
  --bg-hover: #212b26;
  --border: #2b3631;
  --text: #e1e8e4;
  --text-soft: #94a39b;
  --accent: #3cc47f;
  --accent-soft: rgba(60, 196, 127, 0.2);
  --on-accent: #0d1a13;
  --shadow: rgba(0, 0, 0, 0.3);
  --logo-shadow: rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.wrap {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 24px 0;
  flex: 1;
}

/* ---------- top bar: Plbl badge on the left, language + theme on the right ---------- */

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.plbl-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.plbl-badge:hover { border-color: #22a565; transform: translateY(-1px); }
.plbl-badge:focus-visible { outline: 2px solid #22a565; outline-offset: 2px; }
.plbl-logo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #22a565, #15803d);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.plbl-badge .plbl-name { font-weight: 800; }
.plbl-badge .plbl-dim { color: var(--text-soft); }
.plbl-badge .plbl-arrow { color: #22a565; transition: transform 0.18s ease; }
.plbl-badge:hover .plbl-arrow { transform: translate(2px, -2px); }

/* "b" rolls over into "P" and back, like the logo on plbl.day; plbl.js sets the pivot. */
.plbl-flip { display: inline-block; transform-origin: 50% 50%; animation: plbl-flip 5.333s linear infinite; }
@keyframes plbl-flip {
  0%, 18.75%  { transform: perspective(160px) rotateX(0deg); }
  50%, 68.75% { transform: perspective(160px) rotateX(180deg); }
  100%        { transform: perspective(160px) rotateX(360deg); }
}
@media (prefers-reduced-motion: reduce) { .plbl-flip { animation: none; } }

.controls { display: flex; gap: 8px; margin-left: auto; }

.ctl {
  height: 40px;
  min-width: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.ctl:hover { color: var(--accent); border-color: var(--accent); }
.ctl:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ctl svg { width: 18px; height: 18px; }

.theme-toggle .icon-sun { display: none; }
.theme-toggle.is-dark .icon-sun { display: block; }
.theme-toggle.is-dark .icon-moon { display: none; }

.lang { position: relative; }
.lang-btn { padding: 0 10px 0 8px; }
.lang-btn .chev { width: 12px; height: 12px; transition: transform 0.18s ease; }
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.flag {
  width: 22px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  flex: none;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  list-style: none;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 10px 28px var(--shadow);
  z-index: 10;
}
.lang-menu[hidden] { display: none; }
.lang-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  text-align: left;
}
.lang-menu button:hover,
.lang-menu button:focus-visible { background: var(--bg-hover); outline: none; }
.lang-menu button[aria-checked="true"] { color: var(--accent); font-weight: 650; }
.lang-menu button[aria-checked="true"]::after { content: "\2713"; margin-left: auto; }

/* ---------- landing page ---------- */

.hero { text-align: center; padding: 56px 0 40px; }

.app-icon {
  display: block;
  width: 104px;
  height: 104px;
  border-radius: 24px;
  margin: 0 auto 22px;
  box-shadow: 0 10px 30px var(--logo-shadow);
}

.kicker {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  font-size: 2.6rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 8px 0 12px;
}

.tagline {
  color: var(--text-soft);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px 26px;
  border-radius: 999px;
  box-shadow: 0 8px 22px var(--accent-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 12px 28px var(--accent-soft); }
.cta svg { width: 20px; height: 20px; fill: currentColor; }
.cta-note { color: var(--text-soft); font-size: 0.85rem; margin-top: 12px; }

section { margin-bottom: 52px; }

h2 {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 18px;
  font-weight: 600;
  text-align: center;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 2px 10px var(--shadow);
}
.card .emoji { font-size: 1.6rem; line-height: 1; }
.card h3 { font-size: 1.05rem; margin: 10px 0 4px; }
.card p { color: var(--text-soft); font-size: 0.95rem; }

.shots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.shot { margin: 0; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  box-shadow: 0 6px 20px var(--shadow);
}
.shot figcaption {
  text-align: center;
  color: var(--text-soft);
  font-size: 0.85rem;
  line-height: 1.4;
  margin-top: 10px;
}

.prose { max-width: 640px; margin: 0 auto; }
.prose p { margin-bottom: 14px; }

/* ---------- privacy page ---------- */

.doc { max-width: 720px; margin: 0 auto; padding: 36px 0 8px; }
.back { display: inline-block; font-weight: 600; text-decoration: none; margin-bottom: 18px; }
.doc h1 { font-size: 2.2rem; text-align: left; }
.doc .meta { color: var(--text-soft); font-size: 0.9rem; margin-bottom: 22px; }
.doc h2 { text-align: left; text-transform: none; letter-spacing: 0; font-size: 1.2rem; color: var(--accent); margin: 30px 0 8px; }
.doc p, .doc li { margin-bottom: 10px; }
.doc ul { padding-left: 22px; }
.callout {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 20px 0;
}

/* ---------- footer: four links, then the copyright ---------- */

footer {
  border-top: 1px solid var(--border);
  padding: 24px 24px 28px;
  margin-top: 24px;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.85rem;
}

footer .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  margin-bottom: 10px;
}
footer .links a { color: var(--accent); text-decoration: none; }
footer .links a:hover { text-decoration: underline; }

/* The address itself is the contact: a click opens the mail app, a drag selects it for copying. */
a[href^="mailto:"] { user-select: text; -webkit-user-drag: none; }

@media (max-width: 700px) {
  .shots { grid-template-columns: 1fr 1fr; max-width: 440px; margin: 0 auto; }
}

@media (max-width: 520px) {
  .wrap { padding: 12px 16px 0; }
  /* Keep badge and controls on one row: the logo already says "bl". */
  .plbl-badge .plbl-name, .plbl-badge .plbl-dim { display: none; }
  .hero { padding: 40px 0 32px; }
  h1 { font-size: 2.1rem; }
  .doc h1 { font-size: 1.8rem; }
}
