/*
 * chrome.css — the shared site header and footer, rendered by chrome.js.
 * Used on every public page (marketing, info, lobby, game, account pages).
 * Styling follows the original lobby look: 2px ink rule under the header,
 * 1.5px borders, 3px radius, flat offset shadows.
 */

/* ── Header ── */
.pp-header {
  border-bottom: 2px solid var(--ink);
  padding: 10px 24px;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  /* Above the game intro overlay (300) so the menus open over it; below modals (400+) */
  position: sticky; top: 0; z-index: 350;
  font-family: 'DM Sans', system-ui, sans-serif;
}
.pp-brand { display: inline-flex; align-items: center; line-height: 1; flex-shrink: 0; text-decoration: none; }
.pp-brand img { height: 41px; width: auto; display: block; }
.pp-context { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding-left: 12px; border-left: 1.5px solid var(--border); }
.pp-context:empty { display: none; }
.pp-context .logo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.pp-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.pp-extra { display: inline-flex; align-items: center; gap: 12px; }
.pp-extra:empty { display: none; }

.pp-nav { display: flex; align-items: center; gap: 4px; }
.pp-nav a {
  font-size: 0.85rem; color: var(--ink); text-decoration: none;
  padding: 5px 10px; border-radius: 3px; opacity: 0.72; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: opacity 0.15s;
}
.pp-nav a:hover { opacity: 1; }
.pp-nav a[aria-current="page"] { opacity: 1; font-weight: 600; border-bottom-color: var(--accent); border-radius: 0; }

.pp-actions { display: flex; align-items: center; gap: 10px; }
.pp-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 14px; border-radius: 3px; box-sizing: border-box;
  background: var(--accent); color: #fff; border: 1.5px solid var(--accent);
  font-family: inherit; font-size: 0.85rem; font-weight: 600; text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: opacity 0.15s;
}
.pp-btn:hover { opacity: 0.85; }
.pp-btn-ghost { background: none; color: var(--ink); border-color: var(--ink); }
.pp-btn-ghost:hover { opacity: 1; background: var(--ink); color: var(--paper); }
.pp-icon-btn {
  background: none; border: 1.5px solid var(--ink); border-radius: 3px; cursor: pointer;
  color: var(--ink); width: 32px; height: 32px; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; box-sizing: border-box; opacity: 0.7;
  transition: opacity 0.15s, background 0.15s, color 0.15s; flex-shrink: 0;
}
.pp-icon-btn:hover { opacity: 1; background: var(--ink); color: var(--paper); }

/* Avatar + account dropdown */
.pp-account { position: relative; display: flex; align-items: center; }
.pp-avatar {
  width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer; padding: 0;
  background: var(--accent); color: #fff; font-family: inherit; font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0; transition: opacity 0.15s;
}
.pp-avatar:hover { opacity: 0.85; }
.pp-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-menu {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: 3px;
  min-width: 200px; box-shadow: 3px 3px 0 rgba(0,0,0,0.1); z-index: 200; padding: 4px 0;
}
.pp-menu.open { display: block; }
.pp-menu a, .pp-menu button {
  display: block; width: 100%; text-align: left; padding: 9px 14px; background: none; border: none;
  cursor: pointer; font-family: inherit; font-size: 0.88rem; font-weight: 500; color: var(--ink);
  text-decoration: none; box-sizing: border-box;
}
.pp-menu a:hover, .pp-menu button:hover { background: var(--ink); color: var(--paper); }
.pp-menu a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.pp-menu a[aria-current="page"]:hover { color: var(--paper); }
.pp-menu .pp-menu-who {
  padding: 8px 14px 10px; font-size: 0.75rem; color: var(--muted, #666);
  border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pp-menu .pp-menu-who strong { display: block; color: var(--ink); font-size: 0.9rem; }
.pp-menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.pp-menu .pp-menu-cta { padding: 8px 14px 10px; }
.pp-menu .pp-menu-cta .pp-btn,
.pp-mobile .pp-menu .pp-menu-cta .pp-btn { width: 100%; height: 40px; padding: 0 14px; background: var(--accent); color: #fff; text-align: center; justify-content: center; display: flex; align-items: center; }
.pp-menu .pp-menu-cta .pp-btn:hover { background: var(--accent); color: #fff; opacity: 0.88; }

/* Mobile menu button (shown below 760px) */
.pp-menu-btn { display: none; }
.pp-mobile { position: static; }
.pp-mobile .pp-menu { left: 12px; right: 12px; top: calc(100% + 2px); min-width: 0; }
.pp-mobile .pp-menu a, .pp-mobile .pp-menu button { padding: 12px 16px; font-size: 0.95rem; }

/* Profile avatar inside the mobile menu button and at the top of the mobile menu */
.pp-avatar-mini {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; overflow: hidden; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.pp-avatar-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-avatar-mini svg { width: 12px; height: 12px; }
.pp-avatar-lg { width: 36px; height: 36px; font-size: 0.9rem; }
.pp-avatar-lg svg { width: 16px; height: 16px; }
.pp-menu-btn-user { width: auto; padding: 0 6px 0 4px; gap: 6px; border-radius: 99px; }
.pp-menu-btn-user:hover .pp-avatar-mini { color: #fff; }
.pp-menu .pp-menu-who-avatar { display: flex; align-items: center; gap: 10px; white-space: normal; }
.pp-menu .pp-menu-who-avatar > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Guests on mobile: a visible Log in button next to the menu, and a sign-up prompt atop the menu */
.pp-mobile { display: flex; align-items: center; gap: 8px; }
.pp-mobile-login { display: none; }
.pp-menu .pp-menu-prompt {
  margin: 4px 10px 8px; padding: 12px 12px 14px; border: 1.5px solid var(--border); border-radius: 4px;
  background: var(--surface, #eae8e4); font-size: 0.85rem; line-height: 1.45; color: var(--muted, #666);
}
.pp-menu .pp-menu-prompt strong { display: block; color: var(--ink); font-size: 0.95rem; margin-bottom: 2px; font-family: 'Playfair Display', Georgia, serif; }
.pp-menu .pp-menu-prompt-btns { display: flex; gap: 8px; margin-top: 10px; }
.pp-mobile .pp-menu .pp-menu-prompt-btns .pp-btn { flex: 1; border: 1.5px solid var(--accent); display: inline-flex; justify-content: center; align-items: center; height: 38px; padding: 0 10px; font-size: 0.85rem; text-align: center; background: var(--accent); color: #fff; }
.pp-mobile .pp-menu .pp-menu-prompt-btns .pp-btn-ghost { background: none; color: var(--ink); border: 1.5px solid var(--ink); }
.pp-mobile .pp-menu .pp-menu-prompt-btns .pp-btn:hover { opacity: 0.88; }

@media (max-width: 760px) {
  .pp-nav, .pp-actions { display: none; }
  .pp-menu-btn { display: inline-flex; }
  .pp-mobile-login { display: inline-flex; }
}
@media (max-width: 480px) {
  .pp-header { padding: 8px 14px; min-height: 54px; gap: 10px; }
  .pp-brand img { height: 32px; }
  .pp-right, .pp-extra { gap: 8px; }
  .pp-context { padding-left: 10px; }
}
@media (max-width: 400px) {
  /* Very narrow phones: the page title gives way to the logo, timer and menu */
  .pp-context .logo { display: none; }
  .pp-context { border-left: none; padding-left: 0; }
}

/* ── Footer (shared) ── */
.pp-footer { font-family: 'DM Sans', system-ui, sans-serif; color: var(--muted, #666); }
.pp-footer a { color: var(--ink); text-decoration: none; }
.pp-footer a:hover { color: var(--accent); }
.pp-footer h4 {
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted, #666);
  margin: 0 0 10px; font-weight: 600; font-family: inherit;
}
.pp-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pp-footer .pp-link-btn { background: none; border: none; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.pp-footer .pp-link-btn:hover { color: var(--accent); }
.pp-footer .pp-theme-toggle {
  background: none; border: 1.5px solid var(--border); color: var(--ink); border-radius: 3px;
  padding: 3px 10px; cursor: pointer; font: inherit; font-size: 0.78rem;
}
.pp-footer .pp-theme-toggle:hover { border-color: var(--ink); }
.pp-footer .pp-copy { font-family: Georgia, serif; white-space: nowrap; }
.pp-footer-groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* Full (marketing + info pages) */
.pp-footer-full { border-top: 2px solid var(--ink); background: var(--paper); padding: 40px 0 28px; font-size: 0.88rem; margin-top: auto; }
.pp-footer-full .pp-footer-inner { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.pp-footer-full .pp-footer-top { display: grid; grid-template-columns: 1.4fr 4fr; gap: 32px; }
.pp-footer-full .pp-footer-brand img { height: 36px; width: auto; display: block; }
.pp-footer-full .pp-footer-brand p { margin-top: 10px; max-width: 280px; font-size: 0.85rem; line-height: 1.5; }
.pp-footer-full .pp-footer-bottom {
  margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.8rem;
}
@media (max-width: 860px) {
  .pp-footer-full .pp-footer-top { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 600px) {
  .pp-footer-groups { grid-template-columns: 1fr 1fr; }
}

/* Compact (lobby, game and account pages): a slim fixed bar that expands to the same links */
.pp-footer-compact {
  /* Above the game intro overlay (z-index 300), below modals and toasts */
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 350;
  background: var(--paper); border-top: 1px solid var(--border); font-size: 0.72rem;
}
.pp-footer-bar { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 6px 16px; }
.pp-footer-toggle {
  display: inline-flex; align-items: center; gap: 5px; background: none; border: none; cursor: pointer;
  color: var(--muted, #666); font: inherit; padding: 2px 4px;
}
.pp-footer-toggle:hover { color: var(--ink); }
.pp-footer-toggle svg { transition: transform 0.25s ease; }
.pp-footer-compact.open .pp-footer-toggle svg { transform: rotate(180deg); }
.pp-footer-panel { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.pp-footer-compact.open .pp-footer-panel { max-height: 70vh; overflow-y: auto; }
.pp-footer-panel-inner { max-width: 880px; margin: 0 auto; padding: 14px 24px 6px; font-size: 0.8rem; }
.pp-footer-compact ul { gap: 4px; }

/* Guard against page-level element rules (info pages style bare p/ul/li/strong) */
.pp-footer p, .pp-footer li { font-size: inherit; line-height: 1.5; color: inherit; margin: 0; }
.pp-footer-full .pp-footer-brand p { margin-top: 10px; }
.pp-header strong, .pp-footer strong { font-weight: 600; }
