/* Chessbuds — Shared Styles */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Light palette — Apple × board game (matches landing page) */
  --text: #1F1810;
  --text-dim: #6E6359;
  --text-muted: #A99F93;
  --bg: #F4EFE6;
  --bg-elevated: #FBF8F1;
  --surface: rgba(255, 251, 244, 0.85);
  --surface-hover: rgba(255, 247, 235, 0.95);
  --border: rgba(31, 24, 16, 0.10);
  --border-hover: rgba(31, 24, 16, 0.22);
  --accent: #B8842D;
  --accent-dim: rgba(184, 132, 45, 0.45);
  --danger: rgba(170, 70, 60, 0.55);
  --danger-text: #8C3A30;
  --radius: 10px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Site-wide chess-tile cursor with subtle hover/click affordance.
   - Default (everywhere): small bronze tile, soft outline
   - Hover (interactive): slightly larger and more saturated
   - Active (pressed): darker bronze, same size as default */
*, *::before, *::after {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><rect x="6" y="6" width="12" height="12" rx="1.5" fill="%23B8842D" fill-opacity="0.88"/><rect x="6.5" y="6.5" width="11" height="11" rx="1" fill="none" stroke="%231F1810" stroke-opacity="0.35" stroke-width="0.6"/></svg>') 12 12, auto !important;
}

a, a[href], button, [role="button"], [onclick], [tabindex="0"],
.btn, .cta-primary, .cta-secondary, .nav-cta, .nav-link, .footer-link,
.promo-btn, .newgame-btn, .gameover-btn, .profile-cta-btn,
.clickable, label[for], summary, select {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><rect x="7" y="7" width="14" height="14" rx="2" fill="%23B8842D"/><rect x="7.5" y="7.5" width="13" height="13" rx="1.5" fill="none" stroke="%231F1810" stroke-opacity="0.5" stroke-width="0.7"/></svg>') 14 14, pointer !important;
}

a:active, button:active, [role="button"]:active, [onclick]:active,
[tabindex="0"]:active, .btn:active, .cta-primary:active, .cta-secondary:active,
.nav-cta:active, .nav-link:active, .footer-link:active, .promo-btn:active,
.newgame-btn:active, .gameover-btn:active, .profile-cta-btn:active,
.clickable:active, label[for]:active, summary:active {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><rect x="6" y="6" width="12" height="12" rx="1.5" fill="%238A6422"/><rect x="6.5" y="6.5" width="11" height="11" rx="1" fill="none" stroke="%231F1810" stroke-opacity="0.6" stroke-width="0.7"/></svg>') 12 12, pointer !important;
}

/* ── Top bar ── */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  pointer-events: none;
}

#game-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--text);
  position: absolute;
  top: 18px;
  left: clamp(20px, 3vw, 40px);
  opacity: 0.85;
  cursor: pointer;
  pointer-events: auto;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

#game-title:hover { opacity: 1; }

#game-title .brand-mark-icon,
.brand-mark-icon {
  height: 1.65em;
  width: auto;
  display: block;
  /* Crown adds extra bbox height above the lion's head — nudge up so the
     face visually centers on the wordmark baseline. */
  margin-top: -0.08em;
  -webkit-user-drag: none;
  user-select: none;
}

/* ── About Modal ── */
.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 6000;
  background: rgba(31, 24, 16, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.about-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.about-modal {
  position: relative;
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 44px 36px 36px;
  background: rgba(255, 251, 244, 0.97);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s ease;
  opacity: 0;
}

.about-overlay.active .about-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.about-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.about-close:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(31, 24, 16, 0.04);
}

.about-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin: 0 auto 16px;
  opacity: 0.85;
}

.about-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: 32px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 4px;
}

.about-tagline {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 24px;
}

.about-divider {
  width: 32px;
  height: 1px;
  background: var(--accent-dim);
  margin: 0 auto 24px;
}

.about-body {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--text-dim);
}

.about-body + .about-body {
  margin-top: 14px;
}

.about-cta {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.about-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .about-modal { padding: 36px 24px 28px; margin: 0 12px; }
  .about-title { font-size: 28px; }
}

.nav-links {
  position: absolute;
  top: 22px;
  right: clamp(20px, 3vw, 40px);
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 32px);
  pointer-events: auto;
}

/* Clean text-style nav link — matches the landing's .landing-nav a */
.nav-link {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(11px, 0.95vw, 12px);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color 0.2s ease;
}

.nav-link:hover { color: var(--text); }

/* Primary pill CTA — matches the landing's .cta-primary (used for "New Game") */
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border: 1px solid var(--text);
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(11px, 0.9vw, 12px);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(31, 24, 16, 0.10),
              0 6px 16px rgba(31, 24, 16, 0.08);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(31, 24, 16, 0.10),
              0 12px 28px rgba(31, 24, 16, 0.15);
}

.nav-cta:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(31, 24, 16, 0.12);
}

.btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 20px;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text);
}

/* ── Site Footer ── */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  pointer-events: none;
}

.site-footer-left,
.site-footer-right {
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
}

.footer-copyright {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.footer-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.5;
}

.footer-link {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: 'DM Sans', sans-serif;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--text-dim);
}

/* ── Legal Drawer ── */
.legal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(31, 24, 16, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.legal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.legal-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 5001;
  width: 480px;
  max-width: 92vw;
  background: rgba(255, 251, 244, 0.97);
  border-left: 1px solid var(--border);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  padding: 0 28px 36px;
  display: flex;
  flex-direction: column;
}

.legal-drawer.open {
  transform: translateX(0);
}

.legal-drawer::-webkit-scrollbar { width: 4px; }
.legal-drawer::-webkit-scrollbar-thumb {
  background: rgba(31, 24, 16, 0.10);
  border-radius: 2px;
}

.legal-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 20px;
  position: sticky;
  top: 0;
  background: rgba(255, 251, 244, 0.97);
  z-index: 1;
}

.legal-drawer-header h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: 24px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.legal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.legal-close:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(31, 24, 16, 0.04);
}

.legal-updated {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.legal-section {
  margin-bottom: 32px;
}

.legal-section h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 8px;
}

.legal-section p,
.legal-section li {
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-dim);
}

.legal-section p + p {
  margin-top: 8px;
}

.legal-section ul {
  list-style: none;
  padding: 0;
  margin-top: 6px;
}

.legal-section li {
  padding-left: 14px;
  position: relative;
  line-height: 1.55;
}

.legal-section li + li {
  margin-top: 4px;
}

.legal-section li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent-dim);
}

.legal-section a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.legal-section a:hover {
  opacity: 0.7;
}

.legal-divider {
  height: 1px;
  background: var(--border);
  margin: 0 0 20px;
  opacity: 0.5;
}

/* ── Profile Node ── */
.profile-node {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  overflow: hidden;
  text-decoration: none;
}

.profile-node-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.profile-node:hover .profile-node-icon { opacity: 1; }

.profile-node:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.profile-node.active {
  border-color: var(--accent-dim);
  color: var(--accent);
}

@media (max-width: 600px) {
  .legal-drawer { width: 100vw; max-width: 100vw; padding: 0 20px 40px; }
  .site-footer { padding: 12px 16px; }
  .site-footer-inner { gap: 12px; }
}
