/* ═══════════════════════════════════════════════════════════════════════════
   WINDOW PANEL — mini page that pops out from the left side of the main menu.
   Uses the ps1 tokens, so it decays with the rest of the UI automatically.
   ═══════════════════════════════════════════════════════════════════════════ */

.window-button {
  position: fixed;
  z-index: 8;
  left: 18px;
  bottom: 96px;
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 0;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: lowercase;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  backdrop-filter: none;
  border: 1px solid var(--ps1-edge);
  background: rgba(6, 14, 12, 0.88);
  color: var(--ps1-cyan);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.window-button:hover {
  border-color: var(--ps1-cyan);
  color: #d9f6ff;
  box-shadow: 0 0 12px rgba(116, 205, 221, 0.25);
}

.window-button .wb-icon {
  margin-right: 8px;
  color: var(--ps1-green);
}

.window-button[aria-expanded="true"] .wb-icon {
  color: var(--ps1-amber);
}

/* hidden while the game runs — the panel is a main-menu thing */
.window-button.wp-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ─── the panel itself ───────────────────────────────────────────────────── */
.window-panel {
  position: fixed;
  z-index: 9;
  left: 18px;
  top: 50%;
  width: min(340px, calc(100vw - 36px));
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ps1-edge);
  border-radius: 0;
  background: var(--ps1-face);
  box-shadow:
    6px 8px 0 rgba(0, 0, 0, 0.55),
    0 0 30px rgba(0, 0, 0, 0.4);
  color: var(--ps1-text);
  font-family: "Courier New", Courier, monospace;
  transform: translate(calc(-100% - 28px), -50%);
  visibility: hidden;
  transition:
    transform 0.45s cubic-bezier(0.2, 1.3, 0.3, 1),
    opacity 0.3s ease,
    visibility 0s linear 0.45s;
}

.window-panel.open {
  transform: translate(0, -50%);
  visibility: visible;
  opacity: 1;
  transition:
    transform 0.45s cubic-bezier(0.2, 1.3, 0.3, 1),
    opacity 0.25s ease;
}

.window-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ps1-edge);
  background: rgba(0, 0, 0, 0.25);
}

.wp-title {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ps1-amber);
}

.window-panel-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.55;
}

.window-panel-body h2 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--ps1-green);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.window-panel-body p {
  margin: 0 0 12px;
  color: var(--ps1-muted);
}

.window-panel-body p:last-child {
  margin-bottom: 0;
}

.window-panel-body strong {
  color: var(--ps1-text);
}

.window-panel-body em {
  color: var(--ps1-muted);
  font-style: italic;
  opacity: 0.85;
}

.window-panel-body blockquote {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 2px solid var(--ps1-green);
  background: rgba(0, 0, 0, 0.22);
}

.window-panel-body blockquote p {
  margin: 0 0 8px;
  color: var(--ps1-text);
}

.window-panel-body blockquote p:last-child {
  margin-bottom: 0;
}

.window-panel-body .wp-also {
  color: var(--ps1-amber);
  letter-spacing: 2px;
}

.window-panel-body .wp-video {
  margin: 12px 0 4px;
}

.window-panel-body .wp-video video {
  display: block;
  width: 100%;
  border: 1px solid var(--ps1-edge);
  background: #000;
}

.window-panel-body .wp-video figcaption {
  margin-top: 6px;
  font-size: 11px;
}

.window-panel-body .wp-video a {
  color: var(--ps1-cyan);
  text-decoration: none;
  border-bottom: 1px dashed var(--ps1-edge);
}

.window-panel-body .wp-video a:hover {
  color: #d9f6ff;
  border-bottom-color: var(--ps1-cyan);
}

@media (max-width: 820px) {
  .window-button {
    left: 10px;
    bottom: 78px;
    padding: 0 10px;
    font-size: 10px;
  }

  .window-panel {
    left: 10px;
    max-height: 60vh;
  }
}
