/* =========================================================
   Falling Letters Pinball (page styles)
   - Harmonized with home.css + glass.css tokens
   - Sticky header offset, glass surfaces, pinball vibe retained
   ========================================================= */

/* ---- Page tokens (lean on global ones if present) ---- */
:root {
  --letters-max: 780px;
  --letters-panel-w: 280px; /* width of Names panel on desktop */
}

/* Smooth anchor/nav offset under sticky header */
html {
  scroll-padding-top: calc(var(--header-h, 64px) + 12px);
}

/* ---- Base layout (keep center alignment, remove body conflicts) ---- */
body {
  font-family: var(--font-sans, 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif);
  color: var(--gray-700, #374151);
  background: var(--brand-background, #f4f7f6);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  overflow-x: hidden;
}




/* Restart button styling */
button#restartButton {
  display: inline-block;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-md, 10px);
  cursor: pointer;
  color: var(--brand-accent-contrast, #fff);
  transition: transform .2s ease, box-shadow .2s ease, background-color .3s ease;
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
 
}
button#restartButton { 
  background: var(--brand-accent, #3498db);
  margin-top: 16px;
}
button#restartButton:hover,
button#restartButton:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0,0,0,0.16);
}
button#restartButton:disabled {
  background: rgba(149,165,166,0.7);
  cursor: not-allowed;
  box-shadow: none;
}

/* ---- Game shell (glass frame + subtle wood trim) ---- */
#appContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, var(--letters-max));
  margin: 6px auto 0;
}

#gameContainer {
  display: flex;
  gap: 0;
  width: 100%;
  max-width: var(--letters-max);
  box-sizing: border-box;

  /* glass body with theme-aware trim to blend with the board */
  background: var(--glass-bg-strong, rgba(255,255,255,0.18));
 
  border: 12px solid var(--brand-surface-light, #4a3b31); /* Themed wood/metal trim */
  border-radius: 28px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.18);
  padding: 14px;
}

/* Canvas follows theme background with inward depth */
#gameCanvas {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  border-top-left-radius: 90px;
  border-top-right-radius: 90px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 0;
  background: var(--brand-surface, #041a35);
  box-shadow: inset 0 0 25px rgba(0,0,0,0.6);
  border: none;
}

/* Names panel becomes a tidy glass sidebar */
#namesPanel {
  width: var(--letters-panel-w);
  padding: 18px 16px;
  flex-shrink: 0;
  overflow-y: auto;
  background: var(--glass-bg, rgba(255,255,255,0.12));
  border-left: 5px solid var(--brand-surface-light, #4a3b31); /* Themed separator */
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--glass-border, rgba(255,255,255,0.38));
}
#namesPanel h2 {
  margin: 0 0 10px;
  text-align: center;
  color: var(--brand-accent, #2980b9); /* Theme-aware title */
  font-weight: 800;
}

/* PiP trigger matches theme accent */
#namesPanel .pip-trigger {
  width: 100%;
  margin: 12px 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--brand-accent-contrast, #fff);
  background: var(--brand-accent, #3498db);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  transition: transform .2s ease, box-shadow .2s ease;
}
#namesPanel .pip-trigger::before { content: '🪟'; font-size: 1.05em; }
#namesPanel .pip-trigger:hover,
#namesPanel .pip-trigger:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(0,0,0,0.2);
}

/* Names list items */
.name-item {
  padding: 7px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 15px;
  color: var(--brand-text, #374151);
  opacity: 0.8;
  transition: background-color .25s ease, transform .25s ease;
}
.name-item.matched {
  background: var(--brand-accent, rgba(46, 125, 50, 0.15));
  color: var(--brand-accent-contrast, #fff);
  opacity: 1;
  border-radius: 6px;
  font-weight: 800;
  text-decoration: line-through;
  animation: highlightName .5s ease-in-out;
}
@keyframes highlightName {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ---- Results / controls shell (if used on this page later) ---- */
#controls, #results-area {
  background: var(--glass-bg, rgba(255,255,255,0.12));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.38));
  border-radius: var(--radius-lg, 15px);
  box-shadow: var(--glass-shadow, 0 8px 30px rgba(0,0,0,0.15));
  padding: 16px;
}

/* SEO visuals moved to assets/css/seo-card.css */
.seo-content-area a:hover { 
  border-bottom-color: currentColor;
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
  :root { --letters-panel-w: 250px; }
}
@media (max-width: 820px) {
  #gameContainer {
    flex-direction: column;
    padding: 12px;
  }
  #gameCanvas {
    border-top-right-radius: 28px; /* unify radius when stacked */
    border-bottom-right-radius: 12px;
  }
  #namesPanel {
    width: 100%;
    border-left: 0;
    border-top: 5px solid var(--brand-surface-light, #4a3b31);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    border-bottom-left-radius: 12px;
    margin-top: 10px;
  }

  button#restartButton { width: fit-content; }
}
@media (max-width: 520px) {
  .seo-content-area { padding: 18px 16px; }
}
