/*
 * Shared look for MusicMap's plain text pages: About, How to play, FAQ and
 * the past-puzzle answer pages. (The game itself uses src/styles.css.)
 * The colours copy the game's, in light and dark mode.
 *
 * Everything in the "public" folder is copied unchanged into the built site,
 * so this file is served at /site.css.
 */

/* Dark colours (the game's default) */
:root {
  color-scheme: dark;
  --bg: #1c1612;
  --surface: #2a211b;
  --border: #4a3a2e;
  --text: #f3e9d2;
  --muted: #bfae94;
  --accent: #e8743b;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Rockwell', 'Roboto Slab', 'Georgia', serif;
}
/* Light colours: when the device is in light mode (unless the player picked
   dark in the game), or when the player picked light. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    color-scheme: light;
    --bg: #f5eddc;
    --surface: #fffaf0;
    --border: #d8c7a8;
    --text: #2a1f17;
    --muted: #6b5848;
    --accent: #b04d1b;
  }
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f5eddc;
  --surface: #fffaf0;
  --border: #d8c7a8;
  --text: #2a1f17;
  --muted: #6b5848;
  --accent: #b04d1b;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 32px;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.25;
}
h1 {
  font-size: 2rem;
  margin: 16px 0 4px;
}
h2 {
  font-size: 1.25rem;
  margin-top: 2em;
}
a {
  color: var(--accent);
}
.muted {
  color: var(--muted);
}
li {
  margin-bottom: 0.4em;
}

/* Top bar: the MusicMap name (links home) and a big Play button */
.site-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-header__brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.play-link {
  display: inline-block;
  background: var(--accent);
  color: var(--bg); /* dark text on orange in dark mode, light text in light mode */
  font-weight: 700;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 999px;
}

/* A highlighted box (used for each answer on the answer pages) */
.box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 20px 12px;
  margin: 16px 0;
}
.box h2,
.box h3 {
  margin-top: 16px;
}

/* Right side of the top bar: Play button and the ☰ menu */
.site-header__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The ☰ menu. It is a <details> element, so it opens and closes without any
   code. The game has the same menu (src/main.ts and src/styles.css). */
.menu {
  position: relative;
}
.menu > summary {
  list-style: none; /* hide the little triangle browsers add to <details> */
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
}
.menu > summary::-webkit-details-marker {
  display: none;
}
.menu > summary:hover {
  background: var(--surface);
}
.menu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.menu__list a {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.menu__list a:hover,
.menu__list a:focus-visible {
  background: var(--bg);
}
