/* Shared site chrome. Tokens come from design-system/tokens.css (linked in HTML). */

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  min-height: 44px;
}

img.mark {
  width: 36px;
  height: 36px;
  display: block;
  flex: 0 0 36px;
}

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

.top h1 {
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  margin: 0;
  font-weight: 600;
  line-height: 1.1;
}

.top .sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  font-size: 1rem;
}

.nav a:hover,
.nav a[aria-current="page"] { color: var(--ink); }

.meta { display: flex; gap: 8px; flex-wrap: wrap; }

button,
select,
input[type="text"] { font-size: 1rem; }

button {
  font: inherit;
  color: var(--ink);
  background: var(--btn);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  min-height: 44px;
  cursor: pointer;
}

button:hover { border-color: var(--btn-hover-line); background: var(--btn-hover); }
button.primary { background: var(--gold-fill); color: var(--ink-button); border-color: var(--gold-border); font-weight: 600; }
button.primary:hover { background: var(--gold-hover); border-color: var(--gold-border); }
button.ghost { opacity: 0.7; }
button.active { border-color: var(--gold); color: var(--gold); background: var(--gold-active); }

@media (max-width: 760px) {
  .top { align-items: flex-start; }
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  width: 100%;
}

.site-header a.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-height: 44px;
}

.site-header img.mark {
  width: 36px;
  height: 36px;
  display: block;
  flex: 0 0 36px;
}

.site-header h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  font-weight: 600;
  line-height: 1.1;
}

.site-header .nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
}

.site-header .nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  font-size: 1rem;
}

.site-header .nav a:hover,
.site-header .nav a[aria-current="page"] { color: var(--ink); }

/* How to play pop — compact cream modal, not a page takeover. */
#rulesBtn,
.howto-pop-btn {
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 10px;
  min-height: 44px;
  cursor: pointer;
}
#rulesBtn:hover,
.howto-pop-btn:hover { color: var(--ink); }

.rules-pop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(246, 241, 232, 0.45);
  z-index: 20;
  padding: 24px 16px;
}
.rules-pop.hidden { display: none !important; }
.rules-pop-card, .rules-card {
  background: var(--paper-bright);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  max-width: 22rem;
  width: min(22rem, 100%);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.rules-pop-body { font-size: 1.02rem; line-height: 1.45; }
.rules-pop-body p { margin: 0 0 8px; }
.rules-pop-body p:last-child { margin-bottom: 0; }
.rules-pop-body ul { margin: 0 0 8px; padding-left: 1.15em; }
.rules-pop-more { margin: 12px 0 10px; }
.rules-pop-more a { color: var(--ink); text-underline-offset: 3px; }
.rules-pop-card > button, .rules-card > button {
  font: inherit;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 8px 0;
  min-height: 44px;
  cursor: pointer;
}
.rules-pop-card > button, .rules-card > button:hover { color: var(--ink); }

.locale-switch {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
}
.locale-switch label { display: flex; margin: 0; }
.locale-switch select {
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--paper-bright);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 44px;
  max-width: 12.5rem;
  padding: 8px 10px;
  cursor: pointer;
}
@media (max-width: 760px) {
  .locale-switch { margin-left: 0; }
  .locale-switch select { max-width: 11rem; }
}

.nav-games { position: relative; }
.nav-games > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  font-size: 1rem;
}
.nav-games > summary::-webkit-details-marker { display: none; }
.nav-games.is-current > summary,
.nav-games[open] > summary,
.nav-games > summary:hover { color: var(--ink); }
.nav-games-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: absolute;
  z-index: 8;
  top: 100%;
  left: 0;
  min-width: 12rem;
  padding: 6px 0;
  background: var(--paper-bright);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.site-header .nav .nav-games-list a,
.site-header .nav .nav-games-list [aria-current="page"] {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
}
.nav-games-list [aria-current="page"] {
  color: var(--ink);
  cursor: default;
}
@media (max-width: 760px) {
  .nav-games { width: 100%; }
  .nav-games-list {
    position: static;
    min-width: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0 0 0 8px;
  }
}