/* melody.games shared brand chrome — reset, body baseline, paper-grain,
   site header (brand mark + tagline), home button, footer. Markup is
   rendered by brand/chrome.js (see its header for the data-chrome contract).
   Apps link this AFTER tokens.css and BEFORE their own style.css. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
button { font: inherit; color: inherit; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  min-height: 100dvh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

.paper-grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .45;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(0,0,0,.04) 1px, transparent 2px),
    radial-gradient(circle at 70% 55%, rgba(120,80,30,.03) 1px, transparent 2px),
    radial-gradient(circle at 40% 84%, rgba(0,0,0,.035) 1px, transparent 2px);
  background-size: 220px 220px, 180px 180px, 240px 240px;
  mix-blend-mode: multiply;
}

/* ====== Site header ====== */
.site-header {
  position: relative;
  z-index: 30;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(42,53,84,.10);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.brand-mark { width: 36px; height: 36px; display: block; flex: 0 0 36px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--font-brand);
  font-size: 20px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: .2px;
}
.brand-tagline {
  font-family: var(--font-cn-body);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .8px;
  margin-top: 4px;
}

/* ====== Home button (→ portal) ======
   App-side replacement for the explore dropdown: a single link back to the
   portal at melody.games. Markup:
   <a class="home-btn" href="https://melody.games/">
     <span class="home-btn-icon">🏠</span><span>回家</span>
   </a> */
.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: var(--font-cn);
  font-size: 14px;
  letter-spacing: 1px;
  text-decoration: none;
}
.home-btn:hover { background: rgba(42,53,84,.08); }
.home-btn-icon { font-size: 15px; line-height: 1; }
@media (max-width: 480px) {
  .home-btn { padding: 7px 10px; }
  .home-btn span:not(.home-btn-icon) { display: none; }
}

/* ====== Site footer ====== */
.site-footer {
  position: relative;
  z-index: 5;
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 20px 16px;
  font-family: var(--font-cn-body);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .6px;
  text-align: center;
  color: var(--muted);
  text-transform: none;
}
.site-footer .dot { opacity: .6; }

/* ====== Mobile: brand block compacts ====== */
@media (max-width: 480px) {
  .site-header { padding: 14px 18px; }
  .brand-name { font-size: 18px; }
}
