/* shared-solo.css — Common styles for all solo/practice game pages.
 * Extracted from the air-hockey solo template.
 * Each solo page links this file, then adds only game-specific overrides inline.
 */

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

/* ── Accessibility: screen-reader-only utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── Accessibility: focus-visible for keyboard navigation ── */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Accessibility: reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Header ── */
.game-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 16px;
  width: 100%;
  max-width: 1400px;
}
.game-header a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.game-header img { width: 28px; height: 28px; }
.game-header h1, .game-header .logo-text {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
}

/* SEO content section below the game */
.seo-content {
  max-width: 680px;
  width: 100%;
  padding: 24px 20px 32px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}
.seo-content h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.seo-content p { margin-bottom: 12px; }
.seo-content h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 8px;
  letter-spacing: 0.3px;
}
.seo-content ul, .seo-content ol {
  margin: 0 0 12px 20px;
  padding: 0;
}
.seo-content li { margin-bottom: 4px; }
.seo-content a { color: var(--accent); text-decoration: none; }
.seo-content a:hover { text-decoration: underline; }

/* FAQ accordion */
.seo-content details {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 10px 0;
}
.seo-content details:last-of-type {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.seo-content summary {
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
}
.seo-content summary::-webkit-details-marker { display: none; }
.seo-content summary::before {
  content: '▸ ';
  color: var(--accent);
  transition: transform 0.15s;
  display: inline-block;
}
.seo-content details[open] summary::before {
  content: '▾ ';
}
.seo-content details p { margin-top: 6px; }
.game-header .logo-lobby { color: var(--text); font-weight: 700; }
.game-header .logo-room { color: var(--accent); font-weight: 600; text-shadow: 0 0 10px var(--accent-glow); }
.game-header .header-sep { color: var(--text-subtle); font-size: var(--text-md); }
.game-header .header-room-info { color: var(--text-muted); font-size: var(--text-base); font-weight: 400; }

/* ── Game Container ── */
#game-container {
  width: 100%;
  max-width: 1400px;
  padding: 0 8px;
}

/* ── Kebab Menu ── */
#game-menu-wrap {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}
#game-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 2px 6px;
  line-height: 1;
  opacity: 0.6;
  color: var(--near-white);
}
#game-menu-btn:hover { opacity: 1; }
#game-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 120px;
  z-index: 100;
  overflow: hidden;
}
#game-menu.hidden { display: none; }
#game-menu button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 14px;
  font-size: var(--text-base);
  text-align: left;
  cursor: pointer;
}
#game-menu button:hover { background: var(--accent-ghost); color: var(--near-white); }

/* ── Difficulty Bar ── */
#difficulty-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 0 2px;
}
#difficulty-bar .diff-label {
  color: var(--text-subtle);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-right: 4px;
}
#difficulty-bar button {
  background: var(--accent-ghost);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 14px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
#difficulty-bar button:hover {
  background: var(--accent-ghost);
  color: var(--text);
}
#difficulty-bar button.active {
  background: var(--accent-ghost);
  border-color: var(--accent-ghost-border);
  color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow-subtle);
}

/* ── Game Row / Canvas ── */
#game-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: center;
  margin: 4px 0;
}
#canvas-wrapper {
  flex: none;
  position: relative;
}
#game-canvas {
  display: block;
  width: 100%;
  border-radius: var(--radius-md);
}

/* ── CTA Bar (rendered by renderSoloFooter) ── */
#mp-cta {
  width: 100%;
  max-width: 1400px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin: 8px 0;
  background: var(--accent-ghost);
  border: 1px solid var(--accent-ghost-border);
  border-radius: var(--radius-xl);
}
#mp-cta span {
  color: var(--text-muted);
  font-size: var(--text-base);
}
#mp-cta a {
  display: inline-block;
  background: var(--gradient-cta);
  color: var(--near-black);
  padding: 6px 18px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-base);
  transition: box-shadow 0.15s;
  box-shadow: var(--gradient-cta-shadow);
}
#mp-cta a:hover { box-shadow: var(--gradient-cta-shadow-hover); }
#mp-cta .cta-friend {
  background: none;
  border: 1px solid var(--accent-ghost-border);
  color: var(--accent);
  box-shadow: none;
}
#mp-cta .cta-friend:hover {
  background: var(--accent-ghost);
  border-color: var(--accent);
}

/* ── Cross-links ── */
.cross-links {
  text-align: center;
  padding: 0 16px 16px;
  font-size: var(--text-base);
  color: var(--text-subtle);
}
.cross-links a {
  color: var(--accent2);
  text-decoration: none;
}
.cross-links a:hover {
  text-decoration: underline;
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .game-header { padding: 4px 10px; gap: 6px; }
  .game-header h1, .game-header .logo-text { font-size: 1.1rem; }
  .game-header img { width: 22px; height: 22px; }
  #mp-cta { padding: 10px 12px; }
  #mp-cta span { font-size: var(--text-sm); }
  .seo-content { padding: 16px 16px 24px; font-size: 13px; }
}

@media (max-width: 600px) and (orientation: portrait) {
  .game-header { padding: 2px 10px; }
  .game-header h1, .game-header .logo-text { font-size: 1rem; }
  .seo-content { display: none; }
  body { height: 100dvh; overflow: hidden; }
  #solo-footer-target { flex-shrink: 0; }
  #mp-cta { margin: 4px 0; padding: 6px 12px; }
  .cross-links { padding: 0 12px 4px; font-size: var(--text-sm); }
}

/* ── Landscape back-to-lobby link (visible when header is hidden) ── */
.landscape-back-link {
  display: none;
}

/* ── Landscape (compact) ── */
@media (max-height: 500px) and (orientation: landscape) {
  .game-header { display: none; }
  #solo-footer-target { display: none; }
  #mp-cta { display: none; }
  .cross-links { display: none; }
  #difficulty-bar { padding: 2px 0 0; }
  #difficulty-bar .diff-label { display: none; }
  #difficulty-bar button { padding: 2px 10px; font-size: var(--text-xs); }
  #game-row { margin: 0; flex: 1; min-height: 0; }
  body { height: 100dvh; justify-content: center; }
  #game-container { display: flex; flex-direction: column; height: 100%; }
  .landscape-back-link {
    display: block;
    position: fixed;
    top: 4px;
    left: 8px;
    z-index: 100;
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--text-xs);
    padding: 2px 8px;
    background: var(--overlay);
    border-radius: var(--radius-sm);
  }
  .landscape-back-link:hover { color: var(--near-white); }
}
