html, body {
  margin: 0;
  height: 100%;
  background: #07060c;
  overflow: hidden;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  color: #e8e8f0;
  overscroll-behavior: none;
}

#wrap {
  position: fixed;
  inset: 0;
  background: #07060c;
}

/* El canvas ocupa toda la ventana; main.js escala y centra el juego (1024x576 lógicos)
   y rellena los márgenes con el fondo de la planta. */
#game {
  position: absolute;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #07060c;
  outline: none;
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#debug {
  position: fixed;
  left: 0;
  bottom: 0;
  max-width: 100vw;
  padding: 4px 6px;
  font: 10px/1.4 'Courier New', monospace;
  color: #9f9;
  background: rgba(0, 0, 0, 0.7);
  border-top: 1px solid rgba(120, 255, 120, 0.25);
  border-right: 1px solid rgba(120, 255, 120, 0.25);
  white-space: pre-wrap;
  word-break: break-all;
  pointer-events: none;
}

/* Aviso de confirmación (js/confirm.js) */
#confirm-ui { position: fixed; inset: 0; z-index: 99998; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box;
  background: rgba(4, 3, 10, .72); backdrop-filter: blur(2px); font-family: 'Press Start 2P', 'Courier New', monospace; color: #e8e8f0; animation: cf-fade .14s ease-out; }
#confirm-ui .cf-box { width: min(480px, 100%); box-sizing: border-box; padding: 20px 22px 18px; border-radius: 10px; border: 2px solid #ffd23c; background: rgba(14, 10, 24, .98);
  box-shadow: 0 14px 44px rgba(0, 0, 0, .8), 0 0 24px rgba(255, 210, 60, .14); animation: cf-pop .18s ease-out; }
#confirm-ui .cf-box.is-danger { border-color: #ff6b6b; box-shadow: 0 14px 44px rgba(0, 0, 0, .8), 0 0 24px rgba(255, 90, 90, .18); }
#confirm-ui .cf-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
#confirm-ui .cf-ico { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: #ffd23c; color: #1b1528; }
#confirm-ui .is-danger .cf-ico { background: #ff6b6b; }
#confirm-ui h2 { margin: 0; font-size: 12px; line-height: 1.5; font-weight: normal; color: #ffd23c; }
#confirm-ui .is-danger h2 { color: #ff9a9a; }
#confirm-ui .cf-body p { margin: 0 0 10px; font-size: 9px; line-height: 1.9; color: #d8d8e4; }
#confirm-ui .cf-body b { font-weight: normal; color: #ffd23c; }
#confirm-ui .cf-actions { display: flex; gap: 10px; margin-top: 16px; }
#confirm-ui .cf-btn { flex: 1; min-height: 44px; padding: 0 12px; font: inherit; font-size: 9px; line-height: 1.5; border-radius: 6px; cursor: pointer; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .06); color: #fff; }
#confirm-ui .cf-btn:hover, #confirm-ui .cf-btn:focus-visible { border-color: #ffd23c; outline: none; background: rgba(255, 210, 60, .12); }
#confirm-ui .cf-btn.is-danger { border-color: #ff6b6b; background: rgba(255, 90, 90, .16); }
#confirm-ui .cf-btn.is-danger:hover, #confirm-ui .cf-btn.is-danger:focus-visible { background: rgba(255, 90, 90, .3); border-color: #ff9a9a; }
@keyframes cf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cf-pop { from { transform: translateY(8px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 420px) { #confirm-ui .cf-actions { flex-direction: column-reverse; } }

/* Buscadores de la Pokédex (js/menu.js) y de la Wiki (js/wiki.js) */
#dex-search, #wiki-search { position: fixed; z-index: 30; box-sizing: border-box; margin: 0; padding: 0 10px 0 30px; font-family: 'Press Start 2P', 'Courier New', monospace; color: #fff;
  background: #1a1528 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 8a6.5 6.5 0 0 1 13 0z' fill='%23e8413c'/%3E%3Cpath d='M1.5 8a6.5 6.5 0 0 0 13 0z' fill='%23f4f4f4'/%3E%3Ccircle cx='8' cy='8' r='6.5' fill='none' stroke='%2324242e' stroke-width='1.6'/%3E%3Cpath d='M1.5 8h13' stroke='%2324242e' stroke-width='1.6'/%3E%3Ccircle cx='8' cy='8' r='2.1' fill='%23f4f4f4' stroke='%2324242e' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat 10px center / 13px 13px;
  border: 1.5px solid #3a3450; outline: none; }
#dex-search::placeholder, #wiki-search::placeholder { color: #7a7a8e; }
#dex-search:focus, #wiki-search:focus { border-color: #ffd23c; background-color: rgba(255, 210, 60, .06); box-shadow: 0 0 0 2px rgba(255, 210, 60, .18); }
/* El de la Pokédex, como sus filtros (etiqueta #2a2440, sin borde; dorado al escribir) */
#dex-search { background-color: #2a2440; border-color: transparent; color: #dfe2f0; }
#dex-search::placeholder { color: #9a9aae; }
#dex-search:hover { background-color: #3a3458; }
#dex-search:focus { background-color: #2a2440; border-color: #ffd23c; box-shadow: 0 0 0 2px rgba(255, 210, 60, .18); }
