/* =====================
   VARIABLES
   ===================== */
:root {
  --page-bg: #000000;
}

/* =====================
   RESET
   ===================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =====================
   BASE
   ===================== */
html, body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: #000000;
  font-family: sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* =====================
   BACKGROUND CANVAS
   ===================== */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background: transparent;
}

/* =====================
   SHARED CORNER BUTTON
   ===================== */
.corner-btn {
  position: fixed;
  left: 16px;
  z-index: 9998;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s, color 0.2s;
}
.corner-btn:hover {
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,1);
}

/* =====================
   XMB COLOR BUTTON
   ===================== */
#xmb-color-btn {
  bottom: 60px; /* stacked above bg-swap-btn */
}

/* =====================
   BACKGROUND SWAP BUTTON
   ===================== */
#bg-swap-btn {
  bottom: 16px;
}

/* =====================
   BACKGROUND SWAP DIALOG
   ===================== */
#bg-swap-dialog {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
}
#bg-swap-dialog.open {
  display: flex;
}
#bg-swap-box {
  background: #111;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 340px;
}
#bg-swap-title {
  color: #aaa;
  font-family: monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
#bg-swap-options {
  display: flex;
  gap: 12px;
}
.bg-option {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #ccc;
  padding: 14px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}
.bg-option:hover {
  background: #222;
  border-color: #666;
}
.bg-option.active {
  border-color: #c5d68a;
  background: #1e2212;
}
.bg-option-name {
  font-family: monospace;
  font-size: 13px;
  color: #fff;
  font-weight: bold;
}
.bg-option-desc {
  font-family: monospace;
  font-size: 11px;
  color: #666;
}
.bg-option.active .bg-option-desc {
  color: #8aac5a;
}
#bg-swap-close {
  align-self: flex-end;
  background: #2a2a2a;
  border: none;
  border-radius: 4px;
  color: #aaa;
  padding: 7px 20px;
  cursor: pointer;
  font-family: monospace;
  font-size: 13px;
  transition: background 0.2s, color 0.2s;
}
#bg-swap-close:hover {
  background: #333;
  color: #fff;
}

/* =====================
   XMB COLOR DIALOG
   ===================== */
#xmb-color-dialog {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
}
#xmb-color-dialog.open {
  display: flex;
}
#xmb-color-box {
  background: #111;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 280px;
}
#xmb-color-box label {
  color: #aaa;
  font-family: monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
#xmb-color-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
#xmb-color-swatch {
  width: 36px;
  height: 36px;
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
  padding: 2px;
  background: #1a1a1a;
  flex-shrink: 0;
}
#xmb-color-input {
  flex: 1;
  background: #1a1a1a;
  min-width: 0;
  border: 1px solid #555;
  border-radius: 4px;
  color: #fff;
  padding: 8px 12px;
  font-size: 15px;
  font-family: monospace;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
#xmb-color-input:focus {
  border-color: #888;
}
#xmb-color-input.error {
  border-color: #c0392b;
}
#xmb-color-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
#xmb-cancel-btn,
#xmb-apply-btn {
  padding: 7px 20px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-family: monospace;
  font-size: 13px;
}
#xmb-cancel-btn { background: #2a2a2a; color: #aaa; }
#xmb-cancel-btn:hover { background: #333; color: #fff; }
#xmb-apply-btn  { background: #3a6645; color: #fff; }
#xmb-apply-btn:hover  { background: #4a7c59; }

/* =====================
   PAGE CONTENT
   All content sits above the background canvas.
   ===================== */
body > *:not(#bg-canvas):not(#xmb-color-btn):not(#xmb-color-dialog):not(#bg-swap-btn):not(#bg-swap-dialog) {
  position: relative;
  z-index: 1;
}
