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

html, body {
  background: #0c111a;
  color: #eee;
  font-family: 'Segoe UI', system-ui, sans-serif;
  height: 100%;
  overflow: hidden;
}

canvas { display: block; }

#picker-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #11161f 0%, #1a2030 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

#picker-box {
  width: min(720px, 92vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 28px;
  background: rgba(20, 26, 38, 0.92);
  border: 1px solid #2a3249;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
}

#picker-box h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #c8aa6e;
}

.picker-sub {
  color: #9aa7c0;
  font-size: 14px;
  margin-top: -8px;
}

#name-input,
#picker-search {
  background: #0e131c;
  border: 1px solid #2a3249;
  color: #eee;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  border-radius: 8px;
  outline: none;
}
#name-input:focus,
#picker-search:focus { border-color: #c8aa6e; }

#picker-tabs {
  display: flex;
  gap: 6px;
}

.picker-tab {
  flex: 1;
  background: #0e131c;
  border: 1px solid #2a3249;
  color: #9aa7c0;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  border-radius: 8px;
  transition: 80ms ease;
}
.picker-tab:hover { color: #fff; border-color: #3d4a6a; }
.picker-tab.active {
  background: #1a2030;
  color: #c8aa6e;
  border-color: #c8aa6e;
}

#picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  background: #0a0e16;
  border: 1px solid #1c2230;
  border-radius: 8px;
  align-content: start;
}

.icon-btn {
  width: 100%;
  aspect-ratio: 1;
  background: #0e131c;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: 60ms ease;
}
.icon-btn:hover  { border-color: #3d4a6a; transform: translateY(-1px); }
.icon-btn.selected { border-color: #c8aa6e; box-shadow: 0 0 0 2px rgba(200,170,110,0.3); }
.icon-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }

.icon-more {
  grid-column: 1 / -1;
  text-align: center;
  color: #6b7793;
  font-size: 12px;
  padding: 8px 0;
  font-style: italic;
}

#picker-pick-info {
  font-size: 14px;
  color: #d4c08a;
  text-align: center;
  min-height: 18px;
}

#picker-confirm {
  background: #c8aa6e;
  color: #0c111a;
  border: 0;
  padding: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: 80ms ease;
}
#picker-confirm:hover:not(:disabled) { background: #d8bb7f; transform: translateY(-1px); }
#picker-confirm:disabled { opacity: 0.4; cursor: not-allowed; }

#hud {
  position: fixed;
  top: 12px; right: 14px;
  background: rgba(0,0,0,0.45);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #c8aa6e;
  pointer-events: none;
  z-index: 5;
}

#controls-hint {
  position: fixed;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.45);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: #9aa7c0;
  pointer-events: none;
  z-index: 5;
}
